@miden-sdk/miden-sdk 0.14.5 → 0.14.9
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/LICENSE +21 -0
- package/README.md +148 -18
- package/dist/mt/Cargo-DKB2aRX-.js +25826 -0
- package/dist/mt/Cargo-DKB2aRX-.js.map +1 -0
- package/dist/{api-types.d.ts → mt/api-types.d.ts} +18 -3
- package/dist/mt/assets/miden_client_web.wasm +0 -0
- package/dist/mt/crates/miden_client_web.d.ts +4726 -0
- package/dist/{docs-entry.d.ts → mt/docs-entry.d.ts} +2 -2
- package/dist/mt/eager.js +35 -0
- package/dist/mt/eager.js.map +1 -0
- package/dist/{index.d.ts → mt/index.d.ts} +9 -7
- package/dist/mt/index.js +3371 -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-DKB2aRX--C6T4l3AF.js +25827 -0
- package/dist/mt/workers/Cargo-DKB2aRX--C6T4l3AF.js.map +1 -0
- package/dist/mt/workers/assets/miden_client_web.wasm +0 -0
- package/dist/mt/workers/web-client-methods-worker.js +26560 -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-M3382VZc.js → st/Cargo-jOTNoFyS.js} +6714 -5926
- package/dist/st/Cargo-jOTNoFyS.js.map +1 -0
- package/dist/st/api-types.d.ts +1051 -0
- package/dist/{workers → st}/assets/miden_client_web.wasm +0 -0
- package/dist/{crates → st/crates}/miden_client_web.d.ts +31 -0
- package/dist/st/docs-entry.d.ts +35 -0
- package/dist/{eager.js → st/eager.js} +1 -1
- package/dist/st/eager.js.map +1 -0
- package/dist/st/index.d.ts +89 -0
- package/dist/{index.js → st/index.js} +126 -13
- 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-M3382VZc-Dfw4tXwh.js → st/workers/Cargo-jOTNoFyS-DRTcF6wf.js} +6714 -5926
- package/dist/st/workers/Cargo-jOTNoFyS-DRTcF6wf.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 +6731 -5926
- package/dist/st/workers/web-client-methods-worker.js.map +1 -0
- package/dist/st/workers/web-client-methods-worker.module.js +571 -0
- package/dist/st/workers/web-client-methods-worker.module.js.map +1 -0
- package/lazy/package.json +4 -0
- package/mt/lazy/package.json +4 -0
- package/mt/package.json +4 -0
- package/package.json +66 -44
- package/dist/Cargo-M3382VZc.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-M3382VZc-Dfw4tXwh.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/mt/eager.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getWasmOrThrow } from './index.js';
|
|
2
|
+
export { AccountArray, AccountIdArray, AccountType, AuthScheme, CompilerResource, FeltArray, ForeignAccountArray, Linking, MidenArrays, MidenClient, MockWasmWebClient, NoteAndArgsArray, NoteArray, NoteIdAndArgsArray, NoteRecipientArray, NoteVisibility, OutputNoteArray, StorageMode, StorageSlotArray, TransactionScriptInputPairArray, WasmWebClient, buildSwapTag, createP2IDENote, createP2IDNote, resolveAuthScheme } from './index.js';
|
|
3
|
+
export { Account, AccountBuilder, AccountBuilderResult, AccountCode, AccountComponent, AccountComponentCode, AccountDelta, AccountFile, AccountHeader, AccountId, AccountInterface, AccountProof, AccountReader, AccountStatus, AccountStorage, AccountStorageDelta, AccountStorageMode, AccountStorageRequirements, AccountVaultDelta, Address, AdviceInputs, AdviceMap, AssetVault, AuthFalcon512RpoMultisigConfig, AuthSecretKey, BasicFungibleFaucetComponent, BlockHeader, CodeBuilder, CommittedNote, ConsumableNoteRecord, Endpoint, ExecutedTransaction, Felt, FetchedAccount, FetchedNote, FlattenedU8Vec, ForeignAccount, FungibleAsset, FungibleAssetDelta, FungibleAssetDeltaItem, GetProceduresResultItem, InputNote, InputNoteRecord, InputNoteState, InputNotes, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, JsAccountUpdate, JsStateSyncUpdate, JsStorageMapEntry, JsStorageSlot, JsVaultAsset, Library, MerklePath, NetworkId, NetworkType, Note, NoteAndArgs, NoteAssets, NoteAttachment, NoteAttachmentKind, NoteAttachmentScheme, NoteConsumability, NoteConsumptionStatus, NoteDetails, NoteDetailsAndTag, NoteDetailsAndTagArray, NoteExecutionHint, NoteExportFormat, NoteFile, NoteFilter, NoteFilterTypes, NoteHeader, NoteId, NoteIdAndArgs, NoteInclusionProof, NoteLocation, NoteMetadata, NoteRecipient, NoteScript, NoteStorage, NoteSyncBlock, NoteSyncInfo, NoteTag, NoteType, OutputNote, OutputNoteRecord, OutputNoteState, OutputNotes, Package, PartialNote, Poseidon2, ProcedureThreshold, Program, ProvenTransaction, PublicKey, RpcClient, Rpo256, SerializedInputNoteData, SerializedOutputNoteData, SerializedTransactionData, Signature, SigningInputs, SigningInputsType, SlotAndKeys, SparseMerklePath, StorageMap, StorageMapEntry, StorageMapInfo, StorageMapUpdate, StorageSlot, SyncSummary, TestUtils, TokenSymbol, TransactionArgs, TransactionFilter, TransactionId, TransactionProver, TransactionRecord, TransactionRequest, TransactionRequestBuilder, TransactionResult, TransactionScript, TransactionScriptInputPair, TransactionStatus, TransactionStoreUpdate, TransactionSummary, WebClient, WebKeystoreApi, Word, createAuthFalcon512RpoMultisig, exportStore, importStore, initSync, initThreadPool, parallelSumBench, rayonThreadCount, sequentialSumBench, setupLogging, wbg_rayon_PoolBuilder, wbg_rayon_start_worker } from './Cargo-DKB2aRX-.js';
|
|
4
|
+
import './wasm.js';
|
|
5
|
+
|
|
6
|
+
// Eager entry point for @miden-sdk/miden-sdk.
|
|
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 (`@miden-sdk/miden-sdk` → `./dist/eager.js`).
|
|
15
|
+
//
|
|
16
|
+
// When NOT to use this entry:
|
|
17
|
+
// - **Capacitor mobile apps** (Miden Wallet iOS/Android): Capacitor's
|
|
18
|
+
// `capacitor://localhost` scheme handler interacts poorly with top-level
|
|
19
|
+
// await in the main WKWebView. Verified empirically: TLA in a Capacitor
|
|
20
|
+
// host WKWebView hangs module evaluation indefinitely, while the same
|
|
21
|
+
// TLA in the dApp-browser WKWebView (vanilla HTTPS) resolves in <100ms.
|
|
22
|
+
// - **Next.js / SSR**: TLA blocks server-side module evaluation.
|
|
23
|
+
// - **Framework adapters (@miden-sdk/react, etc.)**: they manage readiness
|
|
24
|
+
// via their own state machine (e.g. `isReady`) and should not impose
|
|
25
|
+
// TLA on consumer bundles.
|
|
26
|
+
//
|
|
27
|
+
// For those contexts, import from `@miden-sdk/miden-sdk/lazy` — identical
|
|
28
|
+
// API surface, no top-level await, callers are responsible for awaiting
|
|
29
|
+
// `MidenClient.ready()` (or the equivalent) before touching wasm-bindgen
|
|
30
|
+
// types.
|
|
31
|
+
|
|
32
|
+
await getWasmOrThrow();
|
|
33
|
+
|
|
34
|
+
export { getWasmOrThrow };
|
|
35
|
+
//# 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.\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 (`@miden-sdk/miden-sdk` → `./dist/eager.js`).\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;;AAGA,MAAM,cAAc,EAAE;;;;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
// Re-export everything from the WASM module
|
|
2
|
-
export * from "./crates/miden_client_web";
|
|
2
|
+
export * from "./crates/miden_client_web.js";
|
|
3
3
|
|
|
4
4
|
// Re-export all simplified API types
|
|
5
|
-
export * from "./api-types";
|
|
5
|
+
export * from "./api-types.js";
|
|
6
6
|
|
|
7
7
|
// Explicit re-export to shadow the wasm-bindgen `AuthScheme` enum declared
|
|
8
8
|
// in `./crates/miden_client_web` with the user-facing string constant plus
|
|
9
9
|
// merged string-union type from `./api-types`. Without this, `export *`
|
|
10
10
|
// makes the name ambiguous and TypeScript resolves to the crates enum,
|
|
11
11
|
// breaking `AuthScheme.Falcon` / `AuthScheme.ECDSA` lookups.
|
|
12
|
-
export { AuthScheme, resolveAuthScheme } from "./api-types";
|
|
12
|
+
export { AuthScheme, resolveAuthScheme } from "./api-types.js";
|
|
13
13
|
|
|
14
14
|
// Import types needed for the @internal class declarations below
|
|
15
15
|
import type {
|
|
16
16
|
WebClient as WasmWebClientBase,
|
|
17
17
|
SyncSummary,
|
|
18
|
-
} from "./crates/miden_client_web";
|
|
18
|
+
} from "./crates/miden_client_web.js";
|
|
19
19
|
import type {
|
|
20
20
|
GetKeyCallback,
|
|
21
21
|
InsertKeyCallback,
|
|
22
22
|
SignCallback,
|
|
23
|
-
} from "./api-types";
|
|
23
|
+
} from "./api-types.js";
|
|
24
24
|
|
|
25
25
|
export type LogLevel =
|
|
26
26
|
| "error"
|
|
@@ -51,7 +51,8 @@ export declare class WasmWebClient extends WasmWebClientBase {
|
|
|
51
51
|
noteTransportUrl?: string,
|
|
52
52
|
seed?: Uint8Array,
|
|
53
53
|
storeName?: string,
|
|
54
|
-
logLevel?: LogLevel
|
|
54
|
+
logLevel?: LogLevel,
|
|
55
|
+
useWorker?: boolean
|
|
55
56
|
): Promise<WasmWebClient>;
|
|
56
57
|
|
|
57
58
|
static createClientWithExternalKeystore(
|
|
@@ -62,7 +63,8 @@ export declare class WasmWebClient extends WasmWebClientBase {
|
|
|
62
63
|
getKeyCb?: GetKeyCallback,
|
|
63
64
|
insertKeyCb?: InsertKeyCallback,
|
|
64
65
|
signCb?: SignCallback,
|
|
65
|
-
logLevel?: LogLevel
|
|
66
|
+
logLevel?: LogLevel,
|
|
67
|
+
useWorker?: boolean
|
|
66
68
|
): Promise<WasmWebClient>;
|
|
67
69
|
|
|
68
70
|
syncState(): Promise<SyncSummary>;
|