Wallet RPC API
On this page you will find description of every method in Qwertycoin RPC Wallet API. Qwertycoin RPC Wallet is a HTTP server which provides JSON 2.0 RPC interface for Qwertycoin payment operations and address management. Each method has its own page that can be found by clicking on this method.
More on how to start and operate Qwertycoin RPC Wallet can be found here: [Using-RPC-Wallet.md Qwertycoin RPC Wallet].
To make a JSON PRC request to your Qwertycoin RPC Wallet you should use POST request that looks like this:
Where:
is an IP of Qwertycoin RPC Wallet, if RPC Wallet is located on local machine it is either 127.0.0.1 or localhost,
is Qwertycoin RPC Wallet port, by default it is binded to 8070 port, but it can be manually binded to any port you want, read more about this
Reset
reset() method allows you to re-sync your wallet.
Input.
Argument | Mandatory | Description | Format | Example |
viewSecretKey | No | Private view key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
No output in case of success.
Important: If the view_secret_key was not pointed out reset() methods resets the wallet and re-syncs it. If the view_secret_key argument was pointed out reset() method substitutes the existing wallet with a new one with a specified view_secret_key and creates an address for it.
Input value example:
Output value example:
Save
save() method allows you to save your wallet by request.
No input.
No output in case of success.
Input value example:
Output value example:
Get view key
getViewKey() method returns your view key.
No input.
Output:
Argument | Description | Format | Example |
viewSecretKey | Private view key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
Input Example:
Return value example:
Get spend keys
getSpendKeys() method returns your spend keys.
Argument | Mandatory | Description | Format | Example |
address | Yes | Valid and existing in this container address | string | KfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt |
Output:
Argument | Description | Format | Example |
spendSecretKey | Private spend key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
spendPublicKey | Public spend key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
Input Example:
Return value example:
Get addresses
getAddresses() method returns an array of your RPC Wallet's addresses.
No input.
Output:
Argument | Description | Format | Example |
addresses | Array of strings, where each strings is an address | array | See below |
Input example:
Output example:
Create address
createAddress() method creates an additional address in your wallet.
Input:
Argument | Mandatory | Description | Format | Example |
secretSpendKey | No | Private spend key. If secretSpendKey was specified, RPC Wallet creates spend address | string | |
publicSpendKey | No | Public spend key. If publicSpendKey was specified, RPC Wallet creates view address | string |
Note: If none of the above mentioned parameters were specified, RPC Wallet creates spend address with generated spend key.
Note: both above mentioned parameters can't be present in a single request
Output:
Argument | Description | Format | Example |
address | Created address | string | KfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt |
Input value example:
Output value example:
Delete address
deleteAddress() method deletes a specified address.
Input:
Argument | Mandatory | Description | Format | Example |
address | Yes | An address to be deleted. | string | KfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt |
Output:
In case of success returns an empty JSON object.
Input example:
Output example:
Get balance
getBalance() method returns a balance for a specified address.
Please note: If address is not specified, returns a cumulative balance of all RPC Wallet's addresses.
Input:
Argument | Mandatory | Description | Format | Example |
address | No | Valid and existing address in this particular wallet | string | KfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt |
Output:
Argument | Description | Format | Example |
availableBalance | Available balance of the specified address | uint64 | 123123 |
lockedAmount | Locked amount of the specified address | uint64 | 123123 |
Input example:
Output example:
Get block hashes
getBlockHashes() method returns an array of block hashes for a specified block range.
Input:
Argument | Mandatory | Description | Format | Example |
firstBlockIndex | Yes | Starting height | uint32 | 123123 |
blockCount | Yes | Number of blocks to process | uint32 | 20 |
Output:
Argument | Description | Format | Example |
blockHashes | Array of strings, where each element is a block hash | array | example |
Input example:
Output example:
Get transaction hashes
getTransactionHashes() method returns an array of block and transaction hashes.
Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input:
Argument | Mandatory | Description | Format | Example |
addresses | No | Array of strings, where each string is an address | array | KfXkT5VmdqmA7bWqSH37p87hSXBdTpTogN4mGHPARUSJaLse6jbXaVbVkLs3DwcmuD88xfu835Zvh6qBPCUXw6CHK8koDCt |
blockHash | Only one of these parameters (blockHash or firstBlockIndex) is allowed. | Hash of the starting block | string | f8f07ace392474bfbdc0fc30749a45f779a8aea10c489a103270f63ed88178ad |
firstBlockIndex | Only one of these parameters (blockHash or firstBlockIndex) is allowed. | Starting height | uint32 | 123123 |
blockCount | Yes | Number of blocks to return transaction hashes from | uint32 | 20 |
paymentId | No | Valid payment_id | string | somePaymentId |
Note: if paymentId parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain specified payment_id. (in the set block range)
Note: if addresses parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain transfer from at least one of specified addresses.
Note: if both above mentioned parameters are set, getTransactionHashes() method returns transaction hashes of transactions that contain both specified payment_id and transfer from at least one of specified addresses.
Output:
Argument | Description | Format | Example |
Input example:
Output example:
Get transactions
getTransactions() method returns an array of block and transaction hashes.
Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input:
Argument | Mandatory | Description | Format | Example |
addresses | No | Array of strings, where each string is an address | array | See below |
blockHash | Only one of these parameters (blockHash or firstBlockIndex) is allowed. | Hash of the starting block | string | 8fa07712cbf22c263834c0ac9a3f05058856a1fa7fa3d3eda332f63519b23bd1 |
firstBlockIndex | Only one of these parameters (blockHash or firstBlockIndex) is allowed. | Starting height | uint32 | 123123 |
blockCount | Yes | Number of blocks to return transaction hashes from | uint32 | 20 |
paymentId | No | Valid payment_id | string | somePaymentId |
Note: if paymentId parameter is set, getTransactions() method returns transactions that contain specified payment_id. (in the set block range)
Note: if addresses parameter is set, getTransactions() method returns transactions that contain transfer from at least one of specified addresses.
Note: if both above mentioned parameters are set, getTransactions() method returns transactions that contain both specified payment_id and transfer from at least one of specified addresses.
Output:
Argument | Description | Format | Example |
items | Array that contains: |
Input example:
Output example:
Get unconfirmed transaction hashes
getUnconfirmedTransactionHashes() method returns information about the current unconfirmed transaction pool or for a specified addresses.
Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input:
Argument | Mandatory | Description | Format | Example |
addresses | No | Array of strings, where each string is a valid address | array | See below |
Note: if addresses parameter is set, getUnconfirmedTransactionHashes() method returns transactions that contain transfer from at least one of specified addresses.
Output:
Argument | Description | Format | Example |
transactionHashes | Array of strings, where each string is a hash of an unconfirmed transaction | array | See below |
Input example:
Output example:
Get transaction
getTransaction() method returns information about a particular transaction.
Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.
Input:
Argument | Mandatory | Description | Format | Example |
transactionHash | Yes | Hash of the requested transaction | string | example |
Output:
Argument | Description | Format | Example |
transaction | Contains: |
Input example:
Output example:
Send transaction
sendTransaction() method allows you to send transaction to one or several addresses. Also, it allows you to use a payment_id for a transaction to a single address.
Input:
Argument | Mandatory | Description | Format | Example |
addresses | No | Array of strings, where each string is an address to take the funds from | array | See below |
transfers | Yes | Array that contains: • address - string • amount - int64 | array | "amount": 10000000000, "address": "Kcpg4B4kjwefDeBHGyRdUbgeq5FSYHCof7db8uj6dkFAjkvLSQBc3J7iDSwFx75TUj6MnDYKM5Eu3UmtaAJhvEjdKw1Jkz5" |
fee | Yes | Transaction fee. Minimal fee in Qwertycoin network is 1 QWC. This parameter should be specified in minimal available QWC units. For example, if your fee is 1.1 QWC, you should pass it as 110000000 | uint64 | 1000000 |
unlockTime | No | Height of the block until which transaction is going to be locked for spending. | uint64 | 0 |
anonymity | Yes | Privacy level (a discrete number from 1 to infinity). Level 6 and higher is recommended. | uint64 | 6 |
extra | No | String of variable length. Can contain A-Z, 0-9 characters. | string | |
paymentId | No | payment_id | string | somePaymentId |
changeAddress | No | Valid and existing in this container address. | string | KaUMDHkTqSpaDBtK2pZc4MDaveb2DhQfYiUZ2ACy7evsKYYwWefrvhy34RHNChptMPbefT387qpH7MGkWCsdQJAeGpjmhfz |
Note: if container contains only 1 address, changeAddress field can be left empty and the change is going to be sent to this address
Note: if addresses field contains only 1 address, changeAddress can be left empty and the change is going to be sent to this address
Note: in the rest of the cases, changeAddress field is mandatory and must contain an address.
Output:
Argument | Description | Format | Example |
transactionHash | Hash of the sent transaction. | string | 93faedc8b8a80a084a02dfeffd163934746c2163f23a1b6022b32423ec9ae08f |
Input Example:
Return value example:
Last updated