@miden-sdk/miden-sdk 0.15.7 → 0.16.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +0 -152
  2. package/dist/mt/{Cargo-CnGom-_z.js → Cargo-DKsyWYgG.js} +700 -1245
  3. package/dist/mt/Cargo-DKsyWYgG.js.map +1 -0
  4. package/dist/mt/api-types.d.ts +38 -370
  5. package/dist/mt/assets/miden_client_web.wasm +0 -0
  6. package/dist/mt/crates/miden_client_web.d.ts +179 -402
  7. package/dist/mt/docs-entry.d.ts +3 -9
  8. package/dist/mt/eager.js +1 -1
  9. package/dist/mt/index.d.ts +0 -3
  10. package/dist/mt/index.js +53 -701
  11. package/dist/mt/index.js.map +1 -1
  12. package/dist/mt/wasm.js +1 -1
  13. package/dist/mt/workerHelpers.js +1 -1
  14. package/dist/mt/workers/{Cargo-CnGom-_z-X_3VwTbo.js → Cargo-DKsyWYgG-DfOhgt23.js} +700 -1245
  15. package/dist/mt/workers/Cargo-DKsyWYgG-DfOhgt23.js.map +1 -0
  16. package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
  17. package/dist/mt/workers/web-client-methods-worker.js +703 -1251
  18. package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
  19. package/dist/mt/workers/web-client-methods-worker.module.js +1 -1
  20. package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -1
  21. package/dist/mt/workers/workerHelpers.js +1 -1
  22. package/dist/st/{Cargo-DR9fiMbE.js → Cargo-LwITdlzJ.js} +695 -1237
  23. package/dist/st/Cargo-LwITdlzJ.js.map +1 -0
  24. package/dist/st/api-types.d.ts +38 -370
  25. package/dist/st/assets/miden_client_web.wasm +0 -0
  26. package/dist/st/crates/miden_client_web.d.ts +179 -402
  27. package/dist/st/docs-entry.d.ts +3 -9
  28. package/dist/st/eager.js +1 -1
  29. package/dist/st/index.d.ts +0 -3
  30. package/dist/st/index.js +53 -701
  31. package/dist/st/index.js.map +1 -1
  32. package/dist/st/wasm.js +1 -1
  33. package/dist/st/workers/{Cargo-DR9fiMbE-C0G0clA_.js → Cargo-LwITdlzJ-Dyl2bCwN.js} +695 -1237
  34. package/dist/st/workers/Cargo-LwITdlzJ-Dyl2bCwN.js.map +1 -0
  35. package/dist/st/workers/assets/miden_client_web.wasm +0 -0
  36. package/dist/st/workers/web-client-methods-worker.js +698 -1243
  37. package/dist/st/workers/web-client-methods-worker.js.map +1 -1
  38. package/dist/st/workers/web-client-methods-worker.module.js +1 -1
  39. package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
  40. package/js/client.js +2 -4
  41. package/js/node/client-factory.js +4 -11
  42. package/js/node/napi-compat.js +1 -0
  43. package/js/node-index.js +11 -11
  44. package/js/resources/compiler.js +23 -12
  45. package/js/resources/transactions.js +24 -540
  46. package/js/standalone.js +3 -61
  47. package/package.json +4 -4
  48. package/dist/mt/Cargo-CnGom-_z.js.map +0 -1
  49. package/dist/mt/workers/Cargo-CnGom-_z-X_3VwTbo.js.map +0 -1
  50. package/dist/st/Cargo-DR9fiMbE.js.map +0 -1
  51. package/dist/st/workers/Cargo-DR9fiMbE-C0G0clA_.js.map +0 -1
  52. package/js/resources/pswap.js +0 -132
@@ -57,13 +57,6 @@ export class Account {
57
57
  * Returns true if the account exposes a fungible-faucet interface.
58
58
  */
59
59
  isFaucet(): boolean;
60
- /**
61
- * Returns true if this is a network account.
62
- *
63
- * A network account is a public account whose storage
64
- * carries the standardized network-account note-script allowlist slot.
65
- */
66
- isNetworkAccount(): boolean;
67
60
  /**
68
61
  * Returns true if the account has not yet been committed to the chain.
69
62
  */
@@ -80,11 +73,6 @@ export class Account {
80
73
  * Returns true if the account is a regular (non-faucet) account.
81
74
  */
82
75
  isRegularAccount(): boolean;
83
- /**
84
- * Returns the note-script roots this network account is allowed to
85
- * consume, or `undefined` if this is not a network account.
86
- */
87
- networkNoteAllowlist(): Word[] | undefined;
88
76
  /**
89
77
  * Returns the account nonce, which is incremented on every state update.
90
78
  */
@@ -218,34 +206,19 @@ export class AccountComponent {
218
206
  * Compiles account code with the given storage slots using the provided assembler.
219
207
  */
220
208
  static compile(account_code: AccountComponentCode, storage_slots: StorageSlot[]): AccountComponent;
209
+ /**
210
+ * Returns the exact compiled code used by this component.
211
+ *
212
+ * Link this code when compiling scripts that invoke the component. Rebuilding a library from
213
+ * the original source can produce different procedure identities than the code installed on
214
+ * the account.
215
+ */
216
+ componentCode(): AccountComponentCode;
221
217
  static createAuthComponentFromCommitment(commitment: Word, auth_scheme: AuthScheme): AccountComponent;
222
218
  /**
223
219
  * Builds an auth component from a secret key, inferring the auth scheme from the key type.
224
220
  */
225
221
  static createAuthComponentFromSecretKey(secret_key: AuthSecretKey): AccountComponent;
226
- /**
227
- * Builds the auth component for a network account.
228
- *
229
- * A network account is a public account carrying this component: its
230
- * note-script allowlist is the standardized storage slot the node's
231
- * network-transaction builder inspects to identify the account as a network
232
- * account and route matching notes to it for auto-consumption. The account
233
- * may only consume notes whose script root is in `allowedNoteScriptRoots`
234
- * (obtain a root via `NoteScript.root()`).
235
- *
236
- * `allowedTxScriptRoots` optionally allowlists transaction script roots
237
- * (from `TransactionScript.root()`) the account will execute. When omitted
238
- * or empty, the account permits no transaction scripts and deploys and
239
- * advances via scriptless transactions only. Allowlist a script root only
240
- * if the script's effect is safe for *every* possible input: a root pins
241
- * the script's code but not its arguments or advice inputs, which the
242
- * (arbitrary) transaction submitter controls.
243
- *
244
- * # Errors
245
- * Errors if `allowedNoteScriptRoots` is empty: a network account with no
246
- * allowlisted note scripts could never consume a note.
247
- */
248
- static createNetworkAuth(allowed_note_script_roots: Word[], allowed_tx_script_roots?: Word[] | null): AccountComponent;
249
222
  /**
250
223
  * Creates an account component from a compiled library and storage slots.
251
224
  */
@@ -294,8 +267,10 @@ export class AccountComponentCode {
294
267
  * `AccountDelta` stores the differences between two account states.
295
268
  *
296
269
  * The differences are represented as follows:
297
- * - `storage`: an `AccountStorageDelta` that contains the changes to the account storage.
298
- * - `vault`: an `AccountVaultDelta` object that contains the changes to the account vault.
270
+ * - `storage`: an `AccountStoragePatch` with the absolute final values of changed storage slots
271
+ * (storage changes have identical semantics in the delta and patch models).
272
+ * - `vault`: an `AccountVaultDelta` object that contains the relative changes to the account
273
+ * vault.
299
274
  * - `nonce`: if the nonce of the account has changed, the new nonce is stored here.
300
275
  */
301
276
  export class AccountDelta {
@@ -323,9 +298,9 @@ export class AccountDelta {
323
298
  */
324
299
  serialize(): Uint8Array;
325
300
  /**
326
- * Returns the storage delta.
301
+ * Returns the storage patch (storage changes are absolute in both models).
327
302
  */
328
- storage(): AccountStorageDelta;
303
+ storage(): AccountStoragePatch;
329
304
  /**
330
305
  * Returns the vault delta.
331
306
  */
@@ -482,6 +457,43 @@ export enum AccountInterface {
482
457
  BasicWallet = 0,
483
458
  }
484
459
 
460
+ /**
461
+ * Describes the new absolute account state produced by a transaction.
462
+ */
463
+ export class AccountPatch {
464
+ private constructor();
465
+ free(): void;
466
+ [Symbol.dispose](): void;
467
+ /**
468
+ * Deserializes an account patch from bytes.
469
+ */
470
+ static deserialize(bytes: Uint8Array): AccountPatch;
471
+ /**
472
+ * Returns the final nonce, or `None` if it was unchanged.
473
+ */
474
+ finalNonce(): Felt | undefined;
475
+ /**
476
+ * Returns the affected account ID.
477
+ */
478
+ id(): AccountId;
479
+ /**
480
+ * Returns true if this patch contains no state changes.
481
+ */
482
+ isEmpty(): boolean;
483
+ /**
484
+ * Serializes the account patch into bytes.
485
+ */
486
+ serialize(): Uint8Array;
487
+ /**
488
+ * Returns the account storage patch.
489
+ */
490
+ storage(): AccountStoragePatch;
491
+ /**
492
+ * Returns the account vault patch.
493
+ */
494
+ vault(): AccountVaultPatch;
495
+ }
496
+
485
497
  /**
486
498
  * Proof of existence of an account's state at a specific block number, as returned by the node.
487
499
  *
@@ -698,37 +710,6 @@ export class AccountStorage {
698
710
  getSlotNames(): string[];
699
711
  }
700
712
 
701
- /**
702
- * `AccountStorageDelta` stores the differences between two states of account storage.
703
- *
704
- * The delta consists of two maps:
705
- * - A map containing the updates to value storage slots. The keys in this map are indexes of the
706
- * updated storage slots and the values are the new values for these slots.
707
- * - A map containing updates to storage maps. The keys in this map are indexes of the updated
708
- * storage slots and the values are corresponding storage map delta objects.
709
- */
710
- export class AccountStorageDelta {
711
- private constructor();
712
- free(): void;
713
- [Symbol.dispose](): void;
714
- /**
715
- * Deserializes a storage delta from bytes.
716
- */
717
- static deserialize(bytes: Uint8Array): AccountStorageDelta;
718
- /**
719
- * Returns true if no storage slots are changed.
720
- */
721
- isEmpty(): boolean;
722
- /**
723
- * Serializes the storage delta into bytes.
724
- */
725
- serialize(): Uint8Array;
726
- /**
727
- * Returns the new values for modified storage slots.
728
- */
729
- values(): Word[];
730
- }
731
-
732
713
  /**
733
714
  * Storage visibility mode for an account.
734
715
  *
@@ -766,6 +747,31 @@ export class AccountStorageMode {
766
747
  static tryFromStr(s: string): AccountStorageMode;
767
748
  }
768
749
 
750
+ /**
751
+ * Absolute updates to named account storage slots.
752
+ */
753
+ export class AccountStoragePatch {
754
+ private constructor();
755
+ free(): void;
756
+ [Symbol.dispose](): void;
757
+ /**
758
+ * Deserializes a storage patch from bytes.
759
+ */
760
+ static deserialize(bytes: Uint8Array): AccountStoragePatch;
761
+ /**
762
+ * Returns true if no storage slots are changed.
763
+ */
764
+ isEmpty(): boolean;
765
+ /**
766
+ * Serializes the storage patch into bytes.
767
+ */
768
+ serialize(): Uint8Array;
769
+ /**
770
+ * Returns the final values for created or updated value slots.
771
+ */
772
+ values(): Word[];
773
+ }
774
+
769
775
  export class AccountStorageRequirements {
770
776
  free(): void;
771
777
  [Symbol.dispose](): void;
@@ -830,6 +836,39 @@ export class AccountVaultDelta {
830
836
  serialize(): Uint8Array;
831
837
  }
832
838
 
839
+ /**
840
+ * Absolute updates to account vault entries.
841
+ */
842
+ export class AccountVaultPatch {
843
+ private constructor();
844
+ free(): void;
845
+ [Symbol.dispose](): void;
846
+ /**
847
+ * Deserializes a vault patch from bytes.
848
+ */
849
+ static deserialize(bytes: Uint8Array): AccountVaultPatch;
850
+ /**
851
+ * Returns true if no vault entries are changed.
852
+ */
853
+ isEmpty(): boolean;
854
+ /**
855
+ * Returns the number of changed vault entries.
856
+ */
857
+ numAssets(): number;
858
+ /**
859
+ * Returns the IDs of removed assets as their canonical words.
860
+ */
861
+ removedAssetIds(): Word[];
862
+ /**
863
+ * Serializes the vault patch into bytes.
864
+ */
865
+ serialize(): Uint8Array;
866
+ /**
867
+ * Returns fungible assets whose final balance was added or updated.
868
+ */
869
+ updatedFungibleAssets(): FungibleAsset[];
870
+ }
871
+
833
872
  /**
834
873
  * Representation of a Miden address (account ID plus routing parameters).
835
874
  */
@@ -912,25 +951,6 @@ export class AdviceMap {
912
951
  constructor();
913
952
  }
914
953
 
915
- /**
916
- * Whether a faucet's asset callbacks run when an asset is added to an account or a note.
917
- *
918
- * The flag is part of an asset's vault key, so two assets from the same faucet with different
919
- * flags occupy different vault slots and do not merge. Assets minted by a faucet that registers
920
- * transfer policies carry `Enabled`; everything else carries `Disabled`.
921
- */
922
- export enum AssetCallbackFlag {
923
- /**
924
- * The faucet's callbacks are not invoked for this asset. This is the default for an asset
925
- * built via the `FungibleAsset` constructor.
926
- */
927
- Disabled = 0,
928
- /**
929
- * The faucet's callbacks are invoked before this asset is added to an account or a note.
930
- */
931
- Enabled = 1,
932
- }
933
-
934
954
  /**
935
955
  * A container for an unlimited number of assets.
936
956
  *
@@ -1021,13 +1041,10 @@ export class AuthSecretKey {
1021
1041
  }
1022
1042
 
1023
1043
  /**
1024
- * Provides metadata for a fungible faucet account component.
1044
+ * Provides metadata for a basic fungible faucet account component.
1025
1045
  *
1026
- * Reads the on-chain `FungibleFaucet` component for the account, which holds the per-token
1027
- * info (symbol, decimals, supply, and the descriptive metadata). The same component backs both
1028
- * "basic" public faucets and network-style faucets — in the current protocol the distinction is
1029
- * a function of the surrounding account configuration (account type, auth, access control), not
1030
- * of the faucet component itself — so this reads metadata from either kind of faucet account.
1046
+ * Reads the on-chain [`FungibleFaucet`] component for the account, which holds the
1047
+ * per-token info (symbol/decimals/maxSupply).
1031
1048
  */
1032
1049
  export class BasicFungibleFaucetComponent {
1033
1050
  private constructor();
@@ -1037,22 +1054,10 @@ export class BasicFungibleFaucetComponent {
1037
1054
  * Returns the number of decimal places for the token.
1038
1055
  */
1039
1056
  decimals(): number;
1040
- /**
1041
- * Returns the optional free-form token description, or `undefined` when unset.
1042
- */
1043
- description(): string | undefined;
1044
- /**
1045
- * Returns the optional external link (e.g. project website), or `undefined` when unset.
1046
- */
1047
- externalLink(): string | undefined;
1048
1057
  /**
1049
1058
  * Extracts faucet metadata from an account.
1050
1059
  */
1051
1060
  static fromAccount(account: Account): BasicFungibleFaucetComponent;
1052
- /**
1053
- * Returns the optional token logo URI, or `undefined` when unset.
1054
- */
1055
- logoUri(): string | undefined;
1056
1061
  /**
1057
1062
  * Returns the maximum token supply.
1058
1063
  */
@@ -1061,14 +1066,6 @@ export class BasicFungibleFaucetComponent {
1061
1066
  * Returns the faucet's token symbol.
1062
1067
  */
1063
1068
  symbol(): TokenSymbol;
1064
- /**
1065
- * Returns the human-readable token name.
1066
- */
1067
- tokenName(): string;
1068
- /**
1069
- * Returns the current token supply (the amount minted so far).
1070
- */
1071
- tokenSupply(): Felt;
1072
1069
  }
1073
1070
 
1074
1071
  /**
@@ -1175,6 +1172,13 @@ export class CodeBuilder {
1175
1172
  * with the available modules under this builder. Returns the compiled account component code.
1176
1173
  */
1177
1174
  compileAccountComponentCode(account_code: string): AccountComponentCode;
1175
+ /**
1176
+ * Compiles account component code under an explicit module path.
1177
+ *
1178
+ * The module path is part of procedure identity in Miden Assembly 0.25. Callers that also
1179
+ * link this component into a transaction script must use the same path for both operations.
1180
+ */
1181
+ compileAccountComponentCodeWithPath(component_path: string, account_code: string): AccountComponentCode;
1178
1182
  /**
1179
1183
  * Given a Note Script's source code, compiles it with the available
1180
1184
  * modules under this builder. Returns the compiled script.
@@ -1185,6 +1189,13 @@ export class CodeBuilder {
1185
1189
  * modules under this builder. Returns the compiled script.
1186
1190
  */
1187
1191
  compileTxScript(tx_script: string): TransactionScript;
1192
+ /**
1193
+ * Dynamically links the exact library installed by an account component.
1194
+ *
1195
+ * Use this for component procedures that are available on-chain and invoked with dynamic
1196
+ * calls, including foreign procedure invocation.
1197
+ */
1198
+ linkDynamicAccountComponentCode(account_component_code: AccountComponentCode): void;
1188
1199
  /**
1189
1200
  * This is useful to dynamically link the {@link Library} of a foreign account
1190
1201
  * that is invoked using foreign procedure invocation (FPI). Its code is available
@@ -1199,6 +1210,13 @@ export class CodeBuilder {
1199
1210
  * statically link it for use with scripts to be built with this builder.
1200
1211
  */
1201
1212
  linkModule(module_path: string, module_code: string): void;
1213
+ /**
1214
+ * Statically links the exact library installed by an account component.
1215
+ *
1216
+ * This should be preferred over rebuilding the component source with `buildLibrary`, because
1217
+ * the installed component code is the source of truth for its procedure identities.
1218
+ */
1219
+ linkStaticAccountComponentCode(account_component_code: AccountComponentCode): void;
1202
1220
  /**
1203
1221
  * Statically links the given library.
1204
1222
  *
@@ -1319,50 +1337,13 @@ export class Endpoint {
1319
1337
  readonly protocol: string;
1320
1338
  }
1321
1339
 
1322
- /**
1323
- * A 20-byte Ethereum address, used as the destination of an `AggLayer` bridge-out (B2AGG) note.
1324
- *
1325
- * Construct one from a hex string with [`EthAddress::from_hex`] (the `0x` prefix is optional) or
1326
- * from raw bytes with [`EthAddress::from_bytes`]. The canonical lowercase, `0x`-prefixed hex form
1327
- * is available via [`EthAddress::to_hex`] (also exposed as `toString`).
1328
- */
1329
- export class EthAddress {
1330
- private constructor();
1331
- free(): void;
1332
- [Symbol.dispose](): void;
1333
- /**
1334
- * Builds an Ethereum address from its raw 20-byte big-endian representation.
1335
- *
1336
- * Returns an error if the input is not exactly 20 bytes long.
1337
- */
1338
- static fromBytes(bytes: Uint8Array): EthAddress;
1339
- /**
1340
- * Builds an Ethereum address from a hex string (with or without the `0x` prefix).
1341
- *
1342
- * Returns an error if the string is not valid hex or does not encode exactly 20 bytes.
1343
- */
1344
- static fromHex(hex: string): EthAddress;
1345
- /**
1346
- * Returns the raw 20-byte big-endian representation of the address.
1347
- */
1348
- toBytes(): Uint8Array;
1349
- /**
1350
- * Returns the canonical lowercase, `0x`-prefixed hex representation of the address.
1351
- */
1352
- toHex(): string;
1353
- /**
1354
- * Returns the canonical lowercase, `0x`-prefixed hex representation of the address.
1355
- */
1356
- toString(): string;
1357
- }
1358
-
1359
1340
  /**
1360
1341
  * Describes the result of executing a transaction program for the Miden protocol.
1361
1342
  *
1362
1343
  * Executed transaction serves two primary purposes:
1363
1344
  * - It contains a complete description of the effects of the transaction. Specifically, it
1364
- * contains all output notes created as the result of the transaction and describes all the
1365
- * changes made to the involved account (i.e., the account delta).
1345
+ * contains all output notes created as the result of the transaction and the absolute-valued
1346
+ * account patch produced by execution.
1366
1347
  * - It contains all the information required to re-execute and prove the transaction in a
1367
1348
  * stateless manner. This includes all public transaction inputs, but also all nondeterministic
1368
1349
  * inputs that the host provided to Miden VM while executing the transaction (i.e., advice
@@ -1372,14 +1353,14 @@ export class ExecutedTransaction {
1372
1353
  private constructor();
1373
1354
  free(): void;
1374
1355
  [Symbol.dispose](): void;
1375
- /**
1376
- * Returns the account delta resulting from execution.
1377
- */
1378
- accountDelta(): AccountDelta;
1379
1356
  /**
1380
1357
  * Returns the account the transaction was executed against.
1381
1358
  */
1382
1359
  accountId(): AccountId;
1360
+ /**
1361
+ * Returns the absolute account patch resulting from execution.
1362
+ */
1363
+ accountPatch(): AccountPatch;
1383
1364
  /**
1384
1365
  * Returns the block header that included the transaction.
1385
1366
  */
@@ -1614,10 +1595,6 @@ export class FungibleAsset {
1614
1595
  * Returns the amount of fungible units.
1615
1596
  */
1616
1597
  amount(): bigint;
1617
- /**
1618
- * Returns whether this asset invokes its faucet's callbacks.
1619
- */
1620
- callbacks(): AssetCallbackFlag;
1621
1598
  /**
1622
1599
  * Returns the faucet account that minted this asset.
1623
1600
  */
@@ -1630,15 +1607,6 @@ export class FungibleAsset {
1630
1607
  * Creates a fungible asset for the given faucet and amount.
1631
1608
  */
1632
1609
  constructor(faucet_id: AccountId, amount: bigint);
1633
- /**
1634
- * Returns a copy of this asset carrying the given callback flag.
1635
- *
1636
- * The flag is part of the asset's vault key, so it must match the flag the issuing faucet
1637
- * applies — an asset built with the wrong flag addresses a different vault slot than the one
1638
- * holding the balance. The constructor always produces `Disabled`; pass `Enabled` only for
1639
- * assets from a faucet that registers transfer policies.
1640
- */
1641
- withCallbacks(callbacks: AssetCallbackFlag): FungibleAsset;
1642
1610
  }
1643
1611
 
1644
1612
  /**
@@ -1818,12 +1786,6 @@ export class InputNoteRecord {
1818
1786
  * Returns true if the note has already been consumed.
1819
1787
  */
1820
1788
  isConsumed(): boolean;
1821
- /**
1822
- * Returns true while the note's on-chain inclusion is still unsettled
1823
- * (`Expected` or `Unverified`), i.e. while sync is the mechanism that can
1824
- * advance this record.
1825
- */
1826
- isInclusionPending(): boolean;
1827
1789
  /**
1828
1790
  * Returns true if the note is currently being processed.
1829
1791
  */
@@ -2060,11 +2022,10 @@ export class JsStateSyncUpdate {
2060
2022
  */
2061
2023
  newBlockNums: Uint32Array;
2062
2024
  /**
2063
- * Serialized MMR peaks at the new sync height (single set for the whole update).
2064
- * Written onto the chain-tip block's `blockHeaders` row (the one whose
2065
- * `blockNum` matches `block_num`) and read back by `getCurrentBlockchainPeaks`.
2025
+ * Serialized MMR peaks at the new sync height. The only peaks persisted by the
2026
+ * client (peaks for intermediate note blocks are never read, so they are not stored).
2066
2027
  */
2067
- partialBlockchainPeaks: Uint8Array;
2028
+ newPeaks: Uint8Array;
2068
2029
  /**
2069
2030
  * Input notes for this state update in serialized form.
2070
2031
  */
@@ -2121,6 +2082,13 @@ export class JsStorageSlot {
2121
2082
  private constructor();
2122
2083
  free(): void;
2123
2084
  [Symbol.dispose](): void;
2085
+ /**
2086
+ * The storage patch operation (create, update, or remove).
2087
+ *
2088
+ * Full-state writes do not inspect this field, but incremental writes use it to distinguish
2089
+ * map replacement/removal from an entry-wise update.
2090
+ */
2091
+ patchOperation: number;
2124
2092
  /**
2125
2093
  * The name of the storage slot.
2126
2094
  */
@@ -2186,44 +2154,6 @@ export class MerklePath {
2186
2154
  verify(index: bigint, node: Word, root: Word): boolean;
2187
2155
  }
2188
2156
 
2189
- /**
2190
- * Targets a note at a public network account so the operator auto-consumes it.
2191
- *
2192
- * A note is a network note when it is `Public` and carries a valid
2193
- * `NetworkAccountTarget` attachment (see `Note.isNetworkNote`).
2194
- */
2195
- export class NetworkAccountTarget {
2196
- free(): void;
2197
- [Symbol.dispose](): void;
2198
- /**
2199
- * Returns the note execution hint.
2200
- */
2201
- executionHint(): NoteExecutionHint;
2202
- /**
2203
- * Decodes a `NoteAttachment` back into a `NetworkAccountTarget`.
2204
- *
2205
- * # Errors
2206
- * Errors if the attachment is not a valid network-account-target attachment.
2207
- */
2208
- static fromAttachment(attachment: NoteAttachment): NetworkAccountTarget;
2209
- /**
2210
- * Creates a target for the given network account. `executionHint` defaults
2211
- * to `NoteExecutionHint.always()`.
2212
- *
2213
- * # Errors
2214
- * Errors if `account_id` is not a public account.
2215
- */
2216
- constructor(account_id: AccountId, execution_hint?: NoteExecutionHint | null);
2217
- /**
2218
- * Returns the targeted network account id.
2219
- */
2220
- targetId(): AccountId;
2221
- /**
2222
- * Encodes this target as a `NoteAttachment`.
2223
- */
2224
- toAttachment(): NoteAttachment;
2225
- }
2226
-
2227
2157
  /**
2228
2158
  * The identifier of a Miden network.
2229
2159
  */
@@ -2304,10 +2234,6 @@ export class Note {
2304
2234
  * Returns the assets locked inside the note.
2305
2235
  */
2306
2236
  assets(): NoteAssets;
2307
- /**
2308
- * Returns the note's attachments.
2309
- */
2310
- attachments(): NoteAttachment[];
2311
2237
  /**
2312
2238
  * Returns the commitment to the note (its ID).
2313
2239
  *
@@ -2317,16 +2243,6 @@ export class Note {
2317
2243
  * unchanged.
2318
2244
  */
2319
2245
  commitment(): Word;
2320
- /**
2321
- * Builds a B2AGG (Bridge-to-AggLayer) note that bridges the given assets out to another
2322
- * network via the `AggLayer`.
2323
- *
2324
- * The note is always public and is consumed by `bridge_account`, which burns the assets so
2325
- * they can be claimed on the destination network at `destination_address` (an Ethereum
2326
- * address on the AggLayer-assigned `destination_network`). The assets must be fungible assets
2327
- * issued by a network faucet.
2328
- */
2329
- static createB2AggNote(sender: AccountId, bridge_account: AccountId, assets: NoteAssets, destination_network: number, destination_address: EthAddress): Note;
2330
2246
  /**
2331
2247
  * Builds a P2IDE note that can be reclaimed or timelocked based on block heights.
2332
2248
  */
@@ -2343,11 +2259,6 @@ export class Note {
2343
2259
  * Returns the unique identifier of the note.
2344
2260
  */
2345
2261
  id(): NoteId;
2346
- /**
2347
- * Returns true if the note is a network note (public + a valid
2348
- * `NetworkAccountTarget` attachment).
2349
- */
2350
- isNetworkNote(): boolean;
2351
2262
  /**
2352
2263
  * Returns the public metadata associated with the note.
2353
2264
  */
@@ -2376,14 +2287,6 @@ export class Note {
2376
2287
  * Serializes the note into bytes.
2377
2288
  */
2378
2289
  serialize(): Uint8Array;
2379
- /**
2380
- * Creates a note carrying the provided attachments, using the metadata's
2381
- * sender / note type / tag (attachments on the metadata itself are ignored).
2382
- *
2383
- * # Errors
2384
- * Errors if the attachment set is invalid (too many attachments or words).
2385
- */
2386
- static withAttachments(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient, attachments: NoteAttachment[]): Note;
2387
2290
  }
2388
2291
 
2389
2292
  export class NoteAndArgs {
@@ -2735,12 +2638,20 @@ export class NoteFile {
2735
2638
  * return it as a struct.
2736
2639
  */
2737
2640
  static deserialize(bytes: Uint8Array): NoteFile;
2641
+ /**
2642
+ * Creates an expected-note file with the sync hint required by miden-client 0.16.
2643
+ */
2644
+ static fromExpectedNote(note_details: NoteDetails, note_tag: NoteTag, after_block_num: number): NoteFile;
2738
2645
  /**
2739
2646
  * Creates a `NoteFile` from an input note, preserving proof when available.
2740
2647
  */
2741
2648
  static fromInputNote(note: InputNote): NoteFile;
2742
2649
  /**
2743
- * Creates a `NoteFile` from note details.
2650
+ * Creates a `NoteFile` from note details using a zero-valued sync hint.
2651
+ *
2652
+ * miden-client 0.16 requires every expected note to include a tag and an after-block hint.
2653
+ * This retains the old one-argument JS API by using block zero and the default tag. Prefer
2654
+ * [`from_expected_note`](Self::from_expected_note) when the real sync hint is available.
2744
2655
  */
2745
2656
  static fromNoteDetails(note_details: NoteDetails): NoteFile;
2746
2657
  /**
@@ -2990,11 +2901,6 @@ export class NoteRecipient {
2990
2901
  * Returns the digest of the recipient data (used in the note commitment).
2991
2902
  */
2992
2903
  digest(): Word;
2993
- /**
2994
- * Creates a recipient from a script and storage, generating a fresh random
2995
- * serial number (the secret that prevents double-spends).
2996
- */
2997
- static fromScript(note_script: NoteScript, storage: NoteStorage): NoteRecipient;
2998
2904
  /**
2999
2905
  * Creates a note recipient from its serial number, script, and storage.
3000
2906
  */
@@ -3290,12 +3196,6 @@ export class OutputNoteRecord {
3290
3196
  * Returns true if the note has been consumed on chain.
3291
3197
  */
3292
3198
  isConsumed(): boolean;
3293
- /**
3294
- * Returns true while the note's on-chain inclusion is still unsettled
3295
- * (`ExpectedFull` or `ExpectedPartial`), i.e. while sync is the mechanism
3296
- * that can advance this record.
3297
- */
3298
- isInclusionPending(): boolean;
3299
3199
  /**
3300
3200
  * Returns the note metadata.
3301
3201
  */
@@ -3483,67 +3383,6 @@ export class ProvenTransaction {
3483
3383
  serialize(): Uint8Array;
3484
3384
  }
3485
3385
 
3486
- /**
3487
- * Read-only view of one PSWAP order's chain state, exposed to JavaScript.
3488
- * The mutable fields (remaining amounts, depth, tip, state) advance
3489
- * round-by-round as fills are discovered during sync.
3490
- */
3491
- export class PswapLineageRecord {
3492
- private constructor();
3493
- free(): void;
3494
- [Symbol.dispose](): void;
3495
- /**
3496
- * Account that created the order and receives every payback.
3497
- */
3498
- creatorAccountId(): AccountId;
3499
- /**
3500
- * Depth of the current tip: 0 for the original PSWAP, +1 per fill round.
3501
- */
3502
- currentDepth(): number;
3503
- /**
3504
- * Note id of the current tip in the chain.
3505
- */
3506
- currentTipNoteId(): NoteId;
3507
- /**
3508
- * Stable identifier shared by every note in the chain, as a decimal string.
3509
- */
3510
- orderId(): string;
3511
- /**
3512
- * Offered amount still unfilled on the current tip. The offered faucet is
3513
- * chain-invariant and recovered from the original PSWAP note when needed.
3514
- */
3515
- remainingOffered(): bigint;
3516
- /**
3517
- * Requested amount still outstanding on the current tip. The requested
3518
- * faucet is recovered from the original PSWAP note when needed.
3519
- */
3520
- remainingRequested(): bigint;
3521
- /**
3522
- * Lifecycle state of the order.
3523
- */
3524
- state(): PswapLineageState;
3525
- }
3526
-
3527
- /**
3528
- * Lifecycle state of a PSWAP order.
3529
- *
3530
- * Discriminants match the on-disk encoding in the store.
3531
- */
3532
- export enum PswapLineageState {
3533
- /**
3534
- * Still fillable and reclaimable.
3535
- */
3536
- Active = 0,
3537
- /**
3538
- * Fully filled. Terminal.
3539
- */
3540
- FullyFilled = 1,
3541
- /**
3542
- * Reclaimed by the creator. Terminal.
3543
- */
3544
- Reclaimed = 2,
3545
- }
3546
-
3547
3386
  export class PublicKey {
3548
3387
  private constructor();
3549
3388
  free(): void;
@@ -3944,7 +3783,7 @@ export class StorageMapEntryJs {
3944
3783
  * Information about storage map updates for an account, as returned by the
3945
3784
  * `syncStorageMaps` RPC endpoint.
3946
3785
  *
3947
- * Contains the list of storage map updates within the requested block range,
3786
+ * Contains the storage map entries merged over the requested block range,
3948
3787
  * along with the chain tip and last processed block number.
3949
3788
  */
3950
3789
  export class StorageMapInfo {
@@ -3966,15 +3805,15 @@ export class StorageMapInfo {
3966
3805
  }
3967
3806
 
3968
3807
  /**
3969
- * A single storage map update entry, containing the block number, slot name,
3970
- * key, and new value.
3808
+ * A merged storage map entry containing the last processed block number, slot name, key, and
3809
+ * final value. The node no longer exposes the individual block number for each update.
3971
3810
  */
3972
3811
  export class StorageMapUpdate {
3973
3812
  private constructor();
3974
3813
  free(): void;
3975
3814
  [Symbol.dispose](): void;
3976
3815
  /**
3977
- * Returns the block number in which this update occurred.
3816
+ * Returns the last processed block number for the merged response.
3978
3817
  */
3979
3818
  blockNum(): number;
3980
3819
  /**
@@ -4320,10 +4159,6 @@ export class TransactionRequest {
4320
4159
  private constructor();
4321
4160
  free(): void;
4322
4161
  [Symbol.dispose](): void;
4323
- /**
4324
- * Returns a copy of the advice map carried by this request.
4325
- */
4326
- adviceMap(): AdviceMap;
4327
4162
  /**
4328
4163
  * Returns the authentication argument if present.
4329
4164
  */
@@ -4340,14 +4175,6 @@ export class TransactionRequest {
4340
4175
  * Returns output notes created by the sender account.
4341
4176
  */
4342
4177
  expectedOutputOwnNotes(): Note[];
4343
- /**
4344
- * Returns a copy of this request with `advice_map` merged into its advice map.
4345
- *
4346
- * Entries are merged with last-write-wins semantics: a key already present in the request is
4347
- * overwritten by the value from `advice_map`. Use this to inject advice (e.g. a signature
4348
- * produced by an external signer) after the request has already been built.
4349
- */
4350
- extendAdviceMap(advice_map: AdviceMap): TransactionRequest;
4351
4178
  /**
4352
4179
  * Returns the transaction script argument if present.
4353
4180
  */
@@ -4564,9 +4391,9 @@ export class TransactionStoreUpdate {
4564
4391
  free(): void;
4565
4392
  [Symbol.dispose](): void;
4566
4393
  /**
4567
- * Returns the account delta applied by the transaction.
4394
+ * Returns the absolute account patch applied by the transaction.
4568
4395
  */
4569
- accountDelta(): AccountDelta;
4396
+ accountPatch(): AccountPatch;
4570
4397
  /**
4571
4398
  * Returns the output notes created by the transaction.
4572
4399
  */
@@ -4652,22 +4479,7 @@ export class WebClient {
4652
4479
  accountReader(account_id: AccountId): Promise<AccountReader>;
4653
4480
  addAccountSecretKeyToWebStore(account_id: AccountId, secret_key: AuthSecretKey): Promise<void>;
4654
4481
  addTag(tag: string): Promise<void>;
4655
- /**
4656
- * Persists a submitted transaction and returns its pre-apply
4657
- * [`TransactionStoreUpdate`]. Routes through the high-level
4658
- * `Client::apply_transaction` so registered observers (e.g. PSWAP
4659
- * tracking) fire.
4660
- */
4661
4482
  applyTransaction(transaction_result: TransactionResult, submission_height: number): Promise<TransactionStoreUpdate>;
4662
- /**
4663
- * Builds a transaction reclaiming the unfilled offered asset on the current
4664
- * tip of an Active lineage.
4665
- *
4666
- * `order_id` is the order's stable identifier as a decimal string. The
4667
- * returned request flows into the same submit path as the other PSWAP
4668
- * cancel transactions.
4669
- */
4670
- buildPswapCancelByOrder(order_id: string): Promise<TransactionRequest>;
4671
4483
  static buildSwapTag(note_type: NoteType, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint): NoteTag;
4672
4484
  /**
4673
4485
  * Creates a new `WebClient` instance with the specified configuration.
@@ -4679,11 +4491,8 @@ export class WebClient {
4679
4491
  * * `store_name`: Optional name for the web store. If `None`, the store name defaults to
4680
4492
  * `MidenClientDB_{network_id}`, where `network_id` is derived from the `node_url`.
4681
4493
  * Explicitly setting this allows for creating multiple isolated clients.
4682
- * * `debug_mode`: Optional flag to enable debug mode for transaction execution. When enabled,
4683
- * the transaction executor records additional information useful for debugging. Defaults to
4684
- * disabled.
4685
4494
  */
4686
- createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null, debug_mode?: boolean | null): Promise<any>;
4495
+ createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null): Promise<any>;
4687
4496
  /**
4688
4497
  * Creates a new `WebClient` instance with external keystore callbacks.
4689
4498
  *
@@ -4697,10 +4506,8 @@ export class WebClient {
4697
4506
  * * `get_key_cb`: Callback to retrieve the secret key bytes for a given public key.
4698
4507
  * * `insert_key_cb`: Callback to persist a secret key.
4699
4508
  * * `sign_cb`: Callback to produce serialized signature bytes for the provided inputs.
4700
- * * `debug_mode`: Optional flag to enable debug mode for transaction execution. Defaults to
4701
- * disabled.
4702
4509
  */
4703
- createClientWithExternalKeystore(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null, get_key_cb?: Function | null, insert_key_cb?: Function | null, sign_cb?: Function | null, debug_mode?: boolean | null): Promise<any>;
4510
+ createClientWithExternalKeystore(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null, get_key_cb?: Function | null, insert_key_cb?: Function | null, sign_cb?: Function | null): Promise<any>;
4704
4511
  createCodeBuilder(): Promise<CodeBuilder>;
4705
4512
  /**
4706
4513
  * Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept
@@ -4708,14 +4515,18 @@ export class WebClient {
4708
4515
  */
4709
4516
  createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<string>;
4710
4517
  /**
4711
- * Executes a transaction and returns the `TransactionSummary`.
4518
+ * Executes a transaction and returns the `TransactionSummary` the account is being asked
4519
+ * to authorize.
4712
4520
  *
4713
- * If the transaction is unauthorized (auth script emits the unauthorized event),
4714
- * returns the summary from the error. If the transaction succeeds, constructs
4715
- * a summary from the executed transaction using the `auth_arg` from the transaction
4716
- * request as the salt (or a zero salt if not provided).
4521
+ * The summary only exists while authorization is pending: when the auth procedure aborts
4522
+ * with the unauthorized event (e.g. a multisig below its signing threshold), the summary
4523
+ * built during execution is returned so it can be signed out-of-band. If the transaction
4524
+ * executes successfully it was already fully authorized, no summary is produced, and this
4525
+ * method returns an error with code `TRANSACTION_ALREADY_AUTHORIZED` — submit the
4526
+ * transaction with `execute` instead.
4717
4527
  *
4718
4528
  * # Errors
4529
+ * - If the transaction executes successfully (error code `TRANSACTION_ALREADY_AUTHORIZED`).
4719
4530
  * - If there is an internal failure during execution.
4720
4531
  */
4721
4532
  executeForSummary(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionSummary>;
@@ -4793,20 +4604,6 @@ export class WebClient {
4793
4604
  getInputNotes(filter: NoteFilter): Promise<InputNoteRecord[]>;
4794
4605
  getOutputNote(note_id: string): Promise<OutputNoteRecord>;
4795
4606
  getOutputNotes(filter: NoteFilter): Promise<OutputNoteRecord[]>;
4796
- /**
4797
- * Returns the lineage for one order, or `null` if not tracked.
4798
- *
4799
- * `order_id` is the order's stable identifier as a decimal string.
4800
- */
4801
- getPswapLineage(order_id: string): Promise<PswapLineageRecord | undefined>;
4802
- /**
4803
- * Returns every PSWAP lineage tracked by this client.
4804
- */
4805
- getPswapLineages(): Promise<PswapLineageRecord[]>;
4806
- /**
4807
- * Returns lineages created by a specific local account.
4808
- */
4809
- getPswapLineagesFor(creator: AccountId): Promise<PswapLineageRecord[]>;
4810
4607
  /**
4811
4608
  * Returns all public key commitments associated with the given account ID.
4812
4609
  *
@@ -4825,10 +4622,10 @@ export class WebClient {
4825
4622
  /**
4826
4623
  * Imports a note file and returns the imported note's identifier.
4827
4624
  *
4828
- * A note file that carries metadata — an explicit `NoteId` or a full note
4829
- * with proof — resolves to a concrete `NoteId`, which is returned so the
4830
- * caller can look the note up with [`get_input_note`]. A details-only file
4831
- * (`NoteDetails`) has no metadata and therefore no `NoteId` yet, so its
4625
+ * A note file that carries metadata — an explicit `NoteId` or a committed
4626
+ * note with proof — resolves to a concrete `NoteId`, which is returned so
4627
+ * the caller can look the note up with [`get_input_note`]. An expected-note
4628
+ * file has no metadata and therefore no `NoteId` yet, so its
4832
4629
  * metadata-independent details commitment is returned instead.
4833
4630
  *
4834
4631
  * Migration note (miden-client PR #2214): `Client::import_notes` now
@@ -4878,16 +4675,6 @@ export class WebClient {
4878
4675
  * but callers only need a single await instead of two.
4879
4676
  */
4880
4677
  newAccountWithSecretKey(account: Account, secret_key: AuthSecretKey): Promise<void>;
4881
- /**
4882
- * Builds a transaction request that bridges a fungible asset out to another network via the
4883
- * `AggLayer`.
4884
- *
4885
- * The request emits a single public B2AGG (Bridge-to-AggLayer) note holding `amount` units of
4886
- * the `faucet_id` asset. The note is consumed by `bridge_account_id`, which burns the asset so
4887
- * it can be claimed at `destination_address` (an Ethereum address) on the AggLayer-assigned
4888
- * `destination_network`.
4889
- */
4890
- newB2AggTransactionRequest(sender_account_id: AccountId, bridge_account_id: AccountId, faucet_id: AccountId, amount: bigint, destination_network: number, destination_address: EthAddress): Promise<TransactionRequest>;
4891
4678
  newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
4892
4679
  /**
4893
4680
  * Creates, persists, and returns a new fungible faucet account.
@@ -4963,16 +4750,6 @@ export class WebClient {
4963
4750
  * the chain tip is performed, and the required block header is retrieved.
4964
4751
  */
4965
4752
  submitNewTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionId>;
4966
- /**
4967
- * Executes a batch of transactions against the specified account, proves them individually
4968
- * and as a batch, submits the batch to the network, and atomically applies the per-tx
4969
- * updates to the local store. Returns the block number the batch was accepted into.
4970
- *
4971
- * All transactions must target the same local account — the `account_id` argument.
4972
- * Each element of `transaction_requests` is the serialized-bytes form of a
4973
- * `TransactionRequest` (obtained via `tx_request.serialize()`)
4974
- */
4975
- submitNewTransactionBatch(account_id: AccountId, transaction_requests: Uint8Array[]): Promise<number>;
4976
4753
  /**
4977
4754
  * Executes a transaction specified by the request against the specified account, proves it
4978
4755
  * with the user provided prover, submits it to the network, and updates the local database.