decodeTransactionFromRpcResponse
Call Signature
Decodes a getTransaction response (any of encoding: 'base64',
'base58', or 'json') into a CompiledTransactionMessage plus,
for 'base64' and 'base58', a re-encodable Transaction. The
JSON path does not produce a Transaction: the server has already
decompiled the wire format, so there are no message bytes to carry.
'jsonParsed' is not supported — its instructions arrive
pre-parsed by the server and lack raw bytes, so they cannot be
round-tripped through the auto-generated parseXInstruction clients.
Passing a 'jsonParsed' response throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION;
any other unrecognized input throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE.
A response carrying a transaction version this package cannot decode
throws SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED —
raised by the JSON path for an unrecognized version, and by the wire
decoders for malformed binary input.
Use this together with getInstructionsFromCompiledTransactionMessage
(or walkInstructions) to inspect a confirmed transaction's
instructions in a form the auto-generated @solana-program/* clients
can parse directly.
Prefer encoding: 'base64' when bandwidth allows — it is the most
compact, the wire bytes round-trip cleanly through the kit codecs, and
the return type statically guarantees a re-encodable transaction.
Type Parameters
| Type Parameter | Default type |
|---|---|
TMaxSupportedTransactionVersion extends void | TransactionVersion | void | TransactionVersion |
Parameters
| Parameter | Type |
|---|---|
rpcTx | GetTransactionApiResponseBase64<TMaxSupportedTransactionVersion> |
Returns
Readonly<{
compiledMessage: CompiledTransactionMessage & Readonly<{
lifetimeToken: string;
}>;
loadedAddresses: LoadedAddresses;
transaction?: Readonly<{
messageBytes: TransactionMessageBytes;
signatures: SignaturesMap;
}>;
}> & object
Example
Call Signature
Decodes a getTransaction response (any of encoding: 'base64',
'base58', or 'json') into a CompiledTransactionMessage plus,
for 'base64' and 'base58', a re-encodable Transaction. The
JSON path does not produce a Transaction: the server has already
decompiled the wire format, so there are no message bytes to carry.
'jsonParsed' is not supported — its instructions arrive
pre-parsed by the server and lack raw bytes, so they cannot be
round-tripped through the auto-generated parseXInstruction clients.
Passing a 'jsonParsed' response throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION;
any other unrecognized input throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE.
A response carrying a transaction version this package cannot decode
throws SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED —
raised by the JSON path for an unrecognized version, and by the wire
decoders for malformed binary input.
Use this together with getInstructionsFromCompiledTransactionMessage
(or walkInstructions) to inspect a confirmed transaction's
instructions in a form the auto-generated @solana-program/* clients
can parse directly.
Prefer encoding: 'base64' when bandwidth allows — it is the most
compact, the wire bytes round-trip cleanly through the kit codecs, and
the return type statically guarantees a re-encodable transaction.
Type Parameters
| Type Parameter | Default type |
|---|---|
TMaxSupportedTransactionVersion extends void | TransactionVersion | void | TransactionVersion |
Parameters
| Parameter | Type |
|---|---|
rpcTx | GetTransactionApiResponseBase58<TMaxSupportedTransactionVersion> |
Returns
Readonly<{
compiledMessage: CompiledTransactionMessage & Readonly<{
lifetimeToken: string;
}>;
loadedAddresses: LoadedAddresses;
transaction?: Readonly<{
messageBytes: TransactionMessageBytes;
signatures: SignaturesMap;
}>;
}> & object
Example
Call Signature
Decodes a getTransaction response (any of encoding: 'base64',
'base58', or 'json') into a CompiledTransactionMessage plus,
for 'base64' and 'base58', a re-encodable Transaction. The
JSON path does not produce a Transaction: the server has already
decompiled the wire format, so there are no message bytes to carry.
'jsonParsed' is not supported — its instructions arrive
pre-parsed by the server and lack raw bytes, so they cannot be
round-tripped through the auto-generated parseXInstruction clients.
Passing a 'jsonParsed' response throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__CANNOT_DECODE_JSON_PARSED_TRANSACTION;
any other unrecognized input throws
SOLANA_ERROR__TRANSACTION_INTROSPECTION__UNRECOGNIZED_GET_TRANSACTION_RESPONSE.
A response carrying a transaction version this package cannot decode
throws SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED —
raised by the JSON path for an unrecognized version, and by the wire
decoders for malformed binary input.
Use this together with getInstructionsFromCompiledTransactionMessage
(or walkInstructions) to inspect a confirmed transaction's
instructions in a form the auto-generated @solana-program/* clients
can parse directly.
Prefer encoding: 'base64' when bandwidth allows — it is the most
compact, the wire bytes round-trip cleanly through the kit codecs, and
the return type statically guarantees a re-encodable transaction.
Type Parameters
| Type Parameter | Default type |
|---|---|
TMaxSupportedTransactionVersion extends void | TransactionVersion | void | TransactionVersion |
Parameters
| Parameter | Type |
|---|---|
rpcTx | GetTransactionApiResponseJson<TMaxSupportedTransactionVersion> |