you_call

描述:为签名交易创建一个新的消息调用交易或合约

parameter

Object - 交易调用对象

参数 数据类型 备注
from String 发送交易的原地址,可选
to String 交易目标地址
gas String 交易可用 gas 量,可选。you_call 不消耗 gas,但是某些执行环节需要这个参数
gasPrice String gas 价格,可选
value String 交易发送的 YOU 数量,可选
data String 方法签名和编码参数的哈希,可选

Block number - String, 整数块编号,或字符串 "latest"、"earliest" 或 "pending"

"params": [
        {
            "to": "0xcF9F5007AA1A9ae7b8092DBE3E12B3B97fD5b18D",
            "data": "0x70a082310000000000000000000000009c651b933bdcc4ceb3473b7dc76930c961067c7a"
        },
        "latest"
    ]

return

数据类型 备注
String 所执行合约的返回值

example

Request:

查询某账户(0x9c651b933bDCc4Ceb3473b7Dc76930c961067c7a)ERC20 合约(合约地址:0xcF9F5007AA1A9ae7b8092DBE3E12B3B97fD5b18D)代币余额

curl -X POST \
  http://127.0.0.1:8283 \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "you_call",
    "params": [
        {
            "to": "0xcF9F5007AA1A9ae7b8092DBE3E12B3B97fD5b18D",
            "data": "0x70a082310000000000000000000000009c651b933bdcc4ceb3473b7dc76930c961067c7a"
        },
        "latest"
    ]
}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x00000000000000000000000000000000000000000000000053444835ec580000"
}