rpc/

directory
v0.0.0-...-1bc71c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: GPL-3.0

README

CrossChain-Router API

JSON RPC API Reference

RESTful API Reference

JSON RPC API Reference

swap.RegisterRouterSwap
swap.GetRouterSwap
swap.GetRouterSwapHistory
swap.GetVersionInfo
swap.GetSeverInfo
swap.GetAllChainIDs
swap.GetAllTokenIDs
swap.GetAllMultichainTokens
swap.GetChainConfig
swap.GetTokenConfig

swap.RegisterRouterSwap

注册置换交易

参数:
[{"chainid":"链ChainID", "txid":"交易哈希", "logindex":"日志下标"}]

其中 logindex 为可选参数,对应日志下标,默认值为 0。 如果 logindex 为 0, 则注册本交易中的所有置换。

返回值:
成功返回`Success`,失败返回错误。
swap.GetRouterSwap

查询置换状态

参数:
[{"chainid":"链ChainID", "txid":"交易哈希", "logindex":"日志下标"}]

其中 logindex 为可选参数,对应日志下标,默认值为 0。 如果 logindex 为 0, 则自动查询本交易中的第一个置换。

返回值:
成功返回置换状态,失败返回错误。
swap.GetRouterSwapHistory

查询置换历史,支持分页,addess 为账户地址

参数:
[{"chainid":"链ChainID", "address":"账户地址", "offset":"偏移量", "limit":"数量限制"}]

其中 offset,limit 为可选参数,默认值分别为 0 和 20。 如果 limit 为负数,表示按时间逆序排序后取结果。

返回值:
成功返回置换历史,失败返回错误。
swap.GetVersionInfo
参数:
返回值:
返回版本号信息
swap.GetSeverInfo
参数:
返回值:
获取服务信息
swap.GetAllChainIDs
参数:
返回值:
获取所有 chainID
swap.GetAllTokenIDs
参数:
返回值:
获取所有 tokenID
swap.GetAllMultichainTokens
参数:
["tokenID"]
返回值:
获取指定 tokenID 的所有 multichain token
swap.GetChainConfig
参数:
["链ChainID"]
返回值:
获取指定 chainID 的 chain 配置
swap.GetTokenConfig
参数:
[{"chainid":"链ChainID", "address":"账户地址"}]
返回值:
获取指定 chainID 和 token 地址的 token 配置

RESTful API Reference

POST /swap/register/{chainid}/{txid}?logindex=0

注册置换交易

其中 logindex 为可选参数,对应的日志下标,默认值为 0。 如果 logindex 为 0, 则注册本交易中的所有置换。

GET /swap/status/{chainid}/{txid}?logindex=0

查询置换状态

其中 logindex 为可选参数,对应日志下标,默认值为 0。 如果 logindex 为 0, 则自动查询本交易中的第一个置换。

GET /swap/history/{chainid}/{address}?offset=0&limit=20

查询置换历史,支持分页,addess 为账户地址

其中 offset,limit 为可选参数,默认值分别为 0 和 20。 如果 limit 为负数,表示按时间逆序排序后取结果。

GET /versioninfo

获取版本号信息

GET /serverinfo

获取服务信息

GET /allchainids

获取所有 chainID

GET /alltokenids

获取所有 tokenID

GET /allmultichaintokens/{tokenid}

获取指定 tokenID 的所有 multichain token

GET /chainconfig/{chainid}

获取指定 chainID 的 chain 配置

GET /tokenconfig/{chainid}/{address}

获取指定 chainID 和 token 地址的 token 配置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL