@miden-sdk/miden-wallet-adapter-base 0.13.0
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/adapter.ts +146 -0
- package/dist/adapter.d.ts +69 -0
- package/dist/adapter.js +74 -0
- package/dist/adapter.js.map +1 -0
- package/dist/errors.d.ts +70 -0
- package/dist/errors.js +75 -0
- package/dist/errors.js.map +1 -0
- package/dist/helpers.d.ts +2 -0
- package/dist/helpers.js +32 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/signer.d.ts +34 -0
- package/dist/signer.js +6 -0
- package/dist/signer.js.map +1 -0
- package/dist/transaction.d.ts +67 -0
- package/dist/transaction.js +74 -0
- package/dist/transaction.js.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/README.md +24 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/EventEmitterStatic.md +17 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/ListenerFn.md +25 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ArgumentMap.md +15 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventArgs.md +19 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventListener.md +19 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventNames.md +15 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ValidEventTypes.md +17 -0
- package/docs/@miden-sdk/namespaces/EventEmitter/variables/EventEmitter.md +9 -0
- package/docs/README.md +88 -0
- package/docs/classes/BaseMessageSignerWalletAdapter.md +755 -0
- package/docs/classes/BaseSignerWalletAdapter.md +579 -0
- package/docs/classes/BaseWalletAdapter.md +535 -0
- package/docs/classes/ConsumeTransaction.md +93 -0
- package/docs/classes/CustomTransaction.md +93 -0
- package/docs/classes/EventEmitter.md +305 -0
- package/docs/classes/SendTransaction.md +107 -0
- package/docs/classes/Transaction.md +151 -0
- package/docs/classes/WalletAccountError.md +223 -0
- package/docs/classes/WalletAddressError.md +223 -0
- package/docs/classes/WalletConfigError.md +223 -0
- package/docs/classes/WalletConnectionError.md +223 -0
- package/docs/classes/WalletDecryptionError.md +223 -0
- package/docs/classes/WalletDecryptionNotAllowedError.md +223 -0
- package/docs/classes/WalletDisconnectedError.md +223 -0
- package/docs/classes/WalletDisconnectionError.md +223 -0
- package/docs/classes/WalletError.md +244 -0
- package/docs/classes/WalletKeypairError.md +223 -0
- package/docs/classes/WalletLoadError.md +223 -0
- package/docs/classes/WalletNotConnectedError.md +223 -0
- package/docs/classes/WalletNotReadyError.md +223 -0
- package/docs/classes/WalletNotSelectedError.md +223 -0
- package/docs/classes/WalletPrivateDataPermissionError.md +223 -0
- package/docs/classes/WalletRecordsError.md +223 -0
- package/docs/classes/WalletSendTransactionError.md +223 -0
- package/docs/classes/WalletSignMessageError.md +223 -0
- package/docs/classes/WalletSignTransactionError.md +223 -0
- package/docs/classes/WalletTimeoutError.md +223 -0
- package/docs/classes/WalletTransactionError.md +223 -0
- package/docs/classes/WalletWindowBlockedError.md +223 -0
- package/docs/classes/WalletWindowClosedError.md +223 -0
- package/docs/enumerations/AllowedPrivateData.md +37 -0
- package/docs/enumerations/PrivateDataPermission.md +19 -0
- package/docs/enumerations/TransactionType.md +25 -0
- package/docs/enumerations/WalletAdapterNetwork.md +19 -0
- package/docs/enumerations/WalletReadyState.md +49 -0
- package/docs/functions/b64ToU8.md +19 -0
- package/docs/functions/scopePollingDetectionStrategy.md +19 -0
- package/docs/functions/u8ToB64.md +19 -0
- package/docs/interfaces/Asset.md +19 -0
- package/docs/interfaces/IFailedTransactionOutput.md +13 -0
- package/docs/interfaces/MessageSignerWalletAdapterProps.md +293 -0
- package/docs/interfaces/MidenConsumeTransaction.md +37 -0
- package/docs/interfaces/MidenCustomTransaction.md +37 -0
- package/docs/interfaces/MidenSendTransaction.md +43 -0
- package/docs/interfaces/MidenTransaction.md +19 -0
- package/docs/interfaces/SignerWalletAdapterProps.md +149 -0
- package/docs/interfaces/TransactionOutput.md +19 -0
- package/docs/interfaces/WalletAdapterEvents.md +69 -0
- package/docs/interfaces/WalletAdapterProps.md +106 -0
- package/docs/interfaces/WalletTransactionSuccessOutput.md +19 -0
- package/docs/type-aliases/Adapter.md +9 -0
- package/docs/type-aliases/FungibleAssetDetails.md +21 -0
- package/docs/type-aliases/InputNoteDetails.md +45 -0
- package/docs/type-aliases/MessageSignerWalletAdapter.md +15 -0
- package/docs/type-aliases/NoteTypeString.md +9 -0
- package/docs/type-aliases/SignKind.md +9 -0
- package/docs/type-aliases/SignerWalletAdapter.md +15 -0
- package/docs/type-aliases/SupportedTransactionVersions.md +9 -0
- package/docs/type-aliases/TransactionOrVersionedTransaction.md +15 -0
- package/docs/type-aliases/TransactionPayload.md +9 -0
- package/docs/type-aliases/WalletAdapter.md +15 -0
- package/docs/type-aliases/WalletName.md +21 -0
- package/docs/type-aliases/WalletTransactionOutput.md +9 -0
- package/errors.ts +97 -0
- package/helpers.ts +28 -0
- package/index.ts +6 -0
- package/package.json +21 -0
- package/signer.ts +71 -0
- package/transaction.ts +178 -0
- package/tsconfig.json +15 -0
- package/types.ts +68 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { u8ToB64 } from './helpers';
|
|
2
|
+
export class SendTransaction {
|
|
3
|
+
senderAddress;
|
|
4
|
+
recipientAddress;
|
|
5
|
+
faucetId;
|
|
6
|
+
noteType;
|
|
7
|
+
amount;
|
|
8
|
+
recallBlocks;
|
|
9
|
+
constructor(sender, recipient, faucetId, noteType, amount, recallBlocks) {
|
|
10
|
+
this.senderAddress = sender;
|
|
11
|
+
this.recipientAddress = recipient;
|
|
12
|
+
this.faucetId = faucetId;
|
|
13
|
+
this.noteType = noteType;
|
|
14
|
+
this.amount = amount;
|
|
15
|
+
this.recallBlocks = recallBlocks;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class ConsumeTransaction {
|
|
19
|
+
faucetId;
|
|
20
|
+
noteId;
|
|
21
|
+
noteType;
|
|
22
|
+
amount;
|
|
23
|
+
noteBytes;
|
|
24
|
+
constructor(faucetId, noteId, noteType, amount, noteBytes) {
|
|
25
|
+
this.faucetId = faucetId;
|
|
26
|
+
this.noteId = noteId;
|
|
27
|
+
this.noteType = noteType;
|
|
28
|
+
this.amount = amount;
|
|
29
|
+
this.noteBytes = noteBytes ? u8ToB64(noteBytes) : undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class CustomTransaction {
|
|
33
|
+
address;
|
|
34
|
+
recipientAddress;
|
|
35
|
+
transactionRequest;
|
|
36
|
+
inputNoteIds;
|
|
37
|
+
importNotes;
|
|
38
|
+
constructor(address, recipientAddress, transactionRequest, inputNotesIds, inputNoteBytes) {
|
|
39
|
+
this.address = address;
|
|
40
|
+
this.recipientAddress = recipientAddress;
|
|
41
|
+
const requestBytes = transactionRequest.serialize();
|
|
42
|
+
const base64 = u8ToB64(requestBytes);
|
|
43
|
+
this.transactionRequest = base64;
|
|
44
|
+
this.inputNoteIds = inputNotesIds;
|
|
45
|
+
this.importNotes = inputNoteBytes?.map((note) => u8ToB64(note));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export var TransactionType;
|
|
49
|
+
(function (TransactionType) {
|
|
50
|
+
TransactionType["Send"] = "send";
|
|
51
|
+
TransactionType["Consume"] = "consume";
|
|
52
|
+
TransactionType["Custom"] = "custom";
|
|
53
|
+
})(TransactionType || (TransactionType = {}));
|
|
54
|
+
export class Transaction {
|
|
55
|
+
type;
|
|
56
|
+
payload;
|
|
57
|
+
constructor(type, payload) {
|
|
58
|
+
this.type = type;
|
|
59
|
+
this.payload = payload;
|
|
60
|
+
}
|
|
61
|
+
static createSendTransaction(sender, recipient, faucetId, noteType, amount, recallBlocks) {
|
|
62
|
+
const sendTransaction = new SendTransaction(sender, recipient, faucetId, noteType, amount, recallBlocks);
|
|
63
|
+
return new Transaction(TransactionType.Send, sendTransaction);
|
|
64
|
+
}
|
|
65
|
+
static createConsumeTransaction(faucetId, noteId, noteType, amount, noteBytes) {
|
|
66
|
+
const consumeTransaction = new ConsumeTransaction(faucetId, noteId, noteType, amount, noteBytes);
|
|
67
|
+
return new Transaction(TransactionType.Consume, consumeTransaction);
|
|
68
|
+
}
|
|
69
|
+
static createCustomTransaction(address, recipientAddress, transactionRequest, inputNoteIds, noteBytes) {
|
|
70
|
+
const transactionBytes = new CustomTransaction(address, recipientAddress, transactionRequest, inputNoteIds, noteBytes);
|
|
71
|
+
return new Transaction(TransactionType.Custom, transactionBytes);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../transaction.ts"],"names":[],"mappings":"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"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { InputNoteState, Note, NoteType } from '@miden-sdk/miden-sdk';
|
|
2
|
+
export declare enum WalletAdapterNetwork {
|
|
3
|
+
Testnet = "testnet",
|
|
4
|
+
Localnet = "localnet"
|
|
5
|
+
}
|
|
6
|
+
export type SupportedTransactionVersions = ReadonlySet<any> | null;
|
|
7
|
+
export type TransactionOrVersionedTransaction<S extends SupportedTransactionVersions> = S extends null ? any : any | any;
|
|
8
|
+
export declare enum PrivateDataPermission {
|
|
9
|
+
UponRequest = "UPON_REQUEST",// The App must ask for permission to access private data every time
|
|
10
|
+
Auto = "AUTO"
|
|
11
|
+
}
|
|
12
|
+
export declare enum AllowedPrivateData {
|
|
13
|
+
None = 0,
|
|
14
|
+
Assets = 1,// 1
|
|
15
|
+
Notes = 2,// 2
|
|
16
|
+
Storage = 4,// 4
|
|
17
|
+
All = 65535
|
|
18
|
+
}
|
|
19
|
+
export type SignKind = 'word' | 'signingInputs';
|
|
20
|
+
export interface Asset {
|
|
21
|
+
faucetId: string;
|
|
22
|
+
amount: string;
|
|
23
|
+
}
|
|
24
|
+
export type InputNoteDetails = {
|
|
25
|
+
noteId: string;
|
|
26
|
+
senderAccountId: string | undefined;
|
|
27
|
+
assets: FungibleAssetDetails[];
|
|
28
|
+
noteType: NoteType | undefined;
|
|
29
|
+
nullifier: string;
|
|
30
|
+
state: InputNoteState;
|
|
31
|
+
};
|
|
32
|
+
export type FungibleAssetDetails = {
|
|
33
|
+
amount: string;
|
|
34
|
+
faucetId: string;
|
|
35
|
+
};
|
|
36
|
+
export interface TransactionOutput {
|
|
37
|
+
txHash: string;
|
|
38
|
+
outputNotes: Note[];
|
|
39
|
+
}
|
|
40
|
+
export interface IFailedTransactionOutput {
|
|
41
|
+
errorMessage: string;
|
|
42
|
+
}
|
|
43
|
+
export interface WalletTransactionSuccessOutput {
|
|
44
|
+
txHash: string;
|
|
45
|
+
outputNotes: string[];
|
|
46
|
+
}
|
|
47
|
+
export type WalletTransactionOutput = WalletTransactionSuccessOutput | IFailedTransactionOutput;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var WalletAdapterNetwork;
|
|
2
|
+
(function (WalletAdapterNetwork) {
|
|
3
|
+
WalletAdapterNetwork["Testnet"] = "testnet";
|
|
4
|
+
WalletAdapterNetwork["Localnet"] = "localnet";
|
|
5
|
+
})(WalletAdapterNetwork || (WalletAdapterNetwork = {}));
|
|
6
|
+
export var PrivateDataPermission;
|
|
7
|
+
(function (PrivateDataPermission) {
|
|
8
|
+
PrivateDataPermission["UponRequest"] = "UPON_REQUEST";
|
|
9
|
+
PrivateDataPermission["Auto"] = "AUTO";
|
|
10
|
+
})(PrivateDataPermission || (PrivateDataPermission = {}));
|
|
11
|
+
export var AllowedPrivateData;
|
|
12
|
+
(function (AllowedPrivateData) {
|
|
13
|
+
AllowedPrivateData[AllowedPrivateData["None"] = 0] = "None";
|
|
14
|
+
AllowedPrivateData[AllowedPrivateData["Assets"] = 1] = "Assets";
|
|
15
|
+
AllowedPrivateData[AllowedPrivateData["Notes"] = 2] = "Notes";
|
|
16
|
+
AllowedPrivateData[AllowedPrivateData["Storage"] = 4] = "Storage";
|
|
17
|
+
AllowedPrivateData[AllowedPrivateData["All"] = 65535] = "All";
|
|
18
|
+
})(AllowedPrivateData || (AllowedPrivateData = {}));
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAQD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,qDAA4B,CAAA;IAC5B,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,2DAAQ,CAAA;IACR,+DAAe,CAAA;IACf,6DAAc,CAAA;IACd,iEAAgB,CAAA;IAChB,6DAAmB,CAAA;AACrB,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../README.md) / EventEmitter
|
|
6
|
+
|
|
7
|
+
# EventEmitter
|
|
8
|
+
|
|
9
|
+
## Interfaces
|
|
10
|
+
|
|
11
|
+
- [EventEmitterStatic](interfaces/EventEmitterStatic.md)
|
|
12
|
+
- [ListenerFn](interfaces/ListenerFn.md)
|
|
13
|
+
|
|
14
|
+
## Type Aliases
|
|
15
|
+
|
|
16
|
+
- [ArgumentMap](type-aliases/ArgumentMap.md)
|
|
17
|
+
- [EventArgs](type-aliases/EventArgs.md)
|
|
18
|
+
- [EventListener](type-aliases/EventListener.md)
|
|
19
|
+
- [EventNames](type-aliases/EventNames.md)
|
|
20
|
+
- [ValidEventTypes](type-aliases/ValidEventTypes.md)
|
|
21
|
+
|
|
22
|
+
## Variables
|
|
23
|
+
|
|
24
|
+
- [EventEmitter](variables/EventEmitter.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / EventEmitterStatic
|
|
6
|
+
|
|
7
|
+
# Interface: EventEmitterStatic
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new EventEmitterStatic**\<`EventTypes`, `Context`\>(): [`EventEmitter`](../../../../classes/EventEmitter.md)\<`EventTypes`, `Context`\>
|
|
14
|
+
|
|
15
|
+
#### Returns
|
|
16
|
+
|
|
17
|
+
[`EventEmitter`](../../../../classes/EventEmitter.md)\<`EventTypes`, `Context`\>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / ListenerFn
|
|
6
|
+
|
|
7
|
+
# Interface: ListenerFn()\<Args\>
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### Args
|
|
12
|
+
|
|
13
|
+
`Args` *extends* `any`[] = `any`[]
|
|
14
|
+
|
|
15
|
+
> **ListenerFn**(...`args`): `void`
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### args
|
|
20
|
+
|
|
21
|
+
...`Args`
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`void`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / ArgumentMap
|
|
6
|
+
|
|
7
|
+
# Type Alias: ArgumentMap\<T\>
|
|
8
|
+
|
|
9
|
+
> **ArgumentMap**\<`T`\> = `{ [K in keyof T]: T[K] extends (args: any[]) => void ? Parameters<T[K]> : T[K] extends any[] ? T[K] : any[] }`
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
### T
|
|
14
|
+
|
|
15
|
+
`T` *extends* `object`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / EventArgs
|
|
6
|
+
|
|
7
|
+
# Type Alias: EventArgs\<T, K\>
|
|
8
|
+
|
|
9
|
+
> **EventArgs**\<`T`, `K`\> = `Parameters`\<[`EventListener`](EventListener.md)\<`T`, `K`\>\>
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
### T
|
|
14
|
+
|
|
15
|
+
`T` *extends* [`ValidEventTypes`](ValidEventTypes.md)
|
|
16
|
+
|
|
17
|
+
### K
|
|
18
|
+
|
|
19
|
+
`K` *extends* [`EventNames`](EventNames.md)\<`T`\>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / EventListener
|
|
6
|
+
|
|
7
|
+
# Type Alias: EventListener\<T, K\>
|
|
8
|
+
|
|
9
|
+
> **EventListener**\<`T`, `K`\> = `T` *extends* `string` \| `symbol` ? (...`args`) => `void` : (...`args`) => `void`
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
### T
|
|
14
|
+
|
|
15
|
+
`T` *extends* [`ValidEventTypes`](ValidEventTypes.md)
|
|
16
|
+
|
|
17
|
+
### K
|
|
18
|
+
|
|
19
|
+
`K` *extends* [`EventNames`](EventNames.md)\<`T`\>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / EventNames
|
|
6
|
+
|
|
7
|
+
# Type Alias: EventNames\<T\>
|
|
8
|
+
|
|
9
|
+
> **EventNames**\<`T`\> = `T` *extends* `string` \| `symbol` ? `T` : keyof `T`
|
|
10
|
+
|
|
11
|
+
## Type Parameters
|
|
12
|
+
|
|
13
|
+
### T
|
|
14
|
+
|
|
15
|
+
`T` *extends* [`ValidEventTypes`](ValidEventTypes.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / ValidEventTypes
|
|
6
|
+
|
|
7
|
+
# Type Alias: ValidEventTypes
|
|
8
|
+
|
|
9
|
+
> **ValidEventTypes** = `string` \| `symbol` \| `object`
|
|
10
|
+
|
|
11
|
+
`object` should be in either of the following forms:
|
|
12
|
+
```
|
|
13
|
+
interface EventTypes {
|
|
14
|
+
'event-with-parameters': any[]
|
|
15
|
+
'event-with-example-handler': (...args: any[]) => void
|
|
16
|
+
}
|
|
17
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../../../../README.md) / [EventEmitter](../README.md) / EventEmitter
|
|
6
|
+
|
|
7
|
+
# Variable: EventEmitter
|
|
8
|
+
|
|
9
|
+
> `const` **EventEmitter**: [`EventEmitterStatic`](../interfaces/EventEmitterStatic.md)
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
**@miden-sdk/miden-wallet-adapter-base**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
# @miden-sdk/miden-wallet-adapter-base
|
|
6
|
+
|
|
7
|
+
## Namespaces
|
|
8
|
+
|
|
9
|
+
- [EventEmitter](@miden-sdk/namespaces/EventEmitter/README.md)
|
|
10
|
+
|
|
11
|
+
## Enumerations
|
|
12
|
+
|
|
13
|
+
- [AllowedPrivateData](enumerations/AllowedPrivateData.md)
|
|
14
|
+
- [PrivateDataPermission](enumerations/PrivateDataPermission.md)
|
|
15
|
+
- [TransactionType](enumerations/TransactionType.md)
|
|
16
|
+
- [WalletAdapterNetwork](enumerations/WalletAdapterNetwork.md)
|
|
17
|
+
- [WalletReadyState](enumerations/WalletReadyState.md)
|
|
18
|
+
|
|
19
|
+
## Classes
|
|
20
|
+
|
|
21
|
+
- [BaseMessageSignerWalletAdapter](classes/BaseMessageSignerWalletAdapter.md)
|
|
22
|
+
- [BaseSignerWalletAdapter](classes/BaseSignerWalletAdapter.md)
|
|
23
|
+
- [BaseWalletAdapter](classes/BaseWalletAdapter.md)
|
|
24
|
+
- [ConsumeTransaction](classes/ConsumeTransaction.md)
|
|
25
|
+
- [CustomTransaction](classes/CustomTransaction.md)
|
|
26
|
+
- [EventEmitter](classes/EventEmitter.md)
|
|
27
|
+
- [SendTransaction](classes/SendTransaction.md)
|
|
28
|
+
- [Transaction](classes/Transaction.md)
|
|
29
|
+
- [WalletAccountError](classes/WalletAccountError.md)
|
|
30
|
+
- [WalletAddressError](classes/WalletAddressError.md)
|
|
31
|
+
- [WalletConfigError](classes/WalletConfigError.md)
|
|
32
|
+
- [WalletConnectionError](classes/WalletConnectionError.md)
|
|
33
|
+
- [WalletDecryptionError](classes/WalletDecryptionError.md)
|
|
34
|
+
- [WalletDecryptionNotAllowedError](classes/WalletDecryptionNotAllowedError.md)
|
|
35
|
+
- [WalletDisconnectedError](classes/WalletDisconnectedError.md)
|
|
36
|
+
- [WalletDisconnectionError](classes/WalletDisconnectionError.md)
|
|
37
|
+
- [WalletError](classes/WalletError.md)
|
|
38
|
+
- [WalletKeypairError](classes/WalletKeypairError.md)
|
|
39
|
+
- [WalletLoadError](classes/WalletLoadError.md)
|
|
40
|
+
- [WalletNotConnectedError](classes/WalletNotConnectedError.md)
|
|
41
|
+
- [WalletNotReadyError](classes/WalletNotReadyError.md)
|
|
42
|
+
- [WalletNotSelectedError](classes/WalletNotSelectedError.md)
|
|
43
|
+
- [WalletPrivateDataPermissionError](classes/WalletPrivateDataPermissionError.md)
|
|
44
|
+
- [WalletRecordsError](classes/WalletRecordsError.md)
|
|
45
|
+
- [WalletSendTransactionError](classes/WalletSendTransactionError.md)
|
|
46
|
+
- [WalletSignMessageError](classes/WalletSignMessageError.md)
|
|
47
|
+
- [WalletSignTransactionError](classes/WalletSignTransactionError.md)
|
|
48
|
+
- [WalletTimeoutError](classes/WalletTimeoutError.md)
|
|
49
|
+
- [WalletTransactionError](classes/WalletTransactionError.md)
|
|
50
|
+
- [WalletWindowBlockedError](classes/WalletWindowBlockedError.md)
|
|
51
|
+
- [WalletWindowClosedError](classes/WalletWindowClosedError.md)
|
|
52
|
+
|
|
53
|
+
## Interfaces
|
|
54
|
+
|
|
55
|
+
- [Asset](interfaces/Asset.md)
|
|
56
|
+
- [IFailedTransactionOutput](interfaces/IFailedTransactionOutput.md)
|
|
57
|
+
- [MessageSignerWalletAdapterProps](interfaces/MessageSignerWalletAdapterProps.md)
|
|
58
|
+
- [MidenConsumeTransaction](interfaces/MidenConsumeTransaction.md)
|
|
59
|
+
- [MidenCustomTransaction](interfaces/MidenCustomTransaction.md)
|
|
60
|
+
- [MidenSendTransaction](interfaces/MidenSendTransaction.md)
|
|
61
|
+
- [MidenTransaction](interfaces/MidenTransaction.md)
|
|
62
|
+
- [SignerWalletAdapterProps](interfaces/SignerWalletAdapterProps.md)
|
|
63
|
+
- [TransactionOutput](interfaces/TransactionOutput.md)
|
|
64
|
+
- [WalletAdapterEvents](interfaces/WalletAdapterEvents.md)
|
|
65
|
+
- [WalletAdapterProps](interfaces/WalletAdapterProps.md)
|
|
66
|
+
- [WalletTransactionSuccessOutput](interfaces/WalletTransactionSuccessOutput.md)
|
|
67
|
+
|
|
68
|
+
## Type Aliases
|
|
69
|
+
|
|
70
|
+
- [Adapter](type-aliases/Adapter.md)
|
|
71
|
+
- [FungibleAssetDetails](type-aliases/FungibleAssetDetails.md)
|
|
72
|
+
- [InputNoteDetails](type-aliases/InputNoteDetails.md)
|
|
73
|
+
- [MessageSignerWalletAdapter](type-aliases/MessageSignerWalletAdapter.md)
|
|
74
|
+
- [NoteTypeString](type-aliases/NoteTypeString.md)
|
|
75
|
+
- [SignerWalletAdapter](type-aliases/SignerWalletAdapter.md)
|
|
76
|
+
- [SignKind](type-aliases/SignKind.md)
|
|
77
|
+
- [SupportedTransactionVersions](type-aliases/SupportedTransactionVersions.md)
|
|
78
|
+
- [TransactionOrVersionedTransaction](type-aliases/TransactionOrVersionedTransaction.md)
|
|
79
|
+
- [TransactionPayload](type-aliases/TransactionPayload.md)
|
|
80
|
+
- [WalletAdapter](type-aliases/WalletAdapter.md)
|
|
81
|
+
- [WalletName](type-aliases/WalletName.md)
|
|
82
|
+
- [WalletTransactionOutput](type-aliases/WalletTransactionOutput.md)
|
|
83
|
+
|
|
84
|
+
## Functions
|
|
85
|
+
|
|
86
|
+
- [b64ToU8](functions/b64ToU8.md)
|
|
87
|
+
- [scopePollingDetectionStrategy](functions/scopePollingDetectionStrategy.md)
|
|
88
|
+
- [u8ToB64](functions/u8ToB64.md)
|