-
Notifications
You must be signed in to change notification settings - Fork 0
RPC wallet API methods
On this page you will find descriptions for Fuego RPC Wallet API methods. Fuego RPC Wallet is an HTTP server which provides JSON 2.0 RPC interface for XFG payment operations, as well as address management. Each method has it's own page that can be found by clicking on that method.
More on how to start and operate Fuego RPC Wallet can be found at: Fuego RPC Wallet
To make a JSON PRC request to your Fuego RPC Wallet you should use POST request that looks like this:
http://<service address>:<service port>/json_rpc
- <service address> is an IP of Fuego RPC Wallet, if RPC Wallet is located on local machine it is either 127.0.0.1 or localhost,
- <service port> is Fuego RPC Wallet port, by default it is binded to 18180 port, but it can be manually bound to any port you want, read more about this
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:
{
'params':{
'viewSecretKey':'4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907'
},
'jsonrpc':'2.0',
'id':'test',
'method':'reset'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
}
}
getStatus() method returns information about the current RPC Wallet state: block_count, known_block_count, last_block_hash, and peer_count.
No input.
Output:
Argument | Description | Format | Example |
---|---|---|---|
blockCount | Node's known number of blocks | uint32 | 123456 |
knownBlockCount | Maximum known number of blocks of all seeds that are connected to the node | uint32 | 123123 |
lastBlockHash | Hash of the last known block | string | 8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4 |
peerCount | Connected peers number | uint32 | 5 |
Input example:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'getStatus'
}
{
"id": "test",
"jsonrpc": "2.0",
"result": {
"blockCount": 256739,
"knownBlockCount": 256739,
"lastBlockHash": "1ae2b3fd7351a84c775e3088869efcc8afe6424cc2bc0ba9bd448c542061099b",
"peerCount": 7
}
}
save() method allows you to save your wallet by request.
No input.
No output in case of success.
Input value example:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'save'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
}
}
getViewKey() method returns your view key.
No input.
Output:
Argument | Description | Format | Example |
---|---|---|---|
viewSecretKey | Private view key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
Input Example:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'getViewKey'
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'viewSecretKey':'4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907'
}
}
getSpendKeys() method returns your spend keys.
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
address | Yes | Valid and existing in this container address | string | fire27RrSh8Kw3AiQ4H8LNdW59PdPZ5V3o67LAvtaumHMPP68JVkiPhhffFJrrHu2PeFvviWZGfADPAWQNrCHKLebGVZAN7zX2 |
Output:
Argument | Description | Format | Example |
---|---|---|---|
spendSecretKey | Private spend key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
spendPublicKey | Public spend key | string | 4a2583e42d010e8aabfed22743789569714196246bf01b5f2fec35af9232d907 |
Input Example:
{
'params':{
'address':'fire36p6psZdEXvyGCWApeoAa7MXPH4oQxx2ft76AcDNg3bHAssKjnaVY4kqTQFgZ8fEffumNXZhXTKdgn3HhGBWuhmaSkiiiT'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getSpendKeys'
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'spendSecretKey':'cc0939375e65b83116e3f2b9ca185f41590a0906696cc213e7a5973f86fec309'
'spendPublicKey':'30273e74c30ce7d76de5d935e1f79b352895f3ec8f46728d4cdbff4681935408'
}
}
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:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'getAddresses'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'addresses':[
'fire2JvChZcxB78Ew5161SEPhvfAbxTKfpQw3fdXQixXWQCS427duc67swd2xrPpn52jU4RpZkiJJ2yZg2UeFhufaxPCA6VPrx',
'fire51BrBVBVMb5xPszyfEEgEKGx1gzH1BpDcUBpqK1dn2dYd8WFqh9ra5bbrms5YQXqiGxScQdQheTAZA4ELPX3B7km9NqPtU'
]
}
}
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 | |
reset | No | Determines whether reset wallet or not on address creation with spendKey. By default is true - do reset (old behavior) | boolean |
Note: If none of the above mentioned parameters were specified, RPC Wallet creates spend address with generated spend key.
Note: both above mentioned keys in parameters can't be present in a single request
Output:
Argument | Description | Format | Example |
---|---|---|---|
address | Created address | string | fire7oWDRv4waakZWpW7deoJoyjafhZZRgUoynV9gdthDiGQHvFvmaCwiuw1GqyrUc3GZQCxHMhchGsimwtWe7ERZ8LrtKrTJm |
Input value example:
{
'params':{
},
'jsonrpc':'2.0',
'id':'test',
'method':'createAddress'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'address':'fire6v1ok7GS5aLHu3qAw9QK2LfhmTTS11d72uT2dhrg53q5LJMudW23gWTFGzVBsLdG3Sxa8S77NMQfnTvq8kMeEBEcq27DQg'
}
}
deleteAddress() method deletes a specified address.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
address | Yes | An address to be deleted. | string | fire6v1ok7GS5aLHu3qAw9QK2LfhmTTS11d72uT2dhrg53q5LJMudW23gWTFGzVBsLdG3Sxa8S77NMQfnTvq8kMeEBEcq27DQg |
Output:
In case of success returns an empty JSON object.
Input example:
{
'params':{
'address':'fire8NuiUafbBbuhG4HMkJVtp9oYVsQh8P4KZxvYqgLNZPx7T61QYa3YbBM1QsaHSgbZbjq3DYG4ME7w9W5jSJiG3bm1UQApeV'
},
'jsonrpc':'2.0',
'id':'test',
'method':'deleteAddress'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
}
}
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 | fire6rC5YuPXLy8UYLhwuQhRUXYLf94aHMrMLjM1Dmf5LupiQzUXoPZBM3cWDmdpbDQgKphaY6yhFvW2AFiXgg3WWeHPS4gCyk |
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:
{
'params':{
'address':'fire5Xixe5Ldwu8jTDDBdiqVj6dzC9GhL5hc35CbfkpiMTetKyPxFd6xNcbMedHC63bZ7YuQPmiq19BQR3J2w3Se83NEViGtDM'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getBalance'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'lockedAmount':210,
'availableBalance':110
}
}
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:
{
'params':{
'blockCount':11,
'firstBlockIndex':0
},
'jsonrpc':'2.0',
'id':'test',
'method':'getBlockHashes'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'blockHashes':[
'8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4',
'657cd1c33df7f4250d581c97db665cb4a1856ebfadd6efabaeab745c2c76b1be',
'21047174f74576b6722e72646d7bd553e17d7c9f07fef05151bb1f9df7ed9dd8',
'504b9bfb2cd34531551cb2d68ea3e34e030d991164589ba7ed24e16fed3ea374',
'd9d36b5226d11b2cf60e3cf2038b21032c4ac753eabc32fbdd506158f95a69ca',
'171be105f8e39729838144c78ced336d0ebc29a4bd2c7a22901c0e8c0eaabb42',
'5f7933bd0257649a44e571d59a9f4083297acbdd338c1c0094a7226ade8d0f0f',
'967fd52a57e8193f56329bb37abdddce717098429f62c00776342c605a28e19b',
'6b1a21634a3d72821c43a244af16098eba7c0a59a2e409efa38bd420702f7594',
'7bb5ca944c5f916f80d50246f48789cc4605efd166efc2308553fe0d208fbe12',
'83dfef7c288121d87e60f52c74d3da6b422d4b8581ce732ef8b54273bd6c4f45'
]
}
}
*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 | fire5B538zh59Mn5T11D8gjtWaZj47H8Q6VapCxrsYAZwxu3Bdp4EkJFJkNtrxr2tALBv8gNannsLz5z8TRjnKoh8AwB4hq5U5 |
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 |
---|---|---|---|
items |
Array that contains:
|
array | See below |
Input example:
{
'params':{
'blockCount':100,
'firstBlockIndex':0,
'addresses':[
'fire228gf9PRbrs4ziynt8Rywtm1UWSmBL5yeQSfv6dYrfwBeQdj8hagdDGnAx8w8QHPzgrFs5dwXsHrX3993jrFf2matTAMFM'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransactionHashes'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'items':[
{
'transactionHashes':[
957dcbf54f327846ea0c7a16b2ae8c24ba3fa8305cc3bbc6424e85e7d358b44b
25bb751814dd39bf46c972bd760e7516e34200f5e5dd02fda696671e11201f78
],
'blockHash':'8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4'
}
]
}
}
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:
|
array | See below |
Input example:
{
'params':{
'blockCount':1000,
'firstBlockIndex':1,
'addresses':[
'fire228gf9PRbrs4ziynt8Rywtm1UWSmBL5yeQSfv6dYrfwBeQdj8hagdDGnAx8w8QHPzgrFs5dwXsHrX3993jrFf2matTAMFM',
'fire6BSUpyGKWMm1C4Kkh64Xeas99AmaVSpdsjVTXQmS9xs1XWzRWGAHSF9kJvCZdSc2RndcLaBnNNUNiTyfMFCbunkKDNguaN',
'fire2SUWSvMo5fkfUoryYUiCnnCDeKnsAweodZEPMGoNypiQLhVFML6AUAex3hA25ahZ94PmTJdVLyxAv5zvgGBaqmCbowtD7M'
],
paymentId:'somePaymentId'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransactions'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'items':[
{
'blockHash':'01bd06ca731914f27e143bbb902ce0bc05bff13d76faa027ea817e68f217488c',
'transactions':[
{
'fee':-70368475742208,
'extra':'0127cea59bfadc49aa02ed4a225936671e55607b5241621abca2a5e14405906dbb',
'timestamp':1446029698,
'blockIndex':1,
'state':0,
'transactionHash':'06ec210a8359f253f8b2160a0d6040cf89f2a05a553aaa577b7f508ee5d831f9',
'amount':70368475742208,
'unlockTime':11,
'transfers':[
{
'amount':70368475742208,
'type':0,
'address':'fire228gf9PRbrs4ziynt8Rywtm1UWSmBL5yeQSfv6dYrfwBeQdj8hagdDGnAx8w8QHPzgrFs5dwXsHrX3993jrFf2matTAMFM'
}
],
'paymentId':'',
'isBase':True
}
]
},
{
'blockHash':'28aa7d32f4274f6387969d7671bd4db98fd871bf0dd510a1df5e2ef4b1d41a35',
'transactions':[
{
'fee':-70368207307776,
'extra':'01a8e6e408282b2ddf343e20d5e9aab283723ba10ab7ab7b3131f6981b02a84431',
'timestamp':1446029698,
'blockIndex':2,
'state':0,
'transactionHash':'922d00d2e6eaed63f62d8e3b968cb08b6ea5c555fe0e6af948ab06efe6eb213a',
'amount':70368207307776,
'unlockTime':12,
'transfers':[
{
'amount':70368207307776,
'type':0,
'address':'fire2SUWSvMo5fkfUoryYUiCnnCDeKnsAweodZEPMGoNypiQLhVFML6AUAex3hA25ahZ94PmTJdVLyxAv5zvgGBaqmCbowtD7M'
}
],
'paymentId':'',
'isBase':True
}
]
}
]
}
}
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:
{
'params':{
'addresses':[
'fire3ExTnYFsWB72NnoFb3P9BiZYNkGfWq1usKmZoCeegiyU4GkMb1fPPkU48HkEB6oqn3Yxy1ZGFV7wHsrR8VwbM6EDT5qxND',
'fire6GVTgsDHSNtkbPMAHGaSTD7FsMQ4UU3BBE5miiCAgXGXu1NFCC53bLwh387YBKy1sfqp9m7z5cxvXCdF5iCaKFvZFYkJwZ',
'fire3SYhbMXdRJj2BZSCJK2LpqgJBr8G55BZod5jBymXJvd5msb4CJjQatSqbZtdAFM3M4w4Fi3YTbJnoyoVBXz3RiGZuNfe7x'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'getUnconfirmedTransactionHashes'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHashes':[
...,
...,
...
]
}
}
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:
|
array | See below |
Input example:
{
'params':{
'transactionHash':'92423b0857d36bd172b3f2effbd47ea477bfe0618a50c29d475542c6d5d1b835'
},
'jsonrpc':'2.0',
'id':'test',
'method':'getTransaction'
}
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transaction':{
'fee':1000000,
'extra':'0130b4472974f2deb9fae7d8fd6602b26396379f3fa05cca2430e10e9e60179f42',
'timestamp':0,
'blockIndex':4294967295,
'state':0,
'transactionHash':'92423b0857d36bd172b3f2effbd47ea477bfe0618a50c29d475542c6d5d1b835',
'amount':-1703701,
'unlockTime':0,
'transfers':[
{
'amount':123456,
'type':0,
'address':'fire3ExTnYFsWB72NnoFb3P9BiZYNkGfWq1usKmZoCeegiyU4GkMb1fPPkU48HkEB6oqn3Yxy1ZGFV7wHsrR8VwbM6EDT5qxND'
},
{
'amount':234567,
'type':0,
'address':'fire6GVTgsDHSNtkbPMAHGaSTD7FsMQ4UU3BBE5miiCAgXGXu1NFCC53bLwh387YBKy1sfqp9m7z5cxvXCdF5iCaKFvZFYkJwZ'
},
{
'amount':345678,
'type':0,
'address':'fire3SYhbMXdRJj2BZSCJK2LpqgJBr8G55BZod5jBymXJvd5msb4CJjQatSqbZtdAFM3M4w4Fi3YTbJnoyoVBXz3RiGZuNfe7x'
}
],
'paymentId':'',
'isBase':False
}
}
}
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:
|
array | "amount": 10000000000, "address": "fire6RmFPRFGuvcedreLqbLZP1QrQ7xja22mMCgPG559kkQMZXT6rFfFrEdmSmQkyBgyAa5Jkdq37qBrknUapMEMEPHaPp1mB8" |
fee | Yes | Transaction fee. Minimum fee for transactions on the Fuego network is 0.008 XFG (or 80k 0rbs). This parameter should be specified in minimal available XFG units. For example, if your fee is 0.008 XFG, you should pass it as 80000 | uint64 | 80000 |
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 3 to 18). Level 2 is default for all transacations. | 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 | fire7XntHufTzKoh8H1Uc7PANHtPzZnFTgpSQA7JKzB3rxYwVAKmMDPRHpDJkMS2yeihMzaDbFVgBsGESsymFZaCbhMAT6D34u |
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:
{
'params':{
'anonymity':0,
'fee':80000,
'unlockTime':0,
'paymentId':'somePaymentId',
'addresses':[
'fire7NCdThZ6pWmAfYeQx5P4NUK3wTtDDkhsr9A5HKNFY1o5rpoVanRKram7CH3pxUcXQBP52bEWgkHvSfejcWZR2pzSKXrGX6',
'fire6umiSE3ZL3mJvAbttBqFtaCECaH3Rd4uRfh2hhHimPoVqrfwAXRCCWHg1AJqSD7paNh8xY34Q34Kk7ZX8M8X5df4DKFpG9',
'fire7SBHtD1zs7DfjbpgaNeNid1zntAuH6C8ELWaH7AWWUu8uAdrC55W4N1Lga2od19fmRsnBduFP5pKm5RyADwKazcd7dHTLL'
],
'transfers':[
{
'amount':123456,
'address':'fire3W8fv6HETUm6ubsk77cfSoBHGw8NZ8unfv2ceLANqEFauqUXDaSvnEabGuaJ2YJt6GDFpzNR5qcErvAVdW665bzdh7mEuo'
},
{
'amount':234567,
'address':'fire7vdfvtV7cEgPNSeE85g3NkNSyrxJFbH1oQmuwMLYoxCkw26BsHGYgP4i98hGd4aVqZo2itFthbx7HpS1ZYLQsL62YdEZS8'
},
{
'amount':345678,
'address':'fire2pezdh7qrkMd5QAfAD3BoY4mkAZcFgqWnum3eUzEroMoTJEsyxQpynXSsVNCZ1A67YpEF7yUAvuTvD37VorCVDqBwDHzwg'
}
],
'changeAddress':'fire7NCdThZ6pWmAfYeQx5P4NUK3wTtDDkhsr9A5HKNFY1o5rpoVanRKram7CH3pxUcXQBP52bEWgkHvSfejcWZR2pzSKXrGX6'
},
'jsonrpc':'2.0',
'id':'test',
'method':'sendTransaction'
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHash':'93faedc8b8a80a084a02dfeffd163934746c2163f23a1b6022b32423ec9ae08f'
}
}
estimateFusion() method counts the number of unspent outputs of the specified addresses and returns how many of those outputs can be optimized.
This method is used to understand if a fusion transaction can be created. If fusionReadyCount returns a value = 0, then a fusion transaction cannot be created.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
threshold | Yes | Value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. | uint64 | 1000000 |
addresses | No | Array of strings, where each string is an address to take the funds from. | array | See below |
Output:
Argument | Description | Format | Example |
---|---|---|---|
totalOutputCount | Total number of unspent outputs of the specified addresses. | uint64 | 1000 |
fusionReadyCount | Number of outputs that can be optimized. | uint64 | 50 |
Input example:
{
'params':{
'threshold':1000000,
'addresses':[
'fire6TSbGfKwvVUpLcAHoSsLyyfJP94XNygNZJCZbTpLERk6tgzVdJ5VGXXrmtEvSiGUpnsHEATj9e8fJ27F2h4BWG6QzQvkn2',
'fire7uoFj33TQMVjEGDQu24dfsWytrQBSoAuHuQXKENcos5XdBu2j1Pc2cBEEpARRidrgmzBz9vXEYJAMEozx4LFKNDFMkaDsQ',
'fire7GaunrcxfWF6v2WYJjYKSXnWzs6EEnSEFrgcvUJj2uZw6AqhKseeNXNkVLRoVXskrCyKynL8H4PYbeGkXbGEzoMS3xhVuk'
]
},
'jsonrpc':'2.0',
'id':'test',
'method':'estimateFusion'
}
Output example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'totalOutputCount':1000,
'fusionReadyCount':50
}
}
sendFusionTransaction() method allows you to send a fusion transaction, by taking funds from selected addresses and transferring them to the destination address.
If there aren't any outputs that can be optimized, sendFusionTransaction() will return an error. You can use estimateFusion to check the outputs, available for the optimization.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
threshold | Yes | Value that determines which outputs will be optimized. Only the outputs, lesser than the threshold value, will be included into a fusion transaction. | uint64 | 1000000 |
anonymity | Yes | Privacy level (a discrete number from 3 to 18). Level 2 is default for all transactions. | uint64 | 6 |
addresses | No | Array of strings, where each string is an address to take the funds from. | array | See below |
destinationAddress | No | An address that the optimized funds will be sent to. Valid and existing in this container address. | string | fire7GaunrcxfWF6v2WYJjYKSXnWzs6EEnSEFrgcvUJj2uZw6AqhKseeNXNkVLRoVXskrCyKynL8H4PYbeGkXbGEzoMS3xhVuk |
Note: if container contains only 1 address, destinationAddress field can be left empty and the funds are going to be sent to this address.
Note: if addresses field contains only 1 address, destinationAddress can be left empty and the funds are going to be sent to this address.
Note: in the rest of the cases, destinationAddress field is mandatory and must contain an address.
Output:
Argument | Description | Format | Example |
---|---|---|---|
transactionHash | Hash of the sent transaction. | string | 93faedc8b8a80a084a02dfeffd163934746c2163f23a1b6022b32423ec9ae08f |
Input Example:
{
'params':{
'anonymity':6,
'threshold':80000,
'addresses':[
'fire5yCpXR9LAD1Ci4L2tQdLWZZPALxeETwiBkMWWwcPUm5wvwa5UCWTr42nzgh8F3uQdcLgVJVBfUKYM6gz6AYLXaMi4akfdT',
'fire5cJoAaZ7t9WLE7S3bjMewhxLk28TXwUaQxGZFhMfNHzxF67c2udFLtcTBBUeCV6ggCoLM4zRWTPTmFTi8xqH44nHzKC5YB',
'fire5M4VFB2bbXc3naUhYV489Ns2yFMXFy1F3HmsmcBY8Yh2tQqctuiQd96UASLNFbzmXmbQvjK8Zu8ZFKJuKjjFGsVLchM2xv'
],
'destinationAddress':'fire7i2ht2M7TZ9qteotWNSHoaxMheMKXmioRFvvSmqXpwNJszsPxuRMSmgsDRFMNDewEnuZY1ivgzuQqSYa6fk1c5H9gY7edZ'
},
'jsonrpc':'2.0',
'id':'test',
'method':'sendFusionTransaction'
}
Return value example:
{
'jsonrpc':'2.0',
'id':'test',
'result':{
'transactionHash':'93faedc8b8a80a084a02dfeffd163934746c2163f23a1b6022b32423ec9ae08f'
}
}
validateAddress() method allows you to check if provided address is valid.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
Address | Yes | Address to validate | string | fire7eSRLEbywU7jJN52pM6UM6SpNocyRMBz8jCRJgaY8o7aGx16A8VEz4igfvcYe1KyEGCvcnGu2aj6jjC6Au2VkKtjq2CFBA |
Output:
Argument | Description | Format | Example |
---|---|---|---|
address | Parsed address. | string | fire7eSRLEbywU7jJN52pM6UM6SpNocyRMBz8jCRJgaY8o7aGx16A8VEz4igfvcYe1KyEGCvcnGu2aj6jjC6Au2VkKtjq2CFBA |
isvalid | whether the address is valid or invalid | boolean | true |
spendPublicKey | Public spend key | string | e1f92ab3d124582cb70453917822dd11b40f2ab69191573b9106cc4bba23f150 |
viewPublicKey | Public view key | string | 12fda3d5a8d7aed880ee93df01f492989e225ad609747e40fda503c5abddf754 |
Input Example:
{
"jsonrpc":"2.0",
"method":"validateAddress",
"params":{
"address":"fire5GRpk3jm95jRWgXurZEzguX1nzBFY2Kin7DXJLgXc72Yy4d95EBtMGPcb8x1N9s8rFcwLfQFWg5NMv6vQ4UHWERc5MxmR4"
}
}
Return value example:
{
"jsonrpc": "2.0",
"result": {
"address": "fire5GRpk3jm95jRWgXurZEzguX1nzBFY2Kin7DXJLgXc72Yy4d95EBtMGPcb8x1N9s8rFcwLfQFWg5NMv6vQ4UHWERc5MxmR4",
"isvalid": true,
"spendPublicKey": "84e2198cffa6c5a21df22c99c0c21016c2db7a9eb97926464f0642c9b6fa0dd4",
"viewPublicKey": "b32a52254114440690698be934ff2e2d643174d4b168542fef981c3d62abc0ec"
}
}