Qtum Documentation
  • Qtum Features and Advances
    • Qtum Ordinals
      • Chapter 1: Introduction to ordinals
      • Chapter 2: Understanding Inscriptions in Depth
      • Chapter 3: The Intricacies of Ordinals on the Blockchain
      • Chapter 4: Engineering Ordinals within Qtum's Architecture
      • Chapter 5: Prerequisites for Engaging with Ordinals on Qtum
      • Chapter 6: The Procedure for Inscribing a Satoshi with Ordinals
      • Inscribing Messages on Qtum Testnet
    • Qtum-BIP38
  • Qtum Wallet
    • Qtum-Core Wallet Documentation
      • Qtum Documentation
      • Using Qtum Wallet
      • Linux Repositories
      • Qtum on Raspberry Pi
      • How to Update Qtum
      • Qtum Wallet Best Practices
      • Qtum Wallet Commands
      • Adding Nodes To Qtum Wallet
      • Encrypt & Unlock Qtum Wallet
      • Recovery wallet data with salvagewallet
      • Testnet User Guide
      • Bech32 Addresses support
      • How to Add Options (Config)
      • How to use Bootstrap
  • Staking and Nodes
    • Secure Staking With Qtum Star Network
    • Staking Documentation
      • Qtum Staking
      • Offline Staking
      • Offline Staking Address Delegation - Undelegation Transaction Details
      • Qtum on AWS ec2
      • Staking with a VPS
      • Staking with a Raspberry Pi
  • Other Wallets
    • Wallets Supporting Qtum
      • Electrum
      • Qtum Web Wallet
      • Qtum Lightning Network
  • RPC CALLS AND API
    • QTUM RPC CALLS
    • QTUM RPC API
  • Qtum Deployment
    • Guidance on Qtum Deployment
    • Building Qtum on Linux
    • Guidance for Exchange Deployment
  • Smart Contracts and QRC20 Tokens
    • QRC20 Token integration
    • QRC20 Integration Technical Guide
    • Raw QRC20 Transaction implementation guide
  • WEB3
    • Web3 Compatibility Layer
    • Janus Docker Container
    • Truffle
    • Differences between EVM chains
  • QNEKT
    • QNEKT
    • Why Fork Metamask ?
    • Sideloading Qnekt
    • Setting up QNEKT
    • Working with Testnet Coins on QNEKT
    • Connecting QNEKT to regtest
    • QNEKT Regtest with react-box
  • Research
    • Confidential Assets
    • Data Analytics
Powered by GitBook
On this page
  • qrc20allowance "contractaddress" "addressfrom" "addressto"
  • qrc20balanceof "contractaddress" "address"
  • qrc20decimals "contractaddress"
  • qrc20listtransactions
  • qrc20name "contractaddress"
  • qrc20symbol "contractaddress"
  • qrc20totalsupply "contractaddress"
  • qrc20approve "contractaddress" "owneraddress" "spenderaddress"
  • qrc20burn "contractaddress" "owneraddress" "amount" ( gaslimit gasprice checkoutputs )
  • qrc20burnfrom "contractaddress" "owneraddress" "spenderaddress" "amount" ( gaslimit gasprice checkoutputs )
  • qrc20transfer "contractaddress" "owneraddress" "addressto" "amount" ( gaslimit gasprice checkoutputs )
  1. RPC CALLS AND API

QTUM RPC CALLS

qrc20allowance "contractaddress" "addressfrom" "addressto"

qtum-cli qrc20allowance

qrc20allowance "contractaddress" "addressfrom" "addressto"

Returns remaining tokens allowed to spend for an address

Arguments:
1. contractaddress    (string, required) The contract address
2. addressfrom        (string, required) The qtum address of the account owning tokens
3. addressto          (string, required) The qtum address of the account able to transfer the tokens

Result:
"str"    (string) Amount of remaining tokens allowed to spent

Examples:
> qtum-cli qrc20allowance "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20allowance", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20balanceof "contractaddress" "address"

qtum-cli qrc20balanceof

qrc20balanceof "contractaddress" "address"

Returns the token balance for address

Arguments:
1. contractaddress    (string, required) The contract address
2. address            (string, required) The qtum address to check token balance

Result:
"str"    (string) The token balance of the chosen address

Examples:
> qtum-cli qrc20balanceof "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20balanceof", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20decimals "contractaddress"

qtum-cli qrc20decimals

qrc20decimals "contractaddress"

Returns the number of decimals of the token

Arguments:
1. contractaddress    (string, required) The contract address

Result:
n    (numeric) The number of decimals of the token

Examples:
> qtum-cli qrc20decimals "eb23c0b3e6042821da281a2e2364feb22dd543e3"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20decimals", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20listtransactions

qtum-cli qrc20listtransactions

qrc20listtransactions "contractaddress" "address" ( fromblock minconf )

Returns transactions history for a specific address.

Arguments:
1. contractaddress    (string, required) The contract address.
2. address            (string, required) The qtum address to get history for.
3. fromblock          (numeric, optional, default=0) The number of the earliest block.
4. minconf            (numeric, optional, default=6) Minimal number of confirmations.

Result:
[                                 (json array)
  {                               (json object)
    "receiver" : "str",           (string) The receiver qtum address
    "sender" : "str",             (string) The sender qtum address
    "amount" : "str",             (string) The transferred token amount
    "confirmations" : n,          (numeric) The number of confirmations of the most recent transaction included
    "blockHash" : "hex",          (string) The block hash
    "blockNumber" : n,            (numeric) The block number
    "blocktime" : xxx,            (numeric) The block time expressed in UNIX epoch time.
    "transactionHash" : "hex"     (string) The transaction hash
  },
  ...
]

Examples:
> qtum-cli qrc20listtransactions "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX"
> qtum-cli qrc20listtransactions "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" 0 6
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20listtransactions", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20listtransactions", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" 0 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20name "contractaddress"

qrc20name "contractaddress"

Returns the name of the token

Arguments:
1. contractaddress    (string, required) The contract address

Result:
"str"    (string) The name of the token

Examples:
> qtum-cli qrc20name "eb23c0b3e6042821da281a2e2364feb22dd543e3"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20name", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20symbol "contractaddress"

qrc20symbol "contractaddress"

Returns the symbol of the token

Arguments:
1. contractaddress    (string, required) The contract address

Result:
"str"    (string) The symbol of the token

Examples:
> qtum-cli qrc20symbol "eb23c0b3e6042821da281a2e2364feb22dd543e3"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20symbol", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20totalsupply "contractaddress"

qrc20totalsupply "contractaddress"

Returns the total supply of the token

Arguments:
1. contractaddress    (string, required) The contract address

Result:
"str"    (string) The total supply of the token

Examples:
> qtum-cli qrc20totalsupply "eb23c0b3e6042821da281a2e2364feb22dd543e3"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20totalsupply", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20approve "contractaddress" "owneraddress" "spenderaddress"

"amount" ( gaslimit gasprice checkoutputs )

qrc20approve "contractaddress" "owneraddress" "spenderaddress" "amount" ( gaslimit gasprice checkoutputs )

Owner approves an address to spend some amount of tokens.

Arguments:
1. contractaddress    (string, required) The contract address.
2. owneraddress       (string, required) The token owner qtum address.
3. spenderaddress     (string, required) The token spender qtum address.
4. amount             (string, required) The amount of tokens. eg 0.1
5. gaslimit           (numeric or string, optional) The gas limit, default: 250000, max: 40000000
6. gasprice           (numeric or string, optional) The qtum price per gas unit, default: 0.0000004, min:0.0000004
7. checkoutputs       (boolean, optional, default=true) Check outputs before send

Result:
{                    (json object)
  "psbt" : "str",    (string, optional) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled.
  "txid" : "hex"     (string, optional) The transaction id. Only returned when wallet private keys are enabled.
}

Examples:
> qtum-cli qrc20approve "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
> qtum-cli qrc20approve "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20approve", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20approve", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20burn "contractaddress" "owneraddress" "amount" ( gaslimit gasprice checkoutputs )

qrc20burn "contractaddress" "owneraddress" "amount" ( gaslimit gasprice checkoutputs )

Burns token amount from owner address.

Arguments:
1. contractaddress    (string, required) The contract address.
2. owneraddress       (string, required) The token owner qtum address.
3. amount             (string, required) The amount of tokens to burn. eg 0.1
4. gaslimit           (numeric or string, optional) The gas limit, default: 250000, max: 40000000
5. gasprice           (numeric or string, optional) The qtum price per gas unit, default: 0.0000004, min:0.0000004
6. checkoutputs       (boolean, optional, default=true) Check outputs before send

Result:
{                    (json object)
  "psbt" : "str",    (string, optional) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled.
  "txid" : "hex"     (string, optional) The transaction id. Only returned when wallet private keys are enabled.
}

Examples:
> qtum-cli qrc20burn "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
> qtum-cli qrc20burn "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20burn", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20burn", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20burnfrom "contractaddress" "owneraddress" "spenderaddress" "amount" ( gaslimit gasprice checkoutputs )

qrc20burnfrom "contractaddress" "owneraddress" "spenderaddress" "amount" ( gaslimit gasprice checkoutputs )

Burns token amount from a given address.

Arguments:
1. contractaddress    (string, required) The contract address.
2. owneraddress       (string, required) The token owner qtum address.
3. spenderaddress     (string, required) The token spender qtum address.
4. amount             (string, required) The amount of token to burn. eg 0.1
5. gaslimit           (numeric or string, optional) The gas limit, default: 250000, max: 40000000
6. gasprice           (numeric or string, optional) The qtum price per gas unit, default: 0.0000004, min:0.0000004
7. checkoutputs       (boolean, optional, default=true) Check outputs before send

Result:
{                    (json object)
  "psbt" : "str",    (string, optional) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled.
  "txid" : "hex"     (string, optional) The transaction id. Only returned when wallet private keys are enabled.
}

Examples:
> qtum-cli qrc20burnfrom "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
> qtum-cli qrc20burnfrom "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20burnfrom", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20burnfrom", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

qrc20transfer "contractaddress" "owneraddress" "addressto" "amount" ( gaslimit gasprice checkoutputs )

qrc20transfer "contractaddress" "owneraddress" "addressto" "amount" ( gaslimit gasprice checkoutputs )

Send token amount to a given address.

Arguments:
1. contractaddress    (string, required) The contract address.
2. owneraddress       (string, required) The token owner qtum address.
3. addressto          (string, required) The qtum address to send funds to.
4. amount             (string, required) The amount of tokens to send. eg 0.1
5. gaslimit           (numeric or string, optional) The gas limit, default: 250000, max: 40000000
6. gasprice           (numeric or string, optional) The qtum price per gas unit, default: 0.0000004, min:0.0000004
7. checkoutputs       (boolean, optional, default=true) Check outputs before send

Result:
{                    (json object)
  "psbt" : "str",    (string, optional) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled.
  "txid" : "hex"     (string, optional) The transaction id. Only returned when wallet private keys are enabled.
}

Examples:
> qtum-cli qrc20transfer "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
> qtum-cli qrc20transfer "eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20transfer", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "qrc20transfer", "params": ["eb23c0b3e6042821da281a2e2364feb22dd543e3" "QX1GkJdye9WoUnrE2v6ZQhQ72EUVDtGXQX" "QM72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 250000 0.0000004 true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
qrc20transferfrom "contractaddress" "owneraddress" "spenderaddress" "receiveraddress" "amount" ( gaslimit gasprice checkoutputs )
PreviousQtum Lightning NetworkNextQTUM RPC API

Last updated 1 year ago