@miden-sdk/miden-wallet-adapter-base 0.13.2 → 0.13.3
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/dist/signer.d.ts +3 -1
- package/dist/signer.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/docs/README.md +3 -0
- package/docs/classes/BaseMessageSignerWalletAdapter.md +20 -0
- package/docs/interfaces/CreateAccountParams.md +25 -0
- package/docs/interfaces/MessageSignerWalletAdapterProps.md +16 -0
- package/docs/type-aliases/CreateAccountStorageMode.md +9 -0
- package/docs/type-aliases/CreateAccountType.md +9 -0
- package/package.json +1 -1
- package/signer.ts +3 -1
- package/types.ts +12 -0
package/dist/signer.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { NoteFilterTypes } from '@miden-sdk/miden-sdk';
|
|
|
2
2
|
import type { WalletAdapter, WalletAdapterProps } from './adapter';
|
|
3
3
|
import { BaseWalletAdapter } from './adapter';
|
|
4
4
|
import { MidenConsumeTransaction, MidenSendTransaction, MidenTransaction } from './transaction';
|
|
5
|
-
import { Asset, InputNoteDetails, SignKind, TransactionOutput } from './types';
|
|
5
|
+
import { Asset, CreateAccountParams, InputNoteDetails, SignKind, TransactionOutput } from './types';
|
|
6
6
|
export type Adapter = WalletAdapter | SignerWalletAdapter | MessageSignerWalletAdapter;
|
|
7
7
|
export interface SignerWalletAdapterProps<Name extends string = string> extends WalletAdapterProps<Name> {
|
|
8
8
|
}
|
|
@@ -19,6 +19,7 @@ export interface MessageSignerWalletAdapterProps<Name extends string = string> e
|
|
|
19
19
|
waitForTransaction(txId: string, timeout?: number): Promise<TransactionOutput>;
|
|
20
20
|
requestSend(transaction: MidenSendTransaction): Promise<string>;
|
|
21
21
|
requestConsume(transaction: MidenConsumeTransaction): Promise<string>;
|
|
22
|
+
createAccount(params?: CreateAccountParams): Promise<string>;
|
|
22
23
|
}
|
|
23
24
|
export type MessageSignerWalletAdapter<Name extends string = string> = WalletAdapter<Name> & MessageSignerWalletAdapterProps<Name>;
|
|
24
25
|
export declare abstract class BaseMessageSignerWalletAdapter<Name extends string = string> extends BaseSignerWalletAdapter<Name> implements MessageSignerWalletAdapter<Name> {
|
|
@@ -31,4 +32,5 @@ export declare abstract class BaseMessageSignerWalletAdapter<Name extends string
|
|
|
31
32
|
abstract importPrivateNote(note: Uint8Array): Promise<string>;
|
|
32
33
|
abstract requestConsumableNotes(): Promise<InputNoteDetails[]>;
|
|
33
34
|
abstract waitForTransaction(txId: string, timeout?: number): Promise<TransactionOutput>;
|
|
35
|
+
abstract createAccount(params?: CreateAccountParams): Promise<string>;
|
|
34
36
|
}
|
package/dist/signer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../signer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAmB9C,MAAM,OAAgB,uBACpB,SAAQ,iBAAuB;CACQ;
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../signer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAmB9C,MAAM,OAAgB,uBACpB,SAAQ,iBAAuB;CACQ;AAyBzC,MAAM,OAAgB,8BAGpB,SAAQ,uBAA6B;CAqBtC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -45,3 +45,10 @@ export interface WalletTransactionSuccessOutput {
|
|
|
45
45
|
outputNotes: string[];
|
|
46
46
|
}
|
|
47
47
|
export type WalletTransactionOutput = WalletTransactionSuccessOutput | IFailedTransactionOutput;
|
|
48
|
+
export type CreateAccountType = 'RegularAccountImmutableCode' | 'RegularAccountUpdatableCode';
|
|
49
|
+
export type CreateAccountStorageMode = 'private' | 'public' | 'network';
|
|
50
|
+
export interface CreateAccountParams {
|
|
51
|
+
accountType?: CreateAccountType;
|
|
52
|
+
storageMode?: CreateAccountStorageMode;
|
|
53
|
+
customComponents?: Uint8Array[];
|
|
54
|
+
}
|
package/docs/README.md
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
## Interfaces
|
|
54
54
|
|
|
55
55
|
- [Asset](interfaces/Asset.md)
|
|
56
|
+
- [CreateAccountParams](interfaces/CreateAccountParams.md)
|
|
56
57
|
- [IFailedTransactionOutput](interfaces/IFailedTransactionOutput.md)
|
|
57
58
|
- [MessageSignerWalletAdapterProps](interfaces/MessageSignerWalletAdapterProps.md)
|
|
58
59
|
- [MidenConsumeTransaction](interfaces/MidenConsumeTransaction.md)
|
|
@@ -68,6 +69,8 @@
|
|
|
68
69
|
## Type Aliases
|
|
69
70
|
|
|
70
71
|
- [Adapter](type-aliases/Adapter.md)
|
|
72
|
+
- [CreateAccountStorageMode](type-aliases/CreateAccountStorageMode.md)
|
|
73
|
+
- [CreateAccountType](type-aliases/CreateAccountType.md)
|
|
71
74
|
- [FungibleAssetDetails](type-aliases/FungibleAssetDetails.md)
|
|
72
75
|
- [InputNoteDetails](type-aliases/InputNoteDetails.md)
|
|
73
76
|
- [MessageSignerWalletAdapter](type-aliases/MessageSignerWalletAdapter.md)
|
|
@@ -251,6 +251,26 @@ Minimal `EventEmitter` interface that is molded against the Node.js
|
|
|
251
251
|
|
|
252
252
|
***
|
|
253
253
|
|
|
254
|
+
### createAccount()
|
|
255
|
+
|
|
256
|
+
> `abstract` **createAccount**(`params?`): `Promise`\<`string`\>
|
|
257
|
+
|
|
258
|
+
#### Parameters
|
|
259
|
+
|
|
260
|
+
##### params?
|
|
261
|
+
|
|
262
|
+
[`CreateAccountParams`](../interfaces/CreateAccountParams.md)
|
|
263
|
+
|
|
264
|
+
#### Returns
|
|
265
|
+
|
|
266
|
+
`Promise`\<`string`\>
|
|
267
|
+
|
|
268
|
+
#### Implementation of
|
|
269
|
+
|
|
270
|
+
`MessageSignerWalletAdapter.createAccount`
|
|
271
|
+
|
|
272
|
+
***
|
|
273
|
+
|
|
254
274
|
### disconnect()
|
|
255
275
|
|
|
256
276
|
> `abstract` **disconnect**(): `Promise`\<`void`\>
|
|
@@ -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) / CreateAccountParams
|
|
6
|
+
|
|
7
|
+
# Interface: CreateAccountParams
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### accountType?
|
|
12
|
+
|
|
13
|
+
> `optional` **accountType**: [`CreateAccountType`](../type-aliases/CreateAccountType.md)
|
|
14
|
+
|
|
15
|
+
***
|
|
16
|
+
|
|
17
|
+
### customComponents?
|
|
18
|
+
|
|
19
|
+
> `optional` **customComponents**: `Uint8Array`\<`ArrayBufferLike`\>[]
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### storageMode?
|
|
24
|
+
|
|
25
|
+
> `optional` **storageMode**: [`CreateAccountStorageMode`](../type-aliases/CreateAccountStorageMode.md)
|
|
@@ -136,6 +136,22 @@
|
|
|
136
136
|
|
|
137
137
|
***
|
|
138
138
|
|
|
139
|
+
### createAccount()
|
|
140
|
+
|
|
141
|
+
> **createAccount**(`params?`): `Promise`\<`string`\>
|
|
142
|
+
|
|
143
|
+
#### Parameters
|
|
144
|
+
|
|
145
|
+
##### params?
|
|
146
|
+
|
|
147
|
+
[`CreateAccountParams`](CreateAccountParams.md)
|
|
148
|
+
|
|
149
|
+
#### Returns
|
|
150
|
+
|
|
151
|
+
`Promise`\<`string`\>
|
|
152
|
+
|
|
153
|
+
***
|
|
154
|
+
|
|
139
155
|
### disconnect()
|
|
140
156
|
|
|
141
157
|
> **disconnect**(): `Promise`\<`void`\>
|
|
@@ -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) / CreateAccountStorageMode
|
|
6
|
+
|
|
7
|
+
# Type Alias: CreateAccountStorageMode
|
|
8
|
+
|
|
9
|
+
> **CreateAccountStorageMode** = `"private"` \| `"public"` \| `"network"`
|
|
@@ -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) / CreateAccountType
|
|
6
|
+
|
|
7
|
+
# Type Alias: CreateAccountType
|
|
8
|
+
|
|
9
|
+
> **CreateAccountType** = `"RegularAccountImmutableCode"` \| `"RegularAccountUpdatableCode"`
|
package/package.json
CHANGED
package/signer.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
MidenSendTransaction,
|
|
7
7
|
MidenTransaction,
|
|
8
8
|
} from './transaction';
|
|
9
|
-
import { Asset, InputNoteDetails, SignKind, TransactionOutput } from './types';
|
|
9
|
+
import { Asset, CreateAccountParams, InputNoteDetails, SignKind, TransactionOutput } from './types';
|
|
10
10
|
|
|
11
11
|
export type Adapter =
|
|
12
12
|
| WalletAdapter
|
|
@@ -40,6 +40,7 @@ export interface MessageSignerWalletAdapterProps<Name extends string = string>
|
|
|
40
40
|
): Promise<TransactionOutput>;
|
|
41
41
|
requestSend(transaction: MidenSendTransaction): Promise<string>;
|
|
42
42
|
requestConsume(transaction: MidenConsumeTransaction): Promise<string>;
|
|
43
|
+
createAccount(params?: CreateAccountParams): Promise<string>;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export type MessageSignerWalletAdapter<Name extends string = string> =
|
|
@@ -68,4 +69,5 @@ export abstract class BaseMessageSignerWalletAdapter<
|
|
|
68
69
|
txId: string,
|
|
69
70
|
timeout?: number
|
|
70
71
|
): Promise<TransactionOutput>;
|
|
72
|
+
abstract createAccount(params?: CreateAccountParams): Promise<string>;
|
|
71
73
|
}
|
package/types.ts
CHANGED
|
@@ -66,3 +66,15 @@ export interface WalletTransactionSuccessOutput {
|
|
|
66
66
|
export type WalletTransactionOutput =
|
|
67
67
|
| WalletTransactionSuccessOutput
|
|
68
68
|
| IFailedTransactionOutput;
|
|
69
|
+
|
|
70
|
+
export type CreateAccountType =
|
|
71
|
+
| 'RegularAccountImmutableCode'
|
|
72
|
+
| 'RegularAccountUpdatableCode';
|
|
73
|
+
|
|
74
|
+
export type CreateAccountStorageMode = 'private' | 'public' | 'network';
|
|
75
|
+
|
|
76
|
+
export interface CreateAccountParams {
|
|
77
|
+
accountType?: CreateAccountType;
|
|
78
|
+
storageMode?: CreateAccountStorageMode;
|
|
79
|
+
customComponents?: Uint8Array[];
|
|
80
|
+
}
|