@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.
Files changed (104) hide show
  1. package/adapter.ts +146 -0
  2. package/dist/adapter.d.ts +69 -0
  3. package/dist/adapter.js +74 -0
  4. package/dist/adapter.js.map +1 -0
  5. package/dist/errors.d.ts +70 -0
  6. package/dist/errors.js +75 -0
  7. package/dist/errors.js.map +1 -0
  8. package/dist/helpers.d.ts +2 -0
  9. package/dist/helpers.js +32 -0
  10. package/dist/helpers.js.map +1 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +7 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/signer.d.ts +34 -0
  15. package/dist/signer.js +6 -0
  16. package/dist/signer.js.map +1 -0
  17. package/dist/transaction.d.ts +67 -0
  18. package/dist/transaction.js +74 -0
  19. package/dist/transaction.js.map +1 -0
  20. package/dist/types.d.ts +47 -0
  21. package/dist/types.js +19 -0
  22. package/dist/types.js.map +1 -0
  23. package/docs/@miden-sdk/namespaces/EventEmitter/README.md +24 -0
  24. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/EventEmitterStatic.md +17 -0
  25. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/ListenerFn.md +25 -0
  26. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ArgumentMap.md +15 -0
  27. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventArgs.md +19 -0
  28. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventListener.md +19 -0
  29. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventNames.md +15 -0
  30. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ValidEventTypes.md +17 -0
  31. package/docs/@miden-sdk/namespaces/EventEmitter/variables/EventEmitter.md +9 -0
  32. package/docs/README.md +88 -0
  33. package/docs/classes/BaseMessageSignerWalletAdapter.md +755 -0
  34. package/docs/classes/BaseSignerWalletAdapter.md +579 -0
  35. package/docs/classes/BaseWalletAdapter.md +535 -0
  36. package/docs/classes/ConsumeTransaction.md +93 -0
  37. package/docs/classes/CustomTransaction.md +93 -0
  38. package/docs/classes/EventEmitter.md +305 -0
  39. package/docs/classes/SendTransaction.md +107 -0
  40. package/docs/classes/Transaction.md +151 -0
  41. package/docs/classes/WalletAccountError.md +223 -0
  42. package/docs/classes/WalletAddressError.md +223 -0
  43. package/docs/classes/WalletConfigError.md +223 -0
  44. package/docs/classes/WalletConnectionError.md +223 -0
  45. package/docs/classes/WalletDecryptionError.md +223 -0
  46. package/docs/classes/WalletDecryptionNotAllowedError.md +223 -0
  47. package/docs/classes/WalletDisconnectedError.md +223 -0
  48. package/docs/classes/WalletDisconnectionError.md +223 -0
  49. package/docs/classes/WalletError.md +244 -0
  50. package/docs/classes/WalletKeypairError.md +223 -0
  51. package/docs/classes/WalletLoadError.md +223 -0
  52. package/docs/classes/WalletNotConnectedError.md +223 -0
  53. package/docs/classes/WalletNotReadyError.md +223 -0
  54. package/docs/classes/WalletNotSelectedError.md +223 -0
  55. package/docs/classes/WalletPrivateDataPermissionError.md +223 -0
  56. package/docs/classes/WalletRecordsError.md +223 -0
  57. package/docs/classes/WalletSendTransactionError.md +223 -0
  58. package/docs/classes/WalletSignMessageError.md +223 -0
  59. package/docs/classes/WalletSignTransactionError.md +223 -0
  60. package/docs/classes/WalletTimeoutError.md +223 -0
  61. package/docs/classes/WalletTransactionError.md +223 -0
  62. package/docs/classes/WalletWindowBlockedError.md +223 -0
  63. package/docs/classes/WalletWindowClosedError.md +223 -0
  64. package/docs/enumerations/AllowedPrivateData.md +37 -0
  65. package/docs/enumerations/PrivateDataPermission.md +19 -0
  66. package/docs/enumerations/TransactionType.md +25 -0
  67. package/docs/enumerations/WalletAdapterNetwork.md +19 -0
  68. package/docs/enumerations/WalletReadyState.md +49 -0
  69. package/docs/functions/b64ToU8.md +19 -0
  70. package/docs/functions/scopePollingDetectionStrategy.md +19 -0
  71. package/docs/functions/u8ToB64.md +19 -0
  72. package/docs/interfaces/Asset.md +19 -0
  73. package/docs/interfaces/IFailedTransactionOutput.md +13 -0
  74. package/docs/interfaces/MessageSignerWalletAdapterProps.md +293 -0
  75. package/docs/interfaces/MidenConsumeTransaction.md +37 -0
  76. package/docs/interfaces/MidenCustomTransaction.md +37 -0
  77. package/docs/interfaces/MidenSendTransaction.md +43 -0
  78. package/docs/interfaces/MidenTransaction.md +19 -0
  79. package/docs/interfaces/SignerWalletAdapterProps.md +149 -0
  80. package/docs/interfaces/TransactionOutput.md +19 -0
  81. package/docs/interfaces/WalletAdapterEvents.md +69 -0
  82. package/docs/interfaces/WalletAdapterProps.md +106 -0
  83. package/docs/interfaces/WalletTransactionSuccessOutput.md +19 -0
  84. package/docs/type-aliases/Adapter.md +9 -0
  85. package/docs/type-aliases/FungibleAssetDetails.md +21 -0
  86. package/docs/type-aliases/InputNoteDetails.md +45 -0
  87. package/docs/type-aliases/MessageSignerWalletAdapter.md +15 -0
  88. package/docs/type-aliases/NoteTypeString.md +9 -0
  89. package/docs/type-aliases/SignKind.md +9 -0
  90. package/docs/type-aliases/SignerWalletAdapter.md +15 -0
  91. package/docs/type-aliases/SupportedTransactionVersions.md +9 -0
  92. package/docs/type-aliases/TransactionOrVersionedTransaction.md +15 -0
  93. package/docs/type-aliases/TransactionPayload.md +9 -0
  94. package/docs/type-aliases/WalletAdapter.md +15 -0
  95. package/docs/type-aliases/WalletName.md +21 -0
  96. package/docs/type-aliases/WalletTransactionOutput.md +9 -0
  97. package/errors.ts +97 -0
  98. package/helpers.ts +28 -0
  99. package/index.ts +6 -0
  100. package/package.json +21 -0
  101. package/signer.ts +71 -0
  102. package/transaction.ts +178 -0
  103. package/tsconfig.json +15 -0
  104. 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) / WalletDisconnectedError
6
+
7
+ # Class: WalletDisconnectedError
8
+
9
+ ## Extends
10
+
11
+ - [`WalletError`](WalletError.md)
12
+
13
+ ## Constructors
14
+
15
+ ### Constructor
16
+
17
+ > **new WalletDisconnectedError**(`message?`, `error?`): `WalletDisconnectedError`
18
+
19
+ #### Parameters
20
+
21
+ ##### message?
22
+
23
+ `string`
24
+
25
+ ##### error?
26
+
27
+ `any`
28
+
29
+ #### Returns
30
+
31
+ `WalletDisconnectedError`
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` = `'WalletDisconnectedError'`
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) / WalletDisconnectionError
6
+
7
+ # Class: WalletDisconnectionError
8
+
9
+ ## Extends
10
+
11
+ - [`WalletError`](WalletError.md)
12
+
13
+ ## Constructors
14
+
15
+ ### Constructor
16
+
17
+ > **new WalletDisconnectionError**(`message?`, `error?`): `WalletDisconnectionError`
18
+
19
+ #### Parameters
20
+
21
+ ##### message?
22
+
23
+ `string`
24
+
25
+ ##### error?
26
+
27
+ `any`
28
+
29
+ #### Returns
30
+
31
+ `WalletDisconnectionError`
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` = `'WalletDisconnectionError'`
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,244 @@
1
+ [**@miden-sdk/miden-wallet-adapter-base**](../README.md)
2
+
3
+ ***
4
+
5
+ [@miden-sdk/miden-wallet-adapter-base](../README.md) / WalletError
6
+
7
+ # Class: WalletError
8
+
9
+ ## Extends
10
+
11
+ - `Error`
12
+
13
+ ## Extended by
14
+
15
+ - [`WalletNotReadyError`](WalletNotReadyError.md)
16
+ - [`WalletLoadError`](WalletLoadError.md)
17
+ - [`WalletConfigError`](WalletConfigError.md)
18
+ - [`WalletConnectionError`](WalletConnectionError.md)
19
+ - [`WalletNotSelectedError`](WalletNotSelectedError.md)
20
+ - [`WalletDisconnectedError`](WalletDisconnectedError.md)
21
+ - [`WalletDisconnectionError`](WalletDisconnectionError.md)
22
+ - [`WalletAccountError`](WalletAccountError.md)
23
+ - [`WalletAddressError`](WalletAddressError.md)
24
+ - [`WalletKeypairError`](WalletKeypairError.md)
25
+ - [`WalletNotConnectedError`](WalletNotConnectedError.md)
26
+ - [`WalletSendTransactionError`](WalletSendTransactionError.md)
27
+ - [`WalletSignMessageError`](WalletSignMessageError.md)
28
+ - [`WalletSignTransactionError`](WalletSignTransactionError.md)
29
+ - [`WalletTimeoutError`](WalletTimeoutError.md)
30
+ - [`WalletWindowBlockedError`](WalletWindowBlockedError.md)
31
+ - [`WalletWindowClosedError`](WalletWindowClosedError.md)
32
+ - [`WalletDecryptionNotAllowedError`](WalletDecryptionNotAllowedError.md)
33
+ - [`WalletPrivateDataPermissionError`](WalletPrivateDataPermissionError.md)
34
+ - [`WalletDecryptionError`](WalletDecryptionError.md)
35
+ - [`WalletRecordsError`](WalletRecordsError.md)
36
+ - [`WalletTransactionError`](WalletTransactionError.md)
37
+
38
+ ## Constructors
39
+
40
+ ### Constructor
41
+
42
+ > **new WalletError**(`message?`, `error?`): `WalletError`
43
+
44
+ #### Parameters
45
+
46
+ ##### message?
47
+
48
+ `string`
49
+
50
+ ##### error?
51
+
52
+ `any`
53
+
54
+ #### Returns
55
+
56
+ `WalletError`
57
+
58
+ #### Overrides
59
+
60
+ `Error.constructor`
61
+
62
+ ## Properties
63
+
64
+ ### cause?
65
+
66
+ > `optional` **cause**: `unknown`
67
+
68
+ #### Inherited from
69
+
70
+ `Error.cause`
71
+
72
+ ***
73
+
74
+ ### error
75
+
76
+ > **error**: `any`
77
+
78
+ ***
79
+
80
+ ### message
81
+
82
+ > **message**: `string`
83
+
84
+ #### Inherited from
85
+
86
+ `Error.message`
87
+
88
+ ***
89
+
90
+ ### name
91
+
92
+ > **name**: `string`
93
+
94
+ #### Inherited from
95
+
96
+ `Error.name`
97
+
98
+ ***
99
+
100
+ ### stack?
101
+
102
+ > `optional` **stack**: `string`
103
+
104
+ #### Inherited from
105
+
106
+ `Error.stack`
107
+
108
+ ***
109
+
110
+ ### stackTraceLimit
111
+
112
+ > `static` **stackTraceLimit**: `number`
113
+
114
+ The `Error.stackTraceLimit` property specifies the number of stack frames
115
+ collected by a stack trace (whether generated by `new Error().stack` or
116
+ `Error.captureStackTrace(obj)`).
117
+
118
+ The default value is `10` but may be set to any valid JavaScript number. Changes
119
+ will affect any stack trace captured _after_ the value has been changed.
120
+
121
+ If set to a non-number value, or set to a negative number, stack traces will
122
+ not capture any frames.
123
+
124
+ #### Inherited from
125
+
126
+ `Error.stackTraceLimit`
127
+
128
+ ## Methods
129
+
130
+ ### captureStackTrace()
131
+
132
+ > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
133
+
134
+ Creates a `.stack` property on `targetObject`, which when accessed returns
135
+ a string representing the location in the code at which
136
+ `Error.captureStackTrace()` was called.
137
+
138
+ ```js
139
+ const myObject = {};
140
+ Error.captureStackTrace(myObject);
141
+ myObject.stack; // Similar to `new Error().stack`
142
+ ```
143
+
144
+ The first line of the trace will be prefixed with
145
+ `${myObject.name}: ${myObject.message}`.
146
+
147
+ The optional `constructorOpt` argument accepts a function. If given, all frames
148
+ above `constructorOpt`, including `constructorOpt`, will be omitted from the
149
+ generated stack trace.
150
+
151
+ The `constructorOpt` argument is useful for hiding implementation
152
+ details of error generation from the user. For instance:
153
+
154
+ ```js
155
+ function a() {
156
+ b();
157
+ }
158
+
159
+ function b() {
160
+ c();
161
+ }
162
+
163
+ function c() {
164
+ // Create an error without stack trace to avoid calculating the stack trace twice.
165
+ const { stackTraceLimit } = Error;
166
+ Error.stackTraceLimit = 0;
167
+ const error = new Error();
168
+ Error.stackTraceLimit = stackTraceLimit;
169
+
170
+ // Capture the stack trace above function b
171
+ Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
172
+ throw error;
173
+ }
174
+
175
+ a();
176
+ ```
177
+
178
+ #### Parameters
179
+
180
+ ##### targetObject
181
+
182
+ `object`
183
+
184
+ ##### constructorOpt?
185
+
186
+ `Function`
187
+
188
+ #### Returns
189
+
190
+ `void`
191
+
192
+ #### Inherited from
193
+
194
+ `Error.captureStackTrace`
195
+
196
+ ***
197
+
198
+ ### isError()
199
+
200
+ > `static` **isError**(`error`): `error is Error`
201
+
202
+ Indicates whether the argument provided is a built-in Error instance or not.
203
+
204
+ #### Parameters
205
+
206
+ ##### error
207
+
208
+ `unknown`
209
+
210
+ #### Returns
211
+
212
+ `error is Error`
213
+
214
+ #### Inherited from
215
+
216
+ `Error.isError`
217
+
218
+ ***
219
+
220
+ ### prepareStackTrace()
221
+
222
+ > `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
223
+
224
+ #### Parameters
225
+
226
+ ##### err
227
+
228
+ `Error`
229
+
230
+ ##### stackTraces
231
+
232
+ `CallSite`[]
233
+
234
+ #### Returns
235
+
236
+ `any`
237
+
238
+ #### See
239
+
240
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
241
+
242
+ #### Inherited from
243
+
244
+ `Error.prepareStackTrace`