@chainlink/ccip-sdk 0.96.0 → 1.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/README.md +12 -9
- package/dist/api/index.d.ts +21 -8
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +42 -13
- package/dist/api/index.js.map +1 -1
- package/dist/api/types.d.ts +0 -2
- package/dist/api/types.d.ts.map +1 -1
- package/dist/aptos/exec.d.ts +2 -2
- package/dist/aptos/exec.d.ts.map +1 -1
- package/dist/aptos/exec.js.map +1 -1
- package/dist/aptos/hasher.d.ts.map +1 -1
- package/dist/aptos/hasher.js +1 -1
- package/dist/aptos/hasher.js.map +1 -1
- package/dist/aptos/index.d.ts +17 -16
- package/dist/aptos/index.d.ts.map +1 -1
- package/dist/aptos/index.js +42 -73
- package/dist/aptos/index.js.map +1 -1
- package/dist/aptos/logs.d.ts +2 -2
- package/dist/aptos/logs.d.ts.map +1 -1
- package/dist/aptos/types.d.ts +2 -19
- package/dist/aptos/types.d.ts.map +1 -1
- package/dist/aptos/types.js +0 -11
- package/dist/aptos/types.js.map +1 -1
- package/dist/chain.d.ts +538 -158
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +132 -19
- package/dist/chain.js.map +1 -1
- package/dist/commits.d.ts +4 -6
- package/dist/commits.d.ts.map +1 -1
- package/dist/commits.js +4 -4
- package/dist/commits.js.map +1 -1
- package/dist/errors/CCIPError.d.ts +33 -4
- package/dist/errors/CCIPError.d.ts.map +1 -1
- package/dist/errors/CCIPError.js +33 -4
- package/dist/errors/CCIPError.js.map +1 -1
- package/dist/errors/codes.d.ts +3 -0
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/codes.js +3 -1
- package/dist/errors/codes.js.map +1 -1
- package/dist/errors/index.d.ts +4 -4
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +4 -4
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/recovery.d.ts.map +1 -1
- package/dist/errors/recovery.js +4 -1
- package/dist/errors/recovery.js.map +1 -1
- package/dist/errors/specialized.d.ts +1695 -120
- package/dist/errors/specialized.d.ts.map +1 -1
- package/dist/errors/specialized.js +1715 -123
- package/dist/errors/specialized.js.map +1 -1
- package/dist/errors/utils.d.ts.map +1 -1
- package/dist/errors/utils.js +0 -1
- package/dist/errors/utils.js.map +1 -1
- package/dist/evm/abi/OffRamp_2_0.d.ts +764 -0
- package/dist/evm/abi/OffRamp_2_0.d.ts.map +1 -0
- package/dist/evm/abi/OffRamp_2_0.js +744 -0
- package/dist/evm/abi/OffRamp_2_0.js.map +1 -0
- package/dist/evm/abi/OnRamp_2_0.d.ts +925 -0
- package/dist/evm/abi/OnRamp_2_0.d.ts.map +1 -0
- package/dist/evm/abi/OnRamp_2_0.js +992 -0
- package/dist/evm/abi/OnRamp_2_0.js.map +1 -0
- package/dist/evm/const.d.ts +12 -2
- package/dist/evm/const.d.ts.map +1 -1
- package/dist/evm/const.js +8 -2
- package/dist/evm/const.js.map +1 -1
- package/dist/evm/errors.d.ts.map +1 -1
- package/dist/evm/errors.js +7 -2
- package/dist/evm/errors.js.map +1 -1
- package/dist/evm/extra-args.d.ts.map +1 -1
- package/dist/evm/extra-args.js +5 -24
- package/dist/evm/extra-args.js.map +1 -1
- package/dist/evm/hasher.d.ts.map +1 -1
- package/dist/evm/hasher.js +23 -13
- package/dist/evm/hasher.js.map +1 -1
- package/dist/evm/index.d.ts +73 -16
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +241 -146
- package/dist/evm/index.js.map +1 -1
- package/dist/evm/logs.d.ts +1 -1
- package/dist/evm/logs.js +1 -1
- package/dist/evm/messages.d.ts +59 -5
- package/dist/evm/messages.d.ts.map +1 -1
- package/dist/evm/messages.js +210 -0
- package/dist/evm/messages.js.map +1 -1
- package/dist/evm/offchain.d.ts +1 -14
- package/dist/evm/offchain.d.ts.map +1 -1
- package/dist/evm/offchain.js +1 -133
- package/dist/evm/offchain.js.map +1 -1
- package/dist/evm/types.d.ts +7 -2
- package/dist/evm/types.d.ts.map +1 -1
- package/dist/evm/types.js +22 -1
- package/dist/evm/types.js.map +1 -1
- package/dist/execution.d.ts +62 -22
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +98 -61
- package/dist/execution.js.map +1 -1
- package/dist/extra-args.d.ts +13 -3
- package/dist/extra-args.d.ts.map +1 -1
- package/dist/extra-args.js +13 -3
- package/dist/extra-args.js.map +1 -1
- package/dist/gas.d.ts +25 -2
- package/dist/gas.d.ts.map +1 -1
- package/dist/gas.js +30 -4
- package/dist/gas.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/offchain.d.ts +23 -6
- package/dist/offchain.d.ts.map +1 -1
- package/dist/offchain.js +92 -17
- package/dist/offchain.js.map +1 -1
- package/dist/requests.d.ts +85 -14
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +99 -17
- package/dist/requests.js.map +1 -1
- package/dist/selectors.d.ts.map +1 -1
- package/dist/selectors.js +12 -0
- package/dist/selectors.js.map +1 -1
- package/dist/shared/bcs-codecs.d.ts +61 -0
- package/dist/shared/bcs-codecs.d.ts.map +1 -0
- package/dist/shared/bcs-codecs.js +102 -0
- package/dist/shared/bcs-codecs.js.map +1 -0
- package/dist/shared/constants.d.ts +3 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +3 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/solana/exec.d.ts +2 -2
- package/dist/solana/exec.d.ts.map +1 -1
- package/dist/solana/exec.js.map +1 -1
- package/dist/solana/idl/1.6.0/BASE_TOKEN_POOL.d.ts +1 -1
- package/dist/solana/idl/1.6.0/BASE_TOKEN_POOL.js +1 -1
- package/dist/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.d.ts +1 -1
- package/dist/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.js +1 -1
- package/dist/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.d.ts +1 -1
- package/dist/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.js +1 -1
- package/dist/solana/idl/1.6.0/CCIP_COMMON.d.ts +16 -1
- package/dist/solana/idl/1.6.0/CCIP_COMMON.d.ts.map +1 -1
- package/dist/solana/idl/1.6.0/CCIP_COMMON.js +16 -1
- package/dist/solana/idl/1.6.0/CCIP_COMMON.js.map +1 -1
- package/dist/solana/idl/1.6.0/CCIP_OFFRAMP.d.ts +1 -1
- package/dist/solana/idl/1.6.0/CCIP_OFFRAMP.js +1 -1
- package/dist/solana/idl/1.6.0/CCIP_ROUTER.d.ts +1 -1
- package/dist/solana/idl/1.6.0/CCIP_ROUTER.js +1 -1
- package/dist/solana/index.d.ts +85 -24
- package/dist/solana/index.d.ts.map +1 -1
- package/dist/solana/index.js +69 -37
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/offchain.d.ts +1 -13
- package/dist/solana/offchain.d.ts.map +1 -1
- package/dist/solana/offchain.js +1 -66
- package/dist/solana/offchain.js.map +1 -1
- package/dist/solana/utils.d.ts +4 -4
- package/dist/solana/utils.d.ts.map +1 -1
- package/dist/solana/utils.js +1 -1
- package/dist/solana/utils.js.map +1 -1
- package/dist/sui/hasher.d.ts.map +1 -1
- package/dist/sui/hasher.js +1 -1
- package/dist/sui/hasher.js.map +1 -1
- package/dist/sui/index.d.ts +18 -18
- package/dist/sui/index.d.ts.map +1 -1
- package/dist/sui/index.js +38 -39
- package/dist/sui/index.js.map +1 -1
- package/dist/sui/manuallyExec/encoder.d.ts +2 -2
- package/dist/sui/manuallyExec/encoder.d.ts.map +1 -1
- package/dist/sui/manuallyExec/encoder.js.map +1 -1
- package/dist/sui/manuallyExec/index.d.ts +2 -2
- package/dist/sui/manuallyExec/index.d.ts.map +1 -1
- package/dist/ton/exec.d.ts +3 -3
- package/dist/ton/exec.d.ts.map +1 -1
- package/dist/ton/exec.js +1 -1
- package/dist/ton/exec.js.map +1 -1
- package/dist/ton/index.d.ts +14 -22
- package/dist/ton/index.d.ts.map +1 -1
- package/dist/ton/index.js +26 -35
- package/dist/ton/index.js.map +1 -1
- package/dist/ton/types.d.ts +3 -5
- package/dist/ton/types.d.ts.map +1 -1
- package/dist/ton/types.js.map +1 -1
- package/dist/types.d.ts +55 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +65 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +74 -2
- package/dist/utils.js.map +1 -1
- package/package.json +14 -10
- package/src/api/index.ts +53 -17
- package/src/api/types.ts +0 -2
- package/src/aptos/exec.ts +2 -2
- package/src/aptos/hasher.ts +1 -1
- package/src/aptos/index.ts +55 -100
- package/src/aptos/logs.ts +2 -2
- package/src/aptos/types.ts +2 -15
- package/src/chain.ts +594 -171
- package/src/commits.ts +9 -9
- package/src/errors/CCIPError.ts +33 -4
- package/src/errors/codes.ts +3 -1
- package/src/errors/index.ts +4 -0
- package/src/errors/recovery.ts +7 -1
- package/src/errors/specialized.ts +1726 -130
- package/src/errors/utils.ts +0 -1
- package/src/evm/abi/OffRamp_2_0.ts +743 -0
- package/src/evm/abi/OnRamp_2_0.ts +991 -0
- package/src/evm/const.ts +10 -3
- package/src/evm/errors.ts +6 -2
- package/src/evm/extra-args.ts +4 -21
- package/src/evm/hasher.ts +30 -18
- package/src/evm/index.ts +314 -176
- package/src/evm/logs.ts +1 -1
- package/src/evm/messages.ts +323 -11
- package/src/evm/offchain.ts +2 -191
- package/src/evm/types.ts +20 -2
- package/src/execution.ts +125 -86
- package/src/extra-args.ts +13 -3
- package/src/gas.ts +29 -3
- package/src/index.ts +10 -3
- package/src/offchain.ts +125 -28
- package/src/requests.ts +114 -19
- package/src/selectors.ts +12 -0
- package/src/shared/bcs-codecs.ts +132 -0
- package/src/shared/constants.ts +2 -0
- package/src/solana/exec.ts +4 -4
- package/src/solana/idl/1.6.0/BASE_TOKEN_POOL.ts +2 -2
- package/src/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.ts +2 -2
- package/src/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.ts +2 -2
- package/src/solana/idl/1.6.0/CCIP_COMMON.ts +32 -2
- package/src/solana/idl/1.6.0/CCIP_OFFRAMP.ts +2 -2
- package/src/solana/idl/1.6.0/CCIP_ROUTER.ts +2 -2
- package/src/solana/index.ts +110 -85
- package/src/solana/offchain.ts +3 -100
- package/src/solana/utils.ts +8 -5
- package/src/sui/hasher.ts +1 -1
- package/src/sui/index.ts +55 -59
- package/src/sui/manuallyExec/encoder.ts +2 -2
- package/src/sui/manuallyExec/index.ts +2 -2
- package/src/ton/exec.ts +4 -7
- package/src/ton/index.ts +45 -53
- package/src/ton/types.ts +4 -7
- package/src/types.ts +81 -37
- package/src/utils.ts +73 -2
- package/dist/aptos/utils.d.ts +0 -12
- package/dist/aptos/utils.d.ts.map +0 -1
- package/dist/aptos/utils.js +0 -15
- package/dist/aptos/utils.js.map +0 -1
- package/src/aptos/utils.ts +0 -24
package/src/commits.ts
CHANGED
|
@@ -2,33 +2,33 @@ import type { PickDeep } from 'type-fest'
|
|
|
2
2
|
|
|
3
3
|
import type { Chain, ChainStatic, LogFilter } from './chain.ts'
|
|
4
4
|
import { CCIPCommitNotFoundError } from './errors/index.ts'
|
|
5
|
-
import { type
|
|
5
|
+
import { type CCIPRequest, type CCIPVerifications, CCIPVersion } from './types.ts'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Look for a CommitReport at dest for given CCIPRequest
|
|
9
9
|
* Provides a basic/generic implementation, but subclasses of Chain may override with more specific
|
|
10
|
-
* logic in Chain.
|
|
10
|
+
* logic in Chain.getVerifications method
|
|
11
11
|
*
|
|
12
12
|
* @param dest - Destination network provider
|
|
13
|
-
* @param
|
|
13
|
+
* @param offRamp - Commit store address
|
|
14
14
|
* @param request - CCIP request info
|
|
15
15
|
* @param hints - Additional filtering hints
|
|
16
16
|
* @returns CCIP commit info
|
|
17
17
|
**/
|
|
18
|
-
export async function
|
|
18
|
+
export async function getOnchainCommitReport(
|
|
19
19
|
dest: Chain,
|
|
20
|
-
|
|
20
|
+
offRamp: string,
|
|
21
21
|
{
|
|
22
22
|
lane,
|
|
23
23
|
message,
|
|
24
24
|
tx: { timestamp: requestTimestamp },
|
|
25
|
-
}: PickDeep<CCIPRequest, 'lane' | '
|
|
26
|
-
hints?: Pick<LogFilter, 'page' | 'watch'
|
|
27
|
-
): Promise<
|
|
25
|
+
}: PickDeep<CCIPRequest, 'lane' | `message.${'sequenceNumber' | 'messageId'}` | 'tx.timestamp'>,
|
|
26
|
+
hints?: Pick<LogFilter, 'page' | 'watch' | 'startBlock'>,
|
|
27
|
+
): Promise<CCIPVerifications> {
|
|
28
28
|
for await (const log of dest.getLogs({
|
|
29
29
|
...hints,
|
|
30
30
|
...(!hints?.startBlock ? { startTime: requestTimestamp } : { startBlock: hints.startBlock }),
|
|
31
|
-
address:
|
|
31
|
+
address: offRamp,
|
|
32
32
|
topics: [lane.version < CCIPVersion.V1_6 ? 'ReportAccepted' : 'CommitReportAccepted'],
|
|
33
33
|
})) {
|
|
34
34
|
const reports = (dest.constructor as ChainStatic).decodeCommits(log, lane)
|
package/src/errors/CCIPError.ts
CHANGED
|
@@ -41,7 +41,13 @@ export class CCIPError extends Error {
|
|
|
41
41
|
|
|
42
42
|
override readonly name: string = 'CCIPError'
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Creates a CCIPError with code, message, and options.
|
|
46
|
+
*
|
|
47
|
+
* @param code - Machine-readable error code
|
|
48
|
+
* @param message - Human-readable error message
|
|
49
|
+
* @param options - Additional error options (cause, context, isTransient, etc.)
|
|
50
|
+
*/
|
|
45
51
|
constructor(code: CCIPErrorCode, message: string, options?: CCIPErrorOptions) {
|
|
46
52
|
super(message, { cause: options?.cause })
|
|
47
53
|
Object.setPrototypeOf(this, new.target.prototype)
|
|
@@ -55,7 +61,15 @@ export class CCIPError extends Error {
|
|
|
55
61
|
Error.captureStackTrace(this, this.constructor)
|
|
56
62
|
}
|
|
57
63
|
|
|
58
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Type guard for CCIPError.
|
|
66
|
+
*
|
|
67
|
+
* Prefer this over `instanceof` to handle the dual package hazard
|
|
68
|
+
* when multiple versions of the SDK may be present.
|
|
69
|
+
*
|
|
70
|
+
* @param error - The error to check
|
|
71
|
+
* @returns True if the error is a CCIPError instance
|
|
72
|
+
*/
|
|
59
73
|
static isCCIPError(error: unknown): error is CCIPError {
|
|
60
74
|
return (
|
|
61
75
|
error instanceof CCIPError ||
|
|
@@ -63,7 +77,15 @@ export class CCIPError extends Error {
|
|
|
63
77
|
)
|
|
64
78
|
}
|
|
65
79
|
|
|
66
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Wraps an unknown caught value in a CCIPError.
|
|
82
|
+
*
|
|
83
|
+
* Useful for normalizing errors in catch blocks.
|
|
84
|
+
*
|
|
85
|
+
* @param error - The error to wrap
|
|
86
|
+
* @param code - Optional error code (defaults to 'UNKNOWN')
|
|
87
|
+
* @returns A CCIPError wrapping the original error
|
|
88
|
+
*/
|
|
67
89
|
static from(error: unknown, code?: CCIPErrorCode): CCIPError {
|
|
68
90
|
if (error instanceof CCIPError) return error
|
|
69
91
|
if (error instanceof Error) {
|
|
@@ -72,7 +94,14 @@ export class CCIPError extends Error {
|
|
|
72
94
|
return new CCIPError(code ?? 'UNKNOWN', String(error))
|
|
73
95
|
}
|
|
74
96
|
|
|
75
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Serializes the error for logging.
|
|
99
|
+
*
|
|
100
|
+
* Use this instead of `JSON.stringify(error)` directly, as Error properties
|
|
101
|
+
* are non-enumerable and would be lost.
|
|
102
|
+
*
|
|
103
|
+
* @returns An object containing all error properties
|
|
104
|
+
*/
|
|
76
105
|
toJSON(): Record<string, unknown> {
|
|
77
106
|
return {
|
|
78
107
|
name: this.name,
|
package/src/errors/codes.ts
CHANGED
|
@@ -4,6 +4,7 @@ export const CCIPErrorCode = {
|
|
|
4
4
|
CHAIN_NOT_FOUND: 'CHAIN_NOT_FOUND',
|
|
5
5
|
CHAIN_SELECTOR_NOT_FOUND: 'CHAIN_SELECTOR_NOT_FOUND',
|
|
6
6
|
CHAIN_FAMILY_UNSUPPORTED: 'CHAIN_FAMILY_UNSUPPORTED',
|
|
7
|
+
NETWORK_FAMILY_UNSUPPORTED: 'NETWORK_FAMILY_UNSUPPORTED',
|
|
7
8
|
METHOD_UNSUPPORTED: 'METHOD_UNSUPPORTED',
|
|
8
9
|
CHAIN_FAMILY_MISMATCH: 'CHAIN_FAMILY_MISMATCH',
|
|
9
10
|
APTOS_NETWORK_UNKNOWN: 'APTOS_NETWORK_UNKNOWN',
|
|
@@ -90,6 +91,7 @@ export const CCIPErrorCode = {
|
|
|
90
91
|
TOKEN_POOL_STATE_NOT_FOUND: 'TOKEN_POOL_STATE_NOT_FOUND',
|
|
91
92
|
TOKEN_POOL_INFO_NOT_FOUND: 'TOKEN_POOL_INFO_NOT_FOUND',
|
|
92
93
|
TOKEN_ACCOUNT_NOT_FOUND: 'TOKEN_ACCOUNT_NOT_FOUND',
|
|
94
|
+
LEGACY_TOKEN_POOLS_UNSUPPORTED: 'LEGACY_TOKEN_POOLS_UNSUPPORTED',
|
|
93
95
|
|
|
94
96
|
// Wallet & Signer
|
|
95
97
|
WALLET_NOT_SIGNER: 'WALLET_NOT_SIGNER',
|
|
@@ -136,6 +138,7 @@ export const CCIPErrorCode = {
|
|
|
136
138
|
APTOS_TX_TYPE_UNEXPECTED: 'APTOS_TX_TYPE_UNEXPECTED',
|
|
137
139
|
APTOS_ADDRESS_MODULE_REQUIRED: 'APTOS_ADDRESS_MODULE_REQUIRED',
|
|
138
140
|
APTOS_HASHER_VERSION_UNSUPPORTED: 'APTOS_HASHER_VERSION_UNSUPPORTED',
|
|
141
|
+
APTOS_TOPIC_INVALID: 'APTOS_TOPIC_INVALID',
|
|
139
142
|
|
|
140
143
|
// HTTP & RPC
|
|
141
144
|
HTTP_ERROR: 'HTTP_ERROR',
|
|
@@ -173,7 +176,6 @@ export const TRANSIENT_ERROR_CODES = new Set<CCIPErrorCode>([
|
|
|
173
176
|
CCIPErrorCode.TRANSACTION_NOT_FOUND,
|
|
174
177
|
CCIPErrorCode.BLOCK_TIME_NOT_FOUND,
|
|
175
178
|
CCIPErrorCode.TRANSACTION_NOT_FINALIZED,
|
|
176
|
-
CCIPErrorCode.MESSAGE_NOT_FOUND_IN_TX,
|
|
177
179
|
CCIPErrorCode.MESSAGE_ID_NOT_FOUND,
|
|
178
180
|
CCIPErrorCode.MESSAGE_BATCH_INCOMPLETE,
|
|
179
181
|
CCIPErrorCode.COMMIT_NOT_FOUND,
|
package/src/errors/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export {
|
|
|
10
10
|
CCIPChainFamilyUnsupportedError,
|
|
11
11
|
CCIPChainNotFoundError,
|
|
12
12
|
CCIPMethodUnsupportedError,
|
|
13
|
+
CCIPNetworkFamilyUnsupportedError,
|
|
13
14
|
} from './specialized.ts'
|
|
14
15
|
|
|
15
16
|
// Specialized errors - Block & Transaction
|
|
@@ -67,6 +68,7 @@ export { CCIPExtraArgsInvalidError, CCIPExtraArgsParseError } from './specialize
|
|
|
67
68
|
|
|
68
69
|
// Specialized errors - Token & Registry
|
|
69
70
|
export {
|
|
71
|
+
CCIPLegacyTokenPoolsUnsupportedError,
|
|
70
72
|
CCIPTokenDecimalsInsufficientError,
|
|
71
73
|
CCIPTokenNotConfiguredError,
|
|
72
74
|
CCIPTokenNotFoundError,
|
|
@@ -135,6 +137,7 @@ export {
|
|
|
135
137
|
CCIPAptosNetworkUnknownError,
|
|
136
138
|
CCIPAptosRegistryTypeInvalidError,
|
|
137
139
|
CCIPAptosTokenNotRegisteredError,
|
|
140
|
+
CCIPAptosTopicInvalidError,
|
|
138
141
|
CCIPAptosTransactionInvalidError,
|
|
139
142
|
CCIPAptosTransactionTypeInvalidError,
|
|
140
143
|
CCIPAptosTransactionTypeUnexpectedError,
|
|
@@ -144,6 +147,7 @@ export {
|
|
|
144
147
|
// Specialized errors - Sui-specific
|
|
145
148
|
export {
|
|
146
149
|
CCIPSuiHasherVersionUnsupportedError,
|
|
150
|
+
CCIPSuiLogInvalidError,
|
|
147
151
|
CCIPSuiMessageVersionInvalidError,
|
|
148
152
|
} from './specialized.ts'
|
|
149
153
|
|
package/src/errors/recovery.ts
CHANGED
|
@@ -8,6 +8,8 @@ export const DEFAULT_RECOVERY_HINTS: Partial<Record<CCIPErrorCode, string>> = {
|
|
|
8
8
|
'Verify the chain selector is valid. Use networkInfo() to look up selectors.',
|
|
9
9
|
CHAIN_FAMILY_UNSUPPORTED:
|
|
10
10
|
'This chain family is not supported. Check the method documentation for supported chain families.',
|
|
11
|
+
NETWORK_FAMILY_UNSUPPORTED:
|
|
12
|
+
'This network family is not supported. Supported families: evm, solana, aptos, sui, ton.',
|
|
11
13
|
CHAIN_FAMILY_MISMATCH:
|
|
12
14
|
'Use the correct Chain class for this chain family (e.g., EVMChain for EVM, SolanaChain for Solana).',
|
|
13
15
|
METHOD_UNSUPPORTED:
|
|
@@ -25,7 +27,7 @@ export const DEFAULT_RECOVERY_HINTS: Partial<Record<CCIPErrorCode, string>> = {
|
|
|
25
27
|
'Ensure the data is a valid CCIPSendRequested event log. Check the transaction on the source chain explorer.',
|
|
26
28
|
MESSAGE_CCIP_DECODE_FAILED:
|
|
27
29
|
'Ensure the log data is from a CCIPSendRequested event. Verify the source chain and transaction hash.',
|
|
28
|
-
MESSAGE_NOT_FOUND_IN_TX: 'No
|
|
30
|
+
MESSAGE_NOT_FOUND_IN_TX: 'No CCIP request event found in tx. Verify the transaction hash.',
|
|
29
31
|
MESSAGE_ID_NOT_FOUND: 'Wait and retry. The message may still be in transit (5-20 min typical).',
|
|
30
32
|
MESSAGE_ID_INVALID:
|
|
31
33
|
'Verify the message ID format. Must be a valid 32-byte hex string (0x-prefixed, 64 hex chars).',
|
|
@@ -110,6 +112,8 @@ export const DEFAULT_RECOVERY_HINTS: Partial<Record<CCIPErrorCode, string>> = {
|
|
|
110
112
|
'Check that the token pool is deployed and configured for this lane. Verify supported tokens: https://docs.chain.link/ccip/directory',
|
|
111
113
|
TOKEN_ACCOUNT_NOT_FOUND:
|
|
112
114
|
'The token account does not exist for this holder. The holder has never held this token. You may treat this as zero balance.',
|
|
115
|
+
LEGACY_TOKEN_POOLS_UNSUPPORTED:
|
|
116
|
+
'Legacy token pools (CCIP <1.5) are not supported. Upgrade to CCIP 1.5+ token pools.',
|
|
113
117
|
|
|
114
118
|
WALLET_NOT_SIGNER: 'Provide a wallet with signing capability (Signer interface).',
|
|
115
119
|
WALLET_INVALID: 'Provide a valid Wallet instance.',
|
|
@@ -159,6 +163,8 @@ export const DEFAULT_RECOVERY_HINTS: Partial<Record<CCIPErrorCode, string>> = {
|
|
|
159
163
|
'Check that the transaction is a standard user transaction, not a script or module deployment.',
|
|
160
164
|
APTOS_ADDRESS_MODULE_REQUIRED: 'Provide an address with module for Aptos log filtering.',
|
|
161
165
|
APTOS_HASHER_VERSION_UNSUPPORTED: 'This hasher version is not supported for Aptos.',
|
|
166
|
+
APTOS_TOPIC_INVALID:
|
|
167
|
+
'Invalid Aptos event topic. Ensure the topic matches a known CCIP event type.',
|
|
162
168
|
|
|
163
169
|
HTTP_ERROR: 'HTTP request failed. 429 indicates rate limiting.',
|
|
164
170
|
RPC_NOT_FOUND: 'No RPC endpoint found. Configure an RPC URL.',
|