Skip to main content
Version: 2.15.0

fromJSON

function fromJSON(json: string | ZkappCommand): Transaction<false, false>;

Defined in: lib/mina/v1/transaction.ts:108

Deserializes a transaction from a JSON object or JSON string representation. This method accepts both parsed JSON objects and JSON strings, making it flexible for different use cases.

Parameters​

json​

string | ZkappCommand

A JSON object representation of a transaction (Types.Json.ZkappCommand) or a JSON string

Returns​

Transaction<false, false>

A new Transaction instance reconstructed from the JSON input

Example​

const originalTx = await Mina.transaction(sender, () => {
zkapp.someMethod();
});
const serialized = originalTx.toJSON();
const deserializedTx = Transaction.fromJSON(serialized);