消息
这是Peggy消息类型的参考文档。有关代码参考和精确参数,请参阅proto定义。
User Messages
这些是最终用户通过Injective链Peggy模块发送的消息。有关整个存款和提取过程的更详细概述,请参阅工作流程。
SendToEth
当用户希望将资金提取回以太坊时,发送到Injective。提交的金额会立即从用户的余额中扣除。该提取请求作为types.OutgoingTransferTx
被添加到外发交易池中,直到它被包含在一个批次中。
type MsgSendToEth struct {
Sender string // sender's Injective address
EthDest string // receiver's Ethereum address
Amount types.Coin // amount of tokens to bridge
BridgeFee types.Coin // additional fee for bridge relayers. Must be of same token type as Amount
}
CancelSendToEth
此消息允许用户取消尚未批量处理的特定提取请求。用户余额将被退还(金额 + 桥接费用)。
type MsgCancelSendToEth struct {
TransactionId uint64 // unique tx nonce of the withdrawal
Sender string // original sender of the withdrawal
}
SubmitBadSignatureEvidence
此调用允许任何人提交证据,证明某个验证者签署了一个从未存在的验证者集合或批次。主体包含该批次或验证者集合。
type MsgSubmitBadSignatureEvidence struct {
Subject *types1.Any
Signature string
Sender string
}
Batch Creator Messages
这些消息由Peggy的批次创建子过程发送。
RequestBatch
每当某个批次创建者发现汇集的提取请求,且在批量处理后满足其最低批次费用(PEGGO_MIN_BATCH_FEE_USD
)时,会发送此消息。接收到此消息后,Peggy模块会收集所有请求的代币标识符的提取请求,创建一个唯一的代币批次(types.OutgoingTxBatch
),并将其放入外发批次池中。已批量处理的提取请求无法通过MsgCancelSendToEth
取消。
type MsgRequestBatch struct {
Orchestrator string // orchestrator address interested in creating the batch. Not permissioned.
Denom string // the specific token whose withdrawals will be batched together
}
Oracle Messages
这些消息由Peggy的Oracle子过程发送。
DepositClaim
当Peggy合约触发SendToInjectiveEvent
事件时,发送到Injective。每当用户从以太坊向Injective进行单独存款时,就会发生这种情况。
type MsgDepositClaim struct {
EventNonce uint64 // unique nonce of the event
BlockHeight uint64 // Ethereum block height at which the event was emitted
TokenContract string // contract address of the ERC20 token
Amount sdkmath.Int // amount of deposited tokens
EthereumSender string // sender's Ethereum address
CosmosReceiver string // receiver's Injective address
Orchestrator string // address of the Orchestrator which observed the event
}
WithdrawClaim
当Peggy合约触发TransactionBatchExecutedEvent
事件时,发送到Injective。这发生在转发者成功调用合约上的submitBatch
函数以完成一批提取请求时。
type MsgWithdrawClaim struct {
EventNonce uint64 // unique nonce of the event
BlockHeight uint64 // Ethereum block height at which the event was emitted
BatchNonce uint64 // nonce of the batch executed on Ethereum
TokenContract string // contract address of the ERC20 token
Orchestrator string // address of the Orchestrator which observed the event
}
ValsetUpdatedClaim
当Peggy合约触发ValsetUpdatedEvent
事件时,发送到Injective。这发生在转发者成功调用合约上的updateValset
函数以更新以太坊上的验证者集合时。
type MsgValsetUpdatedClaim struct {
EventNonce uint64 // unique nonce of the event
ValsetNonce uint64 // nonce of the valset
BlockHeight uint64 // Ethereum block height at which the event was emitted
Members []*BridgeValidator // members of the Validator Set
RewardAmount sdkmath.Int // Reward for relaying the valset update
RewardToken string // reward token contract address
Orchestrator string // address of the Orchestrator which observed the event
}
ERC20DeployedClaim
当Peggy合约触发ERC20DeployedEvent
事件时,发送到Injective。这发生在合约上调用deployERC20
方法以发行一个新的符合桥接条件的代币资产时。
type MsgERC20DeployedClaim struct {
EventNonce uint64 // unique nonce of the event
BlockHeight uint64 // Ethereum block height at which the event was emitted
CosmosDenom string // denom of the token
TokenContract string // contract address of the token
Name string // name of the token
Symbol string // symbol of the token
Decimals uint64 // number of decimals the token has
Orchestrator string // address of the Orchestrator which observed the event
}
Signer Messages
这些消息由Peggy的签名者子过程发送。
ConfirmBatch
当签名者发现一个批次尚未由协调器(验证者)签署时,它会使用其委托的以太坊密钥构造签名,并将确认信息发送到Injective。验证者最终必须为已创建的批次提供确认,否则他们将被处罚。
type MsgConfirmBatch struct {
Nonce uint64 // nonce of the batch
TokenContract string // contract address of batch token
EthSigner string // Validator's delegated Ethereum address (previously registered)
Orchestrator string // address of the Orchestrator confirming the batch
Signature string // Validator's signature of the batch
}
ValsetConfirm
当签名者发现一个验证者集合更新尚未由协调器(验证者)签署时,它会使用其委托的以太坊密钥构造签名,并将确认信息发送到Injective。验证者最终必须为已创建的验证者集合更新提供确认,否则他们将被处罚。
type MsgValsetConfirm struct {
Nonce uint64 // nonce of the valset
Orchestrator string // address of the Orchestrator confirming the valset
EthAddress string // Validator's delegated Ethereum address (previously registered)
Signature string // Validator's signature of the valset
}
Relayer Messages
转发者不会向Injective发送任何消息,而是构造包含Injective数据的以太坊交易,通过submitBatch
和updateValset
方法更新Peggy合约。
Validator Messages
这些是直接使用验证者的消息密钥发送的消息。
SetOrchestratorAddresses
由管理验证者节点的操作员发送到Injective。在能够启动他们的协调器(peggo)进程之前,他们必须注册一个选定的以太坊地址,以代表其验证者在以太坊上的身份。可选地,可以提供一个额外的Injective地址(Orchestrator字段)以代表该验证者在桥接过程中的身份(peggo)。如果省略,则默认为验证者的自身地址。
type MsgSetOrchestratorAddresses struct {
Sender string // address of the Injective validator
Orchestrator string // optional Injective address to represent the Validator in the bridging process (Defaults to Sender if left empty)
EthAddress string // the Sender's (Validator) delegated Ethereum address
}
此消息设置协调器的委托密钥。
Last updated