Skip to main content

GraphQL API

Hyperlane代理收集系统活动的有用信息,包括所有消息。这些数据可通过应用程序接口(API)查询。这些应用程序接口目前免费提供,无需任何认证。将您喜欢的GraphQL客户端或库连接到 https://api.hyperlane.xyz/v1/graphql,即可查询数据!

info

请注意,推荐使用REST API而不是GraphQL API,因为它暴露了一个更简单的消息数据模式。

查询示例

下面的查询将检索一条信息的有用信息:

query MyQuery {
message_view(limit: 10, where: {msg_id: {_eq: "\xYOUR_MSG_ID"}}) {
msg_id
nonce
sender
recipient
is_delivered
message_body
origin_mailbox
origin_domain_id
origin_chain_id
origin_block_id
origin_block_height
origin_block_hash
origin_tx_sender
origin_tx_recipient
origin_tx_nonce
origin_tx_max_priority_fee_per_gas
origin_tx_max_fee_per_gas
origin_tx_id
origin_tx_hash
origin_tx_gas_used
origin_tx_gas_price
origin_tx_gas_limit
origin_tx_effective_gas_price
origin_tx_cumulative_gas_used
destination_block_id
destination_block_hash
destination_block_height
destination_chain_id
destination_domain_id
destination_mailbox
destination_tx_cumulative_gas_used
destination_tx_effective_gas_price
destination_tx_gas_limit
destination_tx_gas_price
destination_tx_gas_used
destination_tx_hash
destination_tx_id
destination_tx_max_fee_per_gas
destination_tx_max_priority_fee_per_gas
destination_tx_nonce
destination_tx_recipient
destination_tx_sender
send_occurred_at
delivery_occurred_at
delivery_latency
num_payments
total_payment
total_gas_amount
}
}

GraphQL 模式类型

type message_view {
msg_id: bytea
nonce: Int!
sender: bytea
recipient: bytea
is_delivered: Boolean!
message_body: bytea
origin_mailbox: bytea
origin_domain_id: Int!
origin_chain_id: Int!
origin_block_id: Int!
origin_block_height: Int!
origin_block_hash: bytea
origin_tx_sender: bytea
origin_tx_recipient: bytea
origin_tx_nonce: Int!
origin_tx_max_priority_fee_per_gas: Int!
origin_tx_max_fee_per_gas: Int!
origin_tx_id: Int!
origin_tx_hash: bytea
origin_tx_gas_used: Int!
origin_tx_gas_price: Int!
origin_tx_gas_limit: Int!
origin_tx_effective_gas_price: Int!
origin_tx_cumulative_gas_used: Int!
destination_block_id: Int!
destination_block_hash: bytea
destination_block_height: Int!
destination_chain_id: Int!
destination_domain_id: Int!
destination_mailbox: bytea
destination_tx_cumulative_gas_used: Int!
destination_tx_effective_gas_price: Int!
destination_tx_gas_limit: Int!
destination_tx_gas_price: Int!
destination_tx_gas_used: Int!
destination_tx_hash: bytea
destination_tx_id: Int!
destination_tx_max_fee_per_gas: Int!
destination_tx_max_priority_fee_per_gas: Int!
destination_tx_nonce: Int!
destination_tx_recipient: bytea
destination_tx_sender: bytea
send_occurred_at: timestamp!
delivery_occurred_at: timestamp!
delivery_latency: Int!
num_payments: Int!
total_payment: Int!
total_gas_amount: Int!
}

type block {
domain: Int!
domainByDomain: domain!
hash: String!
height: bigint!
id: bigint!
time_created: timestamp!
timestamp: timestamp!
}

type domain {
chain_id: bigint
id: Int!
is_deprecated: Boolean!
is_test_net: Boolean!
name: String!
native_token: String!
time_created: timestamp!
time_updated: timestamp!
}

type gas_payment {
amount: numeric!
domain: Int!
domainByDomain: domain!
id: bigint!
msg_id: String
time_created: timestamp!
transaction: transaction!
tx_id: bigint!
}

type transaction {
block: block!
block_id: bigint!
checkpoint_updates: [checkpoint_update!]!
cumulative_gas_used: float8!
delivered_messages: [delivered_message!]!
effective_gas_price: float8
gas_limit: float8!
gas_payments: [gas_payment!]!
gas_price: float8
gas_used: float8!
hash: String!
id: bigint!
max_fee_per_gas: float8
max_priority_fee_per_gas: float8
messages: [message!]!
nonce: bigint!
recipient: String
sender: String!
time_created: timestamp!
}