Skip to main content

API for Abelian Wallet

1. Query wallet status and blockchain information

Wallet provides the following APIs for querying wallet status and blockchain information:

getbalancesabenullget the balance information of the wallet onwer
getbestblockhashnullget the best synced block hash information
helpnullprint the help information
listallutxoabenullprint all txos which belong wallet
listimmaturetxoabenullprint all immature txos which belong wallet
listmaturetxoabenullprint all mature txos which belong wallet
listunconfirmedtxoabenullprint all unconfirmed txos which belong wallet
listconfirmedtxoabenullprint all confirmed txos which belong wallet
listconfirmedtxsnullprint all confirmed transaction which consumes txos of wallet
listunconfirmedtxsnullprint all unconfirmed transaction which consumes txos of wallet
listinvalidtxsnullprint all invalid transaction which consumes txos of wallet

When accessing the above wallet APIs, rpcuser and rpcpass should be provided.

For example, abectl --rpcuser=[rpcuser in abewallet.conf] --rpcpass=[rpcpass in abewallet.conf] --wallet getbalancesabe

2. Create Transfer Transactions

When a wallet is running, the owner can unlock the wallet using private passphrase and then use the following API to create a transfer transaction, which is automatically sent to the connected ABEC node, and then is broadcast to Abelian network.

Note: during the transaction generation, a new address may be generated to store change. When the transaction is created successfully, the max index number of address in the wallet would be returned.

sendtoaddressesabe[{"address":"address string","amount":value},
{"address":"address string","amount":value}]
create a transaction with assigned pairs of address and amount

NOTE: "scaleToFeeSatPerKb" can be left unset and will be given a default value of 1.0. Similarly, "feeSpecified" can also be left unset, and will be given a default value of 100. These two parameters can not be set at the same time, but if the next parameter is set, the previous parameter must be set, you can use 1.0.

In current version, because limit of command line length, the wallet uses a file named "arg1" in abec's directory such as ~/Library/Application Support/Abec/arg1 to store parameters, which means the command to creating transfer transaction would become as follows:

abectl --rpcuser=[rpcuser in abewallet.conf] --rpcpass=[rpcpass in abewallet.conf] --wallet sendtoaddressesabe -

An example of the file "arg1" is as follows: