blockchain_node

December 14, 2022 ยท View on GitHub

An API to the Helium blockchain-node. This api follows the json-rpc 2.0 specification. More information available at http://www.jsonrpc.org/specification.

Version 1.0



block_height

Gets the stored height of the blockchain.

Description

Gets the stored height of the blockchain.

Result

NameTypeConstraintsDescription
resultnumberBlock height

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "block_height"
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": 318492
}

block_get

Get a block by height or hash.

Description

Gets a block with it's transaction hashes given a block height or block hash.

Parameters

NameTypeConstraintsDescription
paramsobject
params?.heightnumberBlock height to fetch
params?.hashnumberBlock hash to fetch

Result

NameTypeConstraintsDescription
resultobjectBlock details
result.hashstringHash of block
result.heightnumberHeight of block
result.prev_hashstringHash of previous block
result.timenumberTime of block in seconds from epoch
result.transactionsarrayBlock transaction descriptions
result.transactions[]objectTransaction hash
result.transactions[]?.hashstringTransaction hash
result.transactions[]?.typestringTransaction type

Errors

CodeMessageDescription
-100Block not found
-150Failed to get block
-3602Invalid parameter

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "block_get",
  "params": {
    "height": 318492
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "hash": "vX_PzD2DvIQZPlpM_LiDCCewpWuZkwcdAhjnJXeg5Gk",
    "height": 318492,
    "prev_hash": "OLv5ah-94zg3ySJK5x50-W6Kw4gd510ikhpbByq37ZU",
    "time": 1588558709,
    "transactions": [
      {
        "hash": "UOVRPuEO2IE8y9fxiuO9JBcBLrqP0Hbh7cUqt-n_8QE",
        "type": "poc_request_v1"
      },
      {
        "hash": "67NdSWYjdE8LaR0DE_NNWqMr4XVK8hwrFJ616c9BPmE",
        "type": "poc_request_v1"
      },
      {
        "hash": "KfHpj8ytLV6bqNaMS8wbWXeqXkHxjS-G_U_AAUrFvSQ",
        "type": "poc_request_v1"
      },
      {
        "hash": "r4mgtbBnrY0v6_m01-akrUtZ7KSsLIF4XTJBIUWiaZs",
        "type": "poc_request_v1"
      },
      {
        "hash": "KMFPXYw9QYdW3mtciOuitcWm1qVknm5IDluckN7IcaY",
        "type": "poc_request_v1"
      },
      {
        "hash": "1cpS1AnemprqCmm8SHq9_S-eiCE6zjzf2QsOIaV4GgI",
        "type": "poc_request_v1"
      },
      {
        "hash": "1Rh4iR3eBQIIywqSQ0TCO04tdl2Dl7dW4qWng5q65Es",
        "type": "poc_request_v1"
      }
    ]
  }
}

account_get

Get account details.

Description

Get account details for a given account address.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the account to fetch

Result

NameTypeConstraintsDescription
resultobjectAccount
result.addressstringAddress of the account
result.balancenumberHNT balance of the account in bones
result.mobile_balancenumberMOBILE balance of the account in bones
result.iot_balancenumberIOT balance of the account in bones
result.noncenumberThe current nonce for the account
result.speculative_noncenumberThe larger of the maximum pending balance nonce or the current nonce
result.dc_balancenumberData credit balance of the account
result.dc_noncenumberThe current data credit nonce for the account
result.sec_balancenumberSecurity token balance of the account
result?.sec_noncenumberThe current security token nonce for the account (deprecated).
result?.sec_speculative_noncenumberThe larger of the maximum pending security nonce or the current security token nonce for the account (deprecated)
result.staked_balancenumberStaked HNT balance of the account
result.cooldown_balancenumberStaked HNT balance of the account currently in cooldown

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "account_get",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5",
    "balance": 1000,
    "mobile_balance": 1000,
    "iot_balance": 1000,
    "nonce": 3,
    "speculative_nonce": 12,
    "dc_balance": 0,
    "dc_nonce": 0,
    "sec_balance": 0,
    "sec_nonce": 0,
    "sec_speculative_nonce": 0,
    "staked_balance": 0,
    "cooldown_balance": 0
  }
}

transaction_get

Get transaction details.

Description

Get details for a given transaction hash.

Parameters

NameTypeConstraintsDescription
paramsobject
params.hashstringB64 hash of the transaction to fetch

Result

NameTypeConstraintsDescription
resultobjectTransaction details. The exact fields returned depend on the transaction type returned in the result.
result.hashstringB64 hash of the transaction
result.typestringThe type of the transaction
result?.implicit_burnobjectImplicit burn details
result?.implicit_burn.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result?.implicit_burn.payerstringAddress of the account that paid the fee

Errors

CodeMessageDescription
-100Transaction not found
-150Failed to get transaction

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "transaction_get",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "implicit_burn": {
      "fee": 1401125,
      "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
    }
  }
}

oracle_price_current

Gets the current oracle price.

Description

Gets the oracle price at the current height of the blockchain.

Result

NameTypeConstraintsDescription
resultobjectOracle Price
result.pricenumberThe oracle price at the indicated height
result.heightnumberThe block height of the oracle price

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "oracle_price_current"
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "price": 131069500,
    "height": 633936
  }
}

oracle_price_get

Gets an oracle price at a height.

Description

Gets the oracle price at the given height of the blockchain (if known).

Parameters

NameTypeConstraintsDescription
paramsobject
params.heightnumberBlock height to get the oracle price for.

Result

NameTypeConstraintsDescription
resultobjectOracle Price
result.pricenumberThe oracle price at the indicated height
result.heightnumberThe block height of the oracle price

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "oracle_price_get",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "price": 131069500,
    "height": 633936
  }
}

pending_transaction_get

Get a pending transaction.

Description

Get the previously submitted transaction with status.

Parameters

NameTypeConstraintsDescription
paramsobject
params.hashstringB64 hash of the pending transaction to fetch

Result

NameTypeConstraintsDescription
resultobjectPending transaction details. The exact fields returned depend on the transaction type returned in the result. The transaction will be absent if status is cleared or failed
result?.txnobjectTransaction details. The exact fields returned depend on the transaction type returned in the result.
result?.txn.hashstringB64 hash of the transaction
result?.txn.typestringThe type of the transaction
result?.txn?.implicit_burnobjectImplicit burn details
result?.txn?.implicit_burn.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result?.txn?.implicit_burn.payerstringAddress of the account that paid the fee
result.statusstringOne of pending, cleared or failed
result?.failed_reasonstringPresent during failed status

Errors

CodeMessageDescription
-100Pending transaction not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "pending_transaction_get",
  "params": {
    "hash": "xG-KdomBEdp4gTiJO1Riif92DoMd5hPxadcSci05pIs"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "txn": {
      "implicit_burn": {
        "fee": 1401125,
        "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
      }
    }
  }
}

pending_transaction_status

Get pending transaction status.

Description

Get the status a previously submitted transaction.

Parameters

NameTypeConstraintsDescription
paramsobject
params.hashstringB64 hash of the pending transaction to fetch

Result

NameTypeConstraintsDescription
resultstringOne of 'pending', 'cleared', 'not_found' or a failure reason

Errors

CodeMessageDescription
-100Pending transaction not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "pending_transaction_status",
  "params": {
    "hash": "xG-KdomBEdp4gTiJO1Riif92DoMd5hPxadcSci05pIs"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": "cleared"
}

pending_transaction_submit

Submit a transaction to the pending queue.

Description

Submits a pending transaction to the pending queue. The transactions needs to be in a blockchain_txn envelope and base64 encoded

Parameters

NameTypeConstraintsDescription
paramsobject
params.txnstringB64 encoded transaction

Result

NameTypeConstraintsDescription
resultobjectTransaction details. The exact fields returned depend on the transaction type returned in the result.
result.hashstringB64 hash of the transaction
result.typestringThe type of the transaction
result?.implicit_burnobjectImplicit burn details
result?.implicit_burn.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result?.implicit_burn.payerstringAddress of the account that paid the fee

Errors

CodeMessageDescription
-3602Invalid parameter

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "pending_transaction_submit",
  "params": {
    "txn": "QoWBCIe..."
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "implicit_burn": {
      "fee": 1401125,
      "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
    }
  }
}

pending_transaction_verify

Verify a transaction prior to submitting to the pending queue.

Description

Verifies a transaction prior to submitting to the pending queue. The transactions needs to be in a blockchain_txn envelope and base64 encoded. Result returns "valid" if the transaction is valid; otherwise, the error message is present.

Parameters

NameTypeConstraintsDescription
paramsobject
params.txnstringB64 encoded transaction

Result

NameTypeConstraintsDescription
result

Errors

CodeMessageDescription
-3602Invalid parameter

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "pending_transaction_verify",
  "params": {
    "txn": "QoWBCIe..."
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}

implicit_burn_get

Gets an implicit burn for a transaction hash.

Description

Gets an implicit burn for a transaction hash. Returns amount of HNT burned for a DC fee.

Parameters

NameTypeConstraintsDescription
paramsobject
params.hashstringTransaction hash to get implicit burn for.

Result

NameTypeConstraintsDescription
resultobjectImplicit burn details
result.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result.payerstringAddress of the account that paid the fee

Errors

CodeMessageDescription
-100Implicit burn not found for transaction

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "implicit_burn_get",
  "params": {
    "hash": "13BnsQ6rZVHXHxT8tgYX6njGxppkVEEcAxDdHV51Vwikrh8XBP9"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "fee": 1401125,
    "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
  }
}

htlc_get

Gets HTLC details for an HTLC address.

Description

Gets HTLC details for an HTLC address. If an HTLC was redeemed, it will also show the redemption height.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringHTLC address

Result

NameTypeConstraintsDescription
resultobjectHTLC details
result.addressstringB58 address of the HTLC
result.balancenumberAmount of HNT locked
result.hashlockstringHash to unlock HTLC
result.payeestringAddress of the payee
result.payerstringAddress of the payer
result?.redeemed_atnumberBlock height at which HTLC was redeemed
result.timelocknumberNumber of blocks HTLC is locked for until payer can reclaim

Errors

CodeMessageDescription
-100HTLC not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "htlc_get",
  "params": {
    "address": "13BnsQ6rZVHXHxT8tgYX6njGxppkVEEcAxDdHV51Vwikrh8XBP9"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "address": "13BnsQ6rZVHXHxT8tgYX6njGxppkVEEcAxDdHV51Vwikrh8XBP9",
    "balance": 10,
    "hashlock": "AQEFmiouhIzFHBeCyW4J3sBKvBD3m2yuktTxUf14cIo",
    "payee": "14zemQxLLimdTkHnpBU8f6o3DMmU9QfrreqsR1rYUF4tLveyc62",
    "payer": "13udMhCkD4RmVCKKtprt96UAEBMppT55fs1z9viS6Uha8EWSWGe",
    "redeemed_at": 930213,
    "timelock": 100
  }
}

wallet_create

Create a new wallet.

Description

Creates a new wallet, encrypted with the given password. The wallet is locked after creation.

Parameters

NameTypeConstraintsDescription
paramsobject
params.passwordstringPassword used to encrypt the wallet

Result

NameTypeConstraintsDescription
resultstringThe B58 encoded public address of the wallet

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_create",
  "params": {
    "password": "a password"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5"
}

wallet_delete

Delets a wallet.

Description

Permanently removes the wallet from the database.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the wallet to delete

Result

NameTypeConstraintsDescription
resultbooleanReturns true if the wallet was deleted

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_delete",
  "params": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": true
}

wallet_list

List all wallets.

Description

Lists the public keys of all wallets.

Result

NameTypeConstraintsDescription
resultarray
result[]stringThe B58 encoded public address of a wallet

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_list"
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": ["13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5"]
}

wallet_unlock

Unlock a wallet for signing.

Description

Unlock a wallet for signing. The wallet will be unlocked for 60 seonds.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the wallet to unlock
params.passwordstringPassword used to decrypt the wallet

Result

NameTypeConstraintsDescription
resultbooleanReturns true if the wallet is unlocked

Errors

CodeMessageDescription
-100Wallet not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_unlock",
  "params": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5",
    "password": "a password"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": true
}

wallet_lock

Lock a wallet.

Description

Locks a previously unlocked wallet.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the wallet to lock

Result

NameTypeConstraintsDescription
resultbooleanReturns true regardless of whether the wallet is found or not

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_lock",
  "params": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": true
}

wallet_is_locked

Checks if a wallet is locked.

Description

Checks if a wallet is unlocked.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the wallet to check

Result

NameTypeConstraintsDescription
resultbooleanReturns true if the wallet is locked or uknown

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_is_locked",
  "params": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": true
}

wallet_pay

Send a payment to another account.

Description

Sends a single payment in bones to a given account address. Note that 1 HNT it 100_000_000 bones

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the payer wallet
params.payeestringB58 address of the payee account
params?.bonesintegerAmount in bones to send. Must be specified if "max" = false.
params?.token_typestringToken type to send. [hnt, mobile, iot, hst. Default: hnt]
params?.maxbooleanIf true, send entire wallet balance rather than specific amount.
params?.nonceintegerNonce to use for transaction

Result

NameTypeConstraintsDescription
resultobjectTransaction details. The exact fields returned depend on the transaction type returned in the result.
result.hashstringB64 hash of the transaction
result.typestringThe type of the transaction
result?.implicit_burnobjectImplicit burn details
result?.implicit_burn.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result?.implicit_burn.payerstringAddress of the account that paid the fee

Errors

CodeMessageDescription
-100Wallet not found or locked

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_pay",
  "params": {
    "address": "13Ya3s4k8dsbd1dey6dmiYbwk4Dk1MRFCi3RBQ7nwKnSZqnYoW5",
    "payee": "13buBykFQf5VaQtv7mWj2PBY9Lq4i1DeXhg7C4Vbu3ppzqqNkTH",
    "bones": 1000,
    "token_type": "hnt",
    "max": "false",
    "nonce": 422
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "implicit_burn": {
      "fee": 1401125,
      "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
    }
  }
}

wallet_pay_multi

Send multiple paymens in a single transation.

Description

Sends multiple payments in bones to one or more payees. Note that 1 HNT it 100_000_000 bones

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the payer wallet
params.paymentsarray
params.payments[]object
params.payments[]?.payeestringB58 address of the payee account
params.payments[]?.bonesintegerAmount in bones to send. Must be specified if "max" = false
params.payments[]?.token_typestringToken type to send. [hnt, mobile, iot, hst. Default: hnt]
params.payments[]?.maxbooleanIf true, send entire wallet balance rather than specific amount. Only one payment entry per token type can have "max" set to true.

Result

NameTypeConstraintsDescription
resultobjectTransaction details. The exact fields returned depend on the transaction type returned in the result.
result.hashstringB64 hash of the transaction
result.typestringThe type of the transaction
result?.implicit_burnobjectImplicit burn details
result?.implicit_burn.feenumberAmount of HNT (in bones) burned for the fee of the corresponding transaction
result?.implicit_burn.payerstringAddress of the account that paid the fee

Errors

CodeMessageDescription
-100Wallet not found or locked

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_pay_multi",
  "params": {
    "payments": [
      {
        "token_type": "hnt",
        "max": "false"
      }
    ]
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "implicit_burn": {
      "fee": 1401125,
      "payer": "1b93cMbumsxd2qgahdn7dZ19rzNJ7KxEHsLfT4zQXiS9YnbR39F"
    }
  }
}

wallet_import

Import an encrypted wallet.

Description

Import an encrypted wallet into the wallet database. The password is only used to verify that the wallet can be unlocked and is not stored.

Parameters

NameTypeConstraintsDescription
paramsobject
params.passwordstringPassword used to decrypt the wallet
params.pathstringPath to the file to import the wallet from

Result

NameTypeConstraintsDescription
resultstringThe public key of the wallet

Errors

CodeMessageDescription
-100Wallet file not found
-110Invalid password for wallet

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_import",
  "params": {
    "password": "a password"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}

wallet_export

Export an encrypted wallet to a given path.

Description

Exports an encrypted wallet to the given path.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the payer wallet
params.pathstringPath to the file to save the wallet to

Errors

CodeMessageDescription
-100Wallet not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_export",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}

wallet_export_secret

Export the secret key bytes for a wallet to a given path.

Description

Exports the secret keybytes of a given unlocked wallet to the given path.

Parameters

NameTypeConstraintsDescription
paramsobject
params.addressstringB58 address of the wallet
params.pathstringPath to the file to save the export to

Errors

CodeMessageDescription
-100Wallet not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_export_secret",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}

wallet_backup_list

Lists information on the list of backups in the given path.

Description

Backup list information includes the backup ID, size, and the time the backup was created.

Parameters

NameTypeConstraintsDescription
paramsobject
params.pathstringPath to the backup folder

Result

NameTypeConstraintsDescription
resultarray
result[]object
result[].backup_idintegerID of the backup
result[].number_filesintegerNumber of files in the backup
result[].sizeintegerSize of backup, in bytes
result[].timestampintegerTimestamp (seconds since epoch) of backup

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_backup_list",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": [
    {
      "backup_id": 2,
      "number_files": 3
    }
  ]
}

wallet_backup_create

Creates a backup of the wallet database.

Description

Creates a backup of the backup database in the given path.

Parameters

NameTypeConstraintsDescription
paramsobject
params.pathstringPath to the backup folder
params.max_backupsintegerMaximum number of backups to maintain in the folder

Result

NameTypeConstraintsDescription
resultobject
result.backup_idintegerID of the backup
result.number_filesintegerNumber of files in the backup
result.sizeintegerSize of backup, in bytes
result.timestampintegerTimestamp (seconds since epoch) of backup

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_backup_create",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "result": {
    "backup_id": 2,
    "number_files": 3
  }
}

wallet_backup_delete

Delete a backup.

Description

Delete the backup with the given ID from the given backup path.

Parameters

NameTypeConstraintsDescription
paramsobject
params.pathstringPath to the backup folder
params.backup_idintegerBackup ID to delete

Result

NameTypeConstraintsDescription
resultbooleanTrue if the backup was deleted succesfully

Errors

CodeMessageDescription
-100Backup not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_backup_delete",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}

wallet_backup_restore

Restore the wallet database.

Description

Restores the wallet database from the backup ID in the given backup folder.

Parameters

NameTypeConstraintsDescription
paramsobject
params.pathstringPath to the backup folder
params.backup_idintegerBackup ID to restore from

Result

NameTypeConstraintsDescription
resultbooleanTrue if the backup was restored succesfully

Errors

CodeMessageDescription
-100Backup not found

Examples

Request

{
  "jsonrpc": "2.0",
  "id": "1234567890",
  "method": "wallet_backup_restore",
  "params": {}
}

Response

{
  "jsonrpc": "2.0",
  "id": "1234567890"
}