Class SolanaTransaction
java.lang.Object
com.codename1.crypto.solana.SolanaTransaction
A Solana transaction: a
SolanaMessage and one Ed25519 signature per required signer.
A slot whose signer has not signed yet holds 64 zero bytes, which is how a transaction is
passed between parties that sign it in turn.-
Constructor Summary
ConstructorsConstructorDescriptionSolanaTransaction(SolanaMessage message) An unsigned transaction for a message. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSignature(SolanaAddress signer, byte[] signature) Places a signature made elsewhere, for instance by a hardware wallet.static SolanaTransactionfromBase64(String base64) Reads a Base64 transaction.getId()The transaction id: the fee payer's signature in Base58.The message.byte[]The bytes that are signed.byte[]getSignature(int index) The signature of a signer slot, a copy; all zeros while unsigned.booleanWhether every required signature is present and valid.static SolanaTransactionparse(byte[] data) Reads a transaction.byte[]The wire form.voidsign(byte[] privateKey) Signs with the 32-byte Ed25519 seed of one of the message's signers.toBase64()The Base64 wire form, whatsendTransactiontakes withencoding: base64.
-
Constructor Details
-
SolanaTransaction
An unsigned transaction for a message.
-
-
Method Details
-
getMessage
The message. -
sign
public void sign(byte[] privateKey) Signs with the 32-byte Ed25519 seed of one of the message's signers.
Throws
IllegalArgumentException: if the key is not one of the message's signers
-
addSignature
Places a signature made elsewhere, for instance by a hardware wallet.
Throws
IllegalArgumentException: if the signer is not required or the signature is invalid
-
isFullySigned
public boolean isFullySigned()Whether every required signature is present and valid. -
getSignature
public byte[] getSignature(int index) The signature of a signer slot, a copy; all zeros while unsigned. -
getId
The transaction id: the fee payer's signature in Base58. -
getMessageBytes
public byte[] getMessageBytes()The bytes that are signed. -
serialize
public byte[] serialize()The wire form. -
toBase64
The Base64 wire form, whatsendTransactiontakes withencoding: base64. -
parse
Reads a transaction.
Throws
IllegalArgumentException: for malformed data, or a signature count that does not match the message
-
fromBase64
Reads a Base64 transaction.
-