@miden-sdk/miden-sdk 0.15.6 → 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.
- package/README.md +0 -137
- package/dist/mt/{workers/Cargo-mvyTli7g-BwMMSyoq.js → Cargo-DKsyWYgG.js} +699 -1202
- package/dist/mt/Cargo-DKsyWYgG.js.map +1 -0
- package/dist/mt/api-types.d.ts +38 -250
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +179 -370
- package/dist/mt/docs-entry.d.ts +3 -6
- package/dist/mt/eager.js +1 -1
- package/dist/mt/index.d.ts +0 -3
- package/dist/mt/index.js +49 -450
- package/dist/mt/index.js.map +1 -1
- package/dist/mt/wasm.js +1 -1
- package/dist/mt/workerHelpers.js +1 -1
- package/dist/mt/{Cargo-mvyTli7g.js → workers/Cargo-DKsyWYgG-DfOhgt23.js} +700 -1201
- package/dist/mt/workers/Cargo-DKsyWYgG-DfOhgt23.js.map +1 -0
- package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
- package/dist/mt/workers/web-client-methods-worker.js +703 -1207
- package/dist/mt/workers/web-client-methods-worker.js.map +1 -1
- package/dist/mt/workers/web-client-methods-worker.module.js +1 -1
- package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -1
- package/dist/mt/workers/workerHelpers.js +1 -1
- package/dist/st/{workers/Cargo-Cysp4vto-BIw-TeJn.js → Cargo-LwITdlzJ.js} +694 -1195
- package/dist/st/Cargo-LwITdlzJ.js.map +1 -0
- package/dist/st/api-types.d.ts +38 -250
- package/dist/st/assets/miden_client_web.wasm +0 -0
- package/dist/st/crates/miden_client_web.d.ts +179 -370
- package/dist/st/docs-entry.d.ts +3 -6
- package/dist/st/eager.js +1 -1
- package/dist/st/index.d.ts +0 -3
- package/dist/st/index.js +49 -450
- package/dist/st/index.js.map +1 -1
- package/dist/st/wasm.js +1 -1
- package/dist/st/{Cargo-Cysp4vto.js → workers/Cargo-LwITdlzJ-Dyl2bCwN.js} +695 -1194
- package/dist/st/workers/Cargo-LwITdlzJ-Dyl2bCwN.js.map +1 -0
- package/dist/st/workers/assets/miden_client_web.wasm +0 -0
- package/dist/st/workers/web-client-methods-worker.js +698 -1200
- package/dist/st/workers/web-client-methods-worker.js.map +1 -1
- package/dist/st/workers/web-client-methods-worker.module.js +1 -1
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -1
- package/js/client.js +2 -4
- package/js/node/client-factory.js +4 -11
- package/js/node/napi-compat.js +1 -0
- package/js/node-index.js +11 -10
- package/js/resources/compiler.js +23 -12
- package/js/resources/transactions.js +20 -289
- package/js/standalone.js +3 -61
- package/package.json +4 -4
- package/dist/mt/Cargo-mvyTli7g.js.map +0 -1
- package/dist/mt/workers/Cargo-mvyTli7g-BwMMSyoq.js.map +0 -1
- package/dist/st/Cargo-Cysp4vto.js.map +0 -1
- package/dist/st/workers/Cargo-Cysp4vto-BIw-TeJn.js.map +0 -1
- 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 `
|
|
298
|
-
*
|
|
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
|
|
301
|
+
* Returns the storage patch (storage changes are absolute in both models).
|
|
327
302
|
*/
|
|
328
|
-
storage():
|
|
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
|
*/
|
|
@@ -1002,13 +1041,10 @@ export class AuthSecretKey {
|
|
|
1002
1041
|
}
|
|
1003
1042
|
|
|
1004
1043
|
/**
|
|
1005
|
-
* Provides metadata for a fungible faucet account component.
|
|
1044
|
+
* Provides metadata for a basic fungible faucet account component.
|
|
1006
1045
|
*
|
|
1007
|
-
* Reads the on-chain `FungibleFaucet` component for the account, which holds the
|
|
1008
|
-
* info (symbol
|
|
1009
|
-
* "basic" public faucets and network-style faucets — in the current protocol the distinction is
|
|
1010
|
-
* a function of the surrounding account configuration (account type, auth, access control), not
|
|
1011
|
-
* 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).
|
|
1012
1048
|
*/
|
|
1013
1049
|
export class BasicFungibleFaucetComponent {
|
|
1014
1050
|
private constructor();
|
|
@@ -1018,22 +1054,10 @@ export class BasicFungibleFaucetComponent {
|
|
|
1018
1054
|
* Returns the number of decimal places for the token.
|
|
1019
1055
|
*/
|
|
1020
1056
|
decimals(): number;
|
|
1021
|
-
/**
|
|
1022
|
-
* Returns the optional free-form token description, or `undefined` when unset.
|
|
1023
|
-
*/
|
|
1024
|
-
description(): string | undefined;
|
|
1025
|
-
/**
|
|
1026
|
-
* Returns the optional external link (e.g. project website), or `undefined` when unset.
|
|
1027
|
-
*/
|
|
1028
|
-
externalLink(): string | undefined;
|
|
1029
1057
|
/**
|
|
1030
1058
|
* Extracts faucet metadata from an account.
|
|
1031
1059
|
*/
|
|
1032
1060
|
static fromAccount(account: Account): BasicFungibleFaucetComponent;
|
|
1033
|
-
/**
|
|
1034
|
-
* Returns the optional token logo URI, or `undefined` when unset.
|
|
1035
|
-
*/
|
|
1036
|
-
logoUri(): string | undefined;
|
|
1037
1061
|
/**
|
|
1038
1062
|
* Returns the maximum token supply.
|
|
1039
1063
|
*/
|
|
@@ -1042,14 +1066,6 @@ export class BasicFungibleFaucetComponent {
|
|
|
1042
1066
|
* Returns the faucet's token symbol.
|
|
1043
1067
|
*/
|
|
1044
1068
|
symbol(): TokenSymbol;
|
|
1045
|
-
/**
|
|
1046
|
-
* Returns the human-readable token name.
|
|
1047
|
-
*/
|
|
1048
|
-
tokenName(): string;
|
|
1049
|
-
/**
|
|
1050
|
-
* Returns the current token supply (the amount minted so far).
|
|
1051
|
-
*/
|
|
1052
|
-
tokenSupply(): Felt;
|
|
1053
1069
|
}
|
|
1054
1070
|
|
|
1055
1071
|
/**
|
|
@@ -1156,6 +1172,13 @@ export class CodeBuilder {
|
|
|
1156
1172
|
* with the available modules under this builder. Returns the compiled account component code.
|
|
1157
1173
|
*/
|
|
1158
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;
|
|
1159
1182
|
/**
|
|
1160
1183
|
* Given a Note Script's source code, compiles it with the available
|
|
1161
1184
|
* modules under this builder. Returns the compiled script.
|
|
@@ -1166,6 +1189,13 @@ export class CodeBuilder {
|
|
|
1166
1189
|
* modules under this builder. Returns the compiled script.
|
|
1167
1190
|
*/
|
|
1168
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;
|
|
1169
1199
|
/**
|
|
1170
1200
|
* This is useful to dynamically link the {@link Library} of a foreign account
|
|
1171
1201
|
* that is invoked using foreign procedure invocation (FPI). Its code is available
|
|
@@ -1180,6 +1210,13 @@ export class CodeBuilder {
|
|
|
1180
1210
|
* statically link it for use with scripts to be built with this builder.
|
|
1181
1211
|
*/
|
|
1182
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;
|
|
1183
1220
|
/**
|
|
1184
1221
|
* Statically links the given library.
|
|
1185
1222
|
*
|
|
@@ -1300,50 +1337,13 @@ export class Endpoint {
|
|
|
1300
1337
|
readonly protocol: string;
|
|
1301
1338
|
}
|
|
1302
1339
|
|
|
1303
|
-
/**
|
|
1304
|
-
* A 20-byte Ethereum address, used as the destination of an `AggLayer` bridge-out (B2AGG) note.
|
|
1305
|
-
*
|
|
1306
|
-
* Construct one from a hex string with [`EthAddress::from_hex`] (the `0x` prefix is optional) or
|
|
1307
|
-
* from raw bytes with [`EthAddress::from_bytes`]. The canonical lowercase, `0x`-prefixed hex form
|
|
1308
|
-
* is available via [`EthAddress::to_hex`] (also exposed as `toString`).
|
|
1309
|
-
*/
|
|
1310
|
-
export class EthAddress {
|
|
1311
|
-
private constructor();
|
|
1312
|
-
free(): void;
|
|
1313
|
-
[Symbol.dispose](): void;
|
|
1314
|
-
/**
|
|
1315
|
-
* Builds an Ethereum address from its raw 20-byte big-endian representation.
|
|
1316
|
-
*
|
|
1317
|
-
* Returns an error if the input is not exactly 20 bytes long.
|
|
1318
|
-
*/
|
|
1319
|
-
static fromBytes(bytes: Uint8Array): EthAddress;
|
|
1320
|
-
/**
|
|
1321
|
-
* Builds an Ethereum address from a hex string (with or without the `0x` prefix).
|
|
1322
|
-
*
|
|
1323
|
-
* Returns an error if the string is not valid hex or does not encode exactly 20 bytes.
|
|
1324
|
-
*/
|
|
1325
|
-
static fromHex(hex: string): EthAddress;
|
|
1326
|
-
/**
|
|
1327
|
-
* Returns the raw 20-byte big-endian representation of the address.
|
|
1328
|
-
*/
|
|
1329
|
-
toBytes(): Uint8Array;
|
|
1330
|
-
/**
|
|
1331
|
-
* Returns the canonical lowercase, `0x`-prefixed hex representation of the address.
|
|
1332
|
-
*/
|
|
1333
|
-
toHex(): string;
|
|
1334
|
-
/**
|
|
1335
|
-
* Returns the canonical lowercase, `0x`-prefixed hex representation of the address.
|
|
1336
|
-
*/
|
|
1337
|
-
toString(): string;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
1340
|
/**
|
|
1341
1341
|
* Describes the result of executing a transaction program for the Miden protocol.
|
|
1342
1342
|
*
|
|
1343
1343
|
* Executed transaction serves two primary purposes:
|
|
1344
1344
|
* - It contains a complete description of the effects of the transaction. Specifically, it
|
|
1345
|
-
* contains all output notes created as the result of the transaction and
|
|
1346
|
-
*
|
|
1345
|
+
* contains all output notes created as the result of the transaction and the absolute-valued
|
|
1346
|
+
* account patch produced by execution.
|
|
1347
1347
|
* - It contains all the information required to re-execute and prove the transaction in a
|
|
1348
1348
|
* stateless manner. This includes all public transaction inputs, but also all nondeterministic
|
|
1349
1349
|
* inputs that the host provided to Miden VM while executing the transaction (i.e., advice
|
|
@@ -1353,14 +1353,14 @@ export class ExecutedTransaction {
|
|
|
1353
1353
|
private constructor();
|
|
1354
1354
|
free(): void;
|
|
1355
1355
|
[Symbol.dispose](): void;
|
|
1356
|
-
/**
|
|
1357
|
-
* Returns the account delta resulting from execution.
|
|
1358
|
-
*/
|
|
1359
|
-
accountDelta(): AccountDelta;
|
|
1360
1356
|
/**
|
|
1361
1357
|
* Returns the account the transaction was executed against.
|
|
1362
1358
|
*/
|
|
1363
1359
|
accountId(): AccountId;
|
|
1360
|
+
/**
|
|
1361
|
+
* Returns the absolute account patch resulting from execution.
|
|
1362
|
+
*/
|
|
1363
|
+
accountPatch(): AccountPatch;
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Returns the block header that included the transaction.
|
|
1366
1366
|
*/
|
|
@@ -1786,12 +1786,6 @@ export class InputNoteRecord {
|
|
|
1786
1786
|
* Returns true if the note has already been consumed.
|
|
1787
1787
|
*/
|
|
1788
1788
|
isConsumed(): boolean;
|
|
1789
|
-
/**
|
|
1790
|
-
* Returns true while the note's on-chain inclusion is still unsettled
|
|
1791
|
-
* (`Expected` or `Unverified`), i.e. while sync is the mechanism that can
|
|
1792
|
-
* advance this record.
|
|
1793
|
-
*/
|
|
1794
|
-
isInclusionPending(): boolean;
|
|
1795
1789
|
/**
|
|
1796
1790
|
* Returns true if the note is currently being processed.
|
|
1797
1791
|
*/
|
|
@@ -2028,11 +2022,10 @@ export class JsStateSyncUpdate {
|
|
|
2028
2022
|
*/
|
|
2029
2023
|
newBlockNums: Uint32Array;
|
|
2030
2024
|
/**
|
|
2031
|
-
* Serialized MMR peaks at the new sync height
|
|
2032
|
-
*
|
|
2033
|
-
* `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).
|
|
2034
2027
|
*/
|
|
2035
|
-
|
|
2028
|
+
newPeaks: Uint8Array;
|
|
2036
2029
|
/**
|
|
2037
2030
|
* Input notes for this state update in serialized form.
|
|
2038
2031
|
*/
|
|
@@ -2089,6 +2082,13 @@ export class JsStorageSlot {
|
|
|
2089
2082
|
private constructor();
|
|
2090
2083
|
free(): void;
|
|
2091
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;
|
|
2092
2092
|
/**
|
|
2093
2093
|
* The name of the storage slot.
|
|
2094
2094
|
*/
|
|
@@ -2154,44 +2154,6 @@ export class MerklePath {
|
|
|
2154
2154
|
verify(index: bigint, node: Word, root: Word): boolean;
|
|
2155
2155
|
}
|
|
2156
2156
|
|
|
2157
|
-
/**
|
|
2158
|
-
* Targets a note at a public network account so the operator auto-consumes it.
|
|
2159
|
-
*
|
|
2160
|
-
* A note is a network note when it is `Public` and carries a valid
|
|
2161
|
-
* `NetworkAccountTarget` attachment (see `Note.isNetworkNote`).
|
|
2162
|
-
*/
|
|
2163
|
-
export class NetworkAccountTarget {
|
|
2164
|
-
free(): void;
|
|
2165
|
-
[Symbol.dispose](): void;
|
|
2166
|
-
/**
|
|
2167
|
-
* Returns the note execution hint.
|
|
2168
|
-
*/
|
|
2169
|
-
executionHint(): NoteExecutionHint;
|
|
2170
|
-
/**
|
|
2171
|
-
* Decodes a `NoteAttachment` back into a `NetworkAccountTarget`.
|
|
2172
|
-
*
|
|
2173
|
-
* # Errors
|
|
2174
|
-
* Errors if the attachment is not a valid network-account-target attachment.
|
|
2175
|
-
*/
|
|
2176
|
-
static fromAttachment(attachment: NoteAttachment): NetworkAccountTarget;
|
|
2177
|
-
/**
|
|
2178
|
-
* Creates a target for the given network account. `executionHint` defaults
|
|
2179
|
-
* to `NoteExecutionHint.always()`.
|
|
2180
|
-
*
|
|
2181
|
-
* # Errors
|
|
2182
|
-
* Errors if `account_id` is not a public account.
|
|
2183
|
-
*/
|
|
2184
|
-
constructor(account_id: AccountId, execution_hint?: NoteExecutionHint | null);
|
|
2185
|
-
/**
|
|
2186
|
-
* Returns the targeted network account id.
|
|
2187
|
-
*/
|
|
2188
|
-
targetId(): AccountId;
|
|
2189
|
-
/**
|
|
2190
|
-
* Encodes this target as a `NoteAttachment`.
|
|
2191
|
-
*/
|
|
2192
|
-
toAttachment(): NoteAttachment;
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
2157
|
/**
|
|
2196
2158
|
* The identifier of a Miden network.
|
|
2197
2159
|
*/
|
|
@@ -2272,10 +2234,6 @@ export class Note {
|
|
|
2272
2234
|
* Returns the assets locked inside the note.
|
|
2273
2235
|
*/
|
|
2274
2236
|
assets(): NoteAssets;
|
|
2275
|
-
/**
|
|
2276
|
-
* Returns the note's attachments.
|
|
2277
|
-
*/
|
|
2278
|
-
attachments(): NoteAttachment[];
|
|
2279
2237
|
/**
|
|
2280
2238
|
* Returns the commitment to the note (its ID).
|
|
2281
2239
|
*
|
|
@@ -2285,16 +2243,6 @@ export class Note {
|
|
|
2285
2243
|
* unchanged.
|
|
2286
2244
|
*/
|
|
2287
2245
|
commitment(): Word;
|
|
2288
|
-
/**
|
|
2289
|
-
* Builds a B2AGG (Bridge-to-AggLayer) note that bridges the given assets out to another
|
|
2290
|
-
* network via the `AggLayer`.
|
|
2291
|
-
*
|
|
2292
|
-
* The note is always public and is consumed by `bridge_account`, which burns the assets so
|
|
2293
|
-
* they can be claimed on the destination network at `destination_address` (an Ethereum
|
|
2294
|
-
* address on the AggLayer-assigned `destination_network`). The assets must be fungible assets
|
|
2295
|
-
* issued by a network faucet.
|
|
2296
|
-
*/
|
|
2297
|
-
static createB2AggNote(sender: AccountId, bridge_account: AccountId, assets: NoteAssets, destination_network: number, destination_address: EthAddress): Note;
|
|
2298
2246
|
/**
|
|
2299
2247
|
* Builds a P2IDE note that can be reclaimed or timelocked based on block heights.
|
|
2300
2248
|
*/
|
|
@@ -2311,11 +2259,6 @@ export class Note {
|
|
|
2311
2259
|
* Returns the unique identifier of the note.
|
|
2312
2260
|
*/
|
|
2313
2261
|
id(): NoteId;
|
|
2314
|
-
/**
|
|
2315
|
-
* Returns true if the note is a network note (public + a valid
|
|
2316
|
-
* `NetworkAccountTarget` attachment).
|
|
2317
|
-
*/
|
|
2318
|
-
isNetworkNote(): boolean;
|
|
2319
2262
|
/**
|
|
2320
2263
|
* Returns the public metadata associated with the note.
|
|
2321
2264
|
*/
|
|
@@ -2344,14 +2287,6 @@ export class Note {
|
|
|
2344
2287
|
* Serializes the note into bytes.
|
|
2345
2288
|
*/
|
|
2346
2289
|
serialize(): Uint8Array;
|
|
2347
|
-
/**
|
|
2348
|
-
* Creates a note carrying the provided attachments, using the metadata's
|
|
2349
|
-
* sender / note type / tag (attachments on the metadata itself are ignored).
|
|
2350
|
-
*
|
|
2351
|
-
* # Errors
|
|
2352
|
-
* Errors if the attachment set is invalid (too many attachments or words).
|
|
2353
|
-
*/
|
|
2354
|
-
static withAttachments(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient, attachments: NoteAttachment[]): Note;
|
|
2355
2290
|
}
|
|
2356
2291
|
|
|
2357
2292
|
export class NoteAndArgs {
|
|
@@ -2703,12 +2638,20 @@ export class NoteFile {
|
|
|
2703
2638
|
* return it as a struct.
|
|
2704
2639
|
*/
|
|
2705
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;
|
|
2706
2645
|
/**
|
|
2707
2646
|
* Creates a `NoteFile` from an input note, preserving proof when available.
|
|
2708
2647
|
*/
|
|
2709
2648
|
static fromInputNote(note: InputNote): NoteFile;
|
|
2710
2649
|
/**
|
|
2711
|
-
* 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.
|
|
2712
2655
|
*/
|
|
2713
2656
|
static fromNoteDetails(note_details: NoteDetails): NoteFile;
|
|
2714
2657
|
/**
|
|
@@ -2958,11 +2901,6 @@ export class NoteRecipient {
|
|
|
2958
2901
|
* Returns the digest of the recipient data (used in the note commitment).
|
|
2959
2902
|
*/
|
|
2960
2903
|
digest(): Word;
|
|
2961
|
-
/**
|
|
2962
|
-
* Creates a recipient from a script and storage, generating a fresh random
|
|
2963
|
-
* serial number (the secret that prevents double-spends).
|
|
2964
|
-
*/
|
|
2965
|
-
static fromScript(note_script: NoteScript, storage: NoteStorage): NoteRecipient;
|
|
2966
2904
|
/**
|
|
2967
2905
|
* Creates a note recipient from its serial number, script, and storage.
|
|
2968
2906
|
*/
|
|
@@ -3258,12 +3196,6 @@ export class OutputNoteRecord {
|
|
|
3258
3196
|
* Returns true if the note has been consumed on chain.
|
|
3259
3197
|
*/
|
|
3260
3198
|
isConsumed(): boolean;
|
|
3261
|
-
/**
|
|
3262
|
-
* Returns true while the note's on-chain inclusion is still unsettled
|
|
3263
|
-
* (`ExpectedFull` or `ExpectedPartial`), i.e. while sync is the mechanism
|
|
3264
|
-
* that can advance this record.
|
|
3265
|
-
*/
|
|
3266
|
-
isInclusionPending(): boolean;
|
|
3267
3199
|
/**
|
|
3268
3200
|
* Returns the note metadata.
|
|
3269
3201
|
*/
|
|
@@ -3451,67 +3383,6 @@ export class ProvenTransaction {
|
|
|
3451
3383
|
serialize(): Uint8Array;
|
|
3452
3384
|
}
|
|
3453
3385
|
|
|
3454
|
-
/**
|
|
3455
|
-
* Read-only view of one PSWAP order's chain state, exposed to JavaScript.
|
|
3456
|
-
* The mutable fields (remaining amounts, depth, tip, state) advance
|
|
3457
|
-
* round-by-round as fills are discovered during sync.
|
|
3458
|
-
*/
|
|
3459
|
-
export class PswapLineageRecord {
|
|
3460
|
-
private constructor();
|
|
3461
|
-
free(): void;
|
|
3462
|
-
[Symbol.dispose](): void;
|
|
3463
|
-
/**
|
|
3464
|
-
* Account that created the order and receives every payback.
|
|
3465
|
-
*/
|
|
3466
|
-
creatorAccountId(): AccountId;
|
|
3467
|
-
/**
|
|
3468
|
-
* Depth of the current tip: 0 for the original PSWAP, +1 per fill round.
|
|
3469
|
-
*/
|
|
3470
|
-
currentDepth(): number;
|
|
3471
|
-
/**
|
|
3472
|
-
* Note id of the current tip in the chain.
|
|
3473
|
-
*/
|
|
3474
|
-
currentTipNoteId(): NoteId;
|
|
3475
|
-
/**
|
|
3476
|
-
* Stable identifier shared by every note in the chain, as a decimal string.
|
|
3477
|
-
*/
|
|
3478
|
-
orderId(): string;
|
|
3479
|
-
/**
|
|
3480
|
-
* Offered amount still unfilled on the current tip. The offered faucet is
|
|
3481
|
-
* chain-invariant and recovered from the original PSWAP note when needed.
|
|
3482
|
-
*/
|
|
3483
|
-
remainingOffered(): bigint;
|
|
3484
|
-
/**
|
|
3485
|
-
* Requested amount still outstanding on the current tip. The requested
|
|
3486
|
-
* faucet is recovered from the original PSWAP note when needed.
|
|
3487
|
-
*/
|
|
3488
|
-
remainingRequested(): bigint;
|
|
3489
|
-
/**
|
|
3490
|
-
* Lifecycle state of the order.
|
|
3491
|
-
*/
|
|
3492
|
-
state(): PswapLineageState;
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
|
-
/**
|
|
3496
|
-
* Lifecycle state of a PSWAP order.
|
|
3497
|
-
*
|
|
3498
|
-
* Discriminants match the on-disk encoding in the store.
|
|
3499
|
-
*/
|
|
3500
|
-
export enum PswapLineageState {
|
|
3501
|
-
/**
|
|
3502
|
-
* Still fillable and reclaimable.
|
|
3503
|
-
*/
|
|
3504
|
-
Active = 0,
|
|
3505
|
-
/**
|
|
3506
|
-
* Fully filled. Terminal.
|
|
3507
|
-
*/
|
|
3508
|
-
FullyFilled = 1,
|
|
3509
|
-
/**
|
|
3510
|
-
* Reclaimed by the creator. Terminal.
|
|
3511
|
-
*/
|
|
3512
|
-
Reclaimed = 2,
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
3386
|
export class PublicKey {
|
|
3516
3387
|
private constructor();
|
|
3517
3388
|
free(): void;
|
|
@@ -3912,7 +3783,7 @@ export class StorageMapEntryJs {
|
|
|
3912
3783
|
* Information about storage map updates for an account, as returned by the
|
|
3913
3784
|
* `syncStorageMaps` RPC endpoint.
|
|
3914
3785
|
*
|
|
3915
|
-
* Contains the
|
|
3786
|
+
* Contains the storage map entries merged over the requested block range,
|
|
3916
3787
|
* along with the chain tip and last processed block number.
|
|
3917
3788
|
*/
|
|
3918
3789
|
export class StorageMapInfo {
|
|
@@ -3934,15 +3805,15 @@ export class StorageMapInfo {
|
|
|
3934
3805
|
}
|
|
3935
3806
|
|
|
3936
3807
|
/**
|
|
3937
|
-
* A
|
|
3938
|
-
*
|
|
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.
|
|
3939
3810
|
*/
|
|
3940
3811
|
export class StorageMapUpdate {
|
|
3941
3812
|
private constructor();
|
|
3942
3813
|
free(): void;
|
|
3943
3814
|
[Symbol.dispose](): void;
|
|
3944
3815
|
/**
|
|
3945
|
-
* Returns the block number
|
|
3816
|
+
* Returns the last processed block number for the merged response.
|
|
3946
3817
|
*/
|
|
3947
3818
|
blockNum(): number;
|
|
3948
3819
|
/**
|
|
@@ -4288,10 +4159,6 @@ export class TransactionRequest {
|
|
|
4288
4159
|
private constructor();
|
|
4289
4160
|
free(): void;
|
|
4290
4161
|
[Symbol.dispose](): void;
|
|
4291
|
-
/**
|
|
4292
|
-
* Returns a copy of the advice map carried by this request.
|
|
4293
|
-
*/
|
|
4294
|
-
adviceMap(): AdviceMap;
|
|
4295
4162
|
/**
|
|
4296
4163
|
* Returns the authentication argument if present.
|
|
4297
4164
|
*/
|
|
@@ -4308,14 +4175,6 @@ export class TransactionRequest {
|
|
|
4308
4175
|
* Returns output notes created by the sender account.
|
|
4309
4176
|
*/
|
|
4310
4177
|
expectedOutputOwnNotes(): Note[];
|
|
4311
|
-
/**
|
|
4312
|
-
* Returns a copy of this request with `advice_map` merged into its advice map.
|
|
4313
|
-
*
|
|
4314
|
-
* Entries are merged with last-write-wins semantics: a key already present in the request is
|
|
4315
|
-
* overwritten by the value from `advice_map`. Use this to inject advice (e.g. a signature
|
|
4316
|
-
* produced by an external signer) after the request has already been built.
|
|
4317
|
-
*/
|
|
4318
|
-
extendAdviceMap(advice_map: AdviceMap): TransactionRequest;
|
|
4319
4178
|
/**
|
|
4320
4179
|
* Returns the transaction script argument if present.
|
|
4321
4180
|
*/
|
|
@@ -4532,9 +4391,9 @@ export class TransactionStoreUpdate {
|
|
|
4532
4391
|
free(): void;
|
|
4533
4392
|
[Symbol.dispose](): void;
|
|
4534
4393
|
/**
|
|
4535
|
-
* Returns the account
|
|
4394
|
+
* Returns the absolute account patch applied by the transaction.
|
|
4536
4395
|
*/
|
|
4537
|
-
|
|
4396
|
+
accountPatch(): AccountPatch;
|
|
4538
4397
|
/**
|
|
4539
4398
|
* Returns the output notes created by the transaction.
|
|
4540
4399
|
*/
|
|
@@ -4620,22 +4479,7 @@ export class WebClient {
|
|
|
4620
4479
|
accountReader(account_id: AccountId): Promise<AccountReader>;
|
|
4621
4480
|
addAccountSecretKeyToWebStore(account_id: AccountId, secret_key: AuthSecretKey): Promise<void>;
|
|
4622
4481
|
addTag(tag: string): Promise<void>;
|
|
4623
|
-
/**
|
|
4624
|
-
* Persists a submitted transaction and returns its pre-apply
|
|
4625
|
-
* [`TransactionStoreUpdate`]. Routes through the high-level
|
|
4626
|
-
* `Client::apply_transaction` so registered observers (e.g. PSWAP
|
|
4627
|
-
* tracking) fire.
|
|
4628
|
-
*/
|
|
4629
4482
|
applyTransaction(transaction_result: TransactionResult, submission_height: number): Promise<TransactionStoreUpdate>;
|
|
4630
|
-
/**
|
|
4631
|
-
* Builds a transaction reclaiming the unfilled offered asset on the current
|
|
4632
|
-
* tip of an Active lineage.
|
|
4633
|
-
*
|
|
4634
|
-
* `order_id` is the order's stable identifier as a decimal string. The
|
|
4635
|
-
* returned request flows into the same submit path as the other PSWAP
|
|
4636
|
-
* cancel transactions.
|
|
4637
|
-
*/
|
|
4638
|
-
buildPswapCancelByOrder(order_id: string): Promise<TransactionRequest>;
|
|
4639
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;
|
|
4640
4484
|
/**
|
|
4641
4485
|
* Creates a new `WebClient` instance with the specified configuration.
|
|
@@ -4647,11 +4491,8 @@ export class WebClient {
|
|
|
4647
4491
|
* * `store_name`: Optional name for the web store. If `None`, the store name defaults to
|
|
4648
4492
|
* `MidenClientDB_{network_id}`, where `network_id` is derived from the `node_url`.
|
|
4649
4493
|
* Explicitly setting this allows for creating multiple isolated clients.
|
|
4650
|
-
* * `debug_mode`: Optional flag to enable debug mode for transaction execution. When enabled,
|
|
4651
|
-
* the transaction executor records additional information useful for debugging. Defaults to
|
|
4652
|
-
* disabled.
|
|
4653
4494
|
*/
|
|
4654
|
-
createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null
|
|
4495
|
+
createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, store_name?: string | null): Promise<any>;
|
|
4655
4496
|
/**
|
|
4656
4497
|
* Creates a new `WebClient` instance with external keystore callbacks.
|
|
4657
4498
|
*
|
|
@@ -4665,10 +4506,8 @@ export class WebClient {
|
|
|
4665
4506
|
* * `get_key_cb`: Callback to retrieve the secret key bytes for a given public key.
|
|
4666
4507
|
* * `insert_key_cb`: Callback to persist a secret key.
|
|
4667
4508
|
* * `sign_cb`: Callback to produce serialized signature bytes for the provided inputs.
|
|
4668
|
-
* * `debug_mode`: Optional flag to enable debug mode for transaction execution. Defaults to
|
|
4669
|
-
* disabled.
|
|
4670
4509
|
*/
|
|
4671
|
-
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
|
|
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>;
|
|
4672
4511
|
createCodeBuilder(): Promise<CodeBuilder>;
|
|
4673
4512
|
/**
|
|
4674
4513
|
* Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept
|
|
@@ -4676,14 +4515,18 @@ export class WebClient {
|
|
|
4676
4515
|
*/
|
|
4677
4516
|
createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise<string>;
|
|
4678
4517
|
/**
|
|
4679
|
-
* Executes a transaction and returns the `TransactionSummary
|
|
4518
|
+
* Executes a transaction and returns the `TransactionSummary` the account is being asked
|
|
4519
|
+
* to authorize.
|
|
4680
4520
|
*
|
|
4681
|
-
*
|
|
4682
|
-
*
|
|
4683
|
-
*
|
|
4684
|
-
*
|
|
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.
|
|
4685
4527
|
*
|
|
4686
4528
|
* # Errors
|
|
4529
|
+
* - If the transaction executes successfully (error code `TRANSACTION_ALREADY_AUTHORIZED`).
|
|
4687
4530
|
* - If there is an internal failure during execution.
|
|
4688
4531
|
*/
|
|
4689
4532
|
executeForSummary(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionSummary>;
|
|
@@ -4761,20 +4604,6 @@ export class WebClient {
|
|
|
4761
4604
|
getInputNotes(filter: NoteFilter): Promise<InputNoteRecord[]>;
|
|
4762
4605
|
getOutputNote(note_id: string): Promise<OutputNoteRecord>;
|
|
4763
4606
|
getOutputNotes(filter: NoteFilter): Promise<OutputNoteRecord[]>;
|
|
4764
|
-
/**
|
|
4765
|
-
* Returns the lineage for one order, or `null` if not tracked.
|
|
4766
|
-
*
|
|
4767
|
-
* `order_id` is the order's stable identifier as a decimal string.
|
|
4768
|
-
*/
|
|
4769
|
-
getPswapLineage(order_id: string): Promise<PswapLineageRecord | undefined>;
|
|
4770
|
-
/**
|
|
4771
|
-
* Returns every PSWAP lineage tracked by this client.
|
|
4772
|
-
*/
|
|
4773
|
-
getPswapLineages(): Promise<PswapLineageRecord[]>;
|
|
4774
|
-
/**
|
|
4775
|
-
* Returns lineages created by a specific local account.
|
|
4776
|
-
*/
|
|
4777
|
-
getPswapLineagesFor(creator: AccountId): Promise<PswapLineageRecord[]>;
|
|
4778
4607
|
/**
|
|
4779
4608
|
* Returns all public key commitments associated with the given account ID.
|
|
4780
4609
|
*
|
|
@@ -4793,10 +4622,10 @@ export class WebClient {
|
|
|
4793
4622
|
/**
|
|
4794
4623
|
* Imports a note file and returns the imported note's identifier.
|
|
4795
4624
|
*
|
|
4796
|
-
* A note file that carries metadata — an explicit `NoteId` or a
|
|
4797
|
-
* with proof — resolves to a concrete `NoteId`, which is returned so
|
|
4798
|
-
* caller can look the note up with [`get_input_note`].
|
|
4799
|
-
*
|
|
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
|
|
4800
4629
|
* metadata-independent details commitment is returned instead.
|
|
4801
4630
|
*
|
|
4802
4631
|
* Migration note (miden-client PR #2214): `Client::import_notes` now
|
|
@@ -4846,16 +4675,6 @@ export class WebClient {
|
|
|
4846
4675
|
* but callers only need a single await instead of two.
|
|
4847
4676
|
*/
|
|
4848
4677
|
newAccountWithSecretKey(account: Account, secret_key: AuthSecretKey): Promise<void>;
|
|
4849
|
-
/**
|
|
4850
|
-
* Builds a transaction request that bridges a fungible asset out to another network via the
|
|
4851
|
-
* `AggLayer`.
|
|
4852
|
-
*
|
|
4853
|
-
* The request emits a single public B2AGG (Bridge-to-AggLayer) note holding `amount` units of
|
|
4854
|
-
* the `faucet_id` asset. The note is consumed by `bridge_account_id`, which burns the asset so
|
|
4855
|
-
* it can be claimed at `destination_address` (an Ethereum address) on the AggLayer-assigned
|
|
4856
|
-
* `destination_network`.
|
|
4857
|
-
*/
|
|
4858
|
-
newB2AggTransactionRequest(sender_account_id: AccountId, bridge_account_id: AccountId, faucet_id: AccountId, amount: bigint, destination_network: number, destination_address: EthAddress): Promise<TransactionRequest>;
|
|
4859
4678
|
newConsumeTransactionRequest(list_of_notes: Note[]): TransactionRequest;
|
|
4860
4679
|
/**
|
|
4861
4680
|
* Creates, persists, and returns a new fungible faucet account.
|
|
@@ -4931,16 +4750,6 @@ export class WebClient {
|
|
|
4931
4750
|
* the chain tip is performed, and the required block header is retrieved.
|
|
4932
4751
|
*/
|
|
4933
4752
|
submitNewTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise<TransactionId>;
|
|
4934
|
-
/**
|
|
4935
|
-
* Executes a batch of transactions against the specified account, proves them individually
|
|
4936
|
-
* and as a batch, submits the batch to the network, and atomically applies the per-tx
|
|
4937
|
-
* updates to the local store. Returns the block number the batch was accepted into.
|
|
4938
|
-
*
|
|
4939
|
-
* All transactions must target the same local account — the `account_id` argument.
|
|
4940
|
-
* Each element of `transaction_requests` is the serialized-bytes form of a
|
|
4941
|
-
* `TransactionRequest` (obtained via `tx_request.serialize()`)
|
|
4942
|
-
*/
|
|
4943
|
-
submitNewTransactionBatch(account_id: AccountId, transaction_requests: Uint8Array[]): Promise<number>;
|
|
4944
4753
|
/**
|
|
4945
4754
|
* Executes a transaction specified by the request against the specified account, proves it
|
|
4946
4755
|
* with the user provided prover, submits it to the network, and updates the local database.
|