We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
接口进展:https://docs.google.com/spreadsheets/d/1I6n8siwklm3lKz7PO57B0Hf7v9P_FStgmPip30Eyqlc/edit#gid=0
功能:查询节点同步信息
参数:null
null
返回值
false:不在同步 { startBlock: import启动时的高度 currentBlock: 当前块高,eth_blockNumber一样 highestBlock: 估计的最高块 }
API server
Godwoken提供接口
lastSynced(): Promise<HexString> 只提供currentBlock信息 syncing(): Promise<SyncStatus>
功能:查询gasPrice
gasPrice: hex num in wei
gasPrice(): Promise<HexNumber>;
功能:查询地址的原生代币的额度
参数
address: hex string, blockParameter: hex num, or {"latest","earliest", "pending"},默认latest,指定块高需要archive mode支持
balance: hex num in wei
将ethAddress转换成accountId: address -> script -> scriptHash -> accountId;
根据accountId和sudtId读取balance;
getAccountIdByScriptHash(scriptHash): Promise<number> getBalance(accountId, sudtId, [blockParameter]): Promise<HexNumer>
功能:查询合约的状态存储
address: hex string, storagePosition: hex string, blockParameter: hex num, or {"latest","earliest", "pending"},默认latest,指定块高需要archive mode支持
storageValue: hex string
storagePosition计算规则:
getAccountIdByScriptHash(scriptHash): Promise<number> getStorageAt(accountId, rawKey, [blockParameter]): Promise<Hash>
功能:查询地址发送出的交易数量(nonce)
count: hex num
getAccountIdByScriptHash(scriptHash): Promise<number> getTransactionCount(accountId, [blockParameter]): Promise<number>
功能:读取合约代码
code: hex string, EOA账户返回"0x"
getAccountIdByScriptHash(scriptHash): Promise<number>; getCode(accountId, [blockParameter]): Promise<HexString>
功能:节点执行message call,交易不上链
from: hex string, to: hex string, gas: hex number, gasPrice: hex number, value: hex number, data: hex string, blockParameter: hex num, or {"latest","earliest", "pending"},默认latest,指定块高需要archive mode支持
returnValue: hex string errorMsg: REVERT
构造RawL2Transaction;
从RunResult中提取returnValue;
call(RawL2Transaction): Promise<RunResult>
功能:节点执行message call,估计花费的gas
从RunResult中提取estimateGas;
The text was updated successfully, but these errors were encountered:
#27
Sorry, something went wrong.
Merge pull request bitrocks#6 from nervosnetwork/enable-code-owner
210c9ad
Enable GitHub CODEOWNERS
No branches or pull requests
接口进展:https://docs.google.com/spreadsheets/d/1I6n8siwklm3lKz7PO57B0Hf7v9P_FStgmPip30Eyqlc/edit#gid=0
eth_syncing
功能:查询节点同步信息
参数:
null
返回值
API server
Godwoken提供接口
eth_gasPrice
功能:查询gasPrice
参数:
null
返回值
API server
Godwoken提供接口
eth_getBalance
功能:查询地址的原生代币的额度
参数
返回值
API server
将ethAddress转换成accountId: address -> script -> scriptHash -> accountId;
根据accountId和sudtId读取balance;
Godwoken提供接口
eth_getStorageAt
功能:查询合约的状态存储
参数
返回值
API server
将ethAddress转换成accountId: address -> script -> scriptHash -> accountId;
storagePosition计算规则:
Godwoken提供接口
eth_getTransactionCount
功能:查询地址发送出的交易数量(nonce)
参数
返回值
API server
将ethAddress转换成accountId: address -> script -> scriptHash -> accountId;
Godwoken提供接口
eth_getCode
功能:读取合约代码
参数
返回值
API server
将ethAddress转换成accountId: address -> script -> scriptHash -> accountId;
Godwoken提供接口
eth_call
功能:节点执行message call,交易不上链
参数
返回值
API server
构造RawL2Transaction;
从RunResult中提取returnValue;
Godwoken提供接口
eth_estimateGas
功能:节点执行message call,估计花费的gas
参数
返回值
API server
构造RawL2Transaction;
从RunResult中提取estimateGas;
Godwoken提供接口
Filter过滤器
eth_newBlockFilter
eth_newPendingTransactionFilter
WSS subscribe
subscribe
unsubscribe
The text was updated successfully, but these errors were encountered: