From 2f502afd2cbc06d269958325a8523726374efbf4 Mon Sep 17 00:00:00 2001 From: Lavinia Talpas Date: Fri, 11 Aug 2023 20:30:54 +0300 Subject: [PATCH] add data visualization to multiple methods --- Avalanche.postman_collection.json | 4397 ++++++++++++++++++++++++++--- 1 file changed, 4053 insertions(+), 344 deletions(-) diff --git a/Avalanche.postman_collection.json b/Avalanche.postman_collection.json index da1c98e..dd98325 100644 --- a/Avalanche.postman_collection.json +++ b/Avalanche.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "133cf180-c9cf-4d6b-9834-944dc66f7f0f", + "_postman_id": "3d716136-a9a1-45a5-86ca-2102a10a86a7", "name": "Avalanche", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "23086587" @@ -648,81 +648,52 @@ }, { "name": "getAssetDescription", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getAssetDescription\",\n \"params\" :{\n \"assetID\" :\"{{avaxAssetId}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Get information about an asset. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetassetdescription)" - }, - "response": [] - }, - { - "name": "getBalance - DEPRECATED", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "//Deprecated as of v1.9.12.\n\n{\n \"jsonrpc\":\"2.0\",\n \"id\" : 1,\n \"method\" :\"avm.getBalance\",\n \"params\" :{\n \"address\":\"{{xchainAddress}}\",\n \"assetID\": \"{{avaxAssetId}}\"\n }\n} ", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Get the balance of an asset controlled by a given address. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetbalance)" - }, - "response": [] - }, - { - "name": "getBlock", "event": [ { "listen": "test", "script": { "exec": [ - "" + "var table = `", + " ", + "", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + "
Asset description
Asset ID: {{response.result.assetID}}
Name: {{response.result.name}}
Symbol: {{response.result.symbol}}
Denomination: {{response.result.denomination}}
", + " `;", + "", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" ], "type": "text/javascript" } @@ -733,7 +704,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getBlock\",\n \"params\" :{\n \"blockID\": \"{{xchainBlockID}}\",\n \"encoding\": \"hex\"\n }\n}", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getAssetDescription\",\n \"params\" :{\n \"assetID\" :\"{{avaxAssetId}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -751,12 +722,12 @@ "X" ] }, - "description": "Returns the block with the given id. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetblock)" + "description": "Get information about an asset. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetassetdescription)" }, "response": [] }, { - "name": "getBlockByHeight", + "name": "getBalance - DEPRECATED", "event": [ { "listen": "test", @@ -773,7 +744,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getBlockByHeight\",\n \"params\" :{\n \"height\": {{xhcainBlockHeight}},\n \"encoding\": \"hex\"\n }\n}", + "raw": "//Deprecated as of v1.9.12.\n\n{\n \"jsonrpc\":\"2.0\",\n \"id\" : 1,\n \"method\" :\"avm.getBalance\",\n \"params\" :{\n \"address\":\"{{xchainAddress}}\",\n \"assetID\": \"{{avaxAssetId}}\"\n }\n} ", "options": { "raw": { "language": "json" @@ -791,166 +762,2444 @@ "X" ] }, - "description": "Returns block at the given height. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetblockbyheight)" + "description": "Get the balance of an asset controlled by a given address. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetbalance)" }, "response": [] }, { - "name": "getHeight", + "name": "getBlock", "event": [ { "listen": "test", "script": { "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getHeight\",\n \"params\" :{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Returns the height of the last accepted block. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetheight)" - }, - "response": [] - }, - { - "name": "getTx", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getTx\",\n \"params\" :{\n \"txID\":\"{{txID}}\",\n \"encoding\": \"hex\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Returns the specified transaction [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgettx)" - }, - "response": [] - }, - { - "name": "getTxStatus - DEPRECATED", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "//Deprecated as of v1.10.0.\n\n{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"avm.getTxStatus\",\n \"params\": {\n \"txID\": \"{{txID}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Get the status of a transaction sent to the network. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgettxstatus)" - }, - "response": [] - }, - { - "name": "getUTXOs", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getUTXOs\",\n \"params\" :{\n \"addresses\":[\"{{xchainAddress}}\"],\n \"limit\": 5,\n \"sourceChain\": \"X\",\n \"encoding\": \"hex\",\n \"startIndex\": { \n \"address\": \"{{xchainAddress}}\",\n \"utxo\": \"{{utxo}}\"\n }\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Get the UTXOs that reference a given address. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetutxos)" - }, - "response": [] - }, - { - "name": "import - DEPRECATED", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "//Deprecated as of v1.9.12.\n\n{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.import\",\n \"params\" :{\n \"username\":\"{{avalancheUsername}}\",\n \"password\":\"{{avalanchePassword}}\",\n \"sourceChain\": \"P\",\n \"to\":\"{{xchainAddress}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X" - ] - }, - "description": "Finalize a transfer of AVAX from either the P-Chain to the X-Chain or the C-Chain to the X-Chain.\n\nBefore this method is called, you must call either the P-Chain’s `exportAVAX` method or the C-Chain’s `exportAVAX` method to initiate the transfer. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmimport)" - }, - "response": [] - }, + "var table = `", + " ", + "", + " User Friendly View: ", + "
", + " ", + "
", + "", + " ", + "", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "
Block info
Block Hash {{response.result.block.id}}
Parent ID {{response.result.block.parentID}}
Height {{response.result.block.height}}
Time {{response.result.block.time}}
Merkle Root {{response.result.block.merkleRoot}}
", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.outputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.outputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.inputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.inputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.destinationChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.sourceChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.importedInputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.importedInputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " ", + " ", + " ", + "", + " {{#each response.result.block.txs}} ", + " {{#each credentials}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "
Block's transactions
Transaction ID: {{response.result.block.id}}
Unsigned Transaction
Network ID: {{response.result.block.txs.0.unsignedTx.networkID}}
Blockchain ID: {{response.result.block.txs.0.unsignedTx.blockchainID}}
Outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Inputs:
Transaction ID: {{txID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Memo: {{response.result.block.txs.0.unsignedTx.memo}}
Destination chain: {{response.result.block.txs.0.unsignedTx.destinationChain}}
Exported outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Source chain: {{response.result.block.txs.0.unsignedTx.sourceChain}}
Imported inputs:
Transaction ID: {{txID}}
Output index: {{outputIndex}}
Asset ID: {{assetID}}
Fx ID {{fxID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Creditentials
Fx ID: {{fxID}}
Creditential: Signatures: {{credential.signatures}}
", + " `;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getBlock\",\n \"params\" :{\n \"blockID\": \"{{xchainBlockID}}\",\n \"encoding\": \"json\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Returns the block with the given id. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetblock)" + }, + "response": [] + }, + { + "name": "getBlockByHeight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + " ", + "", + " User Friendly View: ", + "
", + " ", + "
", + "", + " ", + "", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "
Block info
Block Hash {{response.result.block.id}}
Parent ID {{response.result.block.parentID}}
Height {{response.result.block.height}}
Time {{response.result.block.time}}
Merkle Root {{response.result.block.merkleRoot}}
", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.outputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.outputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.inputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.inputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.destinationChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.sourceChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " ", + " {{#if response.result.block.txs.0.unsignedTx.importedInputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.block.txs}}", + " {{#each unsignedTx.importedInputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "", + " ", + " ", + " ", + " ", + "", + " {{#each response.result.block.txs}} ", + " {{#each credentials}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " {{/each}}", + "
Block's transactions
Transaction ID: {{response.result.block.id}}
Unsigned Transaction
Network ID: {{response.result.block.txs.0.unsignedTx.networkID}}
Blockchain ID: {{response.result.block.txs.0.unsignedTx.blockchainID}}
Outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Inputs:
Transaction ID: {{txID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Memo: {{response.result.block.txs.0.unsignedTx.memo}}
Destination chain: {{response.result.block.txs.0.unsignedTx.destinationChain}}
Exported outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Source chain: {{response.result.block.txs.0.unsignedTx.sourceChain}}
Imported inputs:
Transaction ID: {{txID}}
Output index: {{outputIndex}}
Asset ID: {{assetID}}
Fx ID {{fxID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Creditentials
Fx ID: {{fxID}}
Creditential: Signatures: {{credential.signatures}}
", + " `;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getBlockByHeight\",\n \"params\" :{\n \"height\": {{xchainBlockHeight}},\n \"encoding\": \"json\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Returns block at the given height. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetblockbyheight)" + }, + "response": [] + }, + { + "name": "getHeight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getHeight\",\n \"params\" :{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Returns the height of the last accepted block. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetheight)" + }, + "response": [] + }, + { + "name": "getTx", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + " ", + "", + " User Friendly View: ", + "
", + " ", + "
", + "", + " ", + "", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + "", + " ", + " {{#if response.result.tx.unsignedTx.outputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.tx.unsignedTx.outputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + "", + "", + " ", + " {{#if response.result.tx.unsignedTx.inputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.tx.unsignedTx.inputs}} ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + "", + "", + " ", + " {{#if response.result.tx.unsignedTx.destinationChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + " ", + "", + " ", + " {{#if response.result.tx.unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + " {{#each response.result.tx.unsignedTx.exportedOutputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + "", + " ", + " {{#if response.result.tx.unsignedTx.sourceChain}}", + " ", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + "", + " ", + " {{#if response.result.tx.unsignedTx.importedInputs}}", + " ", + " ", + " ", + " {{/if}}", + " ", + "", + " {{#each response.result.tx.unsignedTx.importedInputs}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + " ", + "", + " ", + "", + " ", + " ", + " ", + " ", + "", + " {{#each response.result.tx.credentials}} ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + "", + "
Transaction info
Transaction ID: {{response.result.tx.id}}
Unsigned Transaction
Network ID: {{response.result.tx.unsignedTx.networkID}}
Blockchain ID: {{response.result.tx.unsignedTx.blockchainID}}
Outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Inputs:
Transaction ID: {{txID}}
Output index: {{outputIndex}}
Asset ID: {{assetID}}
Fx ID {{fxID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Memo: {{response.result.tx.unsignedTx.memo}}
Destination chain: {{response.result.tx.unsignedTx.destinationChain}}
Exported outputs:
Asset ID: {{assetID}}
Fx ID: {{fxID}}
Amount (in GWEI):
{{output.amount}}
Locktime:
Output: {{output.locktime}}
Threshold:
{{output.threshold}}
Addresses:
{{output.addresses}}
Source chain: {{response.result.tx.unsignedTx.sourceChain}}
Imported inputs:
Transaction ID: {{txID}}
Output index: {{outputIndex}}
Asset ID: {{assetID}}
Fx ID {{fxID}}
Amount (in GWEI):
Input: {{input.amount}}
Locktime:
{{input.signatureIndices}}
Creditentials
Fx ID: {{fxID}}
Creditential: Signatures: {{credential.signatures}}
", + " `;", + "", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getTx\",\n \"params\" :{\n \"txID\":\"PeMHSFukDHRV1UAhHNDfCwz5jxwbVrJLE7W9Dz32YJ2wMZBTm\",\n \"encoding\": \"json\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Returns the specified transaction [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgettx)" + }, + "response": [] + }, + { + "name": "getTxStatus - DEPRECATED", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "//Deprecated as of v1.10.0.\n\n{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"avm.getTxStatus\",\n \"params\": {\n \"txID\": \"{{txID}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Get the status of a transaction sent to the network. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgettxstatus)" + }, + "response": [] + }, + { + "name": "getUTXOs", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.getUTXOs\",\n \"params\" :{\n \"addresses\":[\"{{xchainAddress}}\"],\n \"limit\": 5,\n \"sourceChain\": \"X\",\n \"encoding\": \"hex\",\n \"startIndex\": { \n \"address\": \"{{xchainAddress}}\",\n \"utxo\": \"{{utxo}}\"\n }\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Get the UTXOs that reference a given address. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmgetutxos)" + }, + "response": [] + }, + { + "name": "import - DEPRECATED", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "//Deprecated as of v1.9.12.\n\n{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avm.import\",\n \"params\" :{\n \"username\":\"{{avalancheUsername}}\",\n \"password\":\"{{avalanchePassword}}\",\n \"sourceChain\": \"P\",\n \"to\":\"{{xchainAddress}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X" + ] + }, + "description": "Finalize a transfer of AVAX from either the P-Chain to the X-Chain or the C-Chain to the X-Chain.\n\nBefore this method is called, you must call either the P-Chain’s `exportAVAX` method or the C-Chain’s `exportAVAX` method to initiate the transfer. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#avmimport)" + }, + "response": [] + }, { "name": "importKey - DEPRECATED", "request": { @@ -1196,31 +3445,284 @@ "language": "json" } } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X/wallet", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X", - "wallet" - ] - }, - "description": "Send a signed transaction to the network and assume the TX will be accepted. `encoding` specifies the format of the signed transaction. Can only be `hex` when a value is provided. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletissuetx)" - }, - "response": [] - }, - { - "name": "wallet_send", + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X/wallet", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X", + "wallet" + ] + }, + "description": "Send a signed transaction to the network and assume the TX will be accepted. `encoding` specifies the format of the signed transaction. Can only be `hex` when a value is provided. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletissuetx)" + }, + "response": [] + }, + { + "name": "wallet_send", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"wallet.send\",\n \"params\" :{\n \"assetID\" : \"AVAX\",\n \"amount\" : 10000,\n \"to\" : \"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\",\n \"memo\" : \"hi, mom!\",\n \"from\" : [\"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\"],\n \"changeAddr\": \"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8\",\n \"username\" : \"userThatControlsAtLeast10000OfThisAsset\",\n \"password\" : \"myPassword\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X/wallet", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X", + "wallet" + ] + }, + "description": "Send a quantity of an asset to an address and assume the TX will be accepted so that future calls can use the modified UTXO set. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletsend)" + }, + "response": [] + }, + { + "name": "wallet_sendMultiple", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"wallet.sendMultiple\",\n \"params\" :{\n \"outputs\": [\n {\n \"assetID\" : \"AVAX\",\n \"to\" : \"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\",\n \"amount\" : 1000000000\n },\n {\n \"assetID\" : \"26aqSTpZuWDAVtRmo44fjCx4zW6PDEx3zy9Qtp2ts1MuMFn9FB\",\n \"to\" : \"X-avax18knvhxx8uhc0mwlgrfyzjcm2wrd6e60w37xrjq\",\n \"amount\" : 10\n }\n ],\n \"memo\" : \"hi, mom!\",\n \"from\" : [\"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\"],\n \"changeAddr\": \"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8\",\n \"username\" : \"username\",\n \"password\" : \"myPassword\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseURL}}/ext/bc/X/wallet", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "X", + "wallet" + ] + }, + "description": "Send multiple transfers of `amount` of `assetID`, to a specified address from a list of owned of addresses and assume the TX will be accepted so that future calls can use the modified UTXO set. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletsendmultiple)" + }, + "response": [] + } + ], + "description": "The X-Chain, Avalanche’s native platform for creating and trading assets, is an instance of the Avalanche Virtual Machine (AVM). This API allows clients to create and trade assets on the X-Chain and other instances of the AVM. [More info](https://docs.avax.network/v1.0/en/api/avm)" + }, + { + "name": "EVM", + "item": [ + { + "name": "eth_baseFee", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + "", + "", + "", + "", + " Convert to decimal: ", + "
", + " ", + "
", + "
", + "", + "", + "", + "", + "", + "", + "", + "", + "
Base fee: {{response.result}} WEI
", + "", + "Please note that 1 AVAX = 1018 WEI and 1 WEI = 109 GWEI", + "", + "`;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"wallet.send\",\n \"params\" :{\n \"assetID\" : \"AVAX\",\n \"amount\" : 10000,\n \"to\" : \"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\",\n \"memo\" : \"hi, mom!\",\n \"from\" : [\"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\"],\n \"changeAddr\": \"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8\",\n \"username\" : \"userThatControlsAtLeast10000OfThisAsset\",\n \"password\" : \"myPassword\"\n }\n}", + "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_baseFee\",\n \"params\": [],\n \"id\": 1\n}", "options": { "raw": { "language": "json" @@ -1228,65 +3730,211 @@ } }, "url": { - "raw": "{{baseURL}}/ext/bc/X/wallet", + "raw": "{{baseURL}}/ext/bc/C/rpc", "host": [ "{{baseURL}}" ], "path": [ "ext", "bc", - "X", - "wallet" + "C", + "rpc" ] }, - "description": "Send a quantity of an asset to an address and assume the TX will be accepted so that future calls can use the modified UTXO set. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletsend)" + "description": "Get the base fee for the next block. [More info](https://docs.avax.network/apis/avalanchego/apis/c-chain#eth_basefee)" }, "response": [] }, { - "name": "wallet_sendMultiple", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"wallet.sendMultiple\",\n \"params\" :{\n \"outputs\": [\n {\n \"assetID\" : \"AVAX\",\n \"to\" : \"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\",\n \"amount\" : 1000000000\n },\n {\n \"assetID\" : \"26aqSTpZuWDAVtRmo44fjCx4zW6PDEx3zy9Qtp2ts1MuMFn9FB\",\n \"to\" : \"X-avax18knvhxx8uhc0mwlgrfyzjcm2wrd6e60w37xrjq\",\n \"amount\" : 10\n }\n ],\n \"memo\" : \"hi, mom!\",\n \"from\" : [\"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5\"],\n \"changeAddr\": \"X-avax1turszjwn05lflpewurw96rfrd3h6x8flgs5uf8\",\n \"username\" : \"username\",\n \"password\" : \"myPassword\"\n }\n}", - "options": { - "raw": { - "language": "json" - } + "name": "eth_blockNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hexVal = jsonData.result", + "", + "", + "", + "var table = `", + "", + "", + "", + "", + "", + " Convert to decimal: ", + "
", + " ", + "
", + "
", + "", + "", + " ", + " ", + " ", + " ", + "
Block number: {{response.result}}
", + "", + "`;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/X/wallet", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "X", - "wallet" - ] - }, - "description": "Send multiple transfers of `amount` of `assetID`, to a specified address from a list of owned of addresses and assume the TX will be accepted so that future calls can use the modified UTXO set. [More info](https://docs.avax.network/apis/avalanchego/apis/x-chain#walletsendmultiple)" - }, - "response": [] - } - ], - "description": "The X-Chain, Avalanche’s native platform for creating and trading assets, is an instance of the Avalanche Virtual Machine (AVM). This API allows clients to create and trade assets on the X-Chain and other instances of the AVM. [More info](https://docs.avax.network/v1.0/en/api/avm)" - }, - { - "name": "EVM", - "item": [ - { - "name": "eth_baseFee", + } + ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_baseFee\",\n \"params\": [],\n \"id\": 1\n}", + "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_blockNumber\",\n \"params\": [],\n \"id\": 1\n}", "options": { "raw": { "language": "json" @@ -1305,18 +3953,18 @@ "rpc" ] }, - "description": "Get the base fee for the next block. [More info](https://docs.avax.network/apis/avalanchego/apis/c-chain#eth_basefee)" + "description": "Getting the most recent block number." }, "response": [] }, { - "name": "eth_blockNumber", + "name": "eth_call", "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_blockNumber\",\n \"params\": [],\n \"id\": 1\n}", + "raw": "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7\",\n \"data\": \"0xc92aecc4\"\n },\n \"latest\"\n ]\n}", "options": { "raw": { "language": "json" @@ -1335,18 +3983,195 @@ "rpc" ] }, - "description": "Getting the most recent block number." + "description": "Call a contract." }, "response": [] }, { - "name": "eth_call", + "name": "eth_chainId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + "", + "", + "", + "", + "", + " Convert to decimal: ", + "
", + " ", + "
", + "
", + "", + "", + " ", + " ", + " ", + " ", + "
Chain ID: {{response.result}}
", + "", + "`;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7\",\n \"data\": \"0xc92aecc4\"\n },\n \"latest\"\n ]\n}", + "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_chainId\",\n \"params\": [],\n \"id\": 1\n}", "options": { "raw": { "language": "json" @@ -1365,42 +4190,130 @@ "rpc" ] }, - "description": "Call a contract." + "description": "Not well documented in JSON-RPC references. See instead EIP694." }, "response": [] }, { - "name": "eth_chainId", - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_chainId\",\n \"params\": [],\n \"id\": 1\n}", - "options": { - "raw": { - "language": "json" - } + "name": "eth_getAssetBalance", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
Balance:
hex: {{response.result}} WEI
dec: {{response.result}} AVAX
", + "", + "Please note that 1 AVAX = 1018 WEI", + "", + "`;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/C/rpc", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "C", - "rpc" - ] - }, - "description": "Not well documented in JSON-RPC references. See instead EIP694." - }, - "response": [] - }, - { - "name": "eth_getAssetBalance", + } + ], "request": { "method": "POST", "header": [], @@ -1431,6 +4344,124 @@ }, { "name": "eth_getBalance", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "
Balance:
hex: {{response.result}} WEI
dec: {{response.result}} AVAX
", + "", + "Please note that 1 AVAX = 1018 WEI", + "", + "`;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [], @@ -4954,31 +7985,362 @@ "language": "json" } } - }, - "url": { - "raw": "{{baseURL}}/ext/bc/C/avax", - "host": [ - "{{baseURL}}" - ], - "path": [ - "ext", - "bc", - "C", - "avax" - ] - }, - "description": "Get the private key that controls a given address. \nThe returned private key can be added to a user with `avm.importKey`. [More info](https://docs.avax.network/apis/avalanchego/apis/c-chain#avaxexportkey)" - }, - "response": [] - }, - { - "name": "getAtomicTx", + }, + "url": { + "raw": "{{baseURL}}/ext/bc/C/avax", + "host": [ + "{{baseURL}}" + ], + "path": [ + "ext", + "bc", + "C", + "avax" + ] + }, + "description": "Get the private key that controls a given address. \nThe returned private key can be added to a user with `avm.importKey`. [More info](https://docs.avax.network/apis/avalanchego/apis/c-chain#avaxexportkey)" + }, + "response": [] + }, + { + "name": "getAtomicTx", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var res = {};", + "const req = JSON.parse(pm.request.body.raw)", + "const txID = req.params.txID", + "var view = `", + "", + " ", + "", + "", + "", + "", + "", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + "", + " {{#if response.inputs.0.address}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.nonce}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.id}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.txId}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.index}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.amount}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.inputs.0.srcChain}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + "", + " {{#if response.outputs.0.address}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.id}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.txId}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.index}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.amount}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.dstChain}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.owner.addresses}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + " {{#if response.outputs.0.owner.threshold}}", + " ", + " ", + " ", + " ", + " ", + " {{/if}}", + "", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + "", + "", + "
Decoded Atomic TX:
ID: {{response.id}}
Type: {{response.type}}
From: {{response.from}}
To: {{response.to}}
From: {{response.from}}
Chain ID: {{response.chainId}}
Date: {{response.timestamp}}
Block number: {{response.blockNumber}}
Block hash: {{response.blockHash}}
Value: {{response.value}}
Burned fees: {{response.burnedFees}}
Status: {{response.status}}
Inputs
Address: {{response.inputs.0.address}}
Nonce: {{response.inputs.0.nonce}}
ID: {{response.inputs.0.id}}
Transaction ID: {{response.inputs.0.txId}}
Index: {{response.inputs.0.index}}
Amount: {{response.inputs.0.amount}}
Source chain: {{response.inputs.0.srcChain}}
Asset ID: {{response.inputs.0.asset.id}}
Asset name: {{response.inputs.0.asset.name}}
Asset symbol: {{response.inputs.0.asset.symbol}}
Asset denomination: {{response.inputs.0.asset.denomination}}
Asset type: {{response.inputs.0.asset.type}}
Outputs
Address: {{response.outputs.0.address}}
ID: {{response.outputs.0.id}}
Transaction ID: {{response.outputs.0.txId}}
Index: {{response.outputs.0.index}}
Amount: {{response.outputs.0.amount}}
Destination chain: {{response.outputs.0.dstChain}}
Owner address: {{response.outputs.0.owner.addresses}}
Threshold: {{response.outputs.0.owner.threshold}}
Asset ID: {{response.outputs.0.asset.id}}
Asset name: {{response.outputs.0.asset.name}}
Asset symbol: {{response.outputs.0.asset.symbol}}
Asset denomination: {{response.outputs.0.asset.denomination}}
Asset type: {{response.outputs.0.asset.type}}
", + "`;", + "", + "const requestURL = \"https://api-beta.avascan.info/v2/network/mainnet/evm/43114/transactions/\" + txID ;", + "console.log(requestURL)", + "pm.sendRequest(requestURL, function (err, response) {", + " res = response.json();", + " console.log(res.value)", + " pm.visualizer.set(view, {", + " response: res,", + " });", + "})", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avax.getAtomicTx\",\n \"params\" :{\n \"txID\":\"2GD5SRYJQr2kw5jE73trBFiAgVQyrCaeg223TaTyJFYXf2kPty\",\n \"encoding\": \"hex\"\n }\n}", + "raw": "{\n \"jsonrpc\":\"2.0\",\n \"id\" :1,\n \"method\" :\"avax.getAtomicTx\",\n \"params\" :{\n \"txID\":\"9zX25brVj24xMBXJFw973MGVgkuDwvFPyBQoqo4pLye5mBkhN\",\n \"encoding\": \"hex\"\n }\n}\n\n//choose \"Visualize\" from the output section to see the decoded tx", "options": { "raw": { "language": "json" @@ -7287,6 +10649,353 @@ }, { "name": "getCurrentValidators", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var table = `", + " ", + "", + "
", + "

Loading. Please wait.

", + " ", + "", + " ", + "", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " {{#each response.result.validators}}", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + "", + " ", + " ", + " ", + " ", + " ", + " {{/each}}", + "", + "
Validators:
Transaction ID: {{txID}}
Start time: {{startTime}}
End time: {{endTime}}
Weight: {{weight}}
Node ID: {{nodeID}}
Stake amount: {{stakeAmount}}
Reward owner:
Locktime: {{rewardOwner.locktime}}
Threshold: {{rewardOwner.threshold}}
Addresses: {{rewardOwner.addresses}}
Validation reward owner:
Locktime: {{validationRewardOwner.locktime}}
Threshold: {{validationRewardOwner.threshold}}
Addresses: {{validationRewardOwner.addresses}}
Delegation reward owner:
Locktime: {{delegationRewardOwner.locktime}}
Threshold: {{delegationRewardOwner.threshold}}
Addresses: {{delegationRewardOwner.addresses}}
Potential reward: {{potentialReward}}
Accrued delegatee reward: {{accruedDelegateeReward}}
Delegation fee: {{delegationFee}}%
Uptime: {{uptime}}%
Connected: {{connected}}
Delegator count: {{delegatorCount}}
Delegator weight: {{delegatorWeight}}
", + " `;", + "", + "pm.visualizer.set(table, {", + " response: pm.response.json(),", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [],