亿链 API 文档

witness ly


查询上链结果

<h3>应用场景</h3> <p>&gt; 商户通过该接口,查询铸造、转移、销毁的交易结果(可配合<code>回调通知服务</code>一起使用)</p> <hr /> <h3>接口定义</h3> <h4>接口URL</h4> <p>请求方法:<code>GET</code></p> <p>URI: <code>/chain/query/txReceipt/{txHash}</code></p> <hr /> <h3>请求参数</h3> <table> <thead> <tr> <th>参数</th> <th>是否必填</th> <th>类型</th> <th>说明</th> <th>示例值</th> </tr> </thead> <tbody> <tr> <td>txHash</td> <td>是</td> <td>String</td> <td>上链接口返回的 txHash 字段</td> <td>&quot;0xb4d8fb18e2b34b0e99db84e3d9977eae2812948ea02c32eff4b0a6e71acc6f76&quot;</td> </tr> </tbody> </table> <h3>请求参数示例</h3> <pre><code class="language-text">http://localhost:8888/chain/query/txReceipt/0xb4d8fb18e2b34b0e99db84e3d9977eae2812948ea02c32eff4b0a6e71acc6f76</code></pre> <hr /> <h3>响应参数</h3> <table> <thead> <tr> <th>参数</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>code</td> <td>响应码</td> </tr> <tr> <td>message</td> <td>成功</td> </tr> <tr> <td>data</td> <td></td> </tr> <tr> <td>&amp;ensp;&amp;ensp; result</td> <td>交易结果</td> </tr> <tr> <td>&amp;ensp;&amp;ensp; rawResponse</td> <td>忽略</td> </tr> <tr> <td>&amp;ensp;&amp;ensp; id</td> <td>忽略</td> </tr> <tr> <td>&amp;ensp;&amp;ensp; jsonrpc</td> <td>忽略</td> </tr> <tr> <td>&amp;ensp;&amp;ensp; error</td> <td>忽略</td> </tr> </tbody> </table> <h3>响应参数示例</h3> <p>&gt; 查询成功的 code 码都为 <code>EC000000</code>,只有<code>result -&amp;gt; status</code>为 <code>0</code>,或<code>result -&amp;gt; statusOK</code>为<code>true</code>才是上链成功,失败参考下一章节 <strong>上链失败梳理</strong></p> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: &amp;quot;EC000000&amp;quot;, &amp;quot;message&amp;quot;: &amp;quot;成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;result&amp;quot;: { &amp;quot;transactionProof&amp;quot;: null, &amp;quot;extraData&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;txReceiptProof&amp;quot;: null, &amp;quot;contractAddress&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;message&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;version&amp;quot;: 0, &amp;quot;receiptProof&amp;quot;: null, &amp;quot;transactionHash&amp;quot;: &amp;quot;0xb4d8fb18e2b34b0e99db84e3d9977eae2812948ea02c32eff4b0a6e71acc6f76&amp;quot;, &amp;quot;output&amp;quot;: &amp;quot;0x&amp;quot;, &amp;quot;logEntries&amp;quot;: [ { &amp;quot;address&amp;quot;: &amp;quot;93644794acfe95135a9df2db6ca6bf301886e817&amp;quot;, &amp;quot;data&amp;quot;: &amp;quot;0x&amp;quot;, &amp;quot;topics&amp;quot;: [ &amp;quot;0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef&amp;quot;, &amp;quot;0x0000000000000000000000000000000000000000000000000000000000000000&amp;quot;, &amp;quot;0x00000000000000000000000021dbb10c42c5caed715edf976396e1cdf7973a63&amp;quot;, &amp;quot;0x0000000000000000000000000000000000000000000000000000000000000007&amp;quot; ], &amp;quot;blockNumber&amp;quot;: null } ], &amp;quot;input&amp;quot;: &amp;quot;0x40c10f1900000000000000000000000021dbb10c42c5caed715edf976396e1cdf7973a630000000000000000000000000000000000000000000000000000000000000007&amp;quot;, &amp;quot;gasUsed&amp;quot;: &amp;quot;23432&amp;quot;, &amp;quot;checksumContractAddress&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;txProof&amp;quot;: null, &amp;quot;blockNumber&amp;quot;: 898030, &amp;quot;statusOK&amp;quot;: true, &amp;quot;from&amp;quot;: &amp;quot;0x75ac45d3f9c5532dff97350954449fc47c03250b&amp;quot;, &amp;quot;to&amp;quot;: &amp;quot;0x93644794acfe95135a9df2db6ca6bf301886e817&amp;quot;, &amp;quot;hash&amp;quot;: &amp;quot;0x3efff4c632b3adf6722f58c6f012a349c698fbd4c0351f230d4fc3f48ab2d2c4&amp;quot;, &amp;quot;status&amp;quot;: 0 }, &amp;quot;rawResponse&amp;quot;: null, &amp;quot;id&amp;quot;: 694154, &amp;quot;jsonrpc&amp;quot;: &amp;quot;2.0&amp;quot;, &amp;quot;error&amp;quot;: null } }</code></pre>

页面列表

ITEM_HTML