Versions in this module Expand all Collapse all v3 v3.6.2 Feb 8, 2023 Changes in this version + var ApplyMpcTypeID = calcSighash("global:apply_mpc") + var ChangeMpcTypeID = calcSighash("global:change_mpc") + var CreateAssociatedTokenTypeID = calcSighash("global:create_associated_token") + var EnableSwapTradeTypeID = calcSighash("global:enable_swap_trade") + var InitializeTypeID = calcSighash("global:initialize") + var InstructionDefVariant = NewVariantDefinition([]VariantType{ ... }) + var SkimLamportsTypeID = calcSighash("global:skim_lamports") + var SwapinMintTypeID = calcSighash("global:swapin_mint") + var SwapinNativeTypeID = calcSighash("global:swapin_native") + var SwapinTransferTypeID = calcSighash("global:swapin_transfer") + var SwapoutBurnTypeID = calcSighash("global:swapout_burn") + var SwapoutNativeTypeID = calcSighash("global:swapout_native") + var SwapoutTransferTypeID = calcSighash("global:swapout_transfer") + func InitRouterProgram(programID types.PublicKey) + type BaseVariant struct + Impl interface{} + TypeID SigHash + func (v *BaseVariant) UnmarshalBinaryVariant(decoder *bin.Decoder, def *VariantDefinition) error + type ChangeMpc struct + Accounts *ChangeMpcAccounts + func (i *ChangeMpc) SetAccounts(accounts []*types.AccountMeta) error + type ChangeMpcAccounts struct + MPC *types.AccountMeta + NewMPC *types.AccountMeta + RouterAccount *types.AccountMeta + type ChangeMpcParams struct + New *types.PublicKey + type CreateAT struct + Accounts *CreateATAccounts + func (i *CreateAT) SetAccounts(accounts []*types.AccountMeta) error + type CreateATAccounts struct + AssociatedToken *types.AccountMeta + AssociatedTokenProgram *types.AccountMeta + Authority *types.AccountMeta + Mint *types.AccountMeta + Payer *types.AccountMeta + Rent *types.AccountMeta + SystemProgram *types.AccountMeta + TokenProgram *types.AccountMeta + type EnableSwapTrade struct + Accounts *EnableSwapTradeAccounts + func (i *EnableSwapTrade) SetAccounts(accounts []*types.AccountMeta) error + type EnableSwapTradeAccounts struct + MPC *types.AccountMeta + RouterAccount *types.AccountMeta + type EnableSwapTradeParams struct + Enable bool + type ISwapinParams interface + GetSwapinParams func() SwapinParams + type Instruction struct + RouterProgramID types.PublicKey + func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error) + func NewApplyMPCInstruction(mpc, routerAccount, newMpc types.PublicKey) *Instruction + func NewChangeMPCInstruction(mpc, routerAccount, newMpc types.PublicKey) *Instruction + func NewCreateATAInstruction(payer, owner, tokenProgramID, ownertokenATA types.PublicKey) *Instruction + func NewEnableSwapTradeInstruction(enable bool, mpc, routerAccount types.PublicKey) *Instruction + func NewSwapinMintInstruction(tx string, amount, fromChainID uint64, ...) *Instruction + func NewSwapinNativeInstruction(tx string, amount, fromChainID uint64, ...) *Instruction + func NewSwapinTransferInstruction(tx string, amount, fromChainID uint64, ...) *Instruction + func (i *Instruction) Accounts() (out []*types.AccountMeta) + func (i *Instruction) Data() ([]byte, error) + func (i *Instruction) MarshalBinary(encoder *bin.Encoder) error + func (i *Instruction) ProgramID() types.PublicKey + func (i *Instruction) UnmarshalBinary(decoder *bin.Decoder) (err error) + type SigHash [8]byte + func (s *SigHash) SetUint64(i uint64) *SigHash + func (s *SigHash) Uint64() uint64 + type SwapinMint struct + Accounts *SwapinMintAccounts + func (i *SwapinMint) GetSwapinParams() SwapinParams + func (i *SwapinMint) SetAccounts(accounts []*types.AccountMeta) error + type SwapinMintAccounts struct + MPC *types.AccountMeta + RouterAccount *types.AccountMeta + To *types.AccountMeta + TokenMint *types.AccountMeta + TokenProgram *types.AccountMeta + type SwapinNative struct + Accounts *SwapinNativeAccounts + func (i *SwapinNative) GetSwapinParams() SwapinParams + func (i *SwapinNative) SetAccounts(accounts []*types.AccountMeta) error + type SwapinNativeAccounts struct + MPC *types.AccountMeta + RouterAccount *types.AccountMeta + SystemProgram *types.AccountMeta + To *types.AccountMeta + type SwapinParams struct + Amount uint64 + FromChainID uint64 + Tx types.BorshString + func (p *SwapinParams) String() string + type SwapinTransfer struct + Accounts *SwapinTransferAccounts + func (i *SwapinTransfer) GetSwapinParams() SwapinParams + func (i *SwapinTransfer) SetAccounts(accounts []*types.AccountMeta) error + type SwapinTransferAccounts struct + From *types.AccountMeta + MPC *types.AccountMeta + RouterAccount *types.AccountMeta + To *types.AccountMeta + TokenMint *types.AccountMeta + TokenProgram *types.AccountMeta + type VariantDefinition struct + func NewVariantDefinition(types []VariantType) *VariantDefinition + type VariantType struct + ID SigHash + Name string + Type interface{}