Documentation ¶
Index ¶
- Constants
- Variables
- type AdvanceNonceAccounts
- type Allocate
- type AllocateWithSeed
- type Assign
- type AssignWithSeed
- type AuthorizeNonceAccount
- type CreateAccount
- type CreateAccountAccounts
- type CreateAccountWithSeed
- type InitializeNonceAccount
- type Instruction
- func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error)
- func NewCreateAccountInstruction(lamports uint64, space uint64, owner, from, to types.PublicKey) *Instruction
- func NewNonceAdvanceInstruction(noncePubkey, authorizedPubkey types.PublicKey) *Instruction
- func NewTransferSolanaInstruction(from, to types.PublicKey, lamports uint64) *Instruction
- type NonceAccount
- type Transfer
- type TransferAccounts
- type WithdrawNonceAccount
Constants ¶
const ( CreateAccountTypeID uint32 = iota AssignTypeID // 1 TransferTypeID // 2 CreateAccountWithSeedTypeID // 3 AdvanceNonceAccountTypeID // 4 WithdrawNonceAccountTypeID // 5 InitializeNonceAccountTypeID // 6 AuthorizeNonceAccountTypeID // 7 AllocateTypeID // 8 AllocateWithSeedTypeID // 9 AssignWithSeedTypeID // 10 )
typeID constants
Variables ¶
var ( SystemProgramID = types.MustPublicKeyFromBase58("11111111111111111111111111111111") SysvarRentProgramID = types.MustPublicKeyFromBase58("SysvarRent111111111111111111111111111111111") SysvarC1ockProgramID = types.MustPublicKeyFromBase58("SysvarC1ock11111111111111111111111111111111") SysvarRecentBlockhashesPubkey = types.MustPublicKeyFromBase58("SysvarRecentB1ockHashes11111111111111111111") MemoProgramID = types.MustPublicKeyFromBase58("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr") MemoProgramIDV2 = types.MustPublicKeyFromBase58("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo") )
programID constants
var InstructionImplDef = bin.NewVariantDefinition(bin.Uint32TypeIDEncoding, []bin.VariantType{ {Name: "create_account", Type: (*CreateAccount)(nil)}, {Name: "assign", Type: (*Assign)(nil)}, {Name: "transfer", Type: (*Transfer)(nil)}, })
InstructionImplDef default
Functions ¶
This section is empty.
Types ¶
type AdvanceNonceAccounts ¶
type AdvanceNonceAccounts struct { NoncePubkey *types.AccountMeta BlockHash *types.AccountMeta AuthorizedPubkey *types.AccountMeta }
AdvanceNonceAccount advance nonce account
type AllocateWithSeed ¶
type AllocateWithSeed struct { // Prefix with byte 0x09 Base types.PublicKey Seed types.BorshString Space bin.Uint64 Owner types.PublicKey }
AllocateWithSeed type
type AssignWithSeed ¶
type AssignWithSeed struct { // Prefix with byte 0x0a Base types.PublicKey Seed types.BorshString Owner types.PublicKey }
AssignWithSeed type
type AuthorizeNonceAccount ¶
AuthorizeNonceAccount authorize nonce account
type CreateAccount ¶
type CreateAccount struct { Lamports bin.Uint64 Space bin.Uint64 Owner types.PublicKey Accounts *CreateAccountAccounts `bin:"-"` }
CreateAccount type
func (*CreateAccount) SetAccounts ¶
func (i *CreateAccount) SetAccounts(accounts []*types.AccountMeta) error
SetAccounts set accounts
type CreateAccountAccounts ¶
type CreateAccountAccounts struct { From *types.AccountMeta `text:"linear,notype"` New *types.AccountMeta `text:"linear,notype"` }
CreateAccountAccounts type
type CreateAccountWithSeed ¶
type CreateAccountWithSeed struct { // Prefix with byte 0x03 Base types.PublicKey Seed types.BorshString Lamports bin.Uint64 Space bin.Uint64 Owner types.PublicKey }
CreateAccountWithSeed type
type InitializeNonceAccount ¶
InitializeNonceAccount initialize nonce account
type Instruction ¶
type Instruction struct {
bin.BaseVariant
}
Instruction type
func DecodeInstruction ¶
func DecodeInstruction(accounts []*types.AccountMeta, data []byte) (*Instruction, error)
DecodeInstruction decode instruction
func NewCreateAccountInstruction ¶
func NewCreateAccountInstruction(lamports uint64, space uint64, owner, from, to types.PublicKey) *Instruction
NewCreateAccountInstruction new create account instruction
func NewNonceAdvanceInstruction ¶
func NewNonceAdvanceInstruction(noncePubkey, authorizedPubkey types.PublicKey) *Instruction
NewNonceAdvanceInstruction new NonceAdvance solana instruction
func NewTransferSolanaInstruction ¶
func NewTransferSolanaInstruction(from, to types.PublicKey, lamports uint64) *Instruction
NewTransferSolanaInstruction new transfer solana instruction
func (*Instruction) Accounts ¶
func (i *Instruction) Accounts() (out []*types.AccountMeta)
Accounts get accounts
func (*Instruction) MarshalBinary ¶
func (i *Instruction) MarshalBinary(encoder *bin.Encoder) error
MarshalBinary marshal binary
func (*Instruction) ProgramID ¶
func (i *Instruction) ProgramID() types.PublicKey
ProgramID return program id
func (*Instruction) UnmarshalBinary ¶
func (i *Instruction) UnmarshalBinary(decoder *bin.Decoder) error
UnmarshalBinary unmarshal binary
type NonceAccount ¶
type NonceAccount struct { // Prefix with 0x04 Accounts *AdvanceNonceAccounts `bin:"-"` }
type Transfer ¶
type Transfer struct { // Prefix with byte 0x02 Lamports bin.Uint64 Accounts *TransferAccounts `bin:"-"` }
Transfer type
func (*Transfer) SetAccounts ¶
func (i *Transfer) SetAccounts(accounts []*types.AccountMeta) error
SetAccounts set accounts
type TransferAccounts ¶
type TransferAccounts struct { From *types.AccountMeta `text:"linear,notype"` To *types.AccountMeta `text:"linear,notype"` }
TransferAccounts type
type WithdrawNonceAccount ¶
WithdrawNonceAccount withdraw nonce account