diff --git a/src/soroban/api.ts b/src/soroban/api.ts index d64fc951a..af73abb61 100644 --- a/src/soroban/api.ts +++ b/src/soroban/api.ts @@ -178,7 +178,9 @@ export namespace Api { interface RawLedgerEntryDiff { type: number; key: string; + // these are xdr.LedgerEntry in base64 before?: string; + // these are xdr.LedgerEntry in base64 after?: string; } diff --git a/src/soroban/parsers.ts b/src/soroban/parsers.ts index 8ff1d1c6d..26a9b666f 100644 --- a/src/soroban/parsers.ts +++ b/src/soroban/parsers.ts @@ -139,7 +139,18 @@ function parseSuccessful( : xdr.ScVal.scvVoid() }; })[0] - }) + }), + + stateDiff: sim.stateDiff?.length ?? 0 > 0 + ? sim.stateDiff!.map((entryDiff) => { + return { + type: entryDiff.type, + key: entryDiff.key, + before: xdr.LedgerEntry.fromXDR(entryDiff.before, 'base64'), + after: xdr.LedgerEntry.fromXDR(entryDiff.after, 'base64'), + }; + }) + : null, }; if (!sim.restorePreamble || sim.restorePreamble.transactionData === '') {