Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountFailedToBase58Decode = errors.New("failed to base58 decode") ErrAccountFailedToHexDecode = errors.New("failed to hex decode") ErrAccountPrivateKeyLengthMismatch = errors.New("key length mismatch") )
View Source
var (
ErrTransactionAddNotNecessarySignatures = errors.New("add not necessary signatures")
)
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { PublicKey common.PublicKey PrivateKey ed25519.PrivateKey }
func AccountFromBase58 ¶ added in v1.7.0
AccountFromBase58 generate a account by base58 private key
func AccountFromBytes ¶ added in v1.7.0
AccountFromBytes generate a account by bytes private key
func AccountFromHex ¶ added in v1.7.0
AccountFromHex generate a account by hex private key
func AccountFromSeed ¶ added in v1.11.0
AccountFromSeed generate a account by seed
func NewAccount ¶
func NewAccount() Account
type AccountMeta ¶
type CompiledInstruction ¶
type Instruction ¶
type Instruction struct { ProgramID common.PublicKey Accounts []AccountMeta Data []byte }
type Message ¶
type Message struct { Header MessageHeader Accounts []common.PublicKey RecentBlockHash string Instructions []CompiledInstruction }
func MessageDeserialize ¶
func MustMessageDeserialize ¶
func NewMessage ¶
func NewMessage(param NewMessageParam) Message
func (*Message) DecompileInstructions ¶
func (m *Message) DecompileInstructions() []Instruction
type MessageHeader ¶
type NewMessageParam ¶ added in v1.9.0
type NewMessageParam struct { FeePayer common.PublicKey Instructions []Instruction RecentBlockhash string }
type NewTransactionParam ¶ added in v1.9.0
type Transaction ¶
func MustTransactionDeserialize ¶
func MustTransactionDeserialize(data []byte) Transaction
MustTransactionDeserialize can deserialize a tx from byte array, it panic if error ocour
func NewTransaction ¶ added in v1.7.0
func NewTransaction(param NewTransactionParam) (Transaction, error)
NewTransaction create a new tx by message and signer. it will reserve signatures slot.
func TransactionDeserialize ¶
func TransactionDeserialize(tx []byte) (Transaction, error)
TransactionDeserialize can deserialize a tx from byte array
func (*Transaction) AddSignature ¶ added in v1.7.0
func (tx *Transaction) AddSignature(sig []byte) error
AddSignature will add or replace signature into the correct order signature's slot.
func (*Transaction) Serialize ¶
func (tx *Transaction) Serialize() ([]byte, error)
Serialize pack tx into byte array
Click to show internal directories.
Click to hide internal directories.