There is a list of commands to interact with WALLET

JSON-RPC Request - WALLET LIST

Shows wallet list

CLI Example

Command syntax:

wallet list

Options:

none

Example:

Command:

cellframe-node-cli wallet list 

Response:

Wallet: foobar_root_0

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;list"], "id":"1"}'

Response:


"type": 0,
"result": "Wallet: foobar_root_0 \n",
"errors": null,
"id":	
}
Link to original

JSON-RPC Request - WALLET NEW

Creates new wallet

CLI Example

Command syntax:

wallet new 
-w <wallet_name> 
[-sign <sign_type>] 
[-restore <hex_value> | -restore_legacy <restore_string>] 
[-force] 
[-password <password>]

Options:

-w - name of the wallet
-sign - type of signature (optional)
-restore/restore_legacy - hash for wallet restoration/hash for wallet restoration in case if wallet was created long time ago and now its hash isn't supported (optional)
-force - forces the wallet creation/restore command even if a wallet with the same name is already in the "var/lib/wallet" folder (optional)
-password - wallet password (optional)

Example:

Command:

cellframe-node-cli wallet new 
-w personalwallet 
-sign sig_dil 
-restore 0x1234 
-password 1234

Response:

Wallet: personalwallet (type=sig_dil) successfully created

new address ptV4n68gTebdUTcbju6cWY9EmUT4L1acBeJic79L8QQXu5SF22crZqqz9G5M18hhqoU7VLUvQm5cu6CJBGZXHyQ3Atzf4sxw2xieywcf

Additional example: Command to restore a wallet:

cellframe-node-cli wallet new -w <wallet_name> -sign sig_dil -restore <hash> -force

Command to restore a wallet with password:

cellframe-node-cli wallet new -w <wallet_name> -sign sig_dil -restore <hash> -password <password> -force

Parameter -force is necessary for restoration.

Before interacting with a protected wallet, it needs to be activated with command:

cellframe-node-cli wallet activate -w <wallet_name> -password <password>

After successful creation or restoration of a wallet, its address and balance can be checked with the following command:

cellframe-node-cli wallet info -net Backbone -w <wallet_name>

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;new;-w;mywallet;-sign;sig_dil;-restore;0x12345;-password;12345"], "id":"1"}'

Response:


"type": 0,
"result": "Wallet: mywallet (type=sig_dil) successfully created\nnew address ptV4n68gTebdUTcbkJSMjJn4GbVLAJJbr4hdQfMfHeZCm2kU8gWsziwnk2amNS8Uv4A6Eq4TjUXTCDSJ6wbKpF5LPgWfXBmPoA1f7dJN",
"errors": null,
"id": 1	
}
Link to original

JSON-RPC Request - WALLET INFO

Shows wallet information

CLI Example

Command syntax:

wallet info 
{-addr <addr> | -w <wallet_name>} 
-net <net_name>

Options:

-w/-addr - name of the wallet or wallet address
-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command 

Example:

Command:

cellframe-node-cli wallet info 
-w personalwallet  
-net foobar

Response:

wallet: personalwallet

addr: ptV4n68gTebdUTcbju6cWY9EmUT4L1acBeJic79L8QQXu5SF22crZqqz9G5M18hhqoU7VLUvQm5cu6CJBGZXHyQ3Atzf4sxw2xieywcf

network: foobar

balance: 0

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;info;-w;mywallet;-net;foobar"], "id":"1"}'

Response:


"type": 0,
"result": "wallet: mywallet\naddr: ptV4n68gTebdUTcbkJSMjJn4GbVLAJJbr4hdQfMfHeZCm2kU8gWsziwnk2amNS8Uv4A6Eq4TjUXTCDSJ6wbKpF5LPgWfXBmPoA1f7dJN\nnetwork: foobar\nbalance: 0",
"errors": null,
"id": 1
}
Link to original

JSON-RPC Request - WALLET OUTPUTS

Shows information about all wallet unspent outputs

CLI Example

Command syntax:

wallet outputs  
-net <net_name> 
-token <token_tiker> 
{-addr <addr> | -w <wallet_name>}
[{-cond | -value <uint256_value>}]

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-token - name of the token 
-addr/-w - wallet address or wallet name
---
-cond/-value - shows only conditional outputs and list of transactions which contain these outputs (optional) / shows outputs which are not lower than "value" (optional)

Example:

Command:

cellframe-node-cli wallet outputs -w CELLWALLET -token CELL -net Backbone

Response:

wallet_addr: Rj7J7MiX2bWy8sNyX332awQN5KEtihm3p7jwuemmRssX4otCGzoUWnfHf6XotbfjckLCyPgpZy8DM46G8LFDG6eVdfCUPUut7BD3pDFp
total_value_coins: 6.78
total_value_datoshi: 6780000000000000000

outs:

item_type: unspent_out
value_coins: 0.88
value_datosi: 880000000000000000
prev_hash: 0xA0EDE786E3B0F05008D776309F3C7C4B87EF28AC4ADFE47D58A11E8DE4CD1213
out_prev_idx: 3

  
item_type: unspent_out
value_coins: 0.9
value_datosi: 900000000000000000
prev_hash: 0x668F7698E4821127A983F919CE66A4A68E123E9E189ECA0C28127531C491ED18
out_prev_idx: 3

  
item_type: unspent_out
value_coins: 1.0
value_datosi: 1000000000000000000
prev_hash: 0x905F3CBE65C216E2594F2A5BD89FD6386C0C139FA9A5DE91FC8A807A50BE980B
out_prev_idx: 2


item_type: unspent_out
value_coins: 1.0
value_datosi: 1000000000000000000
prev_hash: 0xA69279E9EF405BC8B371BEE4757101B49665B6196249CDA9DB95A7A2E04BB8E4
out_prev_idx: 2

  
item_type: unspent_out
value_coins: 3.0
value_datosi: 3000000000000000000
prev_hash: 0x8BA2AD315346CC47EC035368DF7C623036149EE4AC96E9CD064B75D94E0831A7
out_prev_idx: 1

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect 
-d '{"method":"wallet", "params":["wallet;outputs;-net;KelVPN;-w;WL2;-token;KEL;-value;0.01e+18"], "id":"1"}'

Response:

{
"type": 0,
"result": "total_value: 1000000000000000000
            outs: 
                
                    item_type: unspent_out
                    value: 1000000000000000000
                    prev_hash: 0x9298FD0655D8C6B3D735EFCE6BE7E80F0503FBC6F37B75CF14E0225E4460E13E
                    out_prev_idx: 0",
"errors": null,
"id": 1 
}
Link to original

JSON-RPC Request - WALLET ACTIVATE

Activates wallet

CLI Example

Command syntax:

wallet activate 
-w <wallet_name> 
-password <password> 
[-ttl <password_ttl_in_minutes>]

Options:

-w - name of the wallet 
-password - wallet password
-ttl - (time to live) parameter which defines activation time in minutes (optional)

Example:

Command:

cellframe-node-cli wallet activate 
-w personalwallet 
-password 1234

Response:

Wallet personalwallet is activated

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;activate;-w;mywallet;-password;12345"], "id":"1"}'

Response:


"type": 0,
"result": "Wallet mywallet is activated\n",
"errors": null,
"id": 1
}
Link to original

JSON-RPC Request - WALLET DEACTIVATE

Deactivates wallet

CLI Example

Command syntax:

wallet deactivate 
-w <wallet_name> 
-password <password>

Options:

-w - name of the wallet 
-password - wallet password

Example:

Command:

cellframe-node-cli wallet deactivate 
-w personalwallet 
-password 1234

Response:

Wallet personalwallet is deactivated

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;deactivate;-w;mywallet;-password;12345"], "id":"1"}'

Response:


"type": 0,
"result": "Wallet mywallet is deactivated\n",
"errors": null,
"id": 1
}
Link to original

JSON-RPC Request - WALLET CONVERT

Converts wallet without password into wallet with password

CLI Example

Command syntax:

wallet convert 
-w <wallet_name> 
-password <password>

Options:

-w - name of the wallet 
-password - wallet password

Example:

Command:

cellframe-node-cli wallet convert 
-w walletone 
-password 1111

Response:

Wallet: walletone successfully converted

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"wallet", "params":["wallet;convert;-w;wallettwo;-password;2222"], "id":"1"}'

Response:


"type": 0,
"result": "Wallet: wallettwo successfully converted\n",
"errors": null,
"id": 1
}
Link to original