Documentation ¶
Index ¶
- Variables
- func DecimalsInBigInt(decimal uint32) *big.Int
- func DecodeInstruction(programID PublicKey, accounts []*AccountMeta, inst *CompiledInstruction) (interface{}, error)
- func NewRandomPrivateKey() (PublicKey, PrivateKey, error)
- func RegisterInstructionDecoder(programID PublicKey, decoder InstructionDecoder)
- type Account
- type AccountMeta
- type AccountSettable
- type Base58
- type ByteWrapper
- type CompiledInstruction
- type Data
- type Hash
- type InstructionDecoder
- type Message
- type MessageHeader
- type Options
- type Padding
- type PrivateKey
- type PublicKey
- type Signature
- type Transaction
- func (t *Transaction) AccountMetaList() (out []*AccountMeta)
- func (t *Transaction) IsSigner(account PublicKey) bool
- func (t *Transaction) IsWritable(account PublicKey) bool
- func (t *Transaction) ResolveProgramIDIndex(programIDIndex uint8) (PublicKey, error)
- func (t *Transaction) Sign(getter privateKeyGetter) (out []Signature, err error)
- func (t *Transaction) TouchAccount(account PublicKey) bool
- type TransactionInstruction
Constants ¶
This section is empty.
Variables ¶
View Source
var InstructionDecoderRegistry = map[string]InstructionDecoder{}
Functions ¶
func DecimalsInBigInt ¶
func DecodeInstruction ¶ added in v0.2.0
func DecodeInstruction(programID PublicKey, accounts []*AccountMeta, inst *CompiledInstruction) (interface{}, error)
func NewRandomPrivateKey ¶ added in v0.2.0
func NewRandomPrivateKey() (PublicKey, PrivateKey, error)
func RegisterInstructionDecoder ¶ added in v0.2.0
func RegisterInstructionDecoder(programID PublicKey, decoder InstructionDecoder)
Types ¶
type Account ¶ added in v0.2.0
type Account struct {
PrivateKey PrivateKey
}
func AccountFromPrivateKeyBase58 ¶ added in v0.2.0
func NewAccount ¶ added in v0.2.0
func NewAccount() *Account
type AccountMeta ¶
type AccountSettable ¶ added in v0.2.0
type AccountSettable interface {
SetAccounts(accounts []*AccountMeta, instructionActIdx []uint8) error
}
type CompiledInstruction ¶
type InstructionDecoder ¶ added in v0.2.0
type InstructionDecoder func([]*AccountMeta, *CompiledInstruction) (interface{}, error)
type Message ¶
type Message struct { Header MessageHeader `json:"header"` AccountKeys []PublicKey `json:"accountKeys"` RecentBlockhash PublicKey `json:"recentBlockhash"` Instructions []CompiledInstruction `json:"instructions"` }
type MessageHeader ¶
type PrivateKey ¶ added in v0.2.0
type PrivateKey []byte
func PrivateKeyFromBase58 ¶ added in v0.2.0
func PrivateKeyFromBase58(privkey string) (PrivateKey, error)
func (PrivateKey) PublicKey ¶ added in v0.2.0
func (k PrivateKey) PublicKey() PublicKey
func (PrivateKey) Sign ¶ added in v0.2.0
func (k PrivateKey) Sign(payload []byte) (Signature, error)
func (PrivateKey) String ¶ added in v0.2.0
func (k PrivateKey) String() string
type PublicKey ¶
type PublicKey [32]byte
/
func MustPublicKeyFromBase58 ¶
func PublicKeyFromBase58 ¶
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
type Signature ¶
type Signature [64]byte
/
func SignatureFromBase58 ¶
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct { Signatures []Signature `json:"signatures"` Message Message `json:"message"` }
func TransactionFromData ¶
func TransactionFromData(in []byte) (*Transaction, error)
func TransactionWithInstructions ¶ added in v0.2.0
func TransactionWithInstructions(instructions []TransactionInstruction, blockHash PublicKey, opt *Options) (*Transaction, error)
func (*Transaction) AccountMetaList ¶ added in v0.2.0
func (t *Transaction) AccountMetaList() (out []*AccountMeta)
func (*Transaction) IsSigner ¶ added in v0.2.0
func (t *Transaction) IsSigner(account PublicKey) bool
func (*Transaction) IsWritable ¶ added in v0.2.0
func (t *Transaction) IsWritable(account PublicKey) bool
func (*Transaction) ResolveProgramIDIndex ¶ added in v0.2.0
func (t *Transaction) ResolveProgramIDIndex(programIDIndex uint8) (PublicKey, error)
func (*Transaction) Sign ¶ added in v0.2.0
func (t *Transaction) Sign(getter privateKeyGetter) (out []Signature, err error)
func (*Transaction) TouchAccount ¶ added in v0.2.0
func (t *Transaction) TouchAccount(account PublicKey) bool
type TransactionInstruction ¶ added in v0.2.0
type TransactionInstruction interface { Accounts() []*AccountMeta // returns the list of accounts the instructions requires ProgramID() PublicKey // the programID the instruction acts on Data() ([]byte, error) // the binary encoded instructions }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.