@chainlink/ccip-sdk 0.90.2 → 0.91.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 +35 -26
- package/dist/aptos/exec.d.ts +4 -5
- package/dist/aptos/exec.d.ts.map +1 -1
- package/dist/aptos/exec.js +5 -14
- package/dist/aptos/exec.js.map +1 -1
- package/dist/aptos/hasher.d.ts +18 -0
- package/dist/aptos/hasher.d.ts.map +1 -1
- package/dist/aptos/hasher.js +18 -0
- package/dist/aptos/hasher.js.map +1 -1
- package/dist/aptos/index.d.ts +127 -28
- package/dist/aptos/index.d.ts.map +1 -1
- package/dist/aptos/index.js +199 -70
- package/dist/aptos/index.js.map +1 -1
- package/dist/aptos/logs.d.ts +18 -0
- package/dist/aptos/logs.d.ts.map +1 -1
- package/dist/aptos/logs.js +21 -3
- package/dist/aptos/logs.js.map +1 -1
- package/dist/aptos/send.d.ts +22 -5
- package/dist/aptos/send.d.ts.map +1 -1
- package/dist/aptos/send.js +23 -15
- package/dist/aptos/send.js.map +1 -1
- package/dist/aptos/token.d.ts +6 -0
- package/dist/aptos/token.d.ts.map +1 -1
- package/dist/aptos/token.js +6 -0
- package/dist/aptos/token.js.map +1 -1
- package/dist/aptos/types.d.ts +16 -1
- package/dist/aptos/types.d.ts.map +1 -1
- package/dist/aptos/types.js +13 -0
- package/dist/aptos/types.js.map +1 -1
- package/dist/aptos/utils.d.ts +1 -1
- package/dist/aptos/utils.js +1 -1
- package/dist/chain.d.ts +185 -99
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +38 -15
- package/dist/chain.js.map +1 -1
- package/dist/commits.d.ts +4 -10
- package/dist/commits.d.ts.map +1 -1
- package/dist/commits.js +2 -1
- package/dist/commits.js.map +1 -1
- package/dist/evm/const.d.ts +5 -0
- package/dist/evm/const.d.ts.map +1 -1
- package/dist/evm/const.js +5 -0
- package/dist/evm/const.js.map +1 -1
- package/dist/evm/errors.d.ts +5 -0
- package/dist/evm/errors.d.ts.map +1 -1
- package/dist/evm/errors.js +6 -1
- package/dist/evm/errors.js.map +1 -1
- package/dist/evm/hasher.d.ts +16 -2
- package/dist/evm/hasher.d.ts.map +1 -1
- package/dist/evm/hasher.js +17 -3
- package/dist/evm/hasher.js.map +1 -1
- package/dist/evm/index.d.ts +176 -31
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +312 -154
- package/dist/evm/index.js.map +1 -1
- package/dist/evm/logs.d.ts +20 -0
- package/dist/evm/logs.d.ts.map +1 -0
- package/dist/evm/logs.js +194 -0
- package/dist/evm/logs.js.map +1 -0
- package/dist/evm/messages.d.ts +11 -2
- package/dist/evm/messages.d.ts.map +1 -1
- package/dist/evm/messages.js +4 -2
- package/dist/evm/messages.js.map +1 -1
- package/dist/evm/offchain.d.ts +7 -2
- package/dist/evm/offchain.d.ts.map +1 -1
- package/dist/evm/offchain.js +12 -7
- package/dist/evm/offchain.js.map +1 -1
- package/dist/execution.d.ts +19 -62
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +28 -31
- package/dist/execution.js.map +1 -1
- package/dist/extra-args.d.ts +35 -5
- package/dist/extra-args.d.ts.map +1 -1
- package/dist/extra-args.js +10 -5
- package/dist/extra-args.js.map +1 -1
- package/dist/gas.d.ts +6 -8
- package/dist/gas.d.ts.map +1 -1
- package/dist/gas.js +7 -9
- package/dist/gas.js.map +1 -1
- package/dist/hasher/common.d.ts +3 -2
- package/dist/hasher/common.d.ts.map +1 -1
- package/dist/hasher/common.js +2 -2
- package/dist/hasher/common.js.map +1 -1
- package/dist/hasher/hasher.d.ts +8 -2
- package/dist/hasher/hasher.d.ts.map +1 -1
- package/dist/hasher/hasher.js +8 -3
- package/dist/hasher/hasher.js.map +1 -1
- package/dist/hasher/merklemulti.d.ts +11 -9
- package/dist/hasher/merklemulti.d.ts.map +1 -1
- package/dist/hasher/merklemulti.js +17 -16
- package/dist/hasher/merklemulti.js.map +1 -1
- package/dist/index.d.ts +16 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/requests.d.ts +39 -25
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +42 -35
- package/dist/requests.js.map +1 -1
- package/dist/selectors.d.ts +1 -1
- package/dist/solana/cleanup.d.ts +14 -10
- package/dist/solana/cleanup.d.ts.map +1 -1
- package/dist/solana/cleanup.js +35 -33
- package/dist/solana/cleanup.js.map +1 -1
- package/dist/solana/exec.d.ts +19 -11
- package/dist/solana/exec.d.ts.map +1 -1
- package/dist/solana/exec.js +86 -163
- package/dist/solana/exec.js.map +1 -1
- package/dist/solana/hasher.d.ts +7 -2
- package/dist/solana/hasher.d.ts.map +1 -1
- package/dist/solana/hasher.js +7 -2
- package/dist/solana/hasher.js.map +1 -1
- package/dist/solana/index.d.ts +202 -84
- package/dist/solana/index.d.ts.map +1 -1
- package/dist/solana/index.js +367 -252
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/offchain.d.ts +8 -18
- package/dist/solana/offchain.d.ts.map +1 -1
- package/dist/solana/offchain.js +29 -83
- package/dist/solana/offchain.js.map +1 -1
- package/dist/solana/patchBorsh.d.ts +5 -1
- package/dist/solana/patchBorsh.d.ts.map +1 -1
- package/dist/solana/patchBorsh.js +57 -46
- package/dist/solana/patchBorsh.js.map +1 -1
- package/dist/solana/send.d.ts +28 -10
- package/dist/solana/send.d.ts.map +1 -1
- package/dist/solana/send.js +44 -77
- package/dist/solana/send.js.map +1 -1
- package/dist/solana/types.d.ts +22 -1
- package/dist/solana/types.d.ts.map +1 -1
- package/dist/solana/types.js +12 -1
- package/dist/solana/types.js.map +1 -1
- package/dist/solana/utils.d.ts +58 -4
- package/dist/solana/utils.d.ts.map +1 -1
- package/dist/solana/utils.js +110 -7
- package/dist/solana/utils.js.map +1 -1
- package/dist/sui/hasher.d.ts +18 -0
- package/dist/sui/hasher.d.ts.map +1 -1
- package/dist/sui/hasher.js +18 -0
- package/dist/sui/hasher.js.map +1 -1
- package/dist/sui/index.d.ts +99 -12
- package/dist/sui/index.d.ts.map +1 -1
- package/dist/sui/index.js +108 -19
- package/dist/sui/index.js.map +1 -1
- package/dist/sui/types.d.ts +6 -0
- package/dist/sui/types.d.ts.map +1 -1
- package/dist/sui/types.js +5 -0
- package/dist/sui/types.js.map +1 -1
- package/dist/supported-chains.d.ts +2 -1
- package/dist/supported-chains.d.ts.map +1 -1
- package/dist/supported-chains.js.map +1 -1
- package/dist/types.d.ts +127 -16
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +67 -46
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +143 -21
- package/dist/utils.js.map +1 -1
- package/package.json +13 -9
- package/src/aptos/exec.ts +7 -18
- package/src/aptos/hasher.ts +18 -0
- package/src/aptos/index.ts +288 -110
- package/src/aptos/logs.ts +21 -3
- package/src/aptos/send.ts +25 -22
- package/src/aptos/token.ts +6 -0
- package/src/aptos/types.ts +26 -2
- package/src/aptos/utils.ts +1 -1
- package/src/chain.ts +243 -108
- package/src/commits.ts +6 -7
- package/src/evm/const.ts +5 -0
- package/src/evm/errors.ts +6 -1
- package/src/evm/hasher.ts +20 -4
- package/src/evm/index.ts +416 -214
- package/src/evm/logs.ts +255 -0
- package/src/evm/messages.ts +11 -5
- package/src/evm/offchain.ts +13 -4
- package/src/execution.ts +40 -32
- package/src/extra-args.ts +38 -6
- package/src/gas.ts +7 -9
- package/src/hasher/common.ts +3 -2
- package/src/hasher/hasher.ts +12 -4
- package/src/hasher/merklemulti.ts +17 -16
- package/src/index.ts +29 -23
- package/src/requests.ts +64 -46
- package/src/selectors.ts +1 -1
- package/src/solana/cleanup.ts +49 -34
- package/src/solana/exec.ts +128 -272
- package/src/solana/hasher.ts +13 -4
- package/src/solana/index.ts +483 -356
- package/src/solana/offchain.ts +32 -102
- package/src/solana/patchBorsh.ts +65 -50
- package/src/solana/send.ts +52 -111
- package/src/solana/types.ts +44 -3
- package/src/solana/utils.ts +143 -19
- package/src/sui/hasher.ts +18 -0
- package/src/sui/index.ts +143 -31
- package/src/sui/types.ts +6 -0
- package/src/supported-chains.ts +2 -1
- package/src/types.ts +130 -18
- package/src/utils.ts +168 -26
- package/tsconfig.json +2 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AbiParametersToPrimitiveTypes, ExtractAbiEvent } from 'abitype';
|
|
2
2
|
import type { BytesLike, Log } from 'ethers';
|
|
3
|
-
import type { ChainFamily, ChainTransaction } from './chain.ts';
|
|
4
3
|
import type OffRamp_1_6_ABI from './evm/abi/OffRamp_1_6.ts';
|
|
5
4
|
import type { CCIPMessage_EVM, CCIPMessage_V1_6_EVM } from './evm/messages.ts';
|
|
6
5
|
import type { ExtraArgs } from './extra-args.ts';
|
|
@@ -8,27 +7,52 @@ import type { CCIPMessage_V1_6_Solana } from './solana/types.ts';
|
|
|
8
7
|
import type { CCIPMessage_V1_6_Sui } from './sui/types.ts';
|
|
9
8
|
export type { CCIPMessage_V1_6 } from './evm/messages.ts';
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* Logger interface for logging messages (compatible with console)
|
|
12
11
|
*/
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type Logger = {
|
|
13
|
+
debug: (...args: unknown[]) => void;
|
|
14
|
+
info: (...args: unknown[]) => void;
|
|
15
|
+
warn: (...args: unknown[]) => void;
|
|
16
|
+
error: (...args: unknown[]) => void;
|
|
17
|
+
};
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
+
* An options object which may have a logger
|
|
20
|
+
*/
|
|
21
|
+
export type WithLogger = {
|
|
22
|
+
logger?: Logger;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* "Fix" for deeply intersecting types containing arrays: converts `A[] & B[]` to `(A & B)[]`.
|
|
26
|
+
* Usually, if you intersect `\{ arr: A[] \} & \{ arr: B[] \}`, arr will have type `A[] & B[]`,
|
|
19
27
|
* i.e. all/each *index* of A[] and B[] should be present in the intersection, with quite undefined
|
|
20
|
-
* types of the elements themselves, oftentimes assigning only one of A or B to the element type
|
|
21
|
-
* This converts deeply to (A & B)[]
|
|
28
|
+
* types of the elements themselves, oftentimes assigning only one of A or B to the element type.
|
|
29
|
+
* This converts deeply to `(A & B)[]`, i.e. each *element* should have all properties of A & B.
|
|
22
30
|
*/
|
|
23
31
|
export type MergeArrayElements<T, U> = {
|
|
24
32
|
[K in keyof (T & U)]: K extends keyof T & keyof U ? T[K] extends unknown[] ? U[K] extends unknown[] ? (T[K][number] & U[K][number])[] : U[K] extends readonly unknown[] ? readonly (T[K][number] & U[K][number])[] : never : T[K] extends readonly unknown[] ? U[K] extends readonly unknown[] ? readonly (T[K][number] & U[K][number])[] : never : U[K] extends readonly unknown[] ? never : MergeArrayElements<T[K], U[K]> : K extends keyof T ? T[K] : K extends keyof U ? U[K] : never;
|
|
25
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Enumeration of supported blockchain families.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ChainFamily: {
|
|
38
|
+
readonly EVM: "evm";
|
|
39
|
+
readonly Solana: "solana";
|
|
40
|
+
readonly Aptos: "aptos";
|
|
41
|
+
readonly Sui: "sui";
|
|
42
|
+
};
|
|
43
|
+
/** Type representing one of the supported chain families. */
|
|
44
|
+
export type ChainFamily = (typeof ChainFamily)[keyof typeof ChainFamily];
|
|
45
|
+
/**
|
|
46
|
+
* Enumeration of supported CCIP protocol versions.
|
|
47
|
+
*/
|
|
26
48
|
export declare const CCIPVersion: {
|
|
27
49
|
readonly V1_2: "1.2.0";
|
|
28
50
|
readonly V1_5: "1.5.0";
|
|
29
51
|
readonly V1_6: "1.6.0";
|
|
30
52
|
};
|
|
53
|
+
/** Type representing one of the supported CCIP versions. */
|
|
31
54
|
export type CCIPVersion = (typeof CCIPVersion)[keyof typeof CCIPVersion];
|
|
55
|
+
/** Helper type that maps chain family to its chain ID format. */
|
|
32
56
|
type ChainFamilyWithId<F extends ChainFamily> = F extends typeof ChainFamily.EVM ? {
|
|
33
57
|
readonly family: F;
|
|
34
58
|
readonly chainId: number;
|
|
@@ -39,80 +63,167 @@ type ChainFamilyWithId<F extends ChainFamily> = F extends typeof ChainFamily.EVM
|
|
|
39
63
|
readonly family: F;
|
|
40
64
|
readonly chainId: `${F}:${number}`;
|
|
41
65
|
} : never;
|
|
66
|
+
/**
|
|
67
|
+
* Network information including chain selector and metadata.
|
|
68
|
+
*/
|
|
42
69
|
export type NetworkInfo<F extends ChainFamily = ChainFamily> = {
|
|
70
|
+
/** Unique chain selector used by CCIP. */
|
|
43
71
|
readonly chainSelector: bigint;
|
|
72
|
+
/** Human-readable network name. */
|
|
44
73
|
readonly name: string;
|
|
74
|
+
/** Whether this is a testnet. */
|
|
45
75
|
readonly isTestnet: boolean;
|
|
46
76
|
} & ChainFamilyWithId<F>;
|
|
77
|
+
/**
|
|
78
|
+
* CCIP lane configuration connecting source and destination chains.
|
|
79
|
+
*/
|
|
47
80
|
export interface Lane<V extends CCIPVersion = CCIPVersion> {
|
|
81
|
+
/** Source chain selector. */
|
|
48
82
|
sourceChainSelector: bigint;
|
|
83
|
+
/** Destination chain selector. */
|
|
49
84
|
destChainSelector: bigint;
|
|
85
|
+
/** OnRamp contract address on source chain. */
|
|
50
86
|
onRamp: string;
|
|
87
|
+
/** CCIP protocol version for this lane. */
|
|
51
88
|
version: V;
|
|
52
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Union type representing a CCIP message across different versions and chain families.
|
|
92
|
+
*/
|
|
53
93
|
export type CCIPMessage<V extends CCIPVersion = CCIPVersion> = V extends typeof CCIPVersion.V1_2 | typeof CCIPVersion.V1_5 ? CCIPMessage_EVM<V> : CCIPMessage_V1_6_EVM | CCIPMessage_V1_6_Solana | CCIPMessage_V1_6_Sui;
|
|
94
|
+
/**
|
|
95
|
+
* Generic log structure compatible across chain families.
|
|
96
|
+
*/
|
|
54
97
|
export type Log_ = Pick<Log, 'topics' | 'index' | 'address' | 'blockNumber' | 'transactionHash'> & {
|
|
98
|
+
/** Log data as bytes or parsed object. */
|
|
55
99
|
data: BytesLike | Record<string, unknown>;
|
|
100
|
+
/** Optional reference to the containing transaction. */
|
|
56
101
|
tx?: ChainTransaction;
|
|
57
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Generic transaction structure compatible across chain families.
|
|
105
|
+
*/
|
|
106
|
+
export type ChainTransaction = {
|
|
107
|
+
/** Transaction hash. */
|
|
108
|
+
hash: string;
|
|
109
|
+
/** Logs emitted by this transaction. */
|
|
110
|
+
logs: readonly Log_[];
|
|
111
|
+
/** Block number containing this transaction. */
|
|
112
|
+
blockNumber: number;
|
|
113
|
+
/** Unix timestamp of the block. */
|
|
114
|
+
timestamp: number;
|
|
115
|
+
/** Sender address. */
|
|
116
|
+
from: string;
|
|
117
|
+
/** Optional error if transaction failed. */
|
|
118
|
+
error?: unknown;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Complete CCIP request containing lane, message, log, and transaction info.
|
|
122
|
+
*/
|
|
58
123
|
export interface CCIPRequest<V extends CCIPVersion = CCIPVersion> {
|
|
124
|
+
/** Lane configuration for this request. */
|
|
59
125
|
lane: Lane<V>;
|
|
126
|
+
/** The CCIP message being sent. */
|
|
60
127
|
message: CCIPMessage<V>;
|
|
128
|
+
/** Log event from the OnRamp. */
|
|
61
129
|
log: Log_;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
from?: string;
|
|
65
|
-
error?: unknown;
|
|
66
|
-
};
|
|
67
|
-
timestamp: number;
|
|
130
|
+
/** Transaction that emitted the request. */
|
|
131
|
+
tx: Pick<ChainTransaction, 'hash' | 'logs' | 'blockNumber' | 'timestamp' | 'from' | 'error'>;
|
|
68
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Commit report structure from the OffRamp CommitReportAccepted event.
|
|
135
|
+
*/
|
|
69
136
|
export type CommitReport = AbiParametersToPrimitiveTypes<ExtractAbiEvent<typeof OffRamp_1_6_ABI, 'CommitReportAccepted'>['inputs']>[0][number];
|
|
137
|
+
/**
|
|
138
|
+
* CCIP commit information containing the report and its log.
|
|
139
|
+
*/
|
|
70
140
|
export interface CCIPCommit {
|
|
141
|
+
/** The commit report data. */
|
|
71
142
|
report: CommitReport;
|
|
143
|
+
/** Log event from the commit. */
|
|
72
144
|
log: Log_;
|
|
73
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Enumeration of possible execution states for a CCIP message.
|
|
148
|
+
*/
|
|
74
149
|
export declare const ExecutionState: {
|
|
150
|
+
/** Execution is in progress. */
|
|
75
151
|
readonly InProgress: 1;
|
|
152
|
+
/** Execution completed successfully. */
|
|
76
153
|
readonly Success: 2;
|
|
154
|
+
/** Execution failed. */
|
|
77
155
|
readonly Failed: 3;
|
|
78
156
|
};
|
|
157
|
+
/** Type representing an execution state value. */
|
|
79
158
|
export type ExecutionState = (typeof ExecutionState)[keyof typeof ExecutionState];
|
|
159
|
+
/**
|
|
160
|
+
* Receipt of a CCIP message execution on the destination chain.
|
|
161
|
+
*/
|
|
80
162
|
export type ExecutionReceipt = {
|
|
163
|
+
/** Unique message identifier. */
|
|
81
164
|
messageId: string;
|
|
165
|
+
/** Sequence number of the message. */
|
|
82
166
|
sequenceNumber: bigint;
|
|
167
|
+
/** Current execution state. */
|
|
83
168
|
state: ExecutionState;
|
|
169
|
+
/** Source chain selector (if available). */
|
|
84
170
|
sourceChainSelector?: bigint;
|
|
171
|
+
/** Hash of the message (if available). */
|
|
85
172
|
messageHash?: string;
|
|
173
|
+
/** Return data from the receiver contract (if any). */
|
|
86
174
|
returnData?: BytesLike | Record<string, string>;
|
|
175
|
+
/** Gas consumed by execution (if available). */
|
|
87
176
|
gasUsed?: bigint;
|
|
88
177
|
};
|
|
178
|
+
/**
|
|
179
|
+
* Complete CCIP execution event with receipt, log, and timestamp.
|
|
180
|
+
*/
|
|
89
181
|
export interface CCIPExecution {
|
|
182
|
+
/** Execution receipt data. */
|
|
90
183
|
receipt: ExecutionReceipt;
|
|
184
|
+
/** Log event from the execution. */
|
|
91
185
|
log: Log_;
|
|
186
|
+
/** Unix timestamp of the execution. */
|
|
92
187
|
timestamp: number;
|
|
93
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Offchain token data for CCTP or other bridge attestations.
|
|
191
|
+
*/
|
|
94
192
|
export type OffchainTokenData = {
|
|
95
193
|
_tag: string;
|
|
96
194
|
[k: string]: BytesLike;
|
|
97
195
|
} | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Execution report containing message, proofs, and offchain token data.
|
|
198
|
+
*/
|
|
98
199
|
export type ExecutionReport<M extends CCIPMessage = CCIPMessage> = {
|
|
200
|
+
/** The CCIP message to execute. */
|
|
99
201
|
message: M;
|
|
202
|
+
/** Merkle proofs for the message. */
|
|
100
203
|
proofs: readonly BytesLike[];
|
|
204
|
+
/** Bit flags for proof verification. */
|
|
101
205
|
proofFlagBits: bigint;
|
|
206
|
+
/** Merkle root for verification. */
|
|
102
207
|
merkleRoot: string;
|
|
208
|
+
/** Offchain token data for each token transfer. */
|
|
103
209
|
offchainTokenData: readonly OffchainTokenData[];
|
|
104
210
|
};
|
|
105
211
|
/**
|
|
106
|
-
* A message to be sent to another network
|
|
212
|
+
* A message to be sent to another network.
|
|
107
213
|
*/
|
|
108
214
|
export type AnyMessage = {
|
|
215
|
+
/** Receiver address on the destination chain. */
|
|
109
216
|
receiver: BytesLike;
|
|
217
|
+
/** Arbitrary data payload. */
|
|
110
218
|
data: BytesLike;
|
|
219
|
+
/** Extra arguments for gas limits and other settings. */
|
|
111
220
|
extraArgs: ExtraArgs;
|
|
221
|
+
/** Optional token transfers. */
|
|
112
222
|
tokenAmounts?: readonly {
|
|
113
223
|
token: string;
|
|
114
224
|
amount: bigint;
|
|
115
225
|
}[];
|
|
226
|
+
/** Optional fee token address (native if omitted). */
|
|
116
227
|
feeToken?: string;
|
|
117
228
|
};
|
|
118
229
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5C,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;IAClC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;IAClC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CACpC,CAAA;AAED;;GAEG;AAC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ACT,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAAA;AAEpF;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI;IACjE,mCAAmC;IACnC,OAAO,EAAE,CAAC,CAAA;IACV,qCAAqC;IACrC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAA;IACrB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,mDAAmD;IACnD,iBAAiB,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,iDAAiD;IACjD,QAAQ,EAAE,SAAS,CAAA;IACnB,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAA;IACf,yDAAyD;IACzD,SAAS,EAAE,SAAS,CAAA;IACpB,gCAAgC;IAChC,YAAY,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3D,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of supported blockchain families.
|
|
3
|
+
*/
|
|
4
|
+
export const ChainFamily = {
|
|
5
|
+
EVM: 'evm',
|
|
6
|
+
Solana: 'solana',
|
|
7
|
+
Aptos: 'aptos',
|
|
8
|
+
Sui: 'sui',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Enumeration of supported CCIP protocol versions.
|
|
12
|
+
*/
|
|
1
13
|
export const CCIPVersion = {
|
|
2
14
|
V1_2: '1.2.0',
|
|
3
15
|
V1_5: '1.5.0',
|
|
4
16
|
V1_6: '1.6.0',
|
|
5
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Enumeration of possible execution states for a CCIP message.
|
|
20
|
+
*/
|
|
6
21
|
export const ExecutionState = {
|
|
22
|
+
/** Execution is in progress. */
|
|
7
23
|
InProgress: 1,
|
|
24
|
+
/** Execution completed successfully. */
|
|
8
25
|
Success: 2,
|
|
26
|
+
/** Execution failed. */
|
|
9
27
|
Failed: 3,
|
|
10
28
|
};
|
|
11
29
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyDA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACF,CAAA;AAIV;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,OAAO;CACL,CAAA;AA2GV;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,gCAAgC;IAChC,UAAU,EAAE,CAAC;IACb,wCAAwC;IACxC,OAAO,EAAE,CAAC;IACV,wBAAwB;IACxB,MAAM,EAAE,CAAC;CACD,CAAA"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type BigNumberish, type BytesLike, type Numeric } from 'ethers';
|
|
2
|
-
import
|
|
3
|
-
import { type
|
|
4
|
-
import type { NetworkInfo } from './types.ts';
|
|
2
|
+
import type { Chain } from './chain.ts';
|
|
3
|
+
import { type NetworkInfo, type WithLogger, ChainFamily } from './types.ts';
|
|
5
4
|
/**
|
|
6
5
|
* Returns *some* block number with timestamp prior to `timestamp`
|
|
7
6
|
*
|
|
@@ -11,7 +10,9 @@ import type { NetworkInfo } from './types.ts';
|
|
|
11
10
|
* @param precision - returned blockNumber should be within this many blocks before timestamp
|
|
12
11
|
* @returns blockNumber of a block at provider which is close but before target timestamp
|
|
13
12
|
**/
|
|
14
|
-
export declare function getSomeBlockNumberBefore(getBlockTimestamp: (blockNumber: number) => Promise<number>, recentBlockNumber: number, timestamp: number, precision?:
|
|
13
|
+
export declare function getSomeBlockNumberBefore(getBlockTimestamp: (blockNumber: number) => Promise<number>, recentBlockNumber: number, timestamp: number, { precision, logger }?: {
|
|
14
|
+
precision?: number;
|
|
15
|
+
} & WithLogger): Promise<number>;
|
|
15
16
|
/**
|
|
16
17
|
* Converts a chain selector, chain ID, or chain name to complete network information
|
|
17
18
|
*
|
|
@@ -21,47 +22,7 @@ export declare function getSomeBlockNumberBefore(getBlockTimestamp: (blockNumber
|
|
|
21
22
|
* - Chain name as string ("ethereum-mainnet")
|
|
22
23
|
* @returns Complete NetworkInfo object
|
|
23
24
|
*/
|
|
24
|
-
export declare const networkInfo:
|
|
25
|
-
isDeepEqual: boolean;
|
|
26
|
-
isPromise: boolean;
|
|
27
|
-
isReact: boolean;
|
|
28
|
-
isSerialized: boolean;
|
|
29
|
-
isShallowEqual: boolean;
|
|
30
|
-
matchesArg: moize.IsEqual;
|
|
31
|
-
matchesKey: moize.IsMatchingKey;
|
|
32
|
-
maxAge: number;
|
|
33
|
-
maxArgs: number;
|
|
34
|
-
maxSize: number;
|
|
35
|
-
onCacheAdd: moize.OnCacheOperation<(selectorOrIdOrName: bigint | number | string) => NetworkInfo>;
|
|
36
|
-
onCacheChange: moize.OnCacheOperation<(selectorOrIdOrName: bigint | number | string) => NetworkInfo>;
|
|
37
|
-
onCacheHit: moize.OnCacheOperation<(selectorOrIdOrName: bigint | number | string) => NetworkInfo>;
|
|
38
|
-
onExpire: moize.OnExpire;
|
|
39
|
-
profileName: string;
|
|
40
|
-
serializer: moize.Serialize;
|
|
41
|
-
transformArgs: moize.TransformKey;
|
|
42
|
-
updateCacheForKey: moize.UpdateCacheForKey;
|
|
43
|
-
updateExpire: boolean;
|
|
44
|
-
}> & Partial<{
|
|
45
|
-
isDeepEqual: boolean;
|
|
46
|
-
isPromise: boolean;
|
|
47
|
-
isReact: boolean;
|
|
48
|
-
isSerialized: boolean;
|
|
49
|
-
isShallowEqual: boolean;
|
|
50
|
-
matchesArg: moize.IsEqual;
|
|
51
|
-
matchesKey: moize.IsMatchingKey;
|
|
52
|
-
maxAge: number;
|
|
53
|
-
maxArgs: number;
|
|
54
|
-
maxSize: number;
|
|
55
|
-
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
|
|
56
|
-
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
|
|
57
|
-
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
|
|
58
|
-
onExpire: moize.OnExpire;
|
|
59
|
-
profileName: string;
|
|
60
|
-
serializer: moize.Serialize;
|
|
61
|
-
transformArgs: moize.TransformKey;
|
|
62
|
-
updateCacheForKey: moize.UpdateCacheForKey;
|
|
63
|
-
updateExpire: boolean;
|
|
64
|
-
}>>;
|
|
25
|
+
export declare const networkInfo: import("micro-memoize").Memoized<(selectorOrIdOrName: bigint | number | string) => NetworkInfo, {}>;
|
|
65
26
|
/**
|
|
66
27
|
* Generates exclusive block ranges [fromBlock, toBlock]
|
|
67
28
|
* If startBlock is given, moves forward from there (up to latestBlock),
|
|
@@ -83,7 +44,19 @@ export declare function blockRangeGenerator(params: {
|
|
|
83
44
|
toBlock: number;
|
|
84
45
|
progress: string;
|
|
85
46
|
}, void, unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* JSON replacer function that converts BigInt values to strings.
|
|
49
|
+
* @param _key - Property key (unused).
|
|
50
|
+
* @param value - Value to transform.
|
|
51
|
+
* @returns String representation if BigInt, otherwise unchanged value.
|
|
52
|
+
*/
|
|
86
53
|
export declare function bigIntReplacer(_key: string, value: unknown): unknown;
|
|
54
|
+
/**
|
|
55
|
+
* JSON reviver function that converts numeric strings back to BigInt.
|
|
56
|
+
* @param _key - Property key (unused).
|
|
57
|
+
* @param value - Value to transform.
|
|
58
|
+
* @returns BigInt if numeric string, otherwise unchanged value.
|
|
59
|
+
*/
|
|
87
60
|
export declare function bigIntReviver(_key: string, value: unknown): unknown;
|
|
88
61
|
/**
|
|
89
62
|
* Decode address from a 32-byte hex string
|
|
@@ -93,10 +66,36 @@ export declare function decodeAddress(address: BytesLike, family?: ChainFamily):
|
|
|
93
66
|
* Version of decodeAddress which is aware of custom cross-chain OnRamp formats
|
|
94
67
|
**/
|
|
95
68
|
export declare function decodeOnRampAddress(address: BytesLike, family?: ChainFamily): string;
|
|
69
|
+
/**
|
|
70
|
+
* Converts little-endian bytes to BigInt.
|
|
71
|
+
* @param data - Little-endian byte data.
|
|
72
|
+
* @returns BigInt value.
|
|
73
|
+
*/
|
|
96
74
|
export declare function leToBigInt(data: BytesLike | readonly number[]): bigint;
|
|
75
|
+
/**
|
|
76
|
+
* Converts a BigNumber to little-endian byte array.
|
|
77
|
+
* @param value - Numeric value to convert.
|
|
78
|
+
* @param width - Optional byte width for padding.
|
|
79
|
+
* @returns Little-endian Uint8Array.
|
|
80
|
+
*/
|
|
97
81
|
export declare function toLeArray(value: BigNumberish, width?: Numeric): Uint8Array;
|
|
82
|
+
/**
|
|
83
|
+
* Checks if the given data is a valid Base64 encoded string.
|
|
84
|
+
* @param data - Data to check.
|
|
85
|
+
* @returns True if valid Base64 string.
|
|
86
|
+
*/
|
|
98
87
|
export declare function isBase64(data: unknown): data is string;
|
|
88
|
+
/**
|
|
89
|
+
* Converts various data formats to Uint8Array.
|
|
90
|
+
* @param data - Bytes, number array, or Base64 string.
|
|
91
|
+
* @returns Uint8Array representation.
|
|
92
|
+
*/
|
|
99
93
|
export declare function getDataBytes(data: BytesLike | readonly number[]): Uint8Array;
|
|
94
|
+
/**
|
|
95
|
+
* Extracts address bytes, handling both hex and Base58 formats.
|
|
96
|
+
* @param address - Address in hex or Base58 format.
|
|
97
|
+
* @returns Address bytes as Uint8Array.
|
|
98
|
+
*/
|
|
100
99
|
export declare function getAddressBytes(address: BytesLike): Uint8Array;
|
|
101
100
|
/**
|
|
102
101
|
* Converts snake_case strings to camelCase
|
|
@@ -107,11 +106,33 @@ export declare function snakeToCamel(str: string): string;
|
|
|
107
106
|
* Only converts keys that actually have snake_case format
|
|
108
107
|
*/
|
|
109
108
|
export declare function convertKeysToCamelCase(obj: unknown, mapValues?: (value: unknown, key?: string) => unknown, key?: string): unknown;
|
|
109
|
+
/**
|
|
110
|
+
* Promise-based sleep utility.
|
|
111
|
+
* @param ms - Duration in milliseconds.
|
|
112
|
+
* @returns Promise that resolves after the specified duration.
|
|
113
|
+
*/
|
|
110
114
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* Parses a typeAndVersion string into its components.
|
|
117
|
+
* @param typeAndVersion - String in format "TypeName vX.Y.Z".
|
|
118
|
+
* @returns Tuple of [type, version, original, suffix?].
|
|
119
|
+
*/
|
|
111
120
|
export declare function parseTypeAndVersion(typeAndVersion: string): Awaited<ReturnType<Chain['typeAndVersion']>>;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a rate-limited fetch function with retry logic.
|
|
123
|
+
* Configurable via maxRequests, windowMs, and maxRetries options.
|
|
124
|
+
* @returns Rate-limited fetch function.
|
|
125
|
+
*/
|
|
112
126
|
export declare function createRateLimitedFetch({ maxRequests, windowMs, maxRetries, }?: {
|
|
113
127
|
maxRequests?: number;
|
|
114
128
|
windowMs?: number;
|
|
115
129
|
maxRetries?: number;
|
|
116
|
-
}): typeof fetch;
|
|
130
|
+
}, { logger }?: WithLogger): typeof fetch;
|
|
131
|
+
declare const util: {
|
|
132
|
+
inspect: ((v: unknown) => string) & {
|
|
133
|
+
custom: symbol;
|
|
134
|
+
defaultOptions: Record<string, unknown>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export { util };
|
|
117
138
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,OAAO,EAMb,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,OAAO,EAMb,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGvC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE3E;;;;;;;;IAQI;AACJ,wBAAsB,wBAAwB,CAC5C,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EAC3D,iBAAiB,EAAE,MAAM,EACzB,SAAS,EAAE,MAAM,EACjB,EAAE,SAAc,EAAE,MAAgB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAe,GAC7E,OAAO,CAAC,MAAM,CAAC,CA2DjB;AAeD;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,wDACF,MAAM,GAAG,MAAM,GAAG,MAAM,KAC3C,WAAW,KAgCZ,CAAA;AAGF;;;;IAII;AACJ,wBAAiB,mBAAmB,CAClC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAA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