@actioncodes/protocol 1.2.2 → 2.0.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/LICENSE +1 -1
- package/README.md +32 -45
- package/dist/ActionCodesProtocol.d.ts +35 -0
- package/dist/ActionCodesProtocol.d.ts.map +1 -0
- package/dist/adapters/BaseChainAdapter.d.ts +22 -0
- package/dist/adapters/BaseChainAdapter.d.ts.map +1 -0
- package/dist/adapters/SolanaAdapter.d.ts +44 -0
- package/dist/adapters/SolanaAdapter.d.ts.map +1 -0
- package/dist/constants.d.ts +6 -8
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +25 -0
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -36
- package/dist/index.js.map +25 -0
- package/dist/strategy/DelegationStrategy.d.ts +43 -0
- package/dist/strategy/DelegationStrategy.d.ts.map +1 -0
- package/dist/strategy/WalletStrategy.d.ts +8 -0
- package/dist/strategy/WalletStrategy.d.ts.map +1 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/canonical.d.ts +5 -0
- package/dist/utils/canonical.d.ts.map +1 -0
- package/dist/utils/crypto.d.ts +13 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/protocolMeta.d.ts +16 -0
- package/dist/utils/protocolMeta.d.ts.map +1 -0
- package/docs/ActionCodesProtocol/README.md +11 -0
- package/docs/ActionCodesProtocol/classes/ActionCodesProtocol.md +147 -0
- package/docs/README.md +10 -50
- package/docs/adapters/BaseChainAdapter/README.md +20 -0
- package/docs/adapters/BaseChainAdapter/classes/BaseChainAdapter.md +56 -0
- package/docs/adapters/BaseChainAdapter/interfaces/BaseContext.md +17 -0
- package/docs/adapters/BaseChainAdapter/interfaces/ChainAdapter.md +33 -0
- package/docs/adapters/BaseChainAdapter/type-aliases/ChainContext.md +23 -0
- package/docs/adapters/NodeCryptoAdapter/README.md +15 -0
- package/docs/adapters/NodeCryptoAdapter/classes/NodeCryptoAdapter.md +254 -0
- package/docs/adapters/NodeCryptoAdapter/type-aliases/NodeCryptoContext.md +27 -0
- package/docs/adapters/SolanaAdapter/README.md +16 -0
- package/docs/adapters/SolanaAdapter/classes/SolanaAdapter.md +190 -0
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaContext.md +27 -0
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaTransaction.md +13 -0
- package/docs/constants/README.md +8 -13
- package/docs/constants/variables/CODE_CHARSET_DIGITS.md +11 -0
- package/docs/constants/variables/CODE_DEFAULT_LENGTH.md +11 -0
- package/docs/constants/variables/CODE_MAX_LENGTH.md +11 -0
- package/docs/constants/variables/CODE_MIN_LENGTH.md +11 -0
- package/docs/constants/variables/PROTOCOL_META_MAX_BYTES.md +11 -0
- package/docs/constants/variables/PROTOCOL_NORMALIZATION.md +11 -0
- package/docs/constants/variables/SUPPORTED_CHAINS.md +3 -3
- package/docs/errors/README.md +22 -0
- package/docs/errors/classes/ExpiredCodeError.md +695 -0
- package/docs/errors/classes/InvalidCodeFormatError.md +691 -0
- package/docs/errors/classes/InvalidPubkeyFormatError.md +691 -0
- package/docs/errors/classes/InvalidSignatureError.md +687 -0
- package/docs/errors/classes/MetaMismatchError.md +695 -0
- package/docs/errors/classes/MissingMetaError.md +681 -0
- package/docs/errors/classes/ProtocolError.md +637 -0
- package/docs/errors/classes/TransactionNotSignedByIntendedOwnerError.md +691 -0
- package/docs/errors/enumerations/ProtocolErrorCode.md +121 -0
- package/docs/index/README.md +83 -41
- package/docs/modules.md +12 -9
- package/docs/strategy/WalletStrategy/README.md +11 -0
- package/docs/strategy/WalletStrategy/classes/WalletStrategy.md +67 -0
- package/docs/types/README.md +14 -0
- package/docs/types/interfaces/ActionCode.md +65 -0
- package/docs/types/interfaces/CanonicalMessageParts.md +33 -0
- package/docs/types/interfaces/CodeGenerationConfig.md +33 -0
- package/docs/types/interfaces/CodeGenerationResult.md +25 -0
- package/docs/utils/canonical/README.md +16 -0
- package/docs/utils/canonical/functions/serializeCanonical.md +21 -0
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md +11 -0
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md +11 -0
- package/docs/utils/crypto/README.md +18 -0
- package/docs/utils/crypto/functions/base32EncodeCrockford.md +21 -0
- package/docs/utils/crypto/functions/codeHash.md +21 -0
- package/docs/utils/crypto/functions/digestToDigits.md +25 -0
- package/docs/utils/crypto/functions/generateRandomSecret.md +15 -0
- package/docs/utils/crypto/functions/hkdfSha256.md +35 -0
- package/docs/utils/crypto/functions/hmacSha256.md +25 -0
- package/docs/utils/crypto/functions/sha256.md +21 -0
- package/docs/utils/crypto/functions/truncateBits.md +25 -0
- package/docs/utils/protocolMeta/README.md +21 -0
- package/docs/utils/protocolMeta/functions/buildProtocolMeta.md +21 -0
- package/docs/utils/protocolMeta/functions/parseProtocolMeta.md +21 -0
- package/docs/utils/protocolMeta/functions/validateProtocolMetaFormat.md +21 -0
- package/docs/utils/protocolMeta/interfaces/ProtocolMetaFields.md +41 -0
- package/docs/utils/protocolMeta/variables/SCHEME.md +11 -0
- package/package.json +42 -47
- package/dist/actioncode.d.ts +0 -120
- package/dist/actioncode.d.ts.map +0 -1
- package/dist/actioncode.js +0 -186
- package/dist/adapters/base.d.ts +0 -93
- package/dist/adapters/base.d.ts.map +0 -1
- package/dist/adapters/base.js +0 -65
- package/dist/adapters/solana/index.d.ts +0 -2
- package/dist/adapters/solana/index.d.ts.map +0 -1
- package/dist/adapters/solana/index.js +0 -30
- package/dist/adapters/solana/solana.d.ts +0 -113
- package/dist/adapters/solana/solana.d.ts.map +0 -1
- package/dist/adapters/solana/solana.js +0 -537
- package/dist/codegen.d.ts +0 -76
- package/dist/codegen.d.ts.map +0 -1
- package/dist/codegen.js +0 -211
- package/dist/constants.js +0 -24
- package/dist/meta.d.ts +0 -54
- package/dist/meta.d.ts.map +0 -1
- package/dist/meta.js +0 -104
- package/dist/protocol.d.ts +0 -179
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -390
- package/docs/_media/LICENSE +0 -201
- package/docs/_media/README.md +0 -28
- package/docs/actioncode/README.md +0 -21
- package/docs/actioncode/classes/ActionCode.md +0 -430
- package/docs/actioncode/interfaces/ActionCodeFields.md +0 -89
- package/docs/actioncode/interfaces/ActionCodeMetadata.md +0 -25
- package/docs/actioncode/interfaces/ActionCodeTransaction.md +0 -57
- package/docs/actioncode/type-aliases/ActionCodeStatus.md +0 -11
- package/docs/adapters/base/README.md +0 -11
- package/docs/adapters/base/classes/BaseChainAdapter.md +0 -396
- package/docs/adapters/solana/README.md +0 -19
- package/docs/adapters/solana/solana/README.md +0 -15
- package/docs/adapters/solana/solana/classes/SolanaAdapter.md +0 -506
- package/docs/adapters/solana/solana/type-aliases/SolanaTransaction.md +0 -13
- package/docs/codegen/README.md +0 -11
- package/docs/codegen/classes/CodeGenerator.md +0 -341
- package/docs/constants/type-aliases/SupportedChain.md +0 -11
- package/docs/constants/variables/CODE_LENGTH.md +0 -11
- package/docs/constants/variables/CODE_TTL.md +0 -11
- package/docs/constants/variables/MAX_PREFIX_LENGTH.md +0 -11
- package/docs/constants/variables/MIN_PREFIX_LENGTH.md +0 -11
- package/docs/constants/variables/PROTOCOL_CODE_PREFIX.md +0 -11
- package/docs/constants/variables/PROTOCOL_PREFIX.md +0 -11
- package/docs/constants/variables/PROTOCOL_VERSION.md +0 -11
- package/docs/meta/README.md +0 -15
- package/docs/meta/classes/ProtocolMetaParser.md +0 -177
- package/docs/meta/interfaces/ProtocolMetaV1.md +0 -59
- package/docs/protocol/README.md +0 -51
- package/docs/protocol/classes/ActionCodesProtocol.md +0 -676
- package/docs/protocol/interfaces/ProtocolConfig.md +0 -71
@@ -0,0 +1,695 @@
|
|
1
|
+
[**@actioncodes/protocol-v2**](../../README.md)
|
2
|
+
|
3
|
+
***
|
4
|
+
|
5
|
+
[@actioncodes/protocol-v2](../../modules.md) / [errors](../README.md) / MetaMismatchError
|
6
|
+
|
7
|
+
# Class: MetaMismatchError
|
8
|
+
|
9
|
+
Defined in: src/errors.ts:154
|
10
|
+
|
11
|
+
## Extends
|
12
|
+
|
13
|
+
- [`ProtocolError`](ProtocolError.md)
|
14
|
+
|
15
|
+
## Constructors
|
16
|
+
|
17
|
+
### Constructor
|
18
|
+
|
19
|
+
> **new MetaMismatchError**(`expected`, `actual`, `field`): `MetaMismatchError`
|
20
|
+
|
21
|
+
Defined in: src/errors.ts:155
|
22
|
+
|
23
|
+
#### Parameters
|
24
|
+
|
25
|
+
##### expected
|
26
|
+
|
27
|
+
`string`
|
28
|
+
|
29
|
+
##### actual
|
30
|
+
|
31
|
+
`string`
|
32
|
+
|
33
|
+
##### field
|
34
|
+
|
35
|
+
`string`
|
36
|
+
|
37
|
+
#### Returns
|
38
|
+
|
39
|
+
`MetaMismatchError`
|
40
|
+
|
41
|
+
#### Overrides
|
42
|
+
|
43
|
+
[`ProtocolError`](ProtocolError.md).[`constructor`](ProtocolError.md#constructor)
|
44
|
+
|
45
|
+
## Properties
|
46
|
+
|
47
|
+
### cause?
|
48
|
+
|
49
|
+
> `optional` **cause**: `unknown`
|
50
|
+
|
51
|
+
Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:26
|
52
|
+
|
53
|
+
The cause of the error.
|
54
|
+
|
55
|
+
#### Inherited from
|
56
|
+
|
57
|
+
[`ProtocolError`](ProtocolError.md).[`cause`](ProtocolError.md#cause)
|
58
|
+
|
59
|
+
***
|
60
|
+
|
61
|
+
### code
|
62
|
+
|
63
|
+
> `readonly` **code**: [`ProtocolErrorCode`](../enumerations/ProtocolErrorCode.md)
|
64
|
+
|
65
|
+
Defined in: src/errors.ts:29
|
66
|
+
|
67
|
+
#### Inherited from
|
68
|
+
|
69
|
+
[`ProtocolError`](ProtocolError.md).[`code`](ProtocolError.md#code)
|
70
|
+
|
71
|
+
***
|
72
|
+
|
73
|
+
### details?
|
74
|
+
|
75
|
+
> `readonly` `optional` **details**: `Record`\<`string`, `unknown`\>
|
76
|
+
|
77
|
+
Defined in: src/errors.ts:31
|
78
|
+
|
79
|
+
#### Inherited from
|
80
|
+
|
81
|
+
[`ProtocolError`](ProtocolError.md).[`details`](ProtocolError.md#details)
|
82
|
+
|
83
|
+
***
|
84
|
+
|
85
|
+
### message
|
86
|
+
|
87
|
+
> **message**: `string`
|
88
|
+
|
89
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077
|
90
|
+
|
91
|
+
#### Inherited from
|
92
|
+
|
93
|
+
[`ProtocolError`](ProtocolError.md).[`message`](ProtocolError.md#message)
|
94
|
+
|
95
|
+
***
|
96
|
+
|
97
|
+
### name
|
98
|
+
|
99
|
+
> **name**: `string`
|
100
|
+
|
101
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
|
102
|
+
|
103
|
+
#### Inherited from
|
104
|
+
|
105
|
+
[`ProtocolError`](ProtocolError.md).[`name`](ProtocolError.md#name)
|
106
|
+
|
107
|
+
***
|
108
|
+
|
109
|
+
### stack?
|
110
|
+
|
111
|
+
> `optional` **stack**: `string`
|
112
|
+
|
113
|
+
Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078
|
114
|
+
|
115
|
+
#### Inherited from
|
116
|
+
|
117
|
+
[`ProtocolError`](ProtocolError.md).[`stack`](ProtocolError.md#stack)
|
118
|
+
|
119
|
+
***
|
120
|
+
|
121
|
+
### stackTraceLimit
|
122
|
+
|
123
|
+
> `static` **stackTraceLimit**: `number`
|
124
|
+
|
125
|
+
Defined in: node\_modules/@types/node/globals.d.ts:68
|
126
|
+
|
127
|
+
The `Error.stackTraceLimit` property specifies the number of stack frames
|
128
|
+
collected by a stack trace (whether generated by `new Error().stack` or
|
129
|
+
`Error.captureStackTrace(obj)`).
|
130
|
+
|
131
|
+
The default value is `10` but may be set to any valid JavaScript number. Changes
|
132
|
+
will affect any stack trace captured _after_ the value has been changed.
|
133
|
+
|
134
|
+
If set to a non-number value, or set to a negative number, stack traces will
|
135
|
+
not capture any frames.
|
136
|
+
|
137
|
+
#### Inherited from
|
138
|
+
|
139
|
+
[`ProtocolError`](ProtocolError.md).[`stackTraceLimit`](ProtocolError.md#stacktracelimit)
|
140
|
+
|
141
|
+
## Methods
|
142
|
+
|
143
|
+
### captureStackTrace()
|
144
|
+
|
145
|
+
#### Call Signature
|
146
|
+
|
147
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
148
|
+
|
149
|
+
Defined in: node\_modules/@types/node/globals.d.ts:52
|
150
|
+
|
151
|
+
Creates a `.stack` property on `targetObject`, which when accessed returns
|
152
|
+
a string representing the location in the code at which
|
153
|
+
`Error.captureStackTrace()` was called.
|
154
|
+
|
155
|
+
```js
|
156
|
+
const myObject = {};
|
157
|
+
Error.captureStackTrace(myObject);
|
158
|
+
myObject.stack; // Similar to `new Error().stack`
|
159
|
+
```
|
160
|
+
|
161
|
+
The first line of the trace will be prefixed with
|
162
|
+
`${myObject.name}: ${myObject.message}`.
|
163
|
+
|
164
|
+
The optional `constructorOpt` argument accepts a function. If given, all frames
|
165
|
+
above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
166
|
+
generated stack trace.
|
167
|
+
|
168
|
+
The `constructorOpt` argument is useful for hiding implementation
|
169
|
+
details of error generation from the user. For instance:
|
170
|
+
|
171
|
+
```js
|
172
|
+
function a() {
|
173
|
+
b();
|
174
|
+
}
|
175
|
+
|
176
|
+
function b() {
|
177
|
+
c();
|
178
|
+
}
|
179
|
+
|
180
|
+
function c() {
|
181
|
+
// Create an error without stack trace to avoid calculating the stack trace twice.
|
182
|
+
const { stackTraceLimit } = Error;
|
183
|
+
Error.stackTraceLimit = 0;
|
184
|
+
const error = new Error();
|
185
|
+
Error.stackTraceLimit = stackTraceLimit;
|
186
|
+
|
187
|
+
// Capture the stack trace above function b
|
188
|
+
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
189
|
+
throw error;
|
190
|
+
}
|
191
|
+
|
192
|
+
a();
|
193
|
+
```
|
194
|
+
|
195
|
+
##### Parameters
|
196
|
+
|
197
|
+
###### targetObject
|
198
|
+
|
199
|
+
`object`
|
200
|
+
|
201
|
+
###### constructorOpt?
|
202
|
+
|
203
|
+
`Function`
|
204
|
+
|
205
|
+
##### Returns
|
206
|
+
|
207
|
+
`void`
|
208
|
+
|
209
|
+
##### Inherited from
|
210
|
+
|
211
|
+
[`ProtocolError`](ProtocolError.md).[`captureStackTrace`](ProtocolError.md#capturestacktrace)
|
212
|
+
|
213
|
+
#### Call Signature
|
214
|
+
|
215
|
+
> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
216
|
+
|
217
|
+
Defined in: node\_modules/bun-types/globals.d.ts:985
|
218
|
+
|
219
|
+
Create .stack property on a target object
|
220
|
+
|
221
|
+
##### Parameters
|
222
|
+
|
223
|
+
###### targetObject
|
224
|
+
|
225
|
+
`object`
|
226
|
+
|
227
|
+
###### constructorOpt?
|
228
|
+
|
229
|
+
`Function`
|
230
|
+
|
231
|
+
##### Returns
|
232
|
+
|
233
|
+
`void`
|
234
|
+
|
235
|
+
##### Inherited from
|
236
|
+
|
237
|
+
[`ProtocolError`](ProtocolError.md).[`captureStackTrace`](ProtocolError.md#capturestacktrace)
|
238
|
+
|
239
|
+
***
|
240
|
+
|
241
|
+
### create()
|
242
|
+
|
243
|
+
> `static` **create**(`code`, `message`, `details?`): [`ProtocolError`](ProtocolError.md)
|
244
|
+
|
245
|
+
Defined in: src/errors.ts:127
|
246
|
+
|
247
|
+
#### Parameters
|
248
|
+
|
249
|
+
##### code
|
250
|
+
|
251
|
+
[`ProtocolErrorCode`](../enumerations/ProtocolErrorCode.md)
|
252
|
+
|
253
|
+
##### message
|
254
|
+
|
255
|
+
`string`
|
256
|
+
|
257
|
+
##### details?
|
258
|
+
|
259
|
+
`Record`\<`string`, `unknown`\>
|
260
|
+
|
261
|
+
#### Returns
|
262
|
+
|
263
|
+
[`ProtocolError`](ProtocolError.md)
|
264
|
+
|
265
|
+
#### Inherited from
|
266
|
+
|
267
|
+
[`ProtocolError`](ProtocolError.md).[`create`](ProtocolError.md#create)
|
268
|
+
|
269
|
+
***
|
270
|
+
|
271
|
+
### cryptoError()
|
272
|
+
|
273
|
+
> `static` **cryptoError**(`operation`, `reason`): [`ProtocolError`](ProtocolError.md)
|
274
|
+
|
275
|
+
Defined in: src/errors.ts:110
|
276
|
+
|
277
|
+
#### Parameters
|
278
|
+
|
279
|
+
##### operation
|
280
|
+
|
281
|
+
`string`
|
282
|
+
|
283
|
+
##### reason
|
284
|
+
|
285
|
+
`string`
|
286
|
+
|
287
|
+
#### Returns
|
288
|
+
|
289
|
+
[`ProtocolError`](ProtocolError.md)
|
290
|
+
|
291
|
+
#### Inherited from
|
292
|
+
|
293
|
+
[`ProtocolError`](ProtocolError.md).[`cryptoError`](ProtocolError.md#cryptoerror)
|
294
|
+
|
295
|
+
***
|
296
|
+
|
297
|
+
### expiredCode()
|
298
|
+
|
299
|
+
> `static` **expiredCode**(`code`, `expiresAt`, `currentTime`): [`ExpiredCodeError`](ExpiredCodeError.md)
|
300
|
+
|
301
|
+
Defined in: src/errors.ts:38
|
302
|
+
|
303
|
+
#### Parameters
|
304
|
+
|
305
|
+
##### code
|
306
|
+
|
307
|
+
`string`
|
308
|
+
|
309
|
+
##### expiresAt
|
310
|
+
|
311
|
+
`number`
|
312
|
+
|
313
|
+
##### currentTime
|
314
|
+
|
315
|
+
`number`
|
316
|
+
|
317
|
+
#### Returns
|
318
|
+
|
319
|
+
[`ExpiredCodeError`](ExpiredCodeError.md)
|
320
|
+
|
321
|
+
#### Inherited from
|
322
|
+
|
323
|
+
[`ProtocolError`](ProtocolError.md).[`expiredCode`](ProtocolError.md#expiredcode)
|
324
|
+
|
325
|
+
***
|
326
|
+
|
327
|
+
### invalidCodeFormat()
|
328
|
+
|
329
|
+
> `static` **invalidCodeFormat**(`code`, `reason`): [`InvalidCodeFormatError`](InvalidCodeFormatError.md)
|
330
|
+
|
331
|
+
Defined in: src/errors.ts:42
|
332
|
+
|
333
|
+
#### Parameters
|
334
|
+
|
335
|
+
##### code
|
336
|
+
|
337
|
+
`string`
|
338
|
+
|
339
|
+
##### reason
|
340
|
+
|
341
|
+
`string`
|
342
|
+
|
343
|
+
#### Returns
|
344
|
+
|
345
|
+
[`InvalidCodeFormatError`](InvalidCodeFormatError.md)
|
346
|
+
|
347
|
+
#### Inherited from
|
348
|
+
|
349
|
+
[`ProtocolError`](ProtocolError.md).[`invalidCodeFormat`](ProtocolError.md#invalidcodeformat)
|
350
|
+
|
351
|
+
***
|
352
|
+
|
353
|
+
### invalidDigest()
|
354
|
+
|
355
|
+
> `static` **invalidDigest**(`reason`): [`ProtocolError`](ProtocolError.md)
|
356
|
+
|
357
|
+
Defined in: src/errors.ts:118
|
358
|
+
|
359
|
+
#### Parameters
|
360
|
+
|
361
|
+
##### reason
|
362
|
+
|
363
|
+
`string`
|
364
|
+
|
365
|
+
#### Returns
|
366
|
+
|
367
|
+
[`ProtocolError`](ProtocolError.md)
|
368
|
+
|
369
|
+
#### Inherited from
|
370
|
+
|
371
|
+
[`ProtocolError`](ProtocolError.md).[`invalidDigest`](ProtocolError.md#invaliddigest)
|
372
|
+
|
373
|
+
***
|
374
|
+
|
375
|
+
### invalidInput()
|
376
|
+
|
377
|
+
> `static` **invalidInput**(`field`, `value`, `reason`): [`ProtocolError`](ProtocolError.md)
|
378
|
+
|
379
|
+
Defined in: src/errors.ts:93
|
380
|
+
|
381
|
+
#### Parameters
|
382
|
+
|
383
|
+
##### field
|
384
|
+
|
385
|
+
`string`
|
386
|
+
|
387
|
+
##### value
|
388
|
+
|
389
|
+
`unknown`
|
390
|
+
|
391
|
+
##### reason
|
392
|
+
|
393
|
+
`string`
|
394
|
+
|
395
|
+
#### Returns
|
396
|
+
|
397
|
+
[`ProtocolError`](ProtocolError.md)
|
398
|
+
|
399
|
+
#### Inherited from
|
400
|
+
|
401
|
+
[`ProtocolError`](ProtocolError.md).[`invalidInput`](ProtocolError.md#invalidinput)
|
402
|
+
|
403
|
+
***
|
404
|
+
|
405
|
+
### invalidMetaFormat()
|
406
|
+
|
407
|
+
> `static` **invalidMetaFormat**(`reason`): [`ProtocolError`](ProtocolError.md)
|
408
|
+
|
409
|
+
Defined in: src/errors.ts:55
|
410
|
+
|
411
|
+
#### Parameters
|
412
|
+
|
413
|
+
##### reason
|
414
|
+
|
415
|
+
`string`
|
416
|
+
|
417
|
+
#### Returns
|
418
|
+
|
419
|
+
[`ProtocolError`](ProtocolError.md)
|
420
|
+
|
421
|
+
#### Inherited from
|
422
|
+
|
423
|
+
[`ProtocolError`](ProtocolError.md).[`invalidMetaFormat`](ProtocolError.md#invalidmetaformat)
|
424
|
+
|
425
|
+
***
|
426
|
+
|
427
|
+
### invalidPubkeyFormat()
|
428
|
+
|
429
|
+
> `static` **invalidPubkeyFormat**(`pubkey`, `reason`): [`InvalidPubkeyFormatError`](InvalidPubkeyFormatError.md)
|
430
|
+
|
431
|
+
Defined in: src/errors.ts:88
|
432
|
+
|
433
|
+
#### Parameters
|
434
|
+
|
435
|
+
##### pubkey
|
436
|
+
|
437
|
+
`string`
|
438
|
+
|
439
|
+
##### reason
|
440
|
+
|
441
|
+
`string`
|
442
|
+
|
443
|
+
#### Returns
|
444
|
+
|
445
|
+
[`InvalidPubkeyFormatError`](InvalidPubkeyFormatError.md)
|
446
|
+
|
447
|
+
#### Inherited from
|
448
|
+
|
449
|
+
[`ProtocolError`](ProtocolError.md).[`invalidPubkeyFormat`](ProtocolError.md#invalidpubkeyformat)
|
450
|
+
|
451
|
+
***
|
452
|
+
|
453
|
+
### invalidSignature()
|
454
|
+
|
455
|
+
> `static` **invalidSignature**(`reason`): [`InvalidSignatureError`](InvalidSignatureError.md)
|
456
|
+
|
457
|
+
Defined in: src/errors.ts:46
|
458
|
+
|
459
|
+
#### Parameters
|
460
|
+
|
461
|
+
##### reason
|
462
|
+
|
463
|
+
`string`
|
464
|
+
|
465
|
+
#### Returns
|
466
|
+
|
467
|
+
[`InvalidSignatureError`](InvalidSignatureError.md)
|
468
|
+
|
469
|
+
#### Inherited from
|
470
|
+
|
471
|
+
[`ProtocolError`](ProtocolError.md).[`invalidSignature`](ProtocolError.md#invalidsignature)
|
472
|
+
|
473
|
+
***
|
474
|
+
|
475
|
+
### invalidTransactionFormat()
|
476
|
+
|
477
|
+
> `static` **invalidTransactionFormat**(`reason`): [`ProtocolError`](ProtocolError.md)
|
478
|
+
|
479
|
+
Defined in: src/errors.ts:80
|
480
|
+
|
481
|
+
#### Parameters
|
482
|
+
|
483
|
+
##### reason
|
484
|
+
|
485
|
+
`string`
|
486
|
+
|
487
|
+
#### Returns
|
488
|
+
|
489
|
+
[`ProtocolError`](ProtocolError.md)
|
490
|
+
|
491
|
+
#### Inherited from
|
492
|
+
|
493
|
+
[`ProtocolError`](ProtocolError.md).[`invalidTransactionFormat`](ProtocolError.md#invalidtransactionformat)
|
494
|
+
|
495
|
+
***
|
496
|
+
|
497
|
+
### isError()
|
498
|
+
|
499
|
+
#### Call Signature
|
500
|
+
|
501
|
+
> `static` **isError**(`error`): `error is Error`
|
502
|
+
|
503
|
+
Defined in: node\_modules/typescript/lib/lib.esnext.error.d.ts:23
|
504
|
+
|
505
|
+
Indicates whether the argument provided is a built-in Error instance or not.
|
506
|
+
|
507
|
+
##### Parameters
|
508
|
+
|
509
|
+
###### error
|
510
|
+
|
511
|
+
`unknown`
|
512
|
+
|
513
|
+
##### Returns
|
514
|
+
|
515
|
+
`error is Error`
|
516
|
+
|
517
|
+
##### Inherited from
|
518
|
+
|
519
|
+
[`ProtocolError`](ProtocolError.md).[`isError`](ProtocolError.md#iserror)
|
520
|
+
|
521
|
+
#### Call Signature
|
522
|
+
|
523
|
+
> `static` **isError**(`value`): `value is Error`
|
524
|
+
|
525
|
+
Defined in: node\_modules/bun-types/globals.d.ts:980
|
526
|
+
|
527
|
+
Check if a value is an instance of Error
|
528
|
+
|
529
|
+
##### Parameters
|
530
|
+
|
531
|
+
###### value
|
532
|
+
|
533
|
+
`unknown`
|
534
|
+
|
535
|
+
The value to check
|
536
|
+
|
537
|
+
##### Returns
|
538
|
+
|
539
|
+
`value is Error`
|
540
|
+
|
541
|
+
True if the value is an instance of Error, false otherwise
|
542
|
+
|
543
|
+
##### Inherited from
|
544
|
+
|
545
|
+
[`ProtocolError`](ProtocolError.md).[`isError`](ProtocolError.md#iserror)
|
546
|
+
|
547
|
+
***
|
548
|
+
|
549
|
+
### metaMismatch()
|
550
|
+
|
551
|
+
> `static` **metaMismatch**(`expected`, `actual`, `field`): `MetaMismatchError`
|
552
|
+
|
553
|
+
Defined in: src/errors.ts:63
|
554
|
+
|
555
|
+
#### Parameters
|
556
|
+
|
557
|
+
##### expected
|
558
|
+
|
559
|
+
`string`
|
560
|
+
|
561
|
+
##### actual
|
562
|
+
|
563
|
+
`string`
|
564
|
+
|
565
|
+
##### field
|
566
|
+
|
567
|
+
`string`
|
568
|
+
|
569
|
+
#### Returns
|
570
|
+
|
571
|
+
`MetaMismatchError`
|
572
|
+
|
573
|
+
#### Inherited from
|
574
|
+
|
575
|
+
[`ProtocolError`](ProtocolError.md).[`metaMismatch`](ProtocolError.md#metamismatch)
|
576
|
+
|
577
|
+
***
|
578
|
+
|
579
|
+
### metaTooLarge()
|
580
|
+
|
581
|
+
> `static` **metaTooLarge**(`maxBytes`, `actualBytes`): [`ProtocolError`](ProtocolError.md)
|
582
|
+
|
583
|
+
Defined in: src/errors.ts:67
|
584
|
+
|
585
|
+
#### Parameters
|
586
|
+
|
587
|
+
##### maxBytes
|
588
|
+
|
589
|
+
`number`
|
590
|
+
|
591
|
+
##### actualBytes
|
592
|
+
|
593
|
+
`number`
|
594
|
+
|
595
|
+
#### Returns
|
596
|
+
|
597
|
+
[`ProtocolError`](ProtocolError.md)
|
598
|
+
|
599
|
+
#### Inherited from
|
600
|
+
|
601
|
+
[`ProtocolError`](ProtocolError.md).[`metaTooLarge`](ProtocolError.md#metatoolarge)
|
602
|
+
|
603
|
+
***
|
604
|
+
|
605
|
+
### missingMeta()
|
606
|
+
|
607
|
+
> `static` **missingMeta**(): [`MissingMetaError`](MissingMetaError.md)
|
608
|
+
|
609
|
+
Defined in: src/errors.ts:51
|
610
|
+
|
611
|
+
#### Returns
|
612
|
+
|
613
|
+
[`MissingMetaError`](MissingMetaError.md)
|
614
|
+
|
615
|
+
#### Inherited from
|
616
|
+
|
617
|
+
[`ProtocolError`](ProtocolError.md).[`missingMeta`](ProtocolError.md#missingmeta)
|
618
|
+
|
619
|
+
***
|
620
|
+
|
621
|
+
### missingRequiredField()
|
622
|
+
|
623
|
+
> `static` **missingRequiredField**(`field`): [`ProtocolError`](ProtocolError.md)
|
624
|
+
|
625
|
+
Defined in: src/errors.ts:101
|
626
|
+
|
627
|
+
#### Parameters
|
628
|
+
|
629
|
+
##### field
|
630
|
+
|
631
|
+
`string`
|
632
|
+
|
633
|
+
#### Returns
|
634
|
+
|
635
|
+
[`ProtocolError`](ProtocolError.md)
|
636
|
+
|
637
|
+
#### Inherited from
|
638
|
+
|
639
|
+
[`ProtocolError`](ProtocolError.md).[`missingRequiredField`](ProtocolError.md#missingrequiredfield)
|
640
|
+
|
641
|
+
***
|
642
|
+
|
643
|
+
### prepareStackTrace()
|
644
|
+
|
645
|
+
> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
|
646
|
+
|
647
|
+
Defined in: node\_modules/@types/node/globals.d.ts:56
|
648
|
+
|
649
|
+
#### Parameters
|
650
|
+
|
651
|
+
##### err
|
652
|
+
|
653
|
+
`Error`
|
654
|
+
|
655
|
+
##### stackTraces
|
656
|
+
|
657
|
+
`CallSite`[]
|
658
|
+
|
659
|
+
#### Returns
|
660
|
+
|
661
|
+
`any`
|
662
|
+
|
663
|
+
#### See
|
664
|
+
|
665
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
666
|
+
|
667
|
+
#### Inherited from
|
668
|
+
|
669
|
+
[`ProtocolError`](ProtocolError.md).[`prepareStackTrace`](ProtocolError.md#preparestacktrace)
|
670
|
+
|
671
|
+
***
|
672
|
+
|
673
|
+
### transactionNotSignedByIntendedOwner()
|
674
|
+
|
675
|
+
> `static` **transactionNotSignedByIntendedOwner**(`intended`, `actualSigners`): [`TransactionNotSignedByIntendedOwnerError`](TransactionNotSignedByIntendedOwnerError.md)
|
676
|
+
|
677
|
+
Defined in: src/errors.ts:76
|
678
|
+
|
679
|
+
#### Parameters
|
680
|
+
|
681
|
+
##### intended
|
682
|
+
|
683
|
+
`string`
|
684
|
+
|
685
|
+
##### actualSigners
|
686
|
+
|
687
|
+
`string`[]
|
688
|
+
|
689
|
+
#### Returns
|
690
|
+
|
691
|
+
[`TransactionNotSignedByIntendedOwnerError`](TransactionNotSignedByIntendedOwnerError.md)
|
692
|
+
|
693
|
+
#### Inherited from
|
694
|
+
|
695
|
+
[`ProtocolError`](ProtocolError.md).[`transactionNotSignedByIntendedOwner`](ProtocolError.md#transactionnotsignedbyintendedowner)
|