@miden-sdk/react 0.14.4 → 0.15.0-alpha.4
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/CLAUDE.md +66 -47
- package/LICENSE +21 -0
- package/README.md +7 -7
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +150 -160
- package/dist/index.mjs +19 -31
- package/package.json +30 -35
- package/dist/lazy.d.mts +0 -1497
- package/dist/lazy.d.ts +0 -1497
- package/dist/lazy.js +0 -3672
- package/dist/lazy.mjs +0 -3637
package/CLAUDE.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install @miden-sdk/react @miden-sdk/miden-sdk
|
|
7
7
|
# or
|
|
8
|
-
|
|
8
|
+
pnpm add @miden-sdk/react @miden-sdk/miden-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Getting Started
|
|
@@ -45,36 +45,37 @@ function App() {
|
|
|
45
45
|
|
|
46
46
|
## Reading Data (Query Hooks)
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Query hooks return `{ ...data, isLoading, error, refetch }` — the data fields are spread directly onto the result object, with hook-specific names (no generic `data` field).
|
|
49
49
|
|
|
50
50
|
### List Accounts
|
|
51
51
|
```tsx
|
|
52
|
-
const {
|
|
52
|
+
const { accounts, wallets, faucets, isLoading } = useAccounts();
|
|
53
53
|
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
// accounts
|
|
54
|
+
// wallets - regular accounts
|
|
55
|
+
// faucets - token faucets
|
|
56
|
+
// accounts - both, combined
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Get Account Details
|
|
60
60
|
```tsx
|
|
61
|
-
const {
|
|
61
|
+
const { account, isLoading } = useAccount(accountId);
|
|
62
62
|
|
|
63
|
-
// account.id, account.nonce, account.bech32id()
|
|
64
|
-
// account.
|
|
63
|
+
// account.id(), account.nonce(), account.bech32id()
|
|
64
|
+
// account.vault().getBalance(assetId) - get token balance
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
### Get Notes
|
|
68
68
|
```tsx
|
|
69
|
-
const {
|
|
69
|
+
const { notes, consumableNotes, noteSummaries, consumableNoteSummaries } = useNotes();
|
|
70
70
|
|
|
71
|
-
// notes
|
|
72
|
-
//
|
|
71
|
+
// notes - all input notes for this account
|
|
72
|
+
// consumableNotes - subset that's ready to claim
|
|
73
|
+
// noteSummaries / consumableNoteSummaries - same lists, projected to UI-friendly summaries
|
|
73
74
|
```
|
|
74
75
|
|
|
75
76
|
### Check Sync Status
|
|
76
77
|
```tsx
|
|
77
|
-
const { syncHeight, isSyncing, sync } = useSyncState();
|
|
78
|
+
const { syncHeight, isSyncing, lastSyncTime, sync, error } = useSyncState();
|
|
78
79
|
|
|
79
80
|
// Manual sync
|
|
80
81
|
await sync();
|
|
@@ -82,19 +83,19 @@ await sync();
|
|
|
82
83
|
|
|
83
84
|
### Get Token Metadata
|
|
84
85
|
```tsx
|
|
85
|
-
const {
|
|
86
|
+
const { metadata, isLoading } = useAssetMetadata(assetId);
|
|
86
87
|
// metadata.symbol, metadata.decimals
|
|
87
88
|
```
|
|
88
89
|
|
|
89
90
|
## Writing Data (Mutation Hooks)
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
Mutation hooks return `{ <action>, result, isLoading, stage, error, reset }` — the action callback is named after the hook (`send`, `consume`, `mint`, ...) and the resolved value is on `result`.
|
|
92
93
|
|
|
93
94
|
**Transaction stages:** `idle` → `executing` → `proving` → `submitting` → `complete`
|
|
94
95
|
|
|
95
96
|
### Create Wallet
|
|
96
97
|
```tsx
|
|
97
|
-
const {
|
|
98
|
+
const { createWallet, isLoading } = useCreateWallet();
|
|
98
99
|
|
|
99
100
|
const account = await createWallet({
|
|
100
101
|
storageMode: "private", // "private" | "public" | "network"
|
|
@@ -103,12 +104,12 @@ const account = await createWallet({
|
|
|
103
104
|
|
|
104
105
|
### Send Tokens
|
|
105
106
|
```tsx
|
|
106
|
-
const {
|
|
107
|
+
const { send, stage } = useSend();
|
|
107
108
|
|
|
108
109
|
await send({
|
|
109
110
|
from: senderAccountId,
|
|
110
111
|
to: recipientAccountId,
|
|
111
|
-
|
|
112
|
+
assetId: tokenFaucetId,
|
|
112
113
|
amount: 1000n,
|
|
113
114
|
noteType: "private", // "private" | "public"
|
|
114
115
|
});
|
|
@@ -116,20 +117,20 @@ await send({
|
|
|
116
117
|
|
|
117
118
|
### Send to Multiple Recipients
|
|
118
119
|
```tsx
|
|
119
|
-
const {
|
|
120
|
+
const { multiSend } = useMultiSend();
|
|
120
121
|
|
|
121
122
|
await multiSend({
|
|
122
123
|
from: senderAccountId,
|
|
123
|
-
|
|
124
|
-
{ to: recipient1,
|
|
125
|
-
{ to: recipient2,
|
|
124
|
+
recipients: [
|
|
125
|
+
{ to: recipient1, assetId, amount: 500n },
|
|
126
|
+
{ to: recipient2, assetId, amount: 300n },
|
|
126
127
|
],
|
|
127
128
|
});
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
### Claim Notes
|
|
131
132
|
```tsx
|
|
132
|
-
const {
|
|
133
|
+
const { consume } = useConsume();
|
|
133
134
|
|
|
134
135
|
await consume({
|
|
135
136
|
accountId: myAccountId,
|
|
@@ -139,7 +140,7 @@ await consume({
|
|
|
139
140
|
|
|
140
141
|
### Mint Tokens (Faucet Owner)
|
|
141
142
|
```tsx
|
|
142
|
-
const {
|
|
143
|
+
const { mint } = useMint();
|
|
143
144
|
|
|
144
145
|
await mint({
|
|
145
146
|
faucetId: myFaucetId,
|
|
@@ -150,7 +151,7 @@ await mint({
|
|
|
150
151
|
|
|
151
152
|
### Create Faucet
|
|
152
153
|
```tsx
|
|
153
|
-
const {
|
|
154
|
+
const { createFaucet } = useCreateFaucet();
|
|
154
155
|
|
|
155
156
|
const faucet = await createFaucet({
|
|
156
157
|
symbol: "TOKEN",
|
|
@@ -165,11 +166,11 @@ const faucet = await createFaucet({
|
|
|
165
166
|
### Show Transaction Progress
|
|
166
167
|
```tsx
|
|
167
168
|
function SendButton() {
|
|
168
|
-
const {
|
|
169
|
+
const { send, stage, isLoading, error } = useSend();
|
|
169
170
|
|
|
170
171
|
const handleSend = async () => {
|
|
171
172
|
try {
|
|
172
|
-
await send({ from, to,
|
|
173
|
+
await send({ from, to, assetId, amount });
|
|
173
174
|
} catch (err) {
|
|
174
175
|
console.error("Transaction failed:", err);
|
|
175
176
|
}
|
|
@@ -207,11 +208,11 @@ const text = formatNoteSummary(summary); // "1.5 TOKEN"
|
|
|
207
208
|
|
|
208
209
|
### Wait for Transaction Confirmation
|
|
209
210
|
```tsx
|
|
210
|
-
const {
|
|
211
|
+
const { waitForCommit } = useWaitForCommit();
|
|
211
212
|
|
|
212
213
|
// After sending
|
|
213
214
|
const result = await send({ ... });
|
|
214
|
-
await waitForCommit({
|
|
215
|
+
await waitForCommit({ txId: result.txId });
|
|
215
216
|
```
|
|
216
217
|
|
|
217
218
|
### Access Client Directly
|
|
@@ -316,7 +317,8 @@ import { SignerContext } from "@miden-sdk/react";
|
|
|
316
317
|
storeName: `mywallet_${userAddress}`, // unique per user for DB isolation
|
|
317
318
|
isConnected: true,
|
|
318
319
|
accountConfig: {
|
|
319
|
-
|
|
320
|
+
publicKeyCommitment: userPublicKeyCommitment, // Uint8Array
|
|
321
|
+
accountType: "RegularAccountUpdatableCode",
|
|
320
322
|
storageMode: "private",
|
|
321
323
|
},
|
|
322
324
|
signCb: async (pubKey, signingInputs) => {
|
|
@@ -377,23 +379,40 @@ account.bech32id(); // "miden1qy35..."
|
|
|
377
379
|
|
|
378
380
|
## Hook Reference
|
|
379
381
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
|
384
|
-
|
|
385
|
-
| `
|
|
386
|
-
| `
|
|
387
|
-
| `
|
|
388
|
-
| `
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
391
|
-
| `
|
|
392
|
-
| `
|
|
393
|
-
| `
|
|
394
|
-
| `
|
|
395
|
-
|
|
396
|
-
|
|
382
|
+
Query hooks return `{ ...data, isLoading, error, refetch }`. Mutation hooks return `{ <action>, result, isLoading, stage, error, reset }`.
|
|
383
|
+
|
|
384
|
+
### Query (read)
|
|
385
|
+
| Hook | Data fields | Purpose |
|
|
386
|
+
|------|-------------|---------|
|
|
387
|
+
| `useAccounts()` | `accounts`, `wallets`, `faucets` | List local accounts |
|
|
388
|
+
| `useAccount(id)` | `account` | Account details + balances |
|
|
389
|
+
| `useNotes(filter?)` | `notes`, `consumableNotes`, `noteSummaries`, `consumableNoteSummaries` | Input notes + UI summaries |
|
|
390
|
+
| `useNoteStream(filter?)` | streaming variant of `useNotes` | Auto-updates as notes arrive |
|
|
391
|
+
| `useSyncState()` | `syncHeight`, `isSyncing`, `lastSyncTime`, `sync()` | Sync status + manual trigger |
|
|
392
|
+
| `useSyncControl()` | `pause()`, `resume()`, `isPaused` | Pause/resume the auto-sync timer |
|
|
393
|
+
| `useAssetMetadata(id)` | `metadata: { symbol, decimals }` | Token info |
|
|
394
|
+
| `useTransactionHistory(...)` | `transactions` | Local transaction log |
|
|
395
|
+
| `useSessionAccount()` | `account` | The signer's connected account |
|
|
396
|
+
| `useWaitForNotes(...)` | resolves when matching notes appear | Pull-style note waiting |
|
|
397
|
+
|
|
398
|
+
### Mutation (write)
|
|
399
|
+
| Hook | Action | Returns on success |
|
|
400
|
+
|------|--------|--------------------|
|
|
401
|
+
| `useCreateWallet()` | `createWallet({ storageMode })` | `Account` |
|
|
402
|
+
| `useCreateFaucet()` | `createFaucet({ symbol, decimals, ... })` | `Account` |
|
|
403
|
+
| `useImportAccount()` | `importAccount(...)` | `Account` |
|
|
404
|
+
| `useImportNote()` | `importNote(...)` | imported `InputNoteRecord` |
|
|
405
|
+
| `useExportNote()` | `exportNote(...)` | serialized note bytes |
|
|
406
|
+
| `useImportStore()` / `useExportStore()` | store import/export | bytes / `void` |
|
|
407
|
+
| `useSend()` | `send({ from, to, assetId, amount, noteType })` | `SendResult` (with `txId`, `note`) |
|
|
408
|
+
| `useMultiSend()` | `multiSend({ from, recipients })` | `TransactionResult` |
|
|
409
|
+
| `useMint()` | `mint({ faucetId, to, amount })` | `TransactionResult` |
|
|
410
|
+
| `useConsume()` | `consume({ accountId, notes })` | `TransactionResult` |
|
|
411
|
+
| `useSwap()` | `swap({ ... })` | `TransactionResult` |
|
|
412
|
+
| `useTransaction()` | `transact({ ... })` | `TransactionResult` (custom tx) |
|
|
413
|
+
| `useExecuteProgram()` | `execute(...)` | program output |
|
|
414
|
+
| `useCompile()` | `compile({ source })` | `{ component, txScript, noteScript }` |
|
|
415
|
+
| `useWaitForCommit()` | `waitForCommit({ txId })` | resolves when committed on-chain |
|
|
397
416
|
|
|
398
417
|
## Type Imports
|
|
399
418
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Miden
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ React hooks library for the Miden Web Client. Provides a simple, ergonomic inter
|
|
|
21
21
|
```bash
|
|
22
22
|
npm install @miden-sdk/react @miden-sdk/miden-sdk
|
|
23
23
|
# or
|
|
24
|
-
|
|
24
|
+
pnpm add @miden-sdk/react @miden-sdk/miden-sdk
|
|
25
25
|
# or
|
|
26
26
|
pnpm add @miden-sdk/react @miden-sdk/miden-sdk
|
|
27
27
|
```
|
|
@@ -32,14 +32,14 @@ From `packages/react-sdk`:
|
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
# Unit tests
|
|
35
|
-
|
|
35
|
+
pnpm test:unit
|
|
36
36
|
|
|
37
37
|
# Integration tests (Playwright) in test/
|
|
38
38
|
# Build the web-client dist first:
|
|
39
|
-
cd ../../crates/web-client &&
|
|
39
|
+
cd ../../crates/web-client && pnpm build
|
|
40
40
|
cd ../../packages/react-sdk
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
pnpm exec playwright install --with-deps
|
|
42
|
+
pnpm test:integration
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Quick Start
|
|
@@ -1616,8 +1616,8 @@ One runnable Vite example lives in `examples/`:
|
|
|
1616
1616
|
|
|
1617
1617
|
```bash
|
|
1618
1618
|
cd examples/wallet
|
|
1619
|
-
|
|
1620
|
-
|
|
1619
|
+
pnpm install
|
|
1620
|
+
pnpm dev
|
|
1621
1621
|
```
|
|
1622
1622
|
|
|
1623
1623
|
## Requirements
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { AccountId, Account, AccountHeader, AccountStorageMode, AccountComponent, NoteId, InputNoteRecord, Note, StorageMode, AuthScheme, TransactionScript, AdviceInputs, AccountStorageRequirements, TransactionRequest, WasmWebClient, AccountFile, NoteVisibility, ConsumableNoteRecord, TransactionId, TransactionFilter, TransactionRecord, TransactionProver, CompileComponentOptions, CompileTxScriptOptions, CompileNoteScriptOptions, NoteScript, NoteAttachment } from '@miden-sdk/miden-sdk
|
|
5
|
-
export { Account, AccountFile, AccountHeader, AccountId, AccountStorageMode, AuthScheme, ConsumableNoteRecord, InputNoteRecord, Note, NoteType, TransactionFilter, TransactionId, TransactionRecord, TransactionRequest, WasmWebClient as WebClient } from '@miden-sdk/miden-sdk
|
|
4
|
+
import { AccountId, Account, AccountHeader, AccountStorageMode, AccountComponent, NoteId, InputNoteRecord, Note, StorageMode, AuthScheme, TransactionScript, AdviceInputs, AccountStorageRequirements, TransactionRequest, WasmWebClient, AccountFile, NoteVisibility, ConsumableNoteRecord, TransactionId, TransactionFilter, TransactionRecord, TransactionProver, CompileComponentOptions, CompileTxScriptOptions, CompileNoteScriptOptions, NoteScript, NoteAttachment } from '@miden-sdk/miden-sdk';
|
|
5
|
+
export { Account, AccountFile, AccountHeader, AccountId, AccountStorageMode, AuthScheme, ConsumableNoteRecord, InputNoteRecord, Note, NoteType, TransactionFilter, TransactionId, TransactionRecord, TransactionRequest, WasmWebClient as WebClient } from '@miden-sdk/miden-sdk';
|
|
6
6
|
|
|
7
|
-
declare module "@miden-sdk/miden-sdk
|
|
7
|
+
declare module "@miden-sdk/miden-sdk" {
|
|
8
8
|
interface Account {
|
|
9
9
|
/** Returns the bech32-encoded account id using the configured network. */
|
|
10
10
|
bech32id(): string;
|
|
@@ -1391,6 +1391,8 @@ interface UseSyncControlResult {
|
|
|
1391
1391
|
*/
|
|
1392
1392
|
declare function useSyncControl(): UseSyncControlResult;
|
|
1393
1393
|
|
|
1394
|
+
declare const installAccountBech32: () => void;
|
|
1395
|
+
declare const ensureAccountBech32: (account?: Account | null) => void;
|
|
1394
1396
|
declare const toBech32AccountId: (accountId: string) => string;
|
|
1395
1397
|
|
|
1396
1398
|
declare const formatAssetAmount: (amount: bigint | number, decimals?: number) => string;
|
|
@@ -1494,4 +1496,4 @@ declare function createMidenStorage(prefix: string): {
|
|
|
1494
1496
|
clear(): void;
|
|
1495
1497
|
};
|
|
1496
1498
|
|
|
1497
|
-
export { type AccountRef, type AccountResult, type AccountsResult, type AssetBalance, type AssetMetadata, type ConsumeOptions, type CreateFaucetOptions, type CreateWalletOptions, DEFAULTS, type ExecuteProgramOptions, type ExecuteProgramResult, type ExecuteTransactionOptions, type ImportAccountOptions, type ImportStoreOptions, type MidenConfig, MidenError, type MidenErrorCode, MidenProvider, type MidenState, type MigrateStorageOptions, type MintOptions, type MultiSendOptions, type MultiSendRecipient, type MultiSignerContextValue, MultiSignerProvider, type MutationResult, type NoteAsset, type NoteAttachmentData, type NoteSummary, type NotesFilter, type NotesResult, type ProverConfig, type ProverTarget, type ProverUrls, type QueryResult, type RpcUrlConfig, type SendOptions, type SendResult, type SessionAccountStep, type SignCallback, type SignerAccountConfig, type SignerAccountType, SignerContext, type SignerContextValue, SignerSlot, type StreamedNote, type SwapOptions, type SyncState, type TransactionHistoryOptions, type TransactionHistoryResult, type TransactionResult, type TransactionStage, type TransactionStatus, type UseCompileResult, type UseConsumeResult, type UseCreateFaucetResult, type UseCreateWalletResult, type UseExecuteProgramResult, type UseExportNoteResult, type UseExportStoreResult, type UseImportAccountResult, type UseImportNoteResult, type UseImportStoreResult, type UseMintResult, type UseMultiSendResult, type UseNoteStreamOptions, type UseNoteStreamReturn, type UseSendResult, type UseSessionAccountOptions, type UseSessionAccountReturn, type UseSwapResult, type UseSyncControlResult, type UseSyncStateResult, type UseTransactionHistoryResult, type UseTransactionResult, type UseWaitForCommitResult, type UseWaitForNotesResult, type WaitForCommitOptions, type WaitForNotesOptions, type WalletAdapterLike, accountIdsEqual, bigIntToBytes, bytesToBigInt, clearMidenStorage, concatBytes, createMidenStorage, createNoteAttachment, formatAssetAmount, formatNoteSummary, getNoteSummary, migrateStorage, normalizeAccountId, parseAssetAmount, readNoteAttachment, toBech32AccountId, useAccount, useAccounts, useAssetMetadata, useCompile, useConsume, useCreateFaucet, useCreateWallet, useExecuteProgram, useExportNote, useExportStore, useImportAccount, useImportNote, useImportStore, useMiden, useMidenClient, useMint, useMultiSend, useMultiSigner, useNoteStream, useNotes, useSend, useSessionAccount, useSigner, useSwap, useSyncControl, useSyncState, useTransaction, useTransactionHistory, useWaitForCommit, useWaitForNotes, waitForWalletDetection, wrapWasmError };
|
|
1499
|
+
export { type AccountRef, type AccountResult, type AccountsResult, type AssetBalance, type AssetMetadata, type ConsumeOptions, type CreateFaucetOptions, type CreateWalletOptions, DEFAULTS, type ExecuteProgramOptions, type ExecuteProgramResult, type ExecuteTransactionOptions, type ImportAccountOptions, type ImportStoreOptions, type MidenConfig, MidenError, type MidenErrorCode, MidenProvider, type MidenState, type MigrateStorageOptions, type MintOptions, type MultiSendOptions, type MultiSendRecipient, type MultiSignerContextValue, MultiSignerProvider, type MutationResult, type NoteAsset, type NoteAttachmentData, type NoteSummary, type NotesFilter, type NotesResult, type ProverConfig, type ProverTarget, type ProverUrls, type QueryResult, type RpcUrlConfig, type SendOptions, type SendResult, type SessionAccountStep, type SignCallback, type SignerAccountConfig, type SignerAccountType, SignerContext, type SignerContextValue, SignerSlot, type StreamedNote, type SwapOptions, type SyncState, type TransactionHistoryOptions, type TransactionHistoryResult, type TransactionResult, type TransactionStage, type TransactionStatus, type UseCompileResult, type UseConsumeResult, type UseCreateFaucetResult, type UseCreateWalletResult, type UseExecuteProgramResult, type UseExportNoteResult, type UseExportStoreResult, type UseImportAccountResult, type UseImportNoteResult, type UseImportStoreResult, type UseMintResult, type UseMultiSendResult, type UseNoteStreamOptions, type UseNoteStreamReturn, type UseSendResult, type UseSessionAccountOptions, type UseSessionAccountReturn, type UseSwapResult, type UseSyncControlResult, type UseSyncStateResult, type UseTransactionHistoryResult, type UseTransactionResult, type UseWaitForCommitResult, type UseWaitForNotesResult, type WaitForCommitOptions, type WaitForNotesOptions, type WalletAdapterLike, accountIdsEqual, bigIntToBytes, bytesToBigInt, clearMidenStorage, concatBytes, createMidenStorage, createNoteAttachment, ensureAccountBech32, formatAssetAmount, formatNoteSummary, getNoteSummary, installAccountBech32, migrateStorage, normalizeAccountId, parseAssetAmount, readNoteAttachment, toBech32AccountId, useAccount, useAccounts, useAssetMetadata, useCompile, useConsume, useCreateFaucet, useCreateWallet, useExecuteProgram, useExportNote, useExportStore, useImportAccount, useImportNote, useImportStore, useMiden, useMidenClient, useMint, useMultiSend, useMultiSigner, useNoteStream, useNotes, useSend, useSessionAccount, useSigner, useSwap, useSyncControl, useSyncState, useTransaction, useTransactionHistory, useWaitForCommit, useWaitForNotes, waitForWalletDetection, wrapWasmError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { AccountId, Account, AccountHeader, AccountStorageMode, AccountComponent, NoteId, InputNoteRecord, Note, StorageMode, AuthScheme, TransactionScript, AdviceInputs, AccountStorageRequirements, TransactionRequest, WasmWebClient, AccountFile, NoteVisibility, ConsumableNoteRecord, TransactionId, TransactionFilter, TransactionRecord, TransactionProver, CompileComponentOptions, CompileTxScriptOptions, CompileNoteScriptOptions, NoteScript, NoteAttachment } from '@miden-sdk/miden-sdk
|
|
5
|
-
export { Account, AccountFile, AccountHeader, AccountId, AccountStorageMode, AuthScheme, ConsumableNoteRecord, InputNoteRecord, Note, NoteType, TransactionFilter, TransactionId, TransactionRecord, TransactionRequest, WasmWebClient as WebClient } from '@miden-sdk/miden-sdk
|
|
4
|
+
import { AccountId, Account, AccountHeader, AccountStorageMode, AccountComponent, NoteId, InputNoteRecord, Note, StorageMode, AuthScheme, TransactionScript, AdviceInputs, AccountStorageRequirements, TransactionRequest, WasmWebClient, AccountFile, NoteVisibility, ConsumableNoteRecord, TransactionId, TransactionFilter, TransactionRecord, TransactionProver, CompileComponentOptions, CompileTxScriptOptions, CompileNoteScriptOptions, NoteScript, NoteAttachment } from '@miden-sdk/miden-sdk';
|
|
5
|
+
export { Account, AccountFile, AccountHeader, AccountId, AccountStorageMode, AuthScheme, ConsumableNoteRecord, InputNoteRecord, Note, NoteType, TransactionFilter, TransactionId, TransactionRecord, TransactionRequest, WasmWebClient as WebClient } from '@miden-sdk/miden-sdk';
|
|
6
6
|
|
|
7
|
-
declare module "@miden-sdk/miden-sdk
|
|
7
|
+
declare module "@miden-sdk/miden-sdk" {
|
|
8
8
|
interface Account {
|
|
9
9
|
/** Returns the bech32-encoded account id using the configured network. */
|
|
10
10
|
bech32id(): string;
|
|
@@ -1391,6 +1391,8 @@ interface UseSyncControlResult {
|
|
|
1391
1391
|
*/
|
|
1392
1392
|
declare function useSyncControl(): UseSyncControlResult;
|
|
1393
1393
|
|
|
1394
|
+
declare const installAccountBech32: () => void;
|
|
1395
|
+
declare const ensureAccountBech32: (account?: Account | null) => void;
|
|
1394
1396
|
declare const toBech32AccountId: (accountId: string) => string;
|
|
1395
1397
|
|
|
1396
1398
|
declare const formatAssetAmount: (amount: bigint | number, decimals?: number) => string;
|
|
@@ -1494,4 +1496,4 @@ declare function createMidenStorage(prefix: string): {
|
|
|
1494
1496
|
clear(): void;
|
|
1495
1497
|
};
|
|
1496
1498
|
|
|
1497
|
-
export { type AccountRef, type AccountResult, type AccountsResult, type AssetBalance, type AssetMetadata, type ConsumeOptions, type CreateFaucetOptions, type CreateWalletOptions, DEFAULTS, type ExecuteProgramOptions, type ExecuteProgramResult, type ExecuteTransactionOptions, type ImportAccountOptions, type ImportStoreOptions, type MidenConfig, MidenError, type MidenErrorCode, MidenProvider, type MidenState, type MigrateStorageOptions, type MintOptions, type MultiSendOptions, type MultiSendRecipient, type MultiSignerContextValue, MultiSignerProvider, type MutationResult, type NoteAsset, type NoteAttachmentData, type NoteSummary, type NotesFilter, type NotesResult, type ProverConfig, type ProverTarget, type ProverUrls, type QueryResult, type RpcUrlConfig, type SendOptions, type SendResult, type SessionAccountStep, type SignCallback, type SignerAccountConfig, type SignerAccountType, SignerContext, type SignerContextValue, SignerSlot, type StreamedNote, type SwapOptions, type SyncState, type TransactionHistoryOptions, type TransactionHistoryResult, type TransactionResult, type TransactionStage, type TransactionStatus, type UseCompileResult, type UseConsumeResult, type UseCreateFaucetResult, type UseCreateWalletResult, type UseExecuteProgramResult, type UseExportNoteResult, type UseExportStoreResult, type UseImportAccountResult, type UseImportNoteResult, type UseImportStoreResult, type UseMintResult, type UseMultiSendResult, type UseNoteStreamOptions, type UseNoteStreamReturn, type UseSendResult, type UseSessionAccountOptions, type UseSessionAccountReturn, type UseSwapResult, type UseSyncControlResult, type UseSyncStateResult, type UseTransactionHistoryResult, type UseTransactionResult, type UseWaitForCommitResult, type UseWaitForNotesResult, type WaitForCommitOptions, type WaitForNotesOptions, type WalletAdapterLike, accountIdsEqual, bigIntToBytes, bytesToBigInt, clearMidenStorage, concatBytes, createMidenStorage, createNoteAttachment, formatAssetAmount, formatNoteSummary, getNoteSummary, migrateStorage, normalizeAccountId, parseAssetAmount, readNoteAttachment, toBech32AccountId, useAccount, useAccounts, useAssetMetadata, useCompile, useConsume, useCreateFaucet, useCreateWallet, useExecuteProgram, useExportNote, useExportStore, useImportAccount, useImportNote, useImportStore, useMiden, useMidenClient, useMint, useMultiSend, useMultiSigner, useNoteStream, useNotes, useSend, useSessionAccount, useSigner, useSwap, useSyncControl, useSyncState, useTransaction, useTransactionHistory, useWaitForCommit, useWaitForNotes, waitForWalletDetection, wrapWasmError };
|
|
1499
|
+
export { type AccountRef, type AccountResult, type AccountsResult, type AssetBalance, type AssetMetadata, type ConsumeOptions, type CreateFaucetOptions, type CreateWalletOptions, DEFAULTS, type ExecuteProgramOptions, type ExecuteProgramResult, type ExecuteTransactionOptions, type ImportAccountOptions, type ImportStoreOptions, type MidenConfig, MidenError, type MidenErrorCode, MidenProvider, type MidenState, type MigrateStorageOptions, type MintOptions, type MultiSendOptions, type MultiSendRecipient, type MultiSignerContextValue, MultiSignerProvider, type MutationResult, type NoteAsset, type NoteAttachmentData, type NoteSummary, type NotesFilter, type NotesResult, type ProverConfig, type ProverTarget, type ProverUrls, type QueryResult, type RpcUrlConfig, type SendOptions, type SendResult, type SessionAccountStep, type SignCallback, type SignerAccountConfig, type SignerAccountType, SignerContext, type SignerContextValue, SignerSlot, type StreamedNote, type SwapOptions, type SyncState, type TransactionHistoryOptions, type TransactionHistoryResult, type TransactionResult, type TransactionStage, type TransactionStatus, type UseCompileResult, type UseConsumeResult, type UseCreateFaucetResult, type UseCreateWalletResult, type UseExecuteProgramResult, type UseExportNoteResult, type UseExportStoreResult, type UseImportAccountResult, type UseImportNoteResult, type UseImportStoreResult, type UseMintResult, type UseMultiSendResult, type UseNoteStreamOptions, type UseNoteStreamReturn, type UseSendResult, type UseSessionAccountOptions, type UseSessionAccountReturn, type UseSwapResult, type UseSyncControlResult, type UseSyncStateResult, type UseTransactionHistoryResult, type UseTransactionResult, type UseWaitForCommitResult, type UseWaitForNotesResult, type WaitForCommitOptions, type WaitForNotesOptions, type WalletAdapterLike, accountIdsEqual, bigIntToBytes, bytesToBigInt, clearMidenStorage, concatBytes, createMidenStorage, createNoteAttachment, ensureAccountBech32, formatAssetAmount, formatNoteSummary, getNoteSummary, installAccountBech32, migrateStorage, normalizeAccountId, parseAssetAmount, readNoteAttachment, toBech32AccountId, useAccount, useAccounts, useAssetMetadata, useCompile, useConsume, useCreateFaucet, useCreateWallet, useExecuteProgram, useExportNote, useExportStore, useImportAccount, useImportNote, useImportStore, useMiden, useMidenClient, useMint, useMultiSend, useMultiSigner, useNoteStream, useNotes, useSend, useSessionAccount, useSigner, useSwap, useSyncControl, useSyncState, useTransaction, useTransactionHistory, useWaitForCommit, useWaitForNotes, waitForWalletDetection, wrapWasmError };
|