Solana.Transaction (Solana v0.2.0) View Source
Functions for building and encoding Solana transactions
Link to this section Summary
Types
The possible errors encountered when encoding a transaction.
All the details needed to encode a transaction.
Functions
Checks to see if a transaction's signature is valid.
decodes a base58-encoded signature and returns it in a tuple.
decodes a base58-encoded signature and returns it.
Parses a Solana.Transaction.t/0 from data encoded in Solana's binary
format
Encodes a Solana.Transaction.t/0 into a binary
format
Link to this section Types
Specs
encoding_err() :: :no_payer | :no_blockhash | :no_program | :no_instructions | :mismatched_signers
The possible errors encountered when encoding a transaction.
Specs
t() :: %Solana.Transaction{
blockhash: binary() | nil,
instructions: [Solana.Instruction.t()],
payer: Solana.key() | nil,
signers: [Solana.keypair()]
}
All the details needed to encode a transaction.
Link to this section Functions
Specs
Checks to see if a transaction's signature is valid.
Returns {:ok, signature} if it is, and an error tuple if it isn't.
Specs
decodes a base58-encoded signature and returns it in a tuple.
If it fails, return an error tuple.
Specs
decodes a base58-encoded signature and returns it.
Throws an ArgumentError if it fails.
Specs
Parses a Solana.Transaction.t/0 from data encoded in Solana's binary
format
Returns {transaction, extras} if the transaction was successfully
parsed, or :error if the provided binary could not be parsed. extras
is a keyword list containing information about the encoded transaction,
namely:
:header- the transaction message header:accounts- an ordered array of accounts:signatures- a list of signed copies of the transaction message
Specs
to_binary(tx :: t()) :: {:ok, binary()} | {:error, encoding_err()}
Encodes a Solana.Transaction.t/0 into a binary
format
Returns {:ok, encoded_transaction} if the transaction was successfully
encoded, or an error tuple if the encoding failed -- plus more error details
via Logger.error/1.