Sei中文文档(Sei Docs CHN)-by Chainguys
  • 导览(INTRODUCTION)
    • 版权声明(Copyright Notice)
    • 概览 (Overview)
    • Sei 设计空间 (Sei Design Space)
    • DEX 优化 (DEX Optimizations)
    • Sei 生态系统 (Sei Ecosystem)
  • 智能合约和本地开发 (Smart contracts & local development)
    • Sei工具指南 (Sei Tool Guide)
    • 设置一个本地节点 (Set up a local network)
    • 本地 Sei 脚本部署 (Local Sei script deployment)
    • Sei.go
    • CosmWasm合约测试 (CosmWasm Contract Testing)
    • 部署通用合约 (Deploy a generic contract)
    • 部署交易合约 (Deploy an exchange contract)
    • 非完整节点下部署和开发 (Deploy & develop without Full Node)
    • Dex 模块教程 (Dex Module Tutorial)
    • 代币工厂模块教程 (Tokenfactory Module Tutorial)
    • IBC转账 (IBC Transfers)
  • 订单匹配(order match)
    • 并行性 (Parallelism)
    • 资格 (Eligibility)
    • DEX 合约间依赖 (DEX Inter—Contract Dependencies)
    • 白名单商店 (Whitelisted Store)
  • 节点&验证者 (NODES&VALIDATORS)
    • 加入测试网 (Joining Testnets)
    • 更新 (Upgrades)
    • Seinami激励测试网 (Seinami Incentivized Testnet)
      • 加入激励测试网 (Joining Incentivized Testnet)
      • 所有测试任务 (All Testnet Missions)
      • 行为准则 (Code of Conduct)
      • 奖励发放详情 (Rewards Distribution Details)
  • 基础API端点 (Basic API Endpoints)
  • 模块化端点 (Module Endpoints)
  • 状态同步 (Statesync)
  • 恢复操作(Recovery Operations)
  • 治理(GOVERNANCE)
    • 创建提案 (Creating Proposals)
    • 管理质押 (Managing Staking)
    • 对提案投票表决 (Voting on Proposals)
  • 预言机(ORACLE)
    • 预言机参与 (Oracle Participation)
  • 钱包(WALLETS)
    • 钱包集成(Wallet Integration)
    • 转账 (Transfers)
  • 更多(More)
    • 推特(Twitter)
由 GitBook 提供支持
在本页
  • POST 端点 (POST Endpoints)
  • 下单 (PlaceOrders)
  • 取消订单 (CancelOrders)
  • 清算 (Liquidate)
  • AggregateExchangeRatePrevote
  • AggregateExchangeRateVote
  • 获取端点 (GET Endpoints)
  • GetSettledTrades (does not exist?)
  • GetLongBook
  • GetShortBook
  • GetExchangeRate
  • GetExchangeRates
  • Get**VoteTargets
  • GetMissCounter

模块化端点 (Module Endpoints)

这些端点在模块级别可用。您可以使用 GRPC 客户端进行调用 These endpoints are available in the module level. You can use a GRPC client to make these calls

上一页基础API端点 (Basic API Endpoints)下一页状态同步 (Statesync)

最后更新于2年前

POST 端点 (POST Endpoints)

The POST endpoints require a signed transaction (Tx). Here is an example using the cosmjs client:

POST 端点需要签名交易 (Tx)。这是使用 cosmjs 客户端的示例:

下单 (PlaceOrders)

Module: Dex 模块:Dex

This endpoint takes a bulk order placement request. 此端点接受批量下单请求。

rpc PlaceOrders(MsgPlaceOrders) returns (MsgPlaceOrdersResponse);

message MsgPlaceOrders {
  string creator = 1;
  repeated OrderPlacement orders = 2;
  string contractAddr = 3;
  repeated cosmos.base.v1beta1.Coin funds = 5 [
    (gogoproto.nullable) = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
  ];
}

message MsgPlaceOrdersResponse {
  repeated uint64 orderIds = 1;
}

取消订单 (CancelOrders)

Module: Dex 模块:Dex

This endpoint takes a bulk order placement request. 此端点接受批量取消订单请求。

rpc CancelOrders(MsgCancelOrders) returns (MsgCancelOrdersResponse);

message MsgCancelOrders {
  string creator = 1;
  repeated OrderCancellation orderCancellations = 2;
  string contractAddr = 3;
}

message MsgCancelOrdersResponse {}

清算 (Liquidate)

Module: Dex 模块:Dex

This endpoint liquidates an account 此端点清算一个帐户

message MsgLiquidation {
  string creator = 1;
  string accountToLiquidate = 2;
  string contractAddr = 3;
}

message MsgLiquidationResponse {}

AggregateExchangeRatePrevote

Module: Oracle 模块:预言机

This endpoint is to send an oracle prevote hash for the next voting window. 此端点用于为下一个投票窗口发送预言机预选哈希。

message MsgAggregateExchangeRatePrevote {
  string hash = 1;
  string feeder = 2;
  string validator = 3;
}

message MsgAggregateExchangeRatePrevoteResponse {}

AggregateExchangeRateVote

Module: Oracle 模块:预言机

This endpoint is used to send an oracle pricing vote for the current voting window. The exchange rates provided must match the hashed prevote provided in the previous voting window (for the current voting window).

此端点用于为当前投票窗口发送预言机价格投票。提供的汇率必须与前一个投票窗口(针对当前投票窗口)中提供的哈希预投票相匹配。

message MsgAggregateExchangeRateVote {
  string salt = 1;
  string exchange_rates = 2;
  string feeder = 3;
  string validator = 4;
}

message MsgAggregateExchangeRateVoteResponse {}

获取端点 (GET Endpoints)

GetSettledTrades (does not exist?)

Module: Dex 模块:Dex

This endpoint takes a market id and returns the trades settled in the last block.

此端点提取一个市场 id 并返回在最后一个区块中结算的交易。

GetSettledTradesRequest {
  int market_id;
}

GetSettledTradesResponse {
  vector<Order> settled_trades;
}

GetLongBook

Module: Dex 模块:Dex

This endpoint will takes a market id and returns the latest (block) long orderbook. 此端点将采用市场 id 并返回最新(块)长订单簿。

Service 服务: codchen.matrixchain.dex.Query

Method 方法: LongBook

Message Format 消息格式:

// Request
QueryGetLongBookRequest {
  uint64 id = 1;
}

// Response
QueryGetLongBookResponse {
  LongBook LongBook = 1 [(gogoproto.nullable) = false];
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: codchen.matrixchain.dex.Query
? Choose a method: LongBook
Message json (type ? to see defaults): {"id": 0}

GetShortBook

Module: Dex 模块:Dex

This endpoint will takes a market id and returns the latest (block) short orderbook. 此端点将采用市场 id 并返回最新的(块)短订单簿。

Service 服务: codchen.matrixchain.dex.Query

Method 方法: ShortBook

Message Format 消息格式:

// Request
QueryGetShortBookRequest {
  uint64 id = 1;
}

// Response
QueryGetShortBookResponse {
  ShortBook ShortBook = 1 [(gogoproto.nullable) = false];
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: codchen.matrixchain.dex.Query
? Choose a method: ShortBook
Message json (type ? to see defaults): {"id": 0}

GetExchangeRate

Module: Oracle 模块:预言机

This endpoint will return the exchange rate for a specific denomination 此端点将返回特定面额的汇率

Service 服务: seiprotocol.seichain.oracle.Query

Method 方法: ExchangeRate

Message Format 消息格式:

// Request
QueryExchangeRatesRequest {}

// Response
QueryExchangeRateResponse {
  OracleExchangeRate oracle_exchange_rate = 1 [(gogoproto.nullable) = false];
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: seiprotocol.seichain.oracle.Query
? Choose a method: ExchangeRate
Message json (type ? to see defaults): {"denom": "foo"}

GetExchangeRates

Module: Oracle 模块:预言机

This endpoint will return all active exchange rates 此端点返回所有有效/活跃的汇率

Service 服务: seiprotocol.seichain.oracle.Query

Method 方法: ExchangeRates

Message Format 消息格式:

// Request
QueryExchangeRateRequest {
  string denom = 1;
}

DenomOracleExchangeRatePair {
  string denom = 1;
  OracleExchangeRate oracle_exchange_rate = 2 [(gogoproto.nullable) = false];
}

// Response
QueryExchangeRatesResponse {
  // exchange_rates defines a list of the exchange rate for all whitelisted denoms.
  repeated DenomOracleExchangeRatePair denom_oracle_exchange_rate_pairs = 1;
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: seiprotocol.seichain.oracle.Query
? Choose a method: ExchangeRates
Message json (type ? to see defaults): {}

Get**VoteTargets

Module: Oracle 模块:预言机

This endpoint returns all the denoms that are voting targets for oracle pricing votes.

该端点返回所有作为预言机价格投票目标的面额。

Service 服务: seiprotocol.seichain.oracle.Query

Method 方法: VoteTargets

Message Format 消息格式:

// Request
QueryVoteTargetsRequest {}

// Response
QueryVoteTargetsResponse {
  repeated string vote_targets = 1;
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: seiprotocol.seichain.oracle.Query
? Choose a method: VoteTargets
Message json (type ? to see defaults): {}

GetMissCounter

Module: Oracle 模块:预言机

This endpoint returns the miss counter of a specific validator.

该端点返回一个特定验证器的失误计数器。

Service: seiprotocol.seichain.oracle.Query

Method: MissCounter

Message Format:

// Request

// Request
QueryMissCounterRequest {
  string validator_addr = 1;
}

// Response
QueryMissCounterResponse {
  uint64 miss_counter = 1;
}

// Example (using grpc-client-cli)
> grpc-client-cli localhost:9090
? Choose a service: seiprotocol.seichain.oracle.Query
? Choose a method: MissCounter
Message json (type ? to see defaults): {"validator_addr": "seivaloperADDR"}

There are other query endpoints available and the specifications can be found here:

还有其他可用的查询终端,内容可在这里找到。

https://github.com/sei-protocol/sei-chain/blob/master/oracle/oracle.js
https://github.com/sei-protocol/sei-chain/blob/master/proto/oracle/query.proto