@miden-sdk/miden-wallet-adapter-base 0.16.2 → 0.16.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.
Files changed (114) hide show
  1. package/dist/adapter.js.map +1 -1
  2. package/dist/errors.js.map +1 -1
  3. package/dist/helpers.js.map +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/signer.js.map +1 -1
  6. package/dist/transaction.js.map +1 -1
  7. package/dist/types.js.map +1 -1
  8. package/package.json +9 -3
  9. package/__tests__/adapter.test.ts +0 -82
  10. package/__tests__/errors.test.ts +0 -100
  11. package/__tests__/helpers.test.ts +0 -39
  12. package/__tests__/signer.test.ts +0 -20
  13. package/__tests__/transaction.test.ts +0 -166
  14. package/adapter.ts +0 -146
  15. package/dist/__tests__/adapter.test.d.ts +0 -1
  16. package/dist/__tests__/adapter.test.js +0 -66
  17. package/dist/__tests__/adapter.test.js.map +0 -1
  18. package/dist/__tests__/errors.test.d.ts +0 -1
  19. package/dist/__tests__/errors.test.js +0 -70
  20. package/dist/__tests__/errors.test.js.map +0 -1
  21. package/dist/__tests__/helpers.test.d.ts +0 -1
  22. package/dist/__tests__/helpers.test.js +0 -35
  23. package/dist/__tests__/helpers.test.js.map +0 -1
  24. package/dist/__tests__/signer.test.d.ts +0 -1
  25. package/dist/__tests__/signer.test.js +0 -18
  26. package/dist/__tests__/signer.test.js.map +0 -1
  27. package/dist/__tests__/transaction.test.d.ts +0 -1
  28. package/dist/__tests__/transaction.test.js +0 -113
  29. package/dist/__tests__/transaction.test.js.map +0 -1
  30. package/dist/vitest.config.d.ts +0 -2
  31. package/dist/vitest.config.js +0 -8
  32. package/dist/vitest.config.js.map +0 -1
  33. package/docs/@miden-sdk/namespaces/EventEmitter/README.md +0 -24
  34. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/EventEmitterStatic.md +0 -17
  35. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/ListenerFn.md +0 -25
  36. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ArgumentMap.md +0 -15
  37. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventArgs.md +0 -19
  38. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventListener.md +0 -19
  39. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventNames.md +0 -15
  40. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ValidEventTypes.md +0 -17
  41. package/docs/@miden-sdk/namespaces/EventEmitter/variables/EventEmitter.md +0 -9
  42. package/docs/README.md +0 -88
  43. package/docs/classes/BaseMessageSignerWalletAdapter.md +0 -755
  44. package/docs/classes/BaseSignerWalletAdapter.md +0 -579
  45. package/docs/classes/BaseWalletAdapter.md +0 -535
  46. package/docs/classes/ConsumeTransaction.md +0 -93
  47. package/docs/classes/CustomTransaction.md +0 -93
  48. package/docs/classes/EventEmitter.md +0 -305
  49. package/docs/classes/SendTransaction.md +0 -107
  50. package/docs/classes/Transaction.md +0 -151
  51. package/docs/classes/WalletAccountError.md +0 -223
  52. package/docs/classes/WalletAddressError.md +0 -223
  53. package/docs/classes/WalletConfigError.md +0 -223
  54. package/docs/classes/WalletConnectionError.md +0 -223
  55. package/docs/classes/WalletDecryptionError.md +0 -223
  56. package/docs/classes/WalletDecryptionNotAllowedError.md +0 -223
  57. package/docs/classes/WalletDisconnectedError.md +0 -223
  58. package/docs/classes/WalletDisconnectionError.md +0 -223
  59. package/docs/classes/WalletError.md +0 -244
  60. package/docs/classes/WalletKeypairError.md +0 -223
  61. package/docs/classes/WalletLoadError.md +0 -223
  62. package/docs/classes/WalletNotConnectedError.md +0 -223
  63. package/docs/classes/WalletNotReadyError.md +0 -223
  64. package/docs/classes/WalletNotSelectedError.md +0 -223
  65. package/docs/classes/WalletPrivateDataPermissionError.md +0 -223
  66. package/docs/classes/WalletRecordsError.md +0 -223
  67. package/docs/classes/WalletSendTransactionError.md +0 -223
  68. package/docs/classes/WalletSignMessageError.md +0 -223
  69. package/docs/classes/WalletSignTransactionError.md +0 -223
  70. package/docs/classes/WalletTimeoutError.md +0 -223
  71. package/docs/classes/WalletTransactionError.md +0 -223
  72. package/docs/classes/WalletWindowBlockedError.md +0 -223
  73. package/docs/classes/WalletWindowClosedError.md +0 -223
  74. package/docs/enumerations/AllowedPrivateData.md +0 -37
  75. package/docs/enumerations/PrivateDataPermission.md +0 -19
  76. package/docs/enumerations/TransactionType.md +0 -25
  77. package/docs/enumerations/WalletAdapterNetwork.md +0 -19
  78. package/docs/enumerations/WalletReadyState.md +0 -49
  79. package/docs/functions/b64ToU8.md +0 -19
  80. package/docs/functions/scopePollingDetectionStrategy.md +0 -19
  81. package/docs/functions/u8ToB64.md +0 -19
  82. package/docs/interfaces/Asset.md +0 -19
  83. package/docs/interfaces/IFailedTransactionOutput.md +0 -13
  84. package/docs/interfaces/MessageSignerWalletAdapterProps.md +0 -293
  85. package/docs/interfaces/MidenConsumeTransaction.md +0 -37
  86. package/docs/interfaces/MidenCustomTransaction.md +0 -37
  87. package/docs/interfaces/MidenSendTransaction.md +0 -43
  88. package/docs/interfaces/MidenTransaction.md +0 -19
  89. package/docs/interfaces/SignerWalletAdapterProps.md +0 -149
  90. package/docs/interfaces/TransactionOutput.md +0 -19
  91. package/docs/interfaces/WalletAdapterEvents.md +0 -69
  92. package/docs/interfaces/WalletAdapterProps.md +0 -106
  93. package/docs/interfaces/WalletTransactionSuccessOutput.md +0 -19
  94. package/docs/type-aliases/Adapter.md +0 -9
  95. package/docs/type-aliases/FungibleAssetDetails.md +0 -21
  96. package/docs/type-aliases/InputNoteDetails.md +0 -45
  97. package/docs/type-aliases/MessageSignerWalletAdapter.md +0 -15
  98. package/docs/type-aliases/NoteTypeString.md +0 -9
  99. package/docs/type-aliases/SignKind.md +0 -9
  100. package/docs/type-aliases/SignerWalletAdapter.md +0 -15
  101. package/docs/type-aliases/SupportedTransactionVersions.md +0 -9
  102. package/docs/type-aliases/TransactionOrVersionedTransaction.md +0 -15
  103. package/docs/type-aliases/TransactionPayload.md +0 -9
  104. package/docs/type-aliases/WalletAdapter.md +0 -15
  105. package/docs/type-aliases/WalletName.md +0 -21
  106. package/docs/type-aliases/WalletTransactionOutput.md +0 -9
  107. package/errors.ts +0 -97
  108. package/helpers.ts +0 -28
  109. package/index.ts +0 -6
  110. package/signer.ts +0 -84
  111. package/transaction.ts +0 -178
  112. package/tsconfig.json +0 -15
  113. package/types.ts +0 -93
  114. package/vitest.config.ts +0 -8
@@ -1,106 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletAdapterProps
6
-
7
- # Interface: WalletAdapterProps\<Name\>
8
-
9
- ## Extended by
10
-
11
- - [`SignerWalletAdapterProps`](SignerWalletAdapterProps.md)
12
- - [`MessageSignerWalletAdapterProps`](MessageSignerWalletAdapterProps.md)
13
-
14
- ## Type Parameters
15
-
16
- ### Name
17
-
18
- `Name` *extends* `string` = `string`
19
-
20
- ## Properties
21
-
22
- ### address
23
-
24
- > **address**: `string`
25
-
26
- ***
27
-
28
- ### connected
29
-
30
- > **connected**: `boolean`
31
-
32
- ***
33
-
34
- ### connecting
35
-
36
- > **connecting**: `boolean`
37
-
38
- ***
39
-
40
- ### icon
41
-
42
- > **icon**: `string`
43
-
44
- ***
45
-
46
- ### name
47
-
48
- > **name**: [`WalletName`](../type-aliases/WalletName.md)\<`Name`\>
49
-
50
- ***
51
-
52
- ### publicKey
53
-
54
- > **publicKey**: `Uint8Array`\<`ArrayBufferLike`\>
55
-
56
- ***
57
-
58
- ### readyState
59
-
60
- > **readyState**: [`WalletReadyState`](../enumerations/WalletReadyState.md)
61
-
62
- ***
63
-
64
- ### supportedTransactionVersions
65
-
66
- > **supportedTransactionVersions**: `ReadonlySet`
67
-
68
- ***
69
-
70
- ### url
71
-
72
- > **url**: `string`
73
-
74
- ## Methods
75
-
76
- ### connect()
77
-
78
- > **connect**(`privateDataPermission`, `network`, `allowedPrivateData?`): `Promise`\<`void`\>
79
-
80
- #### Parameters
81
-
82
- ##### privateDataPermission
83
-
84
- [`PrivateDataPermission`](../enumerations/PrivateDataPermission.md)
85
-
86
- ##### network
87
-
88
- [`WalletAdapterNetwork`](../enumerations/WalletAdapterNetwork.md)
89
-
90
- ##### allowedPrivateData?
91
-
92
- [`AllowedPrivateData`](../enumerations/AllowedPrivateData.md)
93
-
94
- #### Returns
95
-
96
- `Promise`\<`void`\>
97
-
98
- ***
99
-
100
- ### disconnect()
101
-
102
- > **disconnect**(): `Promise`\<`void`\>
103
-
104
- #### Returns
105
-
106
- `Promise`\<`void`\>
@@ -1,19 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletTransactionSuccessOutput
6
-
7
- # Interface: WalletTransactionSuccessOutput
8
-
9
- ## Properties
10
-
11
- ### outputNotes
12
-
13
- > **outputNotes**: `string`[]
14
-
15
- ***
16
-
17
- ### txHash
18
-
19
- > **txHash**: `string`
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / Adapter
6
-
7
- # Type Alias: Adapter
8
-
9
- > **Adapter** = [`WalletAdapter`](WalletAdapter.md) \| [`SignerWalletAdapter`](SignerWalletAdapter.md) \| [`MessageSignerWalletAdapter`](MessageSignerWalletAdapter.md)
@@ -1,21 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / FungibleAssetDetails
6
-
7
- # Type Alias: FungibleAssetDetails
8
-
9
- > **FungibleAssetDetails** = `object`
10
-
11
- ## Properties
12
-
13
- ### amount
14
-
15
- > **amount**: `string`
16
-
17
- ***
18
-
19
- ### faucetId
20
-
21
- > **faucetId**: `string`
@@ -1,45 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / InputNoteDetails
6
-
7
- # Type Alias: InputNoteDetails
8
-
9
- > **InputNoteDetails** = `object`
10
-
11
- ## Properties
12
-
13
- ### assets
14
-
15
- > **assets**: [`FungibleAssetDetails`](FungibleAssetDetails.md)[]
16
-
17
- ***
18
-
19
- ### noteId
20
-
21
- > **noteId**: `string`
22
-
23
- ***
24
-
25
- ### noteType
26
-
27
- > **noteType**: `NoteType` \| `undefined`
28
-
29
- ***
30
-
31
- ### nullifier
32
-
33
- > **nullifier**: `string`
34
-
35
- ***
36
-
37
- ### senderAccountId
38
-
39
- > **senderAccountId**: `string` \| `undefined`
40
-
41
- ***
42
-
43
- ### state
44
-
45
- > **state**: `InputNoteState`
@@ -1,15 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / MessageSignerWalletAdapter
6
-
7
- # Type Alias: MessageSignerWalletAdapter\<Name\>
8
-
9
- > **MessageSignerWalletAdapter**\<`Name`\> = [`WalletAdapter`](WalletAdapter.md)\<`Name`\> & [`MessageSignerWalletAdapterProps`](../interfaces/MessageSignerWalletAdapterProps.md)\<`Name`\>
10
-
11
- ## Type Parameters
12
-
13
- ### Name
14
-
15
- `Name` *extends* `string` = `string`
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / NoteTypeString
6
-
7
- # Type Alias: NoteTypeString
8
-
9
- > **NoteTypeString** = `"public"` \| `"private"`
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / SignKind
6
-
7
- # Type Alias: SignKind
8
-
9
- > **SignKind** = `"word"` \| `"signingInputs"`
@@ -1,15 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / SignerWalletAdapter
6
-
7
- # Type Alias: SignerWalletAdapter\<Name\>
8
-
9
- > **SignerWalletAdapter**\<`Name`\> = [`WalletAdapter`](WalletAdapter.md)\<`Name`\> & [`SignerWalletAdapterProps`](../interfaces/SignerWalletAdapterProps.md)\<`Name`\>
10
-
11
- ## Type Parameters
12
-
13
- ### Name
14
-
15
- `Name` *extends* `string` = `string`
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / SupportedTransactionVersions
6
-
7
- # Type Alias: SupportedTransactionVersions
8
-
9
- > **SupportedTransactionVersions** = `ReadonlySet`\<`any`\> \| `null`
@@ -1,15 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / TransactionOrVersionedTransaction
6
-
7
- # Type Alias: TransactionOrVersionedTransaction\<S\>
8
-
9
- > **TransactionOrVersionedTransaction**\<`S`\> = `S` *extends* `null` ? `any` : `any` \| `any`
10
-
11
- ## Type Parameters
12
-
13
- ### S
14
-
15
- `S` *extends* [`SupportedTransactionVersions`](SupportedTransactionVersions.md)
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / TransactionPayload
6
-
7
- # Type Alias: TransactionPayload
8
-
9
- > **TransactionPayload** = [`MidenSendTransaction`](../interfaces/MidenSendTransaction.md) \| [`MidenConsumeTransaction`](../interfaces/MidenConsumeTransaction.md) \| [`MidenCustomTransaction`](../interfaces/MidenCustomTransaction.md)
@@ -1,15 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletAdapter
6
-
7
- # Type Alias: WalletAdapter\<Name\>
8
-
9
- > **WalletAdapter**\<`Name`\> = [`WalletAdapterProps`](../interfaces/WalletAdapterProps.md)\<`Name`\> & [`EventEmitter`](../classes/EventEmitter.md)\<[`WalletAdapterEvents`](../interfaces/WalletAdapterEvents.md)\>
10
-
11
- ## Type Parameters
12
-
13
- ### Name
14
-
15
- `Name` *extends* `string` = `string`
@@ -1,21 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletName
6
-
7
- # Type Alias: WalletName\<T\>
8
-
9
- > **WalletName**\<`T`\> = `T` & `object`
10
-
11
- ## Type declaration
12
-
13
- ### \_\_brand\_\_
14
-
15
- > **\_\_brand\_\_**: `"WalletName"`
16
-
17
- ## Type Parameters
18
-
19
- ### T
20
-
21
- `T` *extends* `string` = `string`
@@ -1,9 +0,0 @@
1
- [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
-
3
- ***
4
-
5
- [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletTransactionOutput
6
-
7
- # Type Alias: WalletTransactionOutput
8
-
9
- > **WalletTransactionOutput** = [`WalletTransactionSuccessOutput`](../interfaces/WalletTransactionSuccessOutput.md) \| [`IFailedTransactionOutput`](../interfaces/IFailedTransactionOutput.md)
package/errors.ts DELETED
@@ -1,97 +0,0 @@
1
- export class WalletError extends Error {
2
- error: any;
3
-
4
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
- constructor(message?: string, error?: any) {
6
- super(message);
7
- this.error = error;
8
- }
9
- }
10
-
11
- export class WalletNotReadyError extends WalletError {
12
- name = "WalletNotReadyError";
13
- }
14
-
15
- export class WalletLoadError extends WalletError {
16
- name = "WalletLoadError";
17
- }
18
-
19
- export class WalletConfigError extends WalletError {
20
- name = "WalletConfigError";
21
- }
22
-
23
- export class WalletConnectionError extends WalletError {
24
- name = "WalletConnectionError";
25
- }
26
-
27
- export class WalletNotSelectedError extends WalletError {
28
- name = "WalletNotSelectedError";
29
- }
30
-
31
- export class WalletDisconnectedError extends WalletError {
32
- name = "WalletDisconnectedError";
33
- }
34
-
35
- export class WalletDisconnectionError extends WalletError {
36
- name = "WalletDisconnectionError";
37
- }
38
-
39
- export class WalletAccountError extends WalletError {
40
- name = "WalletAccountError";
41
- }
42
-
43
- export class WalletAddressError extends WalletError {
44
- name = "WalletAddressError";
45
- }
46
-
47
- export class WalletKeypairError extends WalletError {
48
- name = "WalletKeypairError";
49
- }
50
-
51
- export class WalletNotConnectedError extends WalletError {
52
- name = "WalletNotConnectedError";
53
- }
54
-
55
- export class WalletSendTransactionError extends WalletError {
56
- name = "WalletSendTransactionError";
57
- }
58
-
59
- export class WalletSignMessageError extends WalletError {
60
- name = "WalletSignMessageError";
61
- }
62
-
63
- export class WalletSignTransactionError extends WalletError {
64
- name = "WalletSignTransactionError";
65
- }
66
-
67
- export class WalletTimeoutError extends WalletError {
68
- name = "WalletTimeoutError";
69
- }
70
-
71
- export class WalletWindowBlockedError extends WalletError {
72
- name = "WalletWindowBlockedError";
73
- }
74
-
75
- export class WalletWindowClosedError extends WalletError {
76
- name = "WalletWindowClosedError";
77
- }
78
-
79
- export class WalletDecryptionNotAllowedError extends WalletError {
80
- name = "WalletDecryptionNotAllowedError";
81
- }
82
-
83
- export class WalletPrivateDataPermissionError extends WalletError {
84
- name = "WalletPrivateDataPermissionError";
85
- }
86
-
87
- export class WalletDecryptionError extends WalletError {
88
- name = "WalletDecryptionError";
89
- }
90
-
91
- export class WalletRecordsError extends WalletError {
92
- name = "WalletRecordsError";
93
- }
94
-
95
- export class WalletTransactionError extends WalletError {
96
- name = "WalletTransactionError";
97
- }
package/helpers.ts DELETED
@@ -1,28 +0,0 @@
1
- // Encode a Uint8Array to base64
2
- export function u8ToB64(u8: Uint8Array): string {
3
- // Prefer browser builtins (no polyfills)
4
- if (typeof globalThis.btoa === "function") {
5
- let s = "";
6
- for (let i = 0; i < u8.length; i++) s += String.fromCharCode(u8[i]);
7
- return globalThis.btoa(s);
8
- }
9
- // Node/Buffer fallback (won’t be bundled if never executed in browsers)
10
- const Buf: any = (globalThis as any).Buffer;
11
- if (Buf) return Buf.from(u8).toString("base64");
12
- throw new Error("No base64 encoder available in this environment");
13
- }
14
-
15
- // Decode base64 to Uint8Array
16
- export function b64ToU8(b64: string): Uint8Array {
17
- // Prefer browser builtins (no polyfills)
18
- if (typeof globalThis.atob === "function") {
19
- const bin = globalThis.atob(b64);
20
- const out = new Uint8Array(bin.length);
21
- for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);
22
- return out;
23
- }
24
- // Node/Buffer fallback (won’t be bundled if never executed in browsers)
25
- const Buf: any = (globalThis as any).Buffer;
26
- if (Buf) return new Uint8Array(Buf.from(b64, "base64"));
27
- throw new Error("No base64 decoder available in this environment");
28
- }
package/index.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from "./adapter";
2
- export * from "./errors";
3
- export * from "./signer";
4
- export * from "./types";
5
- export * from "./transaction";
6
- export * from "./helpers";
package/signer.ts DELETED
@@ -1,84 +0,0 @@
1
- import type { NoteFilterTypes } from "@miden-sdk/miden-sdk";
2
- import type { WalletAdapter, WalletAdapterProps } from "./adapter";
3
- import { BaseWalletAdapter } from "./adapter";
4
- import {
5
- MidenConsumeTransaction,
6
- MidenSendTransaction,
7
- MidenTransaction,
8
- } from "./transaction";
9
- import {
10
- Asset,
11
- CreateAccountParams,
12
- GuardianInfo,
13
- InputNoteDetails,
14
- SignKind,
15
- TransactionOutput,
16
- } from "./types";
17
-
18
- export type Adapter =
19
- | WalletAdapter
20
- | SignerWalletAdapter
21
- | MessageSignerWalletAdapter;
22
-
23
- export interface SignerWalletAdapterProps<
24
- Name extends string = string,
25
- > extends WalletAdapterProps<Name> {}
26
-
27
- export type SignerWalletAdapter<Name extends string = string> =
28
- WalletAdapter<Name> & SignerWalletAdapterProps<Name>;
29
-
30
- export abstract class BaseSignerWalletAdapter<Name extends string = string>
31
- extends BaseWalletAdapter<Name>
32
- implements SignerWalletAdapter<Name> {}
33
-
34
- export interface MessageSignerWalletAdapterProps<
35
- Name extends string = string,
36
- > extends WalletAdapterProps<Name> {
37
- requestTransaction(transaction: MidenTransaction): Promise<string>;
38
- requestAssets(): Promise<Asset[]>;
39
- requestGuardianInfo(): Promise<GuardianInfo>;
40
- requestPrivateNotes(
41
- noteFilterType: NoteFilterTypes,
42
- noteIds?: string[]
43
- ): Promise<InputNoteDetails[]>;
44
- signBytes(data: Uint8Array, kind: SignKind): Promise<Uint8Array>;
45
- importPrivateNote(note: Uint8Array): Promise<string>;
46
- requestConsumableNotes(): Promise<InputNoteDetails[]>;
47
- waitForTransaction(
48
- txId: string,
49
- timeout?: number
50
- ): Promise<TransactionOutput>;
51
- requestSend(transaction: MidenSendTransaction): Promise<string>;
52
- requestConsume(transaction: MidenConsumeTransaction): Promise<string>;
53
- createAccount(params?: CreateAccountParams): Promise<string>;
54
- }
55
-
56
- export type MessageSignerWalletAdapter<Name extends string = string> =
57
- WalletAdapter<Name> & MessageSignerWalletAdapterProps<Name>;
58
-
59
- export abstract class BaseMessageSignerWalletAdapter<
60
- Name extends string = string,
61
- >
62
- extends BaseSignerWalletAdapter<Name>
63
- implements MessageSignerWalletAdapter<Name>
64
- {
65
- abstract requestSend(transaction: MidenSendTransaction): Promise<string>;
66
- abstract requestConsume(
67
- transaction: MidenConsumeTransaction
68
- ): Promise<string>;
69
- abstract requestTransaction(transaction: MidenTransaction): Promise<string>;
70
- abstract requestAssets(): Promise<Asset[]>;
71
- abstract requestGuardianInfo(): Promise<GuardianInfo>;
72
- abstract requestPrivateNotes(
73
- noteFilterType: NoteFilterTypes,
74
- noteIds?: string[]
75
- ): Promise<InputNoteDetails[]>;
76
- abstract signBytes(data: Uint8Array, kind: SignKind): Promise<Uint8Array>;
77
- abstract importPrivateNote(note: Uint8Array): Promise<string>;
78
- abstract requestConsumableNotes(): Promise<InputNoteDetails[]>;
79
- abstract waitForTransaction(
80
- txId: string,
81
- timeout?: number
82
- ): Promise<TransactionOutput>;
83
- abstract createAccount(params?: CreateAccountParams): Promise<string>;
84
- }