msg

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainId

type ChainId uint8

type EthAddress

type EthAddress string

type Message

type Message struct {
	Source       ChainId      // Source where message was initiated
	Destination  ChainId      // Destination chain of message
	Type         TransferType // type of bridge transfer
	DepositNonce Nonce        // Nonce for the deposit
	Depositer    EthAddress
	ResourceId   ResourceId
	Payload      []interface{} // data associated with event sequence
}

Message is used as a generic format to communicate between chains

func NewFungibleTransfer

func NewFungibleTransfer(source, dest ChainId, depositer EthAddress, nonce Nonce, amount *big.Int, resourceId ResourceId, recipient []byte) Message

func NewGenericTransfer

func NewGenericTransfer(source, dest ChainId, depositer EthAddress, nonce Nonce, resourceId ResourceId, metadata []byte) Message

func NewNonFungibleTransfer

func NewNonFungibleTransfer(source, dest ChainId, depositer EthAddress, nonce Nonce, resourceId ResourceId, tokenId *big.Int, recipient, metadata []byte) Message

type Nonce

type Nonce uint64

func (Nonce) Big

func (n Nonce) Big() *big.Int

type ResourceId

type ResourceId [32]byte

func ResourceIdFromSlice

func ResourceIdFromSlice(in []byte) ResourceId

func (ResourceId) Hex

func (r ResourceId) Hex() string

type TransferType

type TransferType string
var FungibleTransfer TransferType = "FungibleTransfer"
var GenericTransfer TransferType = "GenericTransfer"
var NonFungibleTransfer TransferType = "NonFungibleTransfer"

Jump to

Keyboard shortcuts

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