compileTransaction
Returns a Transaction object for a given TransactionMessage.
This includes the compiled bytes of the transaction message, and a map of signatures. This map will have a key for each address that is required to sign the transaction. The transaction will not yet have signatures for any of these addresses.
Whether a transaction message is ready to be compiled or not is enforced for you at the type level. In order to be signable, a transaction message must:
- have a version and a list of zero or more instructions (ie. conform to BaseTransactionMessage)
- have a fee payer set (ie. conform to TransactionMessageWithFeePayer)
- have a lifetime specified (ie. conform to TransactionMessageWithBlockhashLifetime or TransactionMessageWithDurableNonceLifetime)
Type Parameters
| Type Parameter |
|---|
TTransactionMessage extends Readonly<{ instructions: readonly Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>[]; version: TransactionVersion; }> & TransactionMessageWithFeePayer<string> |
Parameters
| Parameter | Type |
|---|---|
transactionMessage | TTransactionMessage |
Returns
Readonly<TransactionFromTransactionMessage<TTransactionMessage>>