@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,223 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletConnectionError
|
|
6
|
+
|
|
7
|
+
# Class: WalletConnectionError
|
|
8
|
+
|
|
9
|
+
## Extends
|
|
10
|
+
|
|
11
|
+
- [`WalletError`](WalletError.md)
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new WalletConnectionError**(`message?`, `error?`): `WalletConnectionError`
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### message?
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
##### error?
|
|
26
|
+
|
|
27
|
+
`any`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`WalletConnectionError`
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`WalletError`](WalletError.md).[`constructor`](WalletError.md#constructor)
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### cause?
|
|
40
|
+
|
|
41
|
+
> `optional` **cause**: `unknown`
|
|
42
|
+
|
|
43
|
+
#### Inherited from
|
|
44
|
+
|
|
45
|
+
[`WalletError`](WalletError.md).[`cause`](WalletError.md#cause)
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### error
|
|
50
|
+
|
|
51
|
+
> **error**: `any`
|
|
52
|
+
|
|
53
|
+
#### Inherited from
|
|
54
|
+
|
|
55
|
+
[`WalletError`](WalletError.md).[`error`](WalletError.md#error)
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### message
|
|
60
|
+
|
|
61
|
+
> **message**: `string`
|
|
62
|
+
|
|
63
|
+
#### Inherited from
|
|
64
|
+
|
|
65
|
+
[`WalletError`](WalletError.md).[`message`](WalletError.md#message)
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### name
|
|
70
|
+
|
|
71
|
+
> **name**: `string` = `'WalletConnectionError'`
|
|
72
|
+
|
|
73
|
+
#### Overrides
|
|
74
|
+
|
|
75
|
+
[`WalletError`](WalletError.md).[`name`](WalletError.md#name)
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### stack?
|
|
80
|
+
|
|
81
|
+
> `optional` **stack**: `string`
|
|
82
|
+
|
|
83
|
+
#### Inherited from
|
|
84
|
+
|
|
85
|
+
[`WalletError`](WalletError.md).[`stack`](WalletError.md#stack)
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### stackTraceLimit
|
|
90
|
+
|
|
91
|
+
> `static` **stackTraceLimit**: `number`
|
|
92
|
+
|
|
93
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
94
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
|
95
|
+
`Error.captureStackTrace(obj)`).
|
|
96
|
+
|
|
97
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
98
|
+
will affect any stack trace captured _after_ the value has been changed.
|
|
99
|
+
|
|
100
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
101
|
+
not capture any frames.
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`WalletError`](WalletError.md).[`stackTraceLimit`](WalletError.md#stacktracelimit)
|
|
106
|
+
|
|
107
|
+
## Methods
|
|
108
|
+
|
|
109
|
+
### captureStackTrace()
|
|
110
|
+
|
|
111
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
112
|
+
|
|
113
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
114
|
+
a string representing the location in the code at which
|
|
115
|
+
`Error.captureStackTrace()` was called.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const myObject = {};
|
|
119
|
+
Error.captureStackTrace(myObject);
|
|
120
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The first line of the trace will be prefixed with
|
|
124
|
+
`${myObject.name}: ${myObject.message}`.
|
|
125
|
+
|
|
126
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
127
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
128
|
+
generated stack trace.
|
|
129
|
+
|
|
130
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
131
|
+
details of error generation from the user. For instance:
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
function a() {
|
|
135
|
+
b();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function b() {
|
|
139
|
+
c();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function c() {
|
|
143
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
144
|
+
const { stackTraceLimit } = Error;
|
|
145
|
+
Error.stackTraceLimit = 0;
|
|
146
|
+
const error = new Error();
|
|
147
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
148
|
+
|
|
149
|
+
// Capture the stack trace above function b
|
|
150
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
a();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Parameters
|
|
158
|
+
|
|
159
|
+
##### targetObject
|
|
160
|
+
|
|
161
|
+
`object`
|
|
162
|
+
|
|
163
|
+
##### constructorOpt?
|
|
164
|
+
|
|
165
|
+
`Function`
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`void`
|
|
170
|
+
|
|
171
|
+
#### Inherited from
|
|
172
|
+
|
|
173
|
+
[`WalletError`](WalletError.md).[`captureStackTrace`](WalletError.md#capturestacktrace)
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
177
|
+
### isError()
|
|
178
|
+
|
|
179
|
+
> `static` **isError**(`error`): `error is Error`
|
|
180
|
+
|
|
181
|
+
Indicates whether the argument provided is a built-in Error instance or not.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
##### error
|
|
186
|
+
|
|
187
|
+
`unknown`
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`error is Error`
|
|
192
|
+
|
|
193
|
+
#### Inherited from
|
|
194
|
+
|
|
195
|
+
[`WalletError`](WalletError.md).[`isError`](WalletError.md#iserror)
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### prepareStackTrace()
|
|
200
|
+
|
|
201
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
|
202
|
+
|
|
203
|
+
#### Parameters
|
|
204
|
+
|
|
205
|
+
##### err
|
|
206
|
+
|
|
207
|
+
`Error`
|
|
208
|
+
|
|
209
|
+
##### stackTraces
|
|
210
|
+
|
|
211
|
+
`CallSite`[]
|
|
212
|
+
|
|
213
|
+
#### Returns
|
|
214
|
+
|
|
215
|
+
`any`
|
|
216
|
+
|
|
217
|
+
#### See
|
|
218
|
+
|
|
219
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
220
|
+
|
|
221
|
+
#### Inherited from
|
|
222
|
+
|
|
223
|
+
[`WalletError`](WalletError.md).[`prepareStackTrace`](WalletError.md#preparestacktrace)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletDecryptionError
|
|
6
|
+
|
|
7
|
+
# Class: WalletDecryptionError
|
|
8
|
+
|
|
9
|
+
## Extends
|
|
10
|
+
|
|
11
|
+
- [`WalletError`](WalletError.md)
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new WalletDecryptionError**(`message?`, `error?`): `WalletDecryptionError`
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### message?
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
##### error?
|
|
26
|
+
|
|
27
|
+
`any`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`WalletDecryptionError`
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`WalletError`](WalletError.md).[`constructor`](WalletError.md#constructor)
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### cause?
|
|
40
|
+
|
|
41
|
+
> `optional` **cause**: `unknown`
|
|
42
|
+
|
|
43
|
+
#### Inherited from
|
|
44
|
+
|
|
45
|
+
[`WalletError`](WalletError.md).[`cause`](WalletError.md#cause)
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### error
|
|
50
|
+
|
|
51
|
+
> **error**: `any`
|
|
52
|
+
|
|
53
|
+
#### Inherited from
|
|
54
|
+
|
|
55
|
+
[`WalletError`](WalletError.md).[`error`](WalletError.md#error)
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### message
|
|
60
|
+
|
|
61
|
+
> **message**: `string`
|
|
62
|
+
|
|
63
|
+
#### Inherited from
|
|
64
|
+
|
|
65
|
+
[`WalletError`](WalletError.md).[`message`](WalletError.md#message)
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### name
|
|
70
|
+
|
|
71
|
+
> **name**: `string` = `'WalletDecryptionError'`
|
|
72
|
+
|
|
73
|
+
#### Overrides
|
|
74
|
+
|
|
75
|
+
[`WalletError`](WalletError.md).[`name`](WalletError.md#name)
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### stack?
|
|
80
|
+
|
|
81
|
+
> `optional` **stack**: `string`
|
|
82
|
+
|
|
83
|
+
#### Inherited from
|
|
84
|
+
|
|
85
|
+
[`WalletError`](WalletError.md).[`stack`](WalletError.md#stack)
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### stackTraceLimit
|
|
90
|
+
|
|
91
|
+
> `static` **stackTraceLimit**: `number`
|
|
92
|
+
|
|
93
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
94
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
|
95
|
+
`Error.captureStackTrace(obj)`).
|
|
96
|
+
|
|
97
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
98
|
+
will affect any stack trace captured _after_ the value has been changed.
|
|
99
|
+
|
|
100
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
101
|
+
not capture any frames.
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`WalletError`](WalletError.md).[`stackTraceLimit`](WalletError.md#stacktracelimit)
|
|
106
|
+
|
|
107
|
+
## Methods
|
|
108
|
+
|
|
109
|
+
### captureStackTrace()
|
|
110
|
+
|
|
111
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
112
|
+
|
|
113
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
114
|
+
a string representing the location in the code at which
|
|
115
|
+
`Error.captureStackTrace()` was called.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const myObject = {};
|
|
119
|
+
Error.captureStackTrace(myObject);
|
|
120
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The first line of the trace will be prefixed with
|
|
124
|
+
`${myObject.name}: ${myObject.message}`.
|
|
125
|
+
|
|
126
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
127
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
128
|
+
generated stack trace.
|
|
129
|
+
|
|
130
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
131
|
+
details of error generation from the user. For instance:
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
function a() {
|
|
135
|
+
b();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function b() {
|
|
139
|
+
c();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function c() {
|
|
143
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
144
|
+
const { stackTraceLimit } = Error;
|
|
145
|
+
Error.stackTraceLimit = 0;
|
|
146
|
+
const error = new Error();
|
|
147
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
148
|
+
|
|
149
|
+
// Capture the stack trace above function b
|
|
150
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
a();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Parameters
|
|
158
|
+
|
|
159
|
+
##### targetObject
|
|
160
|
+
|
|
161
|
+
`object`
|
|
162
|
+
|
|
163
|
+
##### constructorOpt?
|
|
164
|
+
|
|
165
|
+
`Function`
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`void`
|
|
170
|
+
|
|
171
|
+
#### Inherited from
|
|
172
|
+
|
|
173
|
+
[`WalletError`](WalletError.md).[`captureStackTrace`](WalletError.md#capturestacktrace)
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
177
|
+
### isError()
|
|
178
|
+
|
|
179
|
+
> `static` **isError**(`error`): `error is Error`
|
|
180
|
+
|
|
181
|
+
Indicates whether the argument provided is a built-in Error instance or not.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
##### error
|
|
186
|
+
|
|
187
|
+
`unknown`
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`error is Error`
|
|
192
|
+
|
|
193
|
+
#### Inherited from
|
|
194
|
+
|
|
195
|
+
[`WalletError`](WalletError.md).[`isError`](WalletError.md#iserror)
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### prepareStackTrace()
|
|
200
|
+
|
|
201
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
|
202
|
+
|
|
203
|
+
#### Parameters
|
|
204
|
+
|
|
205
|
+
##### err
|
|
206
|
+
|
|
207
|
+
`Error`
|
|
208
|
+
|
|
209
|
+
##### stackTraces
|
|
210
|
+
|
|
211
|
+
`CallSite`[]
|
|
212
|
+
|
|
213
|
+
#### Returns
|
|
214
|
+
|
|
215
|
+
`any`
|
|
216
|
+
|
|
217
|
+
#### See
|
|
218
|
+
|
|
219
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
220
|
+
|
|
221
|
+
#### Inherited from
|
|
222
|
+
|
|
223
|
+
[`WalletError`](WalletError.md).[`prepareStackTrace`](WalletError.md#preparestacktrace)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
[**@miden-sdk/miden-wallet-adapter-base**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletDecryptionNotAllowedError
|
|
6
|
+
|
|
7
|
+
# Class: WalletDecryptionNotAllowedError
|
|
8
|
+
|
|
9
|
+
## Extends
|
|
10
|
+
|
|
11
|
+
- [`WalletError`](WalletError.md)
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new WalletDecryptionNotAllowedError**(`message?`, `error?`): `WalletDecryptionNotAllowedError`
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### message?
|
|
22
|
+
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
##### error?
|
|
26
|
+
|
|
27
|
+
`any`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`WalletDecryptionNotAllowedError`
|
|
32
|
+
|
|
33
|
+
#### Inherited from
|
|
34
|
+
|
|
35
|
+
[`WalletError`](WalletError.md).[`constructor`](WalletError.md#constructor)
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### cause?
|
|
40
|
+
|
|
41
|
+
> `optional` **cause**: `unknown`
|
|
42
|
+
|
|
43
|
+
#### Inherited from
|
|
44
|
+
|
|
45
|
+
[`WalletError`](WalletError.md).[`cause`](WalletError.md#cause)
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### error
|
|
50
|
+
|
|
51
|
+
> **error**: `any`
|
|
52
|
+
|
|
53
|
+
#### Inherited from
|
|
54
|
+
|
|
55
|
+
[`WalletError`](WalletError.md).[`error`](WalletError.md#error)
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### message
|
|
60
|
+
|
|
61
|
+
> **message**: `string`
|
|
62
|
+
|
|
63
|
+
#### Inherited from
|
|
64
|
+
|
|
65
|
+
[`WalletError`](WalletError.md).[`message`](WalletError.md#message)
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### name
|
|
70
|
+
|
|
71
|
+
> **name**: `string` = `'WalletDecryptionNotAllowedError'`
|
|
72
|
+
|
|
73
|
+
#### Overrides
|
|
74
|
+
|
|
75
|
+
[`WalletError`](WalletError.md).[`name`](WalletError.md#name)
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
### stack?
|
|
80
|
+
|
|
81
|
+
> `optional` **stack**: `string`
|
|
82
|
+
|
|
83
|
+
#### Inherited from
|
|
84
|
+
|
|
85
|
+
[`WalletError`](WalletError.md).[`stack`](WalletError.md#stack)
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### stackTraceLimit
|
|
90
|
+
|
|
91
|
+
> `static` **stackTraceLimit**: `number`
|
|
92
|
+
|
|
93
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
94
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
|
95
|
+
`Error.captureStackTrace(obj)`).
|
|
96
|
+
|
|
97
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
98
|
+
will affect any stack trace captured _after_ the value has been changed.
|
|
99
|
+
|
|
100
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
|
101
|
+
not capture any frames.
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`WalletError`](WalletError.md).[`stackTraceLimit`](WalletError.md#stacktracelimit)
|
|
106
|
+
|
|
107
|
+
## Methods
|
|
108
|
+
|
|
109
|
+
### captureStackTrace()
|
|
110
|
+
|
|
111
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
112
|
+
|
|
113
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
114
|
+
a string representing the location in the code at which
|
|
115
|
+
`Error.captureStackTrace()` was called.
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
const myObject = {};
|
|
119
|
+
Error.captureStackTrace(myObject);
|
|
120
|
+
myObject.stack; // Similar to `new Error().stack`
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The first line of the trace will be prefixed with
|
|
124
|
+
`${myObject.name}: ${myObject.message}`.
|
|
125
|
+
|
|
126
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
127
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
128
|
+
generated stack trace.
|
|
129
|
+
|
|
130
|
+
The `constructorOpt` argument is useful for hiding implementation
|
|
131
|
+
details of error generation from the user. For instance:
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
function a() {
|
|
135
|
+
b();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function b() {
|
|
139
|
+
c();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function c() {
|
|
143
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
|
144
|
+
const { stackTraceLimit } = Error;
|
|
145
|
+
Error.stackTraceLimit = 0;
|
|
146
|
+
const error = new Error();
|
|
147
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
148
|
+
|
|
149
|
+
// Capture the stack trace above function b
|
|
150
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
a();
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Parameters
|
|
158
|
+
|
|
159
|
+
##### targetObject
|
|
160
|
+
|
|
161
|
+
`object`
|
|
162
|
+
|
|
163
|
+
##### constructorOpt?
|
|
164
|
+
|
|
165
|
+
`Function`
|
|
166
|
+
|
|
167
|
+
#### Returns
|
|
168
|
+
|
|
169
|
+
`void`
|
|
170
|
+
|
|
171
|
+
#### Inherited from
|
|
172
|
+
|
|
173
|
+
[`WalletError`](WalletError.md).[`captureStackTrace`](WalletError.md#capturestacktrace)
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
177
|
+
### isError()
|
|
178
|
+
|
|
179
|
+
> `static` **isError**(`error`): `error is Error`
|
|
180
|
+
|
|
181
|
+
Indicates whether the argument provided is a built-in Error instance or not.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
##### error
|
|
186
|
+
|
|
187
|
+
`unknown`
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`error is Error`
|
|
192
|
+
|
|
193
|
+
#### Inherited from
|
|
194
|
+
|
|
195
|
+
[`WalletError`](WalletError.md).[`isError`](WalletError.md#iserror)
|
|
196
|
+
|
|
197
|
+
***
|
|
198
|
+
|
|
199
|
+
### prepareStackTrace()
|
|
200
|
+
|
|
201
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
|
202
|
+
|
|
203
|
+
#### Parameters
|
|
204
|
+
|
|
205
|
+
##### err
|
|
206
|
+
|
|
207
|
+
`Error`
|
|
208
|
+
|
|
209
|
+
##### stackTraces
|
|
210
|
+
|
|
211
|
+
`CallSite`[]
|
|
212
|
+
|
|
213
|
+
#### Returns
|
|
214
|
+
|
|
215
|
+
`any`
|
|
216
|
+
|
|
217
|
+
#### See
|
|
218
|
+
|
|
219
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
220
|
+
|
|
221
|
+
#### Inherited from
|
|
222
|
+
|
|
223
|
+
[`WalletError`](WalletError.md).[`prepareStackTrace`](WalletError.md#preparestacktrace)
|