types

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixConfig       = "config"
	PrefixRollback     = "rollback"
	PrefixProxyRequest = "proxy"
	PrefixPendingReq   = "req"
	PrefixPendingRes   = "res"
	PrefixNetworkFee   = "fee"
	PrefixClaimFees    = "claim_fees"
	PrefixReceipt      = "receipt"
)
View Source
const (
	MethodSetAdmin = "set_admin"

	MethodSetFee    = "set_fee"
	MethodClaimFees = "claim_fees"

	MethodRevertMessage = "revert_message"

	MethodDecodeCsMessage = "decode_cs_message"

	MethodSendMessage     = "send_message"
	MethodRecvMessage     = "recv_message"
	MethodExecuteCall     = "execute_call"
	MethodExecuteRollback = "execute_rollback"

	MethodQueryRecvMessageAccounts     = "query_recv_message_accounts"
	MethodQueryExecuteCallAccounts     = "query_execute_call_accounts"
	MethodQueryExecuteRollbackAccounts = "query_execute_rollback_accounts"
	MethodQueryRevertMessageAccounts   = "query_revert_message_accounts"

	ChainType = "solana"

	EventLogPrefix      = "Program data: "
	ProgramReturnPrefix = "Program return: "

	EventSendMessage     = "SendMessage"
	EventCallMessage     = "CallMessage"
	EventRollbackMessage = "RollbackMessage"

	SolanaDenom = "lamport"
)

Variables

This section is empty.

Functions

func GetPDA

func GetPDA(progID solana.PublicKey, prefix string, additionalSeeds ...[]byte) (solana.PublicKey, error)

Types

type AddressTables

type AddressTables map[solana.PublicKey]solana.PublicKeySlice

type CallMessageEvent

type CallMessageEvent struct {
	FromNetworkAddress string
	To                 string
	Sn                 big.Int
	ReqId              big.Int
	Data               []byte
	ConnProgram        solana.PublicKey
	ConnSn             big.Int
}

type ContractRollback

type ContractRollback struct {
	From      solana.PublicKey
	To        string
	Protocols []string
	Rollback  []byte
	Enabled   bool
}

type CsMessage

type CsMessage struct {
	MessageType CsMessageType
	Request     *CsMessageRequestType
	Result      *CsMessageResultType
}

type CsMessageRequestType

type CsMessageRequestType struct {
	From       struct{ Address string }
	To         string
	SequenceNo big.Int
	MsgType    MessageType
	Data       []byte
	Protocols  []string
}

type CsMessageResultType

type CsMessageResultType struct {
	SequenceNo   big.Int
	ResponseCode CsResponseType
	Message      []byte
}

type CsMessageType

type CsMessageType uint8
const (
	CsMessageRequest CsMessageType = iota
	CsMessageResult
)

type CsResponseType

type CsResponseType uint8
const (
	CsResponseFailure CsResponseType = iota
	CsResponseSuccess
)

type Dapp

type Dapp struct {
	Name         string   `yaml:"name"`
	ProgramID    string   `yaml:"program-id"`
	ConfigPrefix string   `yaml:"config-prefix"`
	OtherPrefix  []string `yaml:"other-prefix"`
}

type MessageType

type MessageType uint8
const (
	CallMessage MessageType = iota
	CallMessageWithRollback
	CallMessagePersisted
)

type PDA

type PDA struct {
	SeedPrefix string
	ProgramID  solana.PublicKey

	// if address is temporary then it can be deactivated from address lookup table onced used.
	IsTemp bool
}

func (PDA) GetAddress

func (pda PDA) GetAddress(additionalSeeds ...[]byte) (solana.PublicKey, error)

type PDARegistry

type PDARegistry struct {
	XcallConfig          PDA
	XcallRollback        PDA
	XcallProxyRequest    PDA //temp
	XcallPendingRequest  PDA //temp
	XcallPendingResponse PDA //temp

	ConnConfig     PDA
	ConnNetworkFee PDA
	ConnClaimFees  PDA
	ConnReceipt    PDA //temp
}

func NewPDARegistry

func NewPDARegistry(xcallProgramID, connProgramID solana.PublicKey) *PDARegistry

type ProxyRequestAccount

type ProxyRequestAccount struct {
	ReqMessage CsMessageRequestType
	Bump       uint8
}

type QueryAccountsResponse

type QueryAccountsResponse struct {
	Accounts      []solana.AccountMeta
	TotalAccounts uint8
	Limit         uint8
	Page          uint8
	HasNextPage   bool
}

type RollbackAccount

type RollbackAccount struct {
	Rollback ContractRollback
	Owner    solana.PublicKey
	Bump     uint8
}

type RollbackMessageEvent

type RollbackMessageEvent struct {
	Sn big.Int
}

type SendMessageEvent

type SendMessageEvent struct {
	TargetNetwork string
	ConnSn        big.Int
	Msg           []byte
}

type SolEvent

type SolEvent struct {
	Slot      uint64
	Signature solana.Signature
	Logs      []string
}

type TxInfo

type TxInfo struct {
	TxSign string `json:"tx_sign"`
}

func (*TxInfo) Deserialize

func (txi *TxInfo) Deserialize(bytesVal []byte) error

func (*TxInfo) Serialize

func (txi *TxInfo) Serialize() ([]byte, error)

type XcallConfigAccount

type XcallConfigAccount struct {
	Admin       solana.PublicKey
	FeeHandler  solana.PublicKey
	NetworkID   string
	ProtocolFee uint64
	SequenceNo  big.Int
	LastReqID   big.Int
	Bump        uint8
}

type XcallRollback

type XcallRollback struct {
	From      solana.PublicKey
	To        struct{ Address string }
	Enabled   bool
	Rollback  []byte
	Protocols []string
}

type XcallRollbackAccount

type XcallRollbackAccount struct {
	Rollback XcallRollback
	Bump     uint8
}

Jump to

Keyboard shortcuts

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