Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CoreModule = []byte{00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0x43, 0x6f, 0x72, 0x65}
CoreModule is the identifier of the Core module (which is used for governance messages)
Functions ¶
Types ¶
type Address ¶
type Address [32]byte
Address is a Wormhole protocol address, it contains the native chain's address. If the address data type of a chain is < 32bytes the value is zero-padded on the left.
func (Address) MarshalJSON ¶
type BodyContractUpgrade ¶
BodyContractUpgrade is a governance message to perform a contract upgrade of the core module
func (BodyContractUpgrade) Serialize ¶
func (b BodyContractUpgrade) Serialize() []byte
type BodyGuardianSetUpdate ¶
BodyGuardianSetUpdate is a governance message to set a new guardian set
func (BodyGuardianSetUpdate) Serialize ¶
func (b BodyGuardianSetUpdate) Serialize() []byte
type ChainID ¶
type ChainID uint16
ChainID of a Wormhole chain
const ( // ChainIDSolana is the ChainID of Solana ChainIDSolana ChainID = 1 // ChainIDEthereum is the ChainID of Ethereum ChainIDEthereum ChainID = 2 // ChainIDTerra is the ChainID of Terra ChainIDTerra ChainID = 3 // ChainIDBSC is the ChainID of Binance Smart Chain ChainIDBSC ChainID = 4 SupportedVAAVersion = 0x01 )
type Signature ¶
type Signature struct { // Index of the validator Index uint8 // Signature data Signature SignatureData }
Signature of a single guardian
type SignatureData ¶
type SignatureData [65]byte
func (SignatureData) MarshalJSON ¶
func (a SignatureData) MarshalJSON() ([]byte, error)
func (SignatureData) String ¶
func (a SignatureData) String() string
type VAA ¶
type VAA struct { // Version of the VAA schema Version uint8 // GuardianSetIndex is the index of the guardian set that signed this VAA GuardianSetIndex uint32 // SignatureData is the signature of the guardian set Signatures []*Signature // Timestamp when the VAA was created Timestamp time.Time // Nonce of the VAA Nonce uint32 // Sequence of the VAA Sequence uint64 /// ConsistencyLevel of the VAA ConsistencyLevel uint8 // EmitterChain the VAA was emitted on EmitterChain ChainID // EmitterAddress of the contract that emitted the Message EmitterAddress Address // Payload of the message Payload []byte }
VAA is a verifiable action approval of the Wormhole protocol
func (*VAA) AddSignature ¶
func (v *VAA) AddSignature(key *ecdsa.PrivateKey, index uint8)
func (*VAA) MessageID ¶
MessageID returns a human-readable emitter_chain/emitter_address/sequence tuple.
func (*VAA) SigningMsg ¶
SigningMsg returns the hash of the signing body. This is used for signature generation and verification