You can see and test the example queries and mutations below.
Click the "Run" button to run the query above it and see the response.
Click the "TypeScript", "Apollo Client", or "urql" buttons to see code examples.
query Balance ( $address : Address , $assetId : AssetId ) {
balance ( owner : $address , assetId : $assetId ) {
owner
amount
assetId
}
}
Icon ClipboardText
Variables:
{
"address" : "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871" ,
"assetId" : "0x0000000000000000000000000000000000000000000000000000000000000000"
}
Icon ClipboardText
Icon Link Check it working
query Balances ( $filter : BalanceFilterInput ) {
balances ( filter : $filter , first : 5 ) {
nodes {
amount
assetId
}
}
}
Icon ClipboardText
Variables:
{
"filter" : {
"owner" : "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871"
}
}
Icon ClipboardText
Icon Link Check it working
query Transactions ( $address : Address ) {
transactionsByOwner ( owner : $address , first : 5 ) {
nodes {
id
inputs {
__typename
... on InputCoin {
owner
utxoId
amount
assetId
}
... on InputContract {
utxoId
contract {
id
}
}
... on InputMessage {
sender
recipient
amount
data
}
}
outputs {
__typename
... on CoinOutput {
to
amount
assetId
}
... on ContractOutput {
inputIndex
balanceRoot
stateRoot
}
... on ChangeOutput {
to
amount
assetId
}
... on VariableOutput {
to
amount
assetId
}
... on ContractCreated {
contract {
id
}
stateRoot
}
}
status {
__typename
... on FailureStatus {
reason
programState {
returnType
}
}
}
}
}
}
Icon ClipboardText
Variables:
{
"address" : "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871"
}
Icon ClipboardText
Icon Link Check it working
query LatestTransactions {
transactions ( last : 5 ) {
nodes {
id
inputs {
__typename
... on InputCoin {
owner
utxoId
amount
assetId
}
... on InputContract {
utxoId
contract {
id
}
}
... on InputMessage {
sender
recipient
amount
data
}
}
outputs {
__typename
... on CoinOutput {
to
amount
assetId
}
... on ContractOutput {
inputIndex
balanceRoot
stateRoot
}
... on ChangeOutput {
to
amount
assetId
}
... on VariableOutput {
to
amount
assetId
}
... on ContractCreated {
contract {
id
}
stateRoot
}
}
status {
__typename
... on FailureStatus {
reason
programState {
returnType
}
}
}
}
}
}
Icon ClipboardText
Icon Link Check it working
query ContractBalance ( $contract : ContractId , $asset : AssetId ) {
contractBalance ( contract : $contract , asset : $asset ) {
contract
amount
assetId
}
}
Icon ClipboardText
Variables:
{
"contract" : "0xc9a5366c269438d294ef942bc962dd2e6c86121e3bca00192723eb7eb58fa87d" ,
"asset" : "0x0000000000000000000000000000000000000000000000000000000000000000"
}
Icon ClipboardText
Icon Link Check it working
query ContractBalances ( $filter : ContractBalanceFilterInput ! ) {
contractBalances ( filter : $filter , first : 5 ) {
nodes {
amount
assetId
}
}
}
Icon ClipboardText
Variables:
{
"filter" : {
"contract" : "0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1"
}
}
Icon ClipboardText
Icon Link Check it working
query LatestBlocks {
blocks ( last : 5 ) {
nodes {
id
transactions {
id
inputAssetIds
inputs {
__typename
... on InputCoin {
owner
utxoId
amount
assetId
}
... on InputContract {
utxoId
contract {
id
}
}
... on InputMessage {
sender
recipient
amount
data
}
}
outputs {
__typename
... on CoinOutput {
to
amount
assetId
}
... on ContractOutput {
inputIndex
balanceRoot
stateRoot
}
... on ChangeOutput {
to
amount
assetId
}
... on VariableOutput {
to
amount
assetId
}
... on ContractCreated {
contract {
id
}
stateRoot
}
}
gasPrice
}
}
}
}
Icon ClipboardText
Icon Link Check it working
query Block ( $height : U64 ) {
block ( height : $height ) {
id
}
}
Icon ClipboardText
Variables:
Icon Link Check it working
query MessageInfo ( $address : Address ) {
messages ( owner : $address , first : 5 ) {
nodes {
amount
sender
recipient
nonce
data
daHeight
}
}
}
Icon ClipboardText
Variables:
{
"address" : "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871"
}
Icon ClipboardText
Icon Link Check it working
mutation DryRun ( $encodedTransaction : HexString ! , $utxoValidation : Boolean ) {
dryRun ( tx : $encodedTransaction, utxoValidation : $utxoValidation) {
receiptType
data
}
}
Icon ClipboardText
mutation submit ( $encodedTransaction : HexString ! ) {
submit ( tx : $encodedTransaction) {
id
}
}
Icon ClipboardText
You can find more examples of how we use this API in our GitHub: