参考Sui的lark云文档发送交易的接口:https://w2z1amg2x5.larksuite.com/docx/VmePdCjKOoOBcZxJCFEu83eUsvf
sui_dryRunTransactionBlock
- 接口作用:发送交易到区块链网络
- 接口参数:已签名的交易
- 请求示范
curl --location 'https://sui-mainnet-endpoint.blockvision.org' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_dryRunTransactionBlock",
"params": ["AAACAAgA8gUqAQAAAAAgFS3TCUSw/wiAMoYKAKRyB5PbbmBxvG15QOf9at3BjJECAgABAQAAAQEDAAAAAAEBAAwswzUoiSN4r6vbjWvkqxrhfAS+4MnALUKHXcstNVfQAVL76xX4J9ECURRUor6tPrqQsqvoQtchbCVARiL6HUZMCrV5DQAAAAAgxlwVTy9h/0flFXfbyFPJAoEAsNHlDqJr0vlNBOTfO9YMLMM1KIkjeK+r241r5Ksa4XwEvuDJwC1Ch13LLTVX0PgkAQAAAAAAgBe0LAAAAAAA","AKYc9Gvx3uA0dVq1ktiACBeeW41yc78nNlnQIP/BKjezxY4y+LthAWEFeEATG3R3QWQ0g7H6PGE2WGHBybNTUQicmvF8J3gThGPCIcsztROQWFG2bZE5ge8ew8Qua8XCVg=="]
}'
发送交易成功后,返回了 digest ,但是浏览器始终无法查到。
查询官方文档,发现这个接口只是用于模拟交易的接口,sui_dryRunTransactionBlock 会返回交易执行效果包括gas费用汇总,但该效果不会提交到链上。
真正的发送的交易的接口是这个:
sui_executeTransactionBlock
curl --location 'https://sui-mainnet-endpoint.blockvision.org' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_executeTransactionBlock",
"params": [
"AAAEAAig0Q8GAAAAAAAIAKuQQQAAAAAAIJ43RvTJVcl35IhoGRzPoswfcPZxKOuJfCh5zAHspPI8ACAMLMM1KIkjeK+r241r5Ksa4XwEvuDJwC1Ch13LLTVX0AMCAAIBAAABAQABAQMAAAAAAQIAAQEDAAABAAEDAAwswzUoiSN4r6vbjWvkqxrhfAS+4MnALUKHXcstNVfQAVL76xX4J9ECURRUor6tPrqQsqvoQtchbCVARiL6HUZMEbV5DQAAAAAg+R/T06zlAfmx6gxh/jav5NriNdy7mUvMF9yaGSzRM/MMLMM1KIkjeK+r241r5Ksa4XwEvuDJwC1Ch13LLTVX0NAHAAAAAAAA4C2SAAAAAAAA",
[
"ABzqLb85LcU8HoMalGot+zofneqKdyWJws5CfYiEBAZw3VO9y7/2zC/mls6AZ2EMWZpzWNu1rmQfbzERFO0LEwGcmvF8J3gThGPCIcsztROQWFG2bZE5ge8ew8Qua8XCVg=="
],
{
"showInput": true,
"showRawInput": true,
"showEffects": true,
"showEvents": true,
"showObjectChanges": true,
"showBalanceChanges": true,
"showRawEffects": false
},
"WaitForLocalExecution"
]
}'