Skip to content

Commit 52a5d3d

Browse files
authored
Replace RpcError with a coded exception (#2286)
# Summary So wow. I completely missed these as part of #2118, and it turns out they're a really big deal and required a ton of changes. There are: * Errors that have enough data to format a message * Errors that have no data, but also no context in the message * Errors that have no data, but really should, because you can't format a message without it * Preflight errors in which is nested a `TransactionError` (see #2213) In this PR we create a helper that takes in the `RpcSimulateTransactionResult` from the RPC and reformats it as a coded `SolanaError`. As always, everything you need to know is in the `packages/errors/src/__tests__/json-rpc-error-test.ts`. # Test Plan ``` pnpm turbo test:unit:browser pnpm turbo test:unit:node ```
1 parent 34ecac6 commit 52a5d3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+957
-350
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import {
2+
SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR,
3+
SOLANA_ERROR__JSON_RPC__INVALID_PARAMS,
4+
SOLANA_ERROR__JSON_RPC__INVALID_REQUEST,
5+
SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND,
6+
SOLANA_ERROR__JSON_RPC__PARSE_ERROR,
7+
SOLANA_ERROR__JSON_RPC__SCAN_ERROR,
8+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP,
9+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE,
10+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET,
11+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX,
12+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED,
13+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED,
14+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT,
15+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY,
16+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
17+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED,
18+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE,
19+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE,
20+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH,
21+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE,
22+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION,
23+
SolanaErrorCode,
24+
} from '../codes';
25+
import { SolanaErrorContext } from '../context';
26+
import { SolanaError } from '../error';
27+
import { getSolanaErrorFromJsonRpcError } from '../json-rpc-error';
28+
import { getSolanaErrorFromTransactionError } from '../transaction-error';
29+
30+
jest.mock('../transaction-error.ts');
31+
32+
describe('getSolanaErrorFromJsonRpcError', () => {
33+
it('produces a `SolanaError` with the same code as the one given', () => {
34+
const code = 123 as SolanaErrorCode;
35+
const error = getSolanaErrorFromJsonRpcError({ code, message: 'o no' });
36+
expect(error).toHaveProperty('context.__code', 123);
37+
});
38+
describe.each([
39+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED,
40+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY,
41+
])('given a %s JSON-RPC error known to have data', jsonRpcErrorCode => {
42+
const expectedData = { baz: 'bat', foo: 'bar' } as unknown as SolanaErrorContext[SolanaErrorCode];
43+
it('does not set the server message on context', () => {
44+
const error = getSolanaErrorFromJsonRpcError({
45+
code: jsonRpcErrorCode,
46+
data: expectedData,
47+
message: 'o no',
48+
});
49+
expect(error).not.toHaveProperty('context.__serverMessage');
50+
});
51+
it('produces a `SolanaError` with that data as context', () => {
52+
const error = getSolanaErrorFromJsonRpcError({
53+
code: jsonRpcErrorCode,
54+
data: expectedData,
55+
message: 'o no',
56+
});
57+
expect(error).toHaveProperty('context', expect.objectContaining(expectedData));
58+
});
59+
});
60+
describe.each([
61+
SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR,
62+
SOLANA_ERROR__JSON_RPC__INVALID_PARAMS,
63+
SOLANA_ERROR__JSON_RPC__INVALID_REQUEST,
64+
SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND,
65+
SOLANA_ERROR__JSON_RPC__PARSE_ERROR,
66+
SOLANA_ERROR__JSON_RPC__SCAN_ERROR,
67+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP,
68+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE,
69+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET,
70+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX,
71+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED,
72+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED,
73+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE,
74+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION,
75+
])(
76+
'given a %s JSON-RPC error known to have no data but important context in the server message',
77+
jsonRpcErrorCode => {
78+
it('produces a `SolanaError` with the server message on the context', () => {
79+
const error = getSolanaErrorFromJsonRpcError({ code: jsonRpcErrorCode, message: 'o no' });
80+
expect(error).toHaveProperty('context.__serverMessage', 'o no');
81+
});
82+
},
83+
);
84+
describe.each([
85+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED,
86+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT,
87+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY,
88+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE,
89+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH,
90+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE,
91+
])(
92+
'given a %s JSON-RPC error known to have neither data nor important context in the server message',
93+
jsonRpcErrorCode => {
94+
it('produces a `SolanaError` without the server message on the context', () => {
95+
const error = getSolanaErrorFromJsonRpcError({ code: jsonRpcErrorCode, message: 'o no' });
96+
expect(error).not.toHaveProperty('context.__serverMessage', 'o no');
97+
});
98+
},
99+
);
100+
describe.each([[1, 2, 3], Symbol('a symbol'), 1, 1n, true, false])('when given non-object data like `%s`', data => {
101+
it('does not add the data to `context`', () => {
102+
const error = getSolanaErrorFromJsonRpcError({
103+
code: 123,
104+
data,
105+
message: 'o no',
106+
});
107+
expect(error).toHaveProperty(
108+
'context',
109+
// Implies exact match; `context` contains nothing but the `__code`
110+
{ __code: 123 },
111+
);
112+
});
113+
});
114+
describe('when passed a preflight failure', () => {
115+
it('produces a `SolanaError` with the transaction error as the `cause`', () => {
116+
const mockErrorResult = Symbol() as unknown as SolanaError;
117+
jest.mocked(getSolanaErrorFromTransactionError).mockReturnValue(mockErrorResult);
118+
const error = getSolanaErrorFromJsonRpcError({
119+
code: SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
120+
data: { err: Symbol() },
121+
message: 'o no',
122+
});
123+
expect(error.cause).toBe(mockErrorResult);
124+
});
125+
it('produces a `SolanaError` with the preflight failure data (minus the `err` property) as the context', () => {
126+
const preflightErrorData = { bar: 2, baz: 3, foo: 1 };
127+
const error = getSolanaErrorFromJsonRpcError({
128+
code: SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
129+
data: { ...preflightErrorData, err: Symbol() },
130+
message: 'o no',
131+
});
132+
expect(error.context).toEqual({
133+
__code: SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
134+
...preflightErrorData,
135+
});
136+
});
137+
it('delegates `err` to the transaction error getter', () => {
138+
const transactionError = Symbol();
139+
getSolanaErrorFromJsonRpcError({
140+
code: SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
141+
data: { err: transactionError },
142+
message: 'o no',
143+
});
144+
expect(getSolanaErrorFromTransactionError).toHaveBeenCalledWith(transactionError);
145+
});
146+
});
147+
});

packages/errors/src/codes.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,31 @@ export const SOLANA_ERROR__MALFORMED_BIGINT_STRING = 7 as const;
3333
export const SOLANA_ERROR__MALFORMED_NUMBER_STRING = 8 as const;
3434
export const SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE = 9 as const;
3535

36+
// JSON-RPC-related errors.
37+
// Reserve error codes in the range [-32768, -32000]
38+
// Keep in sync with https://github.com/anza-xyz/agave/blob/master/rpc-client-api/src/custom_error.rs
39+
export const SOLANA_ERROR__JSON_RPC__PARSE_ERROR = -32700 as const;
40+
export const SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR = -32603 as const;
41+
export const SOLANA_ERROR__JSON_RPC__INVALID_PARAMS = -32602 as const;
42+
export const SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND = -32601 as const;
43+
export const SOLANA_ERROR__JSON_RPC__INVALID_REQUEST = -32600 as const;
44+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED = -32016 as const;
45+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION = -32015 as const;
46+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET = -32014 as const;
47+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH = -32013 as const;
48+
export const SOLANA_ERROR__JSON_RPC__SCAN_ERROR = -32012 as const;
49+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE = -32011 as const;
50+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX = -32010 as const;
51+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED = -32009 as const;
52+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT = -32008 as const;
53+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED = -32007 as const;
54+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE = -32006 as const;
55+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY = -32005 as const;
56+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE = -32004 as const;
57+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE = -32003 as const;
58+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE = -32002 as const;
59+
export const SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP = -32001 as const;
60+
3661
// Addresses-related errors.
3762
// Reserve error codes in the range [2800000-2800999].
3863
export const SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH = 2800000 as const;
@@ -363,6 +388,27 @@ export type SolanaErrorCode =
363388
| typeof SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE
364389
| typeof SOLANA_ERROR__INVARIANT_VIOLATION__WEBSOCKET_MESSAGE_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE
365390
| typeof SOLANA_ERROR__INVARIANT_VIOLATION__WEBSOCKET_MESSAGE_ITERATOR_STATE_MISSING
391+
| typeof SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR
392+
| typeof SOLANA_ERROR__JSON_RPC__INVALID_PARAMS
393+
| typeof SOLANA_ERROR__JSON_RPC__INVALID_REQUEST
394+
| typeof SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND
395+
| typeof SOLANA_ERROR__JSON_RPC__PARSE_ERROR
396+
| typeof SOLANA_ERROR__JSON_RPC__SCAN_ERROR
397+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP
398+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE
399+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET
400+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX
401+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED
402+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED
403+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT
404+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY
405+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE
406+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED
407+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE
408+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE
409+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH
410+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE
411+
| typeof SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION
366412
| typeof SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH
367413
| typeof SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH
368414
| typeof SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH

packages/errors/src/context.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ import {
8484
SOLANA_ERROR__INVALID_NONCE,
8585
SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING,
8686
SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE,
87+
SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR,
88+
SOLANA_ERROR__JSON_RPC__INVALID_PARAMS,
89+
SOLANA_ERROR__JSON_RPC__INVALID_REQUEST,
90+
SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND,
91+
SOLANA_ERROR__JSON_RPC__PARSE_ERROR,
92+
SOLANA_ERROR__JSON_RPC__SCAN_ERROR,
93+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP,
94+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE,
95+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET,
96+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX,
97+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED,
98+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED,
99+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY,
100+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
101+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED,
102+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE,
103+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION,
87104
SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH,
88105
SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH,
89106
SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH,
@@ -120,6 +137,7 @@ import {
120137
SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN,
121138
SolanaErrorCode,
122139
} from './codes';
140+
import { RpcSimulateTransactionResult } from './json-rpc-error';
123141

124142
type BasicInstructionErrorContext<T extends SolanaErrorCode> = Readonly<{ [P in T]: { index: number } }>;
125143

@@ -320,6 +338,58 @@ export type SolanaErrorContext = DefaultUnspecifiedErrorContextToUndefined<
320338
[SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE]: {
321339
unexpectedValue: unknown;
322340
};
341+
[SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR]: {
342+
__serverMessage: string;
343+
};
344+
[SOLANA_ERROR__JSON_RPC__INVALID_PARAMS]: {
345+
__serverMessage: string;
346+
};
347+
[SOLANA_ERROR__JSON_RPC__INVALID_REQUEST]: {
348+
__serverMessage: string;
349+
};
350+
[SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND]: {
351+
__serverMessage: string;
352+
};
353+
[SOLANA_ERROR__JSON_RPC__PARSE_ERROR]: {
354+
__serverMessage: string;
355+
};
356+
[SOLANA_ERROR__JSON_RPC__SCAN_ERROR]: {
357+
__serverMessage: string;
358+
};
359+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP]: {
360+
__serverMessage: string;
361+
};
362+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE]: {
363+
__serverMessage: string;
364+
};
365+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET]: {
366+
__serverMessage: string;
367+
};
368+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX]: {
369+
__serverMessage: string;
370+
};
371+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED]: {
372+
__serverMessage: string;
373+
};
374+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED]: {
375+
contextSlot: number;
376+
};
377+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY]: {
378+
numSlotsBehind?: number;
379+
};
380+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE]: Omit<
381+
RpcSimulateTransactionResult,
382+
'err'
383+
>;
384+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED]: {
385+
__serverMessage: string;
386+
};
387+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE]: {
388+
__serverMessage: string;
389+
};
390+
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION]: {
391+
__serverMessage: string;
392+
};
323393
[SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH]: {
324394
byteLength: number;
325395
};

packages/errors/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './codes';
22
export * from './error';
3+
export * from './json-rpc-error';
34
export * from './instruction-error';
45
export * from './transaction-error';

0 commit comments

Comments
 (0)