say_hellocreate_walletkey_genget_keyget_keysimport_keypairexport_keypairset_default_addressget_balancesget_token_idfeaturesdepositwithdrawtransfersay_helloReturns a helloworld string.
--> {"method": "say_hello", "params": []}
<-- {"result": "helloworld"}
create_walletAttempts to initialize a wallet, and returns true upon success.
--> {"method": "create_wallet", "params": []}
<-- {"result": true}
key_genAttempts to generate a new keypair and returns true upon success.
--> {"method": "key_gen", "params": []}
<-- {"result": true}
get_keyFetches the main keypair from the wallet and returns it in an encoded format.
--> {"method": "get_key", "params": []}
<-- {"result": "vdNS7oBj7KvsMWWmo9r96SV4SqATLrGsH2a3PGpCfJC"}
get_keysFetches all keypairs from the wallet and returns a list of them in an encoded format. The first one in the list is the default selected keypair.
--> {"method": "get_keys", "params": []}
<-- {"result": "[vdNS7oBj7KvsMWWmo9r96SV4SqATLrGsH2a3PGpCfJC,...]"}
import_keypairImports a keypair into the wallet with a given path on the filesystem.
Returns true upon success.
--> {"method": "import_keypair", "params": [path]}
<-- {"result": true}
export_keypairExports the default selected keypair to a given path on the filesystem.
Returns true upon success.
--> {"method": "export_keypair", "params": [path]}
<-- {"result": true}
set_default_addressSets the default wallet address to the given parameter. Returns true upon success.
--> {"method": "set_default_address", "params": [vdNS7oBj7KvsMWWmo9r96SV4SqATLrGsH2a3PGpCfJC]}
<-- {"result": true}
get_balancesFetches the known balances from the wallet.
Returns a map of balances, indexed by network, and token ID.
--> {"method": "get_balances", "params": []}
<-- {"result": "[{"btc":(value,network)},...]"}
get_token_idGenerates the internal token ID for a given network and token ticker or address.
Returns the internal representation of the token ID.
--> {"method": "get_token_id", "params": [network,token]}
<-- {"result": "Ht5G1RhkcKnpLVLMhqJc5aqZ4wYUEbxbtZwGCVbgU7DL"}
featuresAsks the configured cashier for their supported features. Returns a map of features received from the requested cashier.
--> {"method": "features", "params": []}
<-- {"result": {"network":["btc","sol"]}}
depositInitializes a DarkFi deposit request for a given network, token,
and publickey.
The public key send here is used so the cashier can know where to send
the newly minted tokens once the deposit is received.
Returns an address to which the caller is supposed to deposit funds.
--> {"method": "deposit", "params": [network,token,publickey]}
<-- {"result": "Ht5G1RhkcKnpLVLMhqJc5aqZ4wYUEbxbtZwGCVbgU7DL"}
withdrawInitializes a withdraw request for a given network, token, publickey,
and amount.
The publickey send here is the address where the caller wants to receive
the tokens they plan to withdraw.
On request, sends a request to a cashier to get a deposit address, and
then transfers wrapped DarkFitokens to the cashier's wallet. Following that,
the cashier should return a transaction ID of them sending the funds that
are requested for withdrawal.
--> {"method": "withdraw", "params": [network,token,publickey,amount]}
<-- {"result": "txID"}
transferTransfer a given wrapped DarkFi token amount to the given address. Returns the transaction ID of the transfer.
--> {"method": "transfer", "params": [network,dToken,address,amount]}
<-- {"result": "txID"}