@miden-sdk/miden-sdk 0.15.0-alpha.4 → 0.15.0-alpha.5
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 +139 -9
- package/dist/mt/Cargo-smJQCGjz.js +26146 -0
- package/dist/mt/Cargo-smJQCGjz.js.map +1 -0
- package/dist/{api-types.d.ts → mt/api-types.d.ts} +154 -4
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +4791 -0
- package/dist/mt/eager.js +38 -0
- package/dist/mt/eager.js.map +1 -0
- package/dist/{index.d.ts → mt/index.d.ts} +4 -2
- package/dist/mt/index.js +3778 -0
- package/dist/mt/index.js.map +1 -0
- package/dist/{wasm.js → mt/wasm.js} +1 -1
- package/dist/mt/wasm.js.map +1 -0
- package/dist/mt/workerHelpers.js +28 -0
- package/dist/mt/workers/Cargo-smJQCGjz-q4GYXDiD.js +26147 -0
- package/dist/mt/workers/Cargo-smJQCGjz-q4GYXDiD.js.map +1 -0
- package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
- package/dist/mt/workers/web-client-methods-worker.js +26885 -0
- package/dist/mt/workers/web-client-methods-worker.js.map +1 -0
- package/dist/{workers → mt/workers}/web-client-methods-worker.module.js +17 -1
- package/dist/mt/workers/web-client-methods-worker.module.js.map +1 -0
- package/dist/mt/workers/workerHelpers.js +28 -0
- package/dist/{Cargo-CVlXCH_2.js → st/Cargo-CG4XszZo.js} +698 -495
- package/dist/st/Cargo-CG4XszZo.js.map +1 -0
- package/dist/st/api-types.d.ts +1140 -0
- package/dist/{workers → st}/assets/miden_client_web.wasm +0 -0
- package/dist/{crates → st/crates}/miden_client_web.d.ts +342 -196
- package/dist/st/docs-entry.d.ts +38 -0
- package/dist/{eager.js → st/eager.js} +1 -1
- package/dist/st/eager.js.map +1 -0
- package/dist/st/index.d.ts +182 -0
- package/dist/{index.js → st/index.js} +425 -19
- package/dist/st/index.js.map +1 -0
- package/dist/st/wasm.js +23 -0
- package/dist/st/wasm.js.map +1 -0
- package/dist/{workers/Cargo-CVlXCH_2-CWA-5vlh.js → st/workers/Cargo-CG4XszZo-S7EHAZSa.js} +698 -495
- package/dist/st/workers/Cargo-CG4XszZo-S7EHAZSa.js.map +1 -0
- package/dist/{assets → st/workers/assets}/miden_client_web.wasm +0 -0
- package/dist/{workers → st/workers}/web-client-methods-worker.js +715 -496
- package/dist/st/workers/web-client-methods-worker.js.map +1 -0
- package/dist/st/workers/web-client-methods-worker.module.js +575 -0
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -0
- package/js/client.js +166 -2
- package/js/node/napi-compat.js +15 -0
- package/js/node-index.js +0 -1
- package/js/resources/accounts.js +4 -6
- package/js/resources/transactions.js +134 -0
- package/lazy/package.json +2 -2
- package/mt/lazy/package.json +4 -0
- package/mt/package.json +4 -0
- package/package.json +30 -15
- package/dist/Cargo-CVlXCH_2.js.map +0 -1
- package/dist/eager.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/wasm.js.map +0 -1
- package/dist/workers/Cargo-CVlXCH_2-CWA-5vlh.js.map +0 -1
- package/dist/workers/web-client-methods-worker.js.map +0 -1
- package/dist/workers/web-client-methods-worker.module.js.map +0 -1
- /package/dist/{docs-entry.d.ts → mt/docs-entry.d.ts} +0 -0
package/dist/mt/eager.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getWasmOrThrow } from './index.js';
|
|
2
|
+
export { AccountType, AuthScheme, CompilerResource, Linking, MidenArrays, MidenClient, MockWasmWebClient, MockWasmWebClient as MockWebClient, NoteVisibility, StorageMode, StorageResult, StorageView, WasmWebClient, buildSwapTag, createP2IDENote, createP2IDNote, wordToBigInt } from './index.js';
|
|
3
|
+
export { Account, AccountArray, AccountBuilder, AccountBuilderResult, AccountCode, AccountComponent, AccountComponentCode, AccountDelta, AccountFile, AccountHeader, AccountId, AccountIdArray, AccountInterface, AccountProof, AccountReader, AccountStatus, AccountStorage, AccountStorageDelta, AccountStorageMode, AccountStorageRequirements, AccountVaultDelta, Address, AdviceInputs, AdviceMap, AssetVault, AuthFalcon512RpoMultisigConfig, AuthSecretKey, BasicFungibleFaucetComponent, BlockHeader, CodeBuilder, CommittedNote, ConsumableNoteRecord, Endpoint, ExecutedTransaction, Felt, FeltArray, FetchedAccount, FetchedNote, FlattenedU8Vec, ForeignAccount, ForeignAccountArray, FungibleAsset, FungibleAssetDelta, FungibleAssetDeltaItem, GetProceduresResultItem, InputNote, InputNoteRecord, InputNoteState, InputNotes, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, JsAccountUpdate, JsStateSyncUpdate, JsStorageMapEntry, JsStorageSlot, JsVaultAsset, Library, MerklePath, NetworkId, NetworkNoteStatusInfo, NetworkType, Note, NoteAndArgs, NoteAndArgsArray, NoteArray, NoteAssets, NoteAttachment, NoteAttachmentScheme, NoteConsumability, NoteConsumptionStatus, NoteDetails, NoteDetailsAndTag, NoteDetailsAndTagArray, NoteExecutionHint, NoteExportFormat, NoteFile, NoteFilter, NoteFilterTypes, NoteHeader, NoteId, NoteIdAndArgs, NoteIdAndArgsArray, NoteInclusionProof, NoteLocation, NoteMetadata, NoteRecipient, NoteRecipientArray, NoteScript, NoteStorage, NoteSyncBlock, NoteSyncInfo, NoteTag, NoteType, OutputNote, OutputNoteArray, OutputNoteRecord, OutputNoteState, OutputNotes, Package, PartialNote, Poseidon2, ProcedureThreshold, Program, ProvenTransaction, PublicKey, RpcClient, Rpo256, SerializedInputNoteData, SerializedOutputNoteData, SerializedTransactionData, Signature, SigningInputs, SigningInputsType, SlotAndKeys, SparseMerklePath, StorageMap, StorageMapEntry, StorageMapEntryJs, StorageMapInfo, StorageMapUpdate, StorageSlot, StorageSlotArray, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionScriptInputPairArray, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, WebKeystoreApi, Word, createAuthFalcon512RpoMultisig, exportStore, importStore, initSync, initThreadPool, parallelSumBench, rayonThreadCount, sequentialSumBench, setupLogging, wbg_rayon_PoolBuilder, wbg_rayon_start_worker } from './Cargo-smJQCGjz.js';
|
|
4
|
+
import './wasm.js';
|
|
5
|
+
|
|
6
|
+
// Eager entry point for @miden-sdk/miden-sdk (browser builds).
|
|
7
|
+
//
|
|
8
|
+
// Awaits WASM initialization at module top level, so importing this module
|
|
9
|
+
// guarantees that any wasm-bindgen constructor (`new RpcClient(...)`,
|
|
10
|
+
// `AccountId.fromHex(...)`, `TransactionProver.newRemoteProver(...)`, etc.)
|
|
11
|
+
// is safe to call synchronously on the next line. No explicit
|
|
12
|
+
// `await MidenClient.ready()` / `isReady` gate is required.
|
|
13
|
+
//
|
|
14
|
+
// This is the default entry for browser bundlers (`@miden-sdk/miden-sdk`
|
|
15
|
+
// → `./dist/eager.js`). Node.js consumers resolve the `node` exports
|
|
16
|
+
// condition instead and get the napi binding via `./js/node-index.js`,
|
|
17
|
+
// bypassing this file entirely.
|
|
18
|
+
//
|
|
19
|
+
// When NOT to use this entry:
|
|
20
|
+
// - **Capacitor mobile apps** (Miden Wallet iOS/Android): Capacitor's
|
|
21
|
+
// `capacitor://localhost` scheme handler interacts poorly with top-level
|
|
22
|
+
// await in the main WKWebView. Verified empirically: TLA in a Capacitor
|
|
23
|
+
// host WKWebView hangs module evaluation indefinitely, while the same
|
|
24
|
+
// TLA in the dApp-browser WKWebView (vanilla HTTPS) resolves in <100ms.
|
|
25
|
+
// - **Next.js / SSR**: TLA blocks server-side module evaluation.
|
|
26
|
+
// - **Framework adapters (@miden-sdk/react, etc.)**: they manage readiness
|
|
27
|
+
// via their own state machine (e.g. `isReady`) and should not impose
|
|
28
|
+
// TLA on consumer bundles.
|
|
29
|
+
//
|
|
30
|
+
// For those contexts, import from `@miden-sdk/miden-sdk/lazy` — identical
|
|
31
|
+
// API surface, no top-level await, callers are responsible for awaiting
|
|
32
|
+
// `MidenClient.ready()` (or the equivalent) before touching wasm-bindgen
|
|
33
|
+
// types.
|
|
34
|
+
|
|
35
|
+
await getWasmOrThrow();
|
|
36
|
+
|
|
37
|
+
export { getWasmOrThrow };
|
|
38
|
+
//# sourceMappingURL=eager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eager.js","sources":["../../js/eager.js"],"sourcesContent":["// Eager entry point for @miden-sdk/miden-sdk (browser builds).\n//\n// Awaits WASM initialization at module top level, so importing this module\n// guarantees that any wasm-bindgen constructor (`new RpcClient(...)`,\n// `AccountId.fromHex(...)`, `TransactionProver.newRemoteProver(...)`, etc.)\n// is safe to call synchronously on the next line. No explicit\n// `await MidenClient.ready()` / `isReady` gate is required.\n//\n// This is the default entry for browser bundlers (`@miden-sdk/miden-sdk`\n// → `./dist/eager.js`). Node.js consumers resolve the `node` exports\n// condition instead and get the napi binding via `./js/node-index.js`,\n// bypassing this file entirely.\n//\n// When NOT to use this entry:\n// - **Capacitor mobile apps** (Miden Wallet iOS/Android): Capacitor's\n// `capacitor://localhost` scheme handler interacts poorly with top-level\n// await in the main WKWebView. Verified empirically: TLA in a Capacitor\n// host WKWebView hangs module evaluation indefinitely, while the same\n// TLA in the dApp-browser WKWebView (vanilla HTTPS) resolves in <100ms.\n// - **Next.js / SSR**: TLA blocks server-side module evaluation.\n// - **Framework adapters (@miden-sdk/react, etc.)**: they manage readiness\n// via their own state machine (e.g. `isReady`) and should not impose\n// TLA on consumer bundles.\n//\n// For those contexts, import from `@miden-sdk/miden-sdk/lazy` — identical\n// API surface, no top-level await, callers are responsible for awaiting\n// `MidenClient.ready()` (or the equivalent) before touching wasm-bindgen\n// types.\nimport { getWasmOrThrow } from \"./index.js\";\n\nawait getWasmOrThrow();\n\nexport * from \"./index.js\";\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAM,cAAc,EAAE;;;;"}
|
|
@@ -141,7 +141,8 @@ export declare class WasmWebClient extends WasmWebClientBase {
|
|
|
141
141
|
noteTransportUrl?: string,
|
|
142
142
|
seed?: Uint8Array,
|
|
143
143
|
storeName?: string,
|
|
144
|
-
logLevel?: LogLevel
|
|
144
|
+
logLevel?: LogLevel,
|
|
145
|
+
useWorker?: boolean
|
|
145
146
|
): Promise<WasmWebClient>;
|
|
146
147
|
|
|
147
148
|
static createClientWithExternalKeystore(
|
|
@@ -152,7 +153,8 @@ export declare class WasmWebClient extends WasmWebClientBase {
|
|
|
152
153
|
getKeyCb?: GetKeyCallback,
|
|
153
154
|
insertKeyCb?: InsertKeyCallback,
|
|
154
155
|
signCb?: SignCallback,
|
|
155
|
-
logLevel?: LogLevel
|
|
156
|
+
logLevel?: LogLevel,
|
|
157
|
+
useWorker?: boolean
|
|
156
158
|
): Promise<WasmWebClient>;
|
|
157
159
|
|
|
158
160
|
syncState(): Promise<SyncSummary>;
|