@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.
Files changed (247) hide show
  1. package/README.md +12 -9
  2. package/dist/api/index.d.ts +21 -8
  3. package/dist/api/index.d.ts.map +1 -1
  4. package/dist/api/index.js +42 -13
  5. package/dist/api/index.js.map +1 -1
  6. package/dist/api/types.d.ts +0 -2
  7. package/dist/api/types.d.ts.map +1 -1
  8. package/dist/aptos/exec.d.ts +2 -2
  9. package/dist/aptos/exec.d.ts.map +1 -1
  10. package/dist/aptos/exec.js.map +1 -1
  11. package/dist/aptos/hasher.d.ts.map +1 -1
  12. package/dist/aptos/hasher.js +1 -1
  13. package/dist/aptos/hasher.js.map +1 -1
  14. package/dist/aptos/index.d.ts +17 -16
  15. package/dist/aptos/index.d.ts.map +1 -1
  16. package/dist/aptos/index.js +42 -73
  17. package/dist/aptos/index.js.map +1 -1
  18. package/dist/aptos/logs.d.ts +2 -2
  19. package/dist/aptos/logs.d.ts.map +1 -1
  20. package/dist/aptos/types.d.ts +2 -19
  21. package/dist/aptos/types.d.ts.map +1 -1
  22. package/dist/aptos/types.js +0 -11
  23. package/dist/aptos/types.js.map +1 -1
  24. package/dist/chain.d.ts +538 -158
  25. package/dist/chain.d.ts.map +1 -1
  26. package/dist/chain.js +132 -19
  27. package/dist/chain.js.map +1 -1
  28. package/dist/commits.d.ts +4 -6
  29. package/dist/commits.d.ts.map +1 -1
  30. package/dist/commits.js +4 -4
  31. package/dist/commits.js.map +1 -1
  32. package/dist/errors/CCIPError.d.ts +33 -4
  33. package/dist/errors/CCIPError.d.ts.map +1 -1
  34. package/dist/errors/CCIPError.js +33 -4
  35. package/dist/errors/CCIPError.js.map +1 -1
  36. package/dist/errors/codes.d.ts +3 -0
  37. package/dist/errors/codes.d.ts.map +1 -1
  38. package/dist/errors/codes.js +3 -1
  39. package/dist/errors/codes.js.map +1 -1
  40. package/dist/errors/index.d.ts +4 -4
  41. package/dist/errors/index.d.ts.map +1 -1
  42. package/dist/errors/index.js +4 -4
  43. package/dist/errors/index.js.map +1 -1
  44. package/dist/errors/recovery.d.ts.map +1 -1
  45. package/dist/errors/recovery.js +4 -1
  46. package/dist/errors/recovery.js.map +1 -1
  47. package/dist/errors/specialized.d.ts +1695 -120
  48. package/dist/errors/specialized.d.ts.map +1 -1
  49. package/dist/errors/specialized.js +1715 -123
  50. package/dist/errors/specialized.js.map +1 -1
  51. package/dist/errors/utils.d.ts.map +1 -1
  52. package/dist/errors/utils.js +0 -1
  53. package/dist/errors/utils.js.map +1 -1
  54. package/dist/evm/abi/OffRamp_2_0.d.ts +764 -0
  55. package/dist/evm/abi/OffRamp_2_0.d.ts.map +1 -0
  56. package/dist/evm/abi/OffRamp_2_0.js +744 -0
  57. package/dist/evm/abi/OffRamp_2_0.js.map +1 -0
  58. package/dist/evm/abi/OnRamp_2_0.d.ts +925 -0
  59. package/dist/evm/abi/OnRamp_2_0.d.ts.map +1 -0
  60. package/dist/evm/abi/OnRamp_2_0.js +992 -0
  61. package/dist/evm/abi/OnRamp_2_0.js.map +1 -0
  62. package/dist/evm/const.d.ts +12 -2
  63. package/dist/evm/const.d.ts.map +1 -1
  64. package/dist/evm/const.js +8 -2
  65. package/dist/evm/const.js.map +1 -1
  66. package/dist/evm/errors.d.ts.map +1 -1
  67. package/dist/evm/errors.js +7 -2
  68. package/dist/evm/errors.js.map +1 -1
  69. package/dist/evm/extra-args.d.ts.map +1 -1
  70. package/dist/evm/extra-args.js +5 -24
  71. package/dist/evm/extra-args.js.map +1 -1
  72. package/dist/evm/hasher.d.ts.map +1 -1
  73. package/dist/evm/hasher.js +23 -13
  74. package/dist/evm/hasher.js.map +1 -1
  75. package/dist/evm/index.d.ts +73 -16
  76. package/dist/evm/index.d.ts.map +1 -1
  77. package/dist/evm/index.js +241 -146
  78. package/dist/evm/index.js.map +1 -1
  79. package/dist/evm/logs.d.ts +1 -1
  80. package/dist/evm/logs.js +1 -1
  81. package/dist/evm/messages.d.ts +59 -5
  82. package/dist/evm/messages.d.ts.map +1 -1
  83. package/dist/evm/messages.js +210 -0
  84. package/dist/evm/messages.js.map +1 -1
  85. package/dist/evm/offchain.d.ts +1 -14
  86. package/dist/evm/offchain.d.ts.map +1 -1
  87. package/dist/evm/offchain.js +1 -133
  88. package/dist/evm/offchain.js.map +1 -1
  89. package/dist/evm/types.d.ts +7 -2
  90. package/dist/evm/types.d.ts.map +1 -1
  91. package/dist/evm/types.js +22 -1
  92. package/dist/evm/types.js.map +1 -1
  93. package/dist/execution.d.ts +62 -22
  94. package/dist/execution.d.ts.map +1 -1
  95. package/dist/execution.js +98 -61
  96. package/dist/execution.js.map +1 -1
  97. package/dist/extra-args.d.ts +13 -3
  98. package/dist/extra-args.d.ts.map +1 -1
  99. package/dist/extra-args.js +13 -3
  100. package/dist/extra-args.js.map +1 -1
  101. package/dist/gas.d.ts +25 -2
  102. package/dist/gas.d.ts.map +1 -1
  103. package/dist/gas.js +30 -4
  104. package/dist/gas.js.map +1 -1
  105. package/dist/index.d.ts +3 -2
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +2 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/offchain.d.ts +23 -6
  110. package/dist/offchain.d.ts.map +1 -1
  111. package/dist/offchain.js +92 -17
  112. package/dist/offchain.js.map +1 -1
  113. package/dist/requests.d.ts +85 -14
  114. package/dist/requests.d.ts.map +1 -1
  115. package/dist/requests.js +99 -17
  116. package/dist/requests.js.map +1 -1
  117. package/dist/selectors.d.ts.map +1 -1
  118. package/dist/selectors.js +12 -0
  119. package/dist/selectors.js.map +1 -1
  120. package/dist/shared/bcs-codecs.d.ts +61 -0
  121. package/dist/shared/bcs-codecs.d.ts.map +1 -0
  122. package/dist/shared/bcs-codecs.js +102 -0
  123. package/dist/shared/bcs-codecs.js.map +1 -0
  124. package/dist/shared/constants.d.ts +3 -0
  125. package/dist/shared/constants.d.ts.map +1 -0
  126. package/dist/shared/constants.js +3 -0
  127. package/dist/shared/constants.js.map +1 -0
  128. package/dist/solana/exec.d.ts +2 -2
  129. package/dist/solana/exec.d.ts.map +1 -1
  130. package/dist/solana/exec.js.map +1 -1
  131. package/dist/solana/idl/1.6.0/BASE_TOKEN_POOL.d.ts +1 -1
  132. package/dist/solana/idl/1.6.0/BASE_TOKEN_POOL.js +1 -1
  133. package/dist/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.d.ts +1 -1
  134. package/dist/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.js +1 -1
  135. package/dist/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.d.ts +1 -1
  136. package/dist/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.js +1 -1
  137. package/dist/solana/idl/1.6.0/CCIP_COMMON.d.ts +16 -1
  138. package/dist/solana/idl/1.6.0/CCIP_COMMON.d.ts.map +1 -1
  139. package/dist/solana/idl/1.6.0/CCIP_COMMON.js +16 -1
  140. package/dist/solana/idl/1.6.0/CCIP_COMMON.js.map +1 -1
  141. package/dist/solana/idl/1.6.0/CCIP_OFFRAMP.d.ts +1 -1
  142. package/dist/solana/idl/1.6.0/CCIP_OFFRAMP.js +1 -1
  143. package/dist/solana/idl/1.6.0/CCIP_ROUTER.d.ts +1 -1
  144. package/dist/solana/idl/1.6.0/CCIP_ROUTER.js +1 -1
  145. package/dist/solana/index.d.ts +85 -24
  146. package/dist/solana/index.d.ts.map +1 -1
  147. package/dist/solana/index.js +69 -37
  148. package/dist/solana/index.js.map +1 -1
  149. package/dist/solana/offchain.d.ts +1 -13
  150. package/dist/solana/offchain.d.ts.map +1 -1
  151. package/dist/solana/offchain.js +1 -66
  152. package/dist/solana/offchain.js.map +1 -1
  153. package/dist/solana/utils.d.ts +4 -4
  154. package/dist/solana/utils.d.ts.map +1 -1
  155. package/dist/solana/utils.js +1 -1
  156. package/dist/solana/utils.js.map +1 -1
  157. package/dist/sui/hasher.d.ts.map +1 -1
  158. package/dist/sui/hasher.js +1 -1
  159. package/dist/sui/hasher.js.map +1 -1
  160. package/dist/sui/index.d.ts +18 -18
  161. package/dist/sui/index.d.ts.map +1 -1
  162. package/dist/sui/index.js +38 -39
  163. package/dist/sui/index.js.map +1 -1
  164. package/dist/sui/manuallyExec/encoder.d.ts +2 -2
  165. package/dist/sui/manuallyExec/encoder.d.ts.map +1 -1
  166. package/dist/sui/manuallyExec/encoder.js.map +1 -1
  167. package/dist/sui/manuallyExec/index.d.ts +2 -2
  168. package/dist/sui/manuallyExec/index.d.ts.map +1 -1
  169. package/dist/ton/exec.d.ts +3 -3
  170. package/dist/ton/exec.d.ts.map +1 -1
  171. package/dist/ton/exec.js +1 -1
  172. package/dist/ton/exec.js.map +1 -1
  173. package/dist/ton/index.d.ts +14 -22
  174. package/dist/ton/index.d.ts.map +1 -1
  175. package/dist/ton/index.js +26 -35
  176. package/dist/ton/index.js.map +1 -1
  177. package/dist/ton/types.d.ts +3 -5
  178. package/dist/ton/types.d.ts.map +1 -1
  179. package/dist/ton/types.js.map +1 -1
  180. package/dist/types.d.ts +55 -20
  181. package/dist/types.d.ts.map +1 -1
  182. package/dist/types.js +6 -1
  183. package/dist/types.js.map +1 -1
  184. package/dist/utils.d.ts +65 -2
  185. package/dist/utils.d.ts.map +1 -1
  186. package/dist/utils.js +74 -2
  187. package/dist/utils.js.map +1 -1
  188. package/package.json +14 -10
  189. package/src/api/index.ts +53 -17
  190. package/src/api/types.ts +0 -2
  191. package/src/aptos/exec.ts +2 -2
  192. package/src/aptos/hasher.ts +1 -1
  193. package/src/aptos/index.ts +55 -100
  194. package/src/aptos/logs.ts +2 -2
  195. package/src/aptos/types.ts +2 -15
  196. package/src/chain.ts +594 -171
  197. package/src/commits.ts +9 -9
  198. package/src/errors/CCIPError.ts +33 -4
  199. package/src/errors/codes.ts +3 -1
  200. package/src/errors/index.ts +4 -0
  201. package/src/errors/recovery.ts +7 -1
  202. package/src/errors/specialized.ts +1726 -130
  203. package/src/errors/utils.ts +0 -1
  204. package/src/evm/abi/OffRamp_2_0.ts +743 -0
  205. package/src/evm/abi/OnRamp_2_0.ts +991 -0
  206. package/src/evm/const.ts +10 -3
  207. package/src/evm/errors.ts +6 -2
  208. package/src/evm/extra-args.ts +4 -21
  209. package/src/evm/hasher.ts +30 -18
  210. package/src/evm/index.ts +314 -176
  211. package/src/evm/logs.ts +1 -1
  212. package/src/evm/messages.ts +323 -11
  213. package/src/evm/offchain.ts +2 -191
  214. package/src/evm/types.ts +20 -2
  215. package/src/execution.ts +125 -86
  216. package/src/extra-args.ts +13 -3
  217. package/src/gas.ts +29 -3
  218. package/src/index.ts +10 -3
  219. package/src/offchain.ts +125 -28
  220. package/src/requests.ts +114 -19
  221. package/src/selectors.ts +12 -0
  222. package/src/shared/bcs-codecs.ts +132 -0
  223. package/src/shared/constants.ts +2 -0
  224. package/src/solana/exec.ts +4 -4
  225. package/src/solana/idl/1.6.0/BASE_TOKEN_POOL.ts +2 -2
  226. package/src/solana/idl/1.6.0/BURN_MINT_TOKEN_POOL.ts +2 -2
  227. package/src/solana/idl/1.6.0/CCIP_CCTP_TOKEN_POOL.ts +2 -2
  228. package/src/solana/idl/1.6.0/CCIP_COMMON.ts +32 -2
  229. package/src/solana/idl/1.6.0/CCIP_OFFRAMP.ts +2 -2
  230. package/src/solana/idl/1.6.0/CCIP_ROUTER.ts +2 -2
  231. package/src/solana/index.ts +110 -85
  232. package/src/solana/offchain.ts +3 -100
  233. package/src/solana/utils.ts +8 -5
  234. package/src/sui/hasher.ts +1 -1
  235. package/src/sui/index.ts +55 -59
  236. package/src/sui/manuallyExec/encoder.ts +2 -2
  237. package/src/sui/manuallyExec/index.ts +2 -2
  238. package/src/ton/exec.ts +4 -7
  239. package/src/ton/index.ts +45 -53
  240. package/src/ton/types.ts +4 -7
  241. package/src/types.ts +81 -37
  242. package/src/utils.ts +73 -2
  243. package/dist/aptos/utils.d.ts +0 -12
  244. package/dist/aptos/utils.d.ts.map +0 -1
  245. package/dist/aptos/utils.js +0 -15
  246. package/dist/aptos/utils.js.map +0 -1
  247. package/src/aptos/utils.ts +0 -24
@@ -1,59 +1,205 @@
1
1
  import { type CCIPErrorOptions, CCIPError } from './CCIPError.ts';
2
- /** Thrown when chain not found by chainId, selector, or name. */
2
+ /**
3
+ * Thrown when chain not found by chainId, selector, or name.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * import { networkInfo } from '@chainlink/ccip-sdk'
8
+ *
9
+ * try {
10
+ * const info = networkInfo(999999) // Unknown chain
11
+ * } catch (error) {
12
+ * if (error instanceof CCIPChainNotFoundError) {
13
+ * console.log(`Chain not found: ${error.context.chainIdOrSelector}`)
14
+ * console.log(`Recovery: ${error.recovery}`)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
3
19
  export declare class CCIPChainNotFoundError extends CCIPError {
4
20
  readonly name = "CCIPChainNotFoundError";
5
21
  /** Creates a chain not found error. */
6
22
  constructor(chainIdOrSelector: string | number | bigint, options?: CCIPErrorOptions);
7
23
  }
8
- /** Thrown when chain family is not supported. */
24
+ /**
25
+ * Thrown when chain family is not supported.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * try {
30
+ * const chain = await createChain('unsupported-family')
31
+ * } catch (error) {
32
+ * if (error instanceof CCIPChainFamilyUnsupportedError) {
33
+ * console.log(`Unsupported family: ${error.context.family}`)
34
+ * }
35
+ * }
36
+ * ```
37
+ */
9
38
  export declare class CCIPChainFamilyUnsupportedError extends CCIPError {
10
39
  readonly name = "CCIPChainFamilyUnsupportedError";
11
40
  /** Creates a chain family unsupported error. */
12
41
  constructor(family: string, options?: CCIPErrorOptions);
13
42
  }
14
- /** Thrown when some method/operation is not supported on a given implementation class. */
43
+ /**
44
+ * Thrown when a method or operation is not supported on a given implementation class.
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * try {
49
+ * await chain.someUnsupportedMethod()
50
+ * } catch (error) {
51
+ * if (error instanceof CCIPMethodUnsupportedError) {
52
+ * console.log(`Method not supported: ${error.context.class}.${error.context.method}`)
53
+ * }
54
+ * }
55
+ * ```
56
+ */
15
57
  export declare class CCIPMethodUnsupportedError extends CCIPError {
16
58
  readonly name = "CCIPMethodUnsupportedError";
17
59
  /** Creates a method unsupported error. */
18
60
  constructor(klass: string, method: string, options?: CCIPErrorOptions);
19
61
  }
20
- /** Thrown when block not found. Transient: block may not be indexed yet. */
62
+ /**
63
+ * Thrown when block not found. Transient: block may not be indexed yet.
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * try {
68
+ * const timestamp = await chain.getBlockTimestamp(999999999)
69
+ * } catch (error) {
70
+ * if (error instanceof CCIPBlockNotFoundError) {
71
+ * if (error.isTransient) {
72
+ * console.log(`Block not indexed yet, retry in ${error.retryAfterMs}ms`)
73
+ * }
74
+ * }
75
+ * }
76
+ * ```
77
+ */
21
78
  export declare class CCIPBlockNotFoundError extends CCIPError {
22
79
  readonly name = "CCIPBlockNotFoundError";
23
80
  /** Creates a block not found error. */
24
81
  constructor(block: number | bigint | string, options?: CCIPErrorOptions);
25
82
  }
26
- /** Thrown when transaction not found. Transient: tx may be pending. */
83
+ /**
84
+ * Thrown when transaction not found. Transient: tx may be pending.
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * try {
89
+ * const tx = await chain.getTransaction('0x1234...')
90
+ * } catch (error) {
91
+ * if (error instanceof CCIPTransactionNotFoundError) {
92
+ * if (error.isTransient) {
93
+ * await sleep(error.retryAfterMs ?? 5000)
94
+ * // Retry the operation
95
+ * }
96
+ * }
97
+ * }
98
+ * ```
99
+ */
27
100
  export declare class CCIPTransactionNotFoundError extends CCIPError {
28
101
  readonly name = "CCIPTransactionNotFoundError";
29
102
  /** Creates a transaction not found error. */
30
103
  constructor(hash: string, options?: CCIPErrorOptions);
31
104
  }
32
- /** Thrown when message format is invalid. */
105
+ /**
106
+ * Thrown when message format is invalid.
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * try {
111
+ * const message = EVMChain.decodeMessage(invalidLog)
112
+ * } catch (error) {
113
+ * if (error instanceof CCIPMessageInvalidError) {
114
+ * console.log(`Invalid message format: ${error.message}`)
115
+ * }
116
+ * }
117
+ * ```
118
+ */
33
119
  export declare class CCIPMessageInvalidError extends CCIPError {
34
120
  readonly name = "CCIPMessageInvalidError";
35
121
  /** Creates a message invalid error. */
36
122
  constructor(data: unknown, options?: CCIPErrorOptions);
37
123
  }
38
- /** Thrown when no CCIPSendRequested event in tx. Transient: tx may not be indexed. */
124
+ /**
125
+ * Thrown when no CCIPSendRequested event in tx. Transient: tx may not be indexed.
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * try {
130
+ * const messages = await chain.getMessagesInTx('0x1234...')
131
+ * } catch (error) {
132
+ * if (error instanceof CCIPMessageNotFoundInTxError) {
133
+ * if (error.isTransient) {
134
+ * console.log(`Message not indexed yet, retry in ${error.retryAfterMs}ms`)
135
+ * }
136
+ * }
137
+ * }
138
+ * ```
139
+ */
39
140
  export declare class CCIPMessageNotFoundInTxError extends CCIPError {
40
141
  readonly name = "CCIPMessageNotFoundInTxError";
41
142
  /** Creates a message not found in transaction error. */
42
143
  constructor(txHash: string, options?: CCIPErrorOptions);
43
144
  }
44
- /** Thrown when message with messageId not found. Transient: message may be in transit. */
145
+ /**
146
+ * Thrown when message with messageId not found. Transient: message may be in transit.
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * try {
151
+ * const request = await getMessageById(chain, messageId, onRamp)
152
+ * } catch (error) {
153
+ * if (error instanceof CCIPMessageIdNotFoundError) {
154
+ * if (error.isTransient) {
155
+ * console.log(`Message in transit, retry in ${error.retryAfterMs}ms`)
156
+ * }
157
+ * }
158
+ * }
159
+ * ```
160
+ */
45
161
  export declare class CCIPMessageIdNotFoundError extends CCIPError {
46
162
  readonly name = "CCIPMessageIdNotFoundError";
47
163
  /** Creates a message ID not found error. */
48
164
  constructor(messageId: string, options?: CCIPErrorOptions);
49
165
  }
50
- /** Thrown when messageId format is invalid. */
166
+ /**
167
+ * Thrown when messageId format is invalid.
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * try {
172
+ * const request = await chain.getMessageById('invalid-format')
173
+ * } catch (error) {
174
+ * if (error instanceof CCIPMessageIdValidationError) {
175
+ * console.log(`Invalid messageId: ${error.message}`)
176
+ * // Not transient - fix the messageId format
177
+ * }
178
+ * }
179
+ * ```
180
+ */
51
181
  export declare class CCIPMessageIdValidationError extends CCIPError {
52
182
  readonly name = "CCIPMessageIdValidationError";
53
183
  /** Creates a message ID validation error. */
54
184
  constructor(message: string, options?: CCIPErrorOptions);
55
185
  }
56
- /** Thrown when not all messages in batch were found. Transient: may still be indexing. */
186
+ /**
187
+ * Thrown when not all messages in batch were found. Transient: may still be indexing.
188
+ *
189
+ * @example
190
+ * ```typescript
191
+ * try {
192
+ * const messages = await getMessagesInBatch(chain, request, commit)
193
+ * } catch (error) {
194
+ * if (error instanceof CCIPMessageBatchIncompleteError) {
195
+ * console.log(`Found ${error.context.foundSeqNums.length} of expected range`)
196
+ * if (error.isTransient) {
197
+ * await sleep(error.retryAfterMs ?? 30000)
198
+ * }
199
+ * }
200
+ * }
201
+ * ```
202
+ */
57
203
  export declare class CCIPMessageBatchIncompleteError extends CCIPError {
58
204
  readonly name = "CCIPMessageBatchIncompleteError";
59
205
  /** Creates a message batch incomplete error. */
@@ -62,7 +208,20 @@ export declare class CCIPMessageBatchIncompleteError extends CCIPError {
62
208
  max: bigint;
63
209
  }, foundSeqNums: bigint[], options?: CCIPErrorOptions);
64
210
  }
65
- /** Thrown when message not in expected batch. */
211
+ /**
212
+ * Thrown when message not in expected batch.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * try {
217
+ * const proof = calculateManualExecProof(messages, lane, messageId)
218
+ * } catch (error) {
219
+ * if (error instanceof CCIPMessageNotInBatchError) {
220
+ * console.log(`Message ${error.context.messageId} not in batch range`)
221
+ * }
222
+ * }
223
+ * ```
224
+ */
66
225
  export declare class CCIPMessageNotInBatchError extends CCIPError {
67
226
  readonly name = "CCIPMessageNotInBatchError";
68
227
  /** Creates a message not in batch error. */
@@ -71,61 +230,195 @@ export declare class CCIPMessageNotInBatchError extends CCIPError {
71
230
  max: bigint;
72
231
  }, options?: CCIPErrorOptions);
73
232
  }
74
- /** Thrown when message retrieval fails via both API and RPC. */
233
+ /**
234
+ * Thrown when message retrieval fails via both API and RPC.
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * try {
239
+ * const request = await chain.getMessageById('0xabc123...')
240
+ * } catch (error) {
241
+ * if (error instanceof CCIPMessageRetrievalError) {
242
+ * console.log(`Failed to retrieve message: ${error.message}`)
243
+ * console.log(`Recovery: ${error.recovery}`)
244
+ * }
245
+ * }
246
+ * ```
247
+ */
75
248
  export declare class CCIPMessageRetrievalError extends CCIPError {
76
249
  readonly name = "CCIPMessageRetrievalError";
77
250
  /** Creates a message retrieval error with both API and RPC failure context. */
78
251
  constructor(messageId: string, apiError: CCIPError | undefined, rpcError: CCIPError | undefined, options?: CCIPErrorOptions);
79
252
  }
80
- /** Thrown when no offRamp found for lane. */
253
+ /**
254
+ * Thrown when no offRamp found for lane.
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * try {
259
+ * const offRamp = await discoverOffRamp(source, dest, request)
260
+ * } catch (error) {
261
+ * if (error instanceof CCIPOffRampNotFoundError) {
262
+ * console.log(`No offRamp for ${error.context.onRamp} on ${error.context.destNetwork}`)
263
+ * console.log(`Recovery: ${error.recovery}`)
264
+ * }
265
+ * }
266
+ * ```
267
+ */
81
268
  export declare class CCIPOffRampNotFoundError extends CCIPError {
82
269
  readonly name = "CCIPOffRampNotFoundError";
83
270
  /** Creates an offRamp not found error. */
84
271
  constructor(onRamp: string, destNetwork: string, options?: CCIPErrorOptions);
85
272
  }
86
- /** Thrown when onRamp required but not provided. */
273
+ /**
274
+ * Thrown when onRamp required but not provided.
275
+ *
276
+ * @example
277
+ * ```typescript
278
+ * try {
279
+ * const lane = await chain.getLaneForOnRamp(undefined)
280
+ * } catch (error) {
281
+ * if (error instanceof CCIPOnRampRequiredError) {
282
+ * console.log('onRamp address is required for this operation')
283
+ * }
284
+ * }
285
+ * ```
286
+ */
87
287
  export declare class CCIPOnRampRequiredError extends CCIPError {
88
288
  readonly name = "CCIPOnRampRequiredError";
89
289
  /** Creates an onRamp required error. */
90
290
  constructor(options?: CCIPErrorOptions);
91
291
  }
92
- /** Thrown when lane not found between source and destination chains. */
292
+ /**
293
+ * Thrown when lane not found between source and destination chains.
294
+ *
295
+ * @example
296
+ * ```typescript
297
+ * try {
298
+ * const lane = await discoverLane(sourceChainSelector, destChainSelector)
299
+ * } catch (error) {
300
+ * if (error instanceof CCIPLaneNotFoundError) {
301
+ * console.log(`No lane: ${error.context.sourceChainSelector} → ${error.context.destChainSelector}`)
302
+ * }
303
+ * }
304
+ * ```
305
+ */
93
306
  export declare class CCIPLaneNotFoundError extends CCIPError {
94
307
  readonly name = "CCIPLaneNotFoundError";
95
308
  /** Creates a lane not found error. */
96
309
  constructor(sourceChainSelector: bigint, destChainSelector: bigint, options?: CCIPErrorOptions);
97
310
  }
98
- /** Thrown when commit report not found. Transient: DON may not have committed yet. */
311
+ /**
312
+ * Thrown when commit report not found. Transient: DON may not have committed yet.
313
+ *
314
+ * @example
315
+ * ```typescript
316
+ * try {
317
+ * const verifications = await chain.getVerifications({ offRamp, request })
318
+ * } catch (error) {
319
+ * if (error instanceof CCIPCommitNotFoundError) {
320
+ * if (error.isTransient) {
321
+ * console.log(`Commit pending, retry in ${error.retryAfterMs}ms`)
322
+ * }
323
+ * }
324
+ * }
325
+ * ```
326
+ */
99
327
  export declare class CCIPCommitNotFoundError extends CCIPError {
100
328
  readonly name = "CCIPCommitNotFoundError";
101
329
  /** Creates a commit not found error. */
102
330
  constructor(startBlock: number | string, sequenceNumber: bigint, options?: CCIPErrorOptions);
103
331
  }
104
- /** Thrown when merkle root verification fails. */
332
+ /**
333
+ * Thrown when merkle root verification fails.
334
+ *
335
+ * @example
336
+ * ```typescript
337
+ * try {
338
+ * const proof = calculateManualExecProof(messages, lane, messageId, merkleRoot)
339
+ * } catch (error) {
340
+ * if (error instanceof CCIPMerkleRootMismatchError) {
341
+ * console.log(`Root mismatch: expected=${error.context.expected}, got=${error.context.got}`)
342
+ * }
343
+ * }
344
+ * ```
345
+ */
105
346
  export declare class CCIPMerkleRootMismatchError extends CCIPError {
106
347
  readonly name = "CCIPMerkleRootMismatchError";
107
348
  /** Creates a merkle root mismatch error. */
108
349
  constructor(expected: string, got: string, options?: CCIPErrorOptions);
109
350
  }
110
- /** Thrown when attempting to create tree without leaves. */
351
+ /**
352
+ * Thrown when attempting to create tree without leaves.
353
+ *
354
+ * @example
355
+ * ```typescript
356
+ * try {
357
+ * const root = createMerkleTree([])
358
+ * } catch (error) {
359
+ * if (error instanceof CCIPMerkleTreeEmptyError) {
360
+ * console.log('Cannot create merkle tree without messages')
361
+ * }
362
+ * }
363
+ * ```
364
+ */
111
365
  export declare class CCIPMerkleTreeEmptyError extends CCIPError {
112
366
  readonly name = "CCIPMerkleTreeEmptyError";
113
367
  /** Creates a merkle tree empty error. */
114
368
  constructor(options?: CCIPErrorOptions);
115
369
  }
116
- /** Thrown when CCIP version not supported. */
370
+ /**
371
+ * Thrown when CCIP version not supported.
372
+ *
373
+ * @example
374
+ * ```typescript
375
+ * try {
376
+ * const [type, version] = await chain.typeAndVersion(contractAddress)
377
+ * } catch (error) {
378
+ * if (error instanceof CCIPVersionUnsupportedError) {
379
+ * console.log(`Version ${error.context.version} not supported`)
380
+ * }
381
+ * }
382
+ * ```
383
+ */
117
384
  export declare class CCIPVersionUnsupportedError extends CCIPError {
118
385
  readonly name = "CCIPVersionUnsupportedError";
119
386
  /** Creates a version unsupported error. */
120
387
  constructor(version: string, options?: CCIPErrorOptions);
121
388
  }
122
- /** Thrown when hasher version not supported for chain. */
389
+ /**
390
+ * Thrown when hasher version not supported for chain.
391
+ *
392
+ * @example
393
+ * ```typescript
394
+ * try {
395
+ * const hasher = getLeafHasher(lane)
396
+ * } catch (error) {
397
+ * if (error instanceof CCIPHasherVersionUnsupportedError) {
398
+ * console.log(`Hasher not available for ${error.context.chain} v${error.context.version}`)
399
+ * }
400
+ * }
401
+ * ```
402
+ */
123
403
  export declare class CCIPHasherVersionUnsupportedError extends CCIPError {
124
404
  readonly name = "CCIPHasherVersionUnsupportedError";
125
405
  /** Creates a hasher version unsupported error. */
126
406
  constructor(chain: string, version: string, options?: CCIPErrorOptions);
127
407
  }
128
- /** Thrown when extraArgs cannot be parsed. */
408
+ /**
409
+ * Thrown when extraArgs cannot be parsed.
410
+ *
411
+ * @example
412
+ * ```typescript
413
+ * try {
414
+ * const args = decodeExtraArgs(invalidData)
415
+ * } catch (error) {
416
+ * if (error instanceof CCIPExtraArgsParseError) {
417
+ * console.log(`Cannot parse extraArgs: ${error.context.from}`)
418
+ * }
419
+ * }
420
+ * ```
421
+ */
129
422
  export declare class CCIPExtraArgsParseError extends CCIPError {
130
423
  readonly name = "CCIPExtraArgsParseError";
131
424
  /** Creates an extraArgs parse error. */
@@ -136,439 +429,1475 @@ export declare class CCIPExtraArgsParseError extends CCIPError {
136
429
  *
137
430
  * @param chainFamily - Display name for the chain family (user-facing, differs from ChainFamily enum)
138
431
  * @param extraArgs - The actual invalid extraArgs value (for debugging)
432
+ *
433
+ * @example
434
+ * ```typescript
435
+ * try {
436
+ * const encoded = encodeExtraArgs({ gasLimit: -1n }, 'EVM')
437
+ * } catch (error) {
438
+ * if (error instanceof CCIPExtraArgsInvalidError) {
439
+ * console.log(`Invalid extraArgs for ${error.context.chainFamily}`)
440
+ * }
441
+ * }
442
+ * ```
139
443
  */
140
444
  export declare class CCIPExtraArgsInvalidError extends CCIPError {
141
445
  readonly name = "CCIPExtraArgsInvalidError";
142
446
  /** Creates an extraArgs invalid error. */
143
447
  constructor(chainFamily: 'EVM' | 'SVM' | 'Sui' | 'Aptos' | 'TON', extraArgs?: string, options?: CCIPErrorOptions);
144
448
  }
145
- /** Thrown when token not found in registry. */
449
+ /**
450
+ * Thrown when token not found in registry.
451
+ *
452
+ * @example
453
+ * ```typescript
454
+ * try {
455
+ * const config = await chain.getRegistryTokenConfig(registry, tokenAddress)
456
+ * } catch (error) {
457
+ * if (error instanceof CCIPTokenNotInRegistryError) {
458
+ * console.log(`Token ${error.context.token} not in ${error.context.registry}`)
459
+ * }
460
+ * }
461
+ * ```
462
+ */
146
463
  export declare class CCIPTokenNotInRegistryError extends CCIPError {
147
464
  readonly name = "CCIPTokenNotInRegistryError";
148
465
  /** Creates a token not in registry error. */
149
466
  constructor(token: string, registry: string, options?: CCIPErrorOptions);
150
467
  }
151
- /** Thrown when token not configured in registry. */
468
+ /**
469
+ * Thrown when token not configured in registry.
470
+ *
471
+ * @example
472
+ * ```typescript
473
+ * try {
474
+ * const pool = await chain.getTokenPoolConfigs(tokenPool)
475
+ * } catch (error) {
476
+ * if (error instanceof CCIPTokenNotConfiguredError) {
477
+ * console.log(`Token ${error.context.token} not configured`)
478
+ * }
479
+ * }
480
+ * ```
481
+ */
152
482
  export declare class CCIPTokenNotConfiguredError extends CCIPError {
153
483
  readonly name = "CCIPTokenNotConfiguredError";
154
484
  /** Creates a token not configured error. */
155
485
  constructor(token: string, registry: string, options?: CCIPErrorOptions);
156
486
  }
157
- /** Thrown when destination token decimals insufficient. */
487
+ /**
488
+ * Thrown when destination token decimals insufficient.
489
+ *
490
+ * @example
491
+ * ```typescript
492
+ * try {
493
+ * const amounts = await sourceToDestTokenAmounts(source, dest, tokenAmounts)
494
+ * } catch (error) {
495
+ * if (error instanceof CCIPTokenDecimalsInsufficientError) {
496
+ * console.log(`Cannot express ${error.context.amount} with ${error.context.destDecimals} decimals`)
497
+ * }
498
+ * }
499
+ * ```
500
+ */
158
501
  export declare class CCIPTokenDecimalsInsufficientError extends CCIPError {
159
502
  readonly name = "CCIPTokenDecimalsInsufficientError";
160
503
  /** Creates a token decimals insufficient error. */
161
504
  constructor(token: string, destDecimals: number, destChain: string, amount: string, options?: CCIPErrorOptions);
162
505
  }
163
- /** Thrown when contract type is not as expected. */
506
+ /**
507
+ * Thrown when contract type is not as expected.
508
+ *
509
+ * @example
510
+ * ```typescript
511
+ * try {
512
+ * const router = await chain.getRouterForOnRamp(address)
513
+ * } catch (error) {
514
+ * if (error instanceof CCIPContractTypeInvalidError) {
515
+ * console.log(`${error.context.address} is "${error.context.actualType}", expected ${error.context.expectedTypes}`)
516
+ * }
517
+ * }
518
+ * ```
519
+ */
164
520
  export declare class CCIPContractTypeInvalidError extends CCIPError {
165
521
  readonly name = "CCIPContractTypeInvalidError";
166
522
  /** Creates a contract type invalid error. */
167
523
  constructor(address: string, actualType: string, expectedTypes: string[], options?: CCIPErrorOptions);
168
524
  }
169
- /** Thrown when wallet must be Signer but isn't. */
525
+ /**
526
+ * Thrown when wallet must be Signer but isn't.
527
+ *
528
+ * @example
529
+ * ```typescript
530
+ * try {
531
+ * await chain.sendMessage({ ...opts, wallet: provider })
532
+ * } catch (error) {
533
+ * if (error instanceof CCIPWalletNotSignerError) {
534
+ * console.log('Wallet must be a Signer to send transactions')
535
+ * }
536
+ * }
537
+ * ```
538
+ */
170
539
  export declare class CCIPWalletNotSignerError extends CCIPError {
171
540
  readonly name = "CCIPWalletNotSignerError";
172
541
  /** Creates a wallet not signer error. */
173
542
  constructor(wallet: unknown, options?: CCIPErrorOptions);
174
543
  }
175
- /** Thrown when exec tx not confirmed. Transient: may need more time. */
544
+ /**
545
+ * Thrown when exec tx not confirmed. Transient: may need more time.
546
+ *
547
+ * @example
548
+ * ```typescript
549
+ * try {
550
+ * await chain.execute({ offRamp, input, wallet })
551
+ * } catch (error) {
552
+ * if (error instanceof CCIPExecTxNotConfirmedError) {
553
+ * if (error.isTransient) {
554
+ * await sleep(error.retryAfterMs ?? 5000)
555
+ * }
556
+ * }
557
+ * }
558
+ * ```
559
+ */
176
560
  export declare class CCIPExecTxNotConfirmedError extends CCIPError {
177
561
  readonly name = "CCIPExecTxNotConfirmedError";
178
562
  /** Creates an exec transaction not confirmed error. */
179
563
  constructor(txHash: string, options?: CCIPErrorOptions);
180
564
  }
181
- /** Thrown when exec tx reverted. */
565
+ /**
566
+ * Thrown when exec tx reverted.
567
+ *
568
+ * @example
569
+ * ```typescript
570
+ * try {
571
+ * await chain.execute({ offRamp, input, wallet })
572
+ * } catch (error) {
573
+ * if (error instanceof CCIPExecTxRevertedError) {
574
+ * console.log(`Execution reverted: ${error.context.txHash}`)
575
+ * }
576
+ * }
577
+ * ```
578
+ */
182
579
  export declare class CCIPExecTxRevertedError extends CCIPError {
183
580
  readonly name = "CCIPExecTxRevertedError";
184
581
  /** Creates an exec transaction reverted error. */
185
582
  constructor(txHash: string, options?: CCIPErrorOptions);
186
583
  }
187
- /** Thrown when USDC attestation fetch fails. Transient: attestation may not be ready. */
584
+ /**
585
+ * Thrown when USDC attestation fetch fails. Transient: attestation may not be ready.
586
+ *
587
+ * @example
588
+ * ```typescript
589
+ * try {
590
+ * const offchainData = await chain.getOffchainTokenData(request)
591
+ * } catch (error) {
592
+ * if (error instanceof CCIPUsdcAttestationError) {
593
+ * if (error.isTransient) {
594
+ * console.log(`USDC attestation pending, retry in ${error.retryAfterMs}ms`)
595
+ * }
596
+ * }
597
+ * }
598
+ * ```
599
+ */
188
600
  export declare class CCIPUsdcAttestationError extends CCIPError {
189
601
  readonly name = "CCIPUsdcAttestationError";
190
602
  /** Creates a USDC attestation error. */
191
603
  constructor(messageHash: string, response: unknown, options?: CCIPErrorOptions);
192
604
  }
193
- /** Thrown when LBTC attestation fetch fails. Transient: attestation may not be ready. */
605
+ /**
606
+ * Thrown when LBTC attestation fetch fails. Transient: attestation may not be ready.
607
+ *
608
+ * @example
609
+ * ```typescript
610
+ * try {
611
+ * const offchainData = await chain.getOffchainTokenData(request)
612
+ * } catch (error) {
613
+ * if (error instanceof CCIPLbtcAttestationError) {
614
+ * if (error.isTransient) {
615
+ * console.log(`LBTC attestation pending, retry in ${error.retryAfterMs}ms`)
616
+ * }
617
+ * }
618
+ * }
619
+ * ```
620
+ */
194
621
  export declare class CCIPLbtcAttestationError extends CCIPError {
195
622
  readonly name = "CCIPLbtcAttestationError";
196
623
  /** Creates an LBTC attestation error. */
197
624
  constructor(response: unknown, options?: CCIPErrorOptions);
198
625
  }
199
- /** Thrown when LBTC attestation not found for payload hash. Transient: may not be processed yet. */
626
+ /**
627
+ * Thrown when LBTC attestation not found for payload hash. Transient: may not be processed yet.
628
+ *
629
+ * @example
630
+ * ```typescript
631
+ * try {
632
+ * const offchainData = await chain.getOffchainTokenData(request)
633
+ * } catch (error) {
634
+ * if (error instanceof CCIPLbtcAttestationNotFoundError) {
635
+ * console.log(`Attestation not found for hash: ${error.context.payloadHash}`)
636
+ * if (error.isTransient) {
637
+ * await sleep(error.retryAfterMs ?? 30000)
638
+ * }
639
+ * }
640
+ * }
641
+ * ```
642
+ */
200
643
  export declare class CCIPLbtcAttestationNotFoundError extends CCIPError {
201
644
  readonly name = "CCIPLbtcAttestationNotFoundError";
202
645
  /** Creates an LBTC attestation not found error. */
203
646
  constructor(payloadHash: string, response: unknown, options?: CCIPErrorOptions);
204
647
  }
205
- /** Thrown when LBTC attestation is not yet approved. Transient: may be pending notarization. */
648
+ /**
649
+ * Thrown when LBTC attestation is not yet approved. Transient: may be pending notarization.
650
+ *
651
+ * @example
652
+ * ```typescript
653
+ * try {
654
+ * const offchainData = await chain.getOffchainTokenData(request)
655
+ * } catch (error) {
656
+ * if (error instanceof CCIPLbtcAttestationNotApprovedError) {
657
+ * console.log(`Attestation pending approval for: ${error.context.payloadHash}`)
658
+ * if (error.isTransient) {
659
+ * await sleep(error.retryAfterMs ?? 30000)
660
+ * }
661
+ * }
662
+ * }
663
+ * ```
664
+ */
206
665
  export declare class CCIPLbtcAttestationNotApprovedError extends CCIPError {
207
666
  readonly name = "CCIPLbtcAttestationNotApprovedError";
208
667
  /** Creates an LBTC attestation not approved error. */
209
668
  constructor(payloadHash: string, attestation: unknown, options?: CCIPErrorOptions);
210
669
  }
211
- /** Thrown when lookup table not found. Transient: may not be synced yet. */
670
+ /**
671
+ * Thrown when lookup table not found. Transient: may not be synced yet.
672
+ *
673
+ * @example
674
+ * ```typescript
675
+ * try {
676
+ * const lookupTable = await solanaChain.getLookupTable(address)
677
+ * } catch (error) {
678
+ * if (error instanceof CCIPSolanaLookupTableNotFoundError) {
679
+ * if (error.isTransient) {
680
+ * console.log(`Lookup table not synced, retry in ${error.retryAfterMs}ms`)
681
+ * }
682
+ * }
683
+ * }
684
+ * ```
685
+ */
212
686
  export declare class CCIPSolanaLookupTableNotFoundError extends CCIPError {
213
687
  readonly name = "CCIPSolanaLookupTableNotFoundError";
214
688
  /** Creates a Solana lookup table not found error. */
215
689
  constructor(address: string, options?: CCIPErrorOptions);
216
690
  }
217
- /** Thrown for invalid Aptos transaction hash or version. */
691
+ /**
692
+ * Thrown for invalid Aptos transaction hash or version.
693
+ *
694
+ * @example
695
+ * ```typescript
696
+ * try {
697
+ * const tx = await aptosChain.getTransaction('invalid-hash')
698
+ * } catch (error) {
699
+ * if (error instanceof CCIPAptosTransactionInvalidError) {
700
+ * console.log(`Invalid tx: ${error.context.hashOrVersion}`)
701
+ * }
702
+ * }
703
+ * ```
704
+ */
218
705
  export declare class CCIPAptosTransactionInvalidError extends CCIPError {
219
706
  readonly name = "CCIPAptosTransactionInvalidError";
220
707
  /** Creates an Aptos transaction invalid error. */
221
708
  constructor(hashOrVersion: string | number, options?: CCIPErrorOptions);
222
709
  }
223
- /** Thrown for HTTP errors. Transient if 429 or 5xx. */
710
+ /**
711
+ * Thrown for HTTP errors. Transient if 429 or 5xx.
712
+ *
713
+ * @example
714
+ * ```typescript
715
+ * try {
716
+ * const latency = await chain.getLaneLatency(destChainSelector)
717
+ * } catch (error) {
718
+ * if (error instanceof CCIPHttpError) {
719
+ * console.log(`HTTP ${error.context.status}: ${error.context.statusText}`)
720
+ * if (error.isTransient) {
721
+ * // 429 or 5xx - safe to retry
722
+ * }
723
+ * }
724
+ * }
725
+ * ```
726
+ */
224
727
  export declare class CCIPHttpError extends CCIPError {
225
728
  readonly name = "CCIPHttpError";
226
729
  /** Creates an HTTP error. */
227
730
  constructor(status: number, statusText: string, options?: CCIPErrorOptions);
228
731
  }
229
- /** Thrown when a request times out. Transient: network may recover. */
732
+ /**
733
+ * Thrown when a request times out. Transient: network may recover.
734
+ *
735
+ * @example
736
+ * ```typescript
737
+ * try {
738
+ * const tx = await chain.getTransaction('0x1234...')
739
+ * } catch (error) {
740
+ * if (error instanceof CCIPTimeoutError) {
741
+ * console.log(`Operation timed out: ${error.context.operation}`)
742
+ * if (error.isTransient) {
743
+ * console.log(`Retry in ${error.retryAfterMs}ms`)
744
+ * }
745
+ * }
746
+ * }
747
+ * ```
748
+ */
230
749
  export declare class CCIPTimeoutError extends CCIPError {
231
750
  readonly name = "CCIPTimeoutError";
232
751
  /** Creates a timeout error. */
233
752
  constructor(operation: string, timeoutMs: number, options?: CCIPErrorOptions);
234
753
  }
235
- /** Thrown for not implemented features. */
754
+ /**
755
+ * Thrown for not implemented features.
756
+ *
757
+ * @example
758
+ * ```typescript
759
+ * try {
760
+ * await chain.someUnimplementedMethod()
761
+ * } catch (error) {
762
+ * if (error instanceof CCIPNotImplementedError) {
763
+ * console.log(`Feature not implemented: ${error.context.feature}`)
764
+ * }
765
+ * }
766
+ * ```
767
+ */
236
768
  export declare class CCIPNotImplementedError extends CCIPError {
237
769
  readonly name = "CCIPNotImplementedError";
238
770
  /** Creates a not implemented error. */
239
771
  constructor(feature?: string, options?: CCIPErrorOptions);
240
772
  }
241
- /** Thrown when data format is not supported. */
773
+ /**
774
+ * Thrown when data format is not supported.
775
+ *
776
+ * @example
777
+ * ```typescript
778
+ * try {
779
+ * const parsed = parseData(unknownFormat)
780
+ * } catch (error) {
781
+ * if (error instanceof CCIPDataFormatUnsupportedError) {
782
+ * console.log(`Unsupported format: ${error.context.data}`)
783
+ * }
784
+ * }
785
+ * ```
786
+ */
242
787
  export declare class CCIPDataFormatUnsupportedError extends CCIPError {
243
788
  readonly name = "CCIPDataFormatUnsupportedError";
244
789
  /** Creates a data format unsupported error. */
245
790
  constructor(data: unknown, options?: CCIPErrorOptions);
246
791
  }
247
- /** Thrown when typeAndVersion string cannot be parsed. */
792
+ /**
793
+ * Thrown when typeAndVersion string cannot be parsed.
794
+ *
795
+ * @example
796
+ * ```typescript
797
+ * try {
798
+ * const [type, version] = await chain.typeAndVersion(contractAddress)
799
+ * } catch (error) {
800
+ * if (error instanceof CCIPTypeVersionInvalidError) {
801
+ * console.log(`Cannot parse: ${error.context.typeAndVersion}`)
802
+ * }
803
+ * }
804
+ * ```
805
+ */
248
806
  export declare class CCIPTypeVersionInvalidError extends CCIPError {
249
807
  readonly name = "CCIPTypeVersionInvalidError";
250
808
  /** Creates a type version invalid error. */
251
809
  constructor(typeAndVersion: string, options?: CCIPErrorOptions);
252
810
  }
253
- /** Thrown when no block found before timestamp. */
811
+ /**
812
+ * Thrown when no block found before timestamp.
813
+ *
814
+ * @example
815
+ * ```typescript
816
+ * try {
817
+ * const block = await chain.getBlockBeforeTimestamp(timestamp)
818
+ * } catch (error) {
819
+ * if (error instanceof CCIPBlockBeforeTimestampNotFoundError) {
820
+ * console.log(`No block before timestamp: ${error.context.timestamp}`)
821
+ * }
822
+ * }
823
+ * ```
824
+ */
254
825
  export declare class CCIPBlockBeforeTimestampNotFoundError extends CCIPError {
255
826
  readonly name = "CCIPBlockBeforeTimestampNotFoundError";
256
827
  /** Creates a block before timestamp not found error. */
257
828
  constructor(timestamp: number, options?: CCIPErrorOptions);
258
829
  }
259
- /** Thrown when message decoding fails. */
830
+ /**
831
+ * Thrown when message decoding fails.
832
+ *
833
+ * @example
834
+ * ```typescript
835
+ * try {
836
+ * const message = EVMChain.decodeMessage(log)
837
+ * } catch (error) {
838
+ * if (error instanceof CCIPMessageDecodeError) {
839
+ * console.log(`Decode failed: ${error.context.reason}`)
840
+ * }
841
+ * }
842
+ * ```
843
+ */
260
844
  export declare class CCIPMessageDecodeError extends CCIPError {
261
845
  readonly name = "CCIPMessageDecodeError";
262
846
  /** Creates a message decode error. */
263
847
  constructor(reason?: string, options?: CCIPErrorOptions);
264
848
  }
265
- /** Thrown when RPC endpoint not found. */
849
+ /**
850
+ * Thrown when network family is not supported for an operation.
851
+ *
852
+ * @example
853
+ * ```typescript
854
+ * try {
855
+ * const chain = await Chain.fromUrl(rpcUrl)
856
+ * } catch (error) {
857
+ * if (error instanceof CCIPNetworkFamilyUnsupportedError) {
858
+ * console.log(`Unsupported family: ${error.context.family}`)
859
+ * }
860
+ * }
861
+ * ```
862
+ */
863
+ export declare class CCIPNetworkFamilyUnsupportedError extends CCIPError {
864
+ readonly name = "CCIPNetworkFamilyUnsupportedError";
865
+ /** Creates a network family unsupported error. */
866
+ constructor(family: string, options?: CCIPErrorOptions);
867
+ }
868
+ /**
869
+ * Thrown when RPC endpoint not found.
870
+ *
871
+ * @example
872
+ * ```typescript
873
+ * try {
874
+ * const chain = await EVMChain.fromUrl(rpcUrl)
875
+ * } catch (error) {
876
+ * if (error instanceof CCIPRpcNotFoundError) {
877
+ * console.log(`No RPC for chainId: ${error.context.chainId}`)
878
+ * }
879
+ * }
880
+ * ```
881
+ */
266
882
  export declare class CCIPRpcNotFoundError extends CCIPError {
267
883
  readonly name = "CCIPRpcNotFoundError";
268
884
  /** Creates an RPC not found error. */
269
885
  constructor(chainId: string | number, options?: CCIPErrorOptions);
270
886
  }
271
- /** Thrown when logs not found for filter criteria. */
887
+ /**
888
+ * Thrown when logs not found for filter criteria. Transient: logs may not be indexed yet.
889
+ *
890
+ * @example
891
+ * ```typescript
892
+ * try {
893
+ * const logs = await chain.getLogs(filter)
894
+ * } catch (error) {
895
+ * if (error instanceof CCIPLogsNotFoundError) {
896
+ * if (error.isTransient) {
897
+ * await sleep(error.retryAfterMs ?? 5000)
898
+ * }
899
+ * }
900
+ * }
901
+ * ```
902
+ */
272
903
  export declare class CCIPLogsNotFoundError extends CCIPError {
273
904
  readonly name = "CCIPLogsNotFoundError";
274
905
  /** Creates a logs not found error. */
275
906
  constructor(filter?: unknown, options?: CCIPErrorOptions);
276
907
  }
277
- /** Thrown when log topics not found. */
908
+ /**
909
+ * Thrown when log topics not found.
910
+ *
911
+ * @example
912
+ * ```typescript
913
+ * try {
914
+ * const logs = await chain.getLogs({ topics: ['0xunknown'] })
915
+ * } catch (error) {
916
+ * if (error instanceof CCIPLogTopicsNotFoundError) {
917
+ * console.log(`Topics not matched: ${error.context.topics}`)
918
+ * }
919
+ * }
920
+ * ```
921
+ */
278
922
  export declare class CCIPLogTopicsNotFoundError extends CCIPError {
279
923
  readonly name = "CCIPLogTopicsNotFoundError";
280
924
  /** Creates a log topics not found error. */
281
925
  constructor(topics: unknown, options?: CCIPErrorOptions);
282
926
  }
283
- /** Thrown when trying to `watch` logs but giving a fixed `endBlock` */
927
+ /**
928
+ * Thrown when trying to `watch` logs but giving a fixed `endBlock`.
929
+ *
930
+ * @example
931
+ * ```typescript
932
+ * try {
933
+ * await chain.watchLogs({ endBlock: 1000 }) // Fixed endBlock not allowed
934
+ * } catch (error) {
935
+ * if (error instanceof CCIPLogsWatchRequiresFinalityError) {
936
+ * console.log('Use "latest" or "finalized" for endBlock in watch mode')
937
+ * }
938
+ * }
939
+ * ```
940
+ */
284
941
  export declare class CCIPLogsWatchRequiresFinalityError extends CCIPError {
285
942
  readonly name = "CCIPLogsWatchRequiresFinalityError";
286
- /** Creates a watch requires finality error. */
943
+ /** Creates a logs watch requires finality error. */
287
944
  constructor(endBlock?: number | string, options?: CCIPErrorOptions);
288
945
  }
289
- /** Thrown when trying to `watch` logs without a start point. */
946
+ /**
947
+ * Thrown when trying to `watch` logs but no start position provided.
948
+ *
949
+ * @example
950
+ * ```typescript
951
+ * try {
952
+ * await chain.watchLogs({}) // Missing startBlock or startTime
953
+ * } catch (error) {
954
+ * if (error instanceof CCIPLogsWatchRequiresStartError) {
955
+ * console.log('Provide startBlock or startTime for watch mode')
956
+ * }
957
+ * }
958
+ * ```
959
+ */
290
960
  export declare class CCIPLogsWatchRequiresStartError extends CCIPError {
291
961
  readonly name = "CCIPLogsWatchRequiresStartError";
292
- /** Creates a watch requires start error. */
962
+ /** Creates a logs watch requires start error. */
293
963
  constructor(options?: CCIPErrorOptions);
294
964
  }
295
- /** Thrown when address is required for logs filtering, but not provided. */
965
+ /**
966
+ * Thrown when address is required for logs filtering, but not provided.
967
+ *
968
+ * @example
969
+ * ```typescript
970
+ * try {
971
+ * await chain.getLogs({ topics: [...] }) // Missing address
972
+ * } catch (error) {
973
+ * if (error instanceof CCIPLogsAddressRequiredError) {
974
+ * console.log('Contract address is required for this chain')
975
+ * }
976
+ * }
977
+ * ```
978
+ */
296
979
  export declare class CCIPLogsAddressRequiredError extends CCIPError {
297
980
  readonly name = "CCIPLogsAddressRequiredError";
298
981
  /** Creates a Solana program address required error. */
299
982
  constructor(options?: CCIPErrorOptions);
300
983
  }
301
- /** Thrown when network family does not match expected for a Chain constructor. */
984
+ /**
985
+ * Thrown when network family does not match expected for a Chain constructor.
986
+ *
987
+ * @example
988
+ * ```typescript
989
+ * try {
990
+ * const chain = new EVMChain(provider, solanaNetworkInfo) // Wrong family
991
+ * } catch (error) {
992
+ * if (error instanceof CCIPChainFamilyMismatchError) {
993
+ * console.log(`Expected ${error.context.expected}, got ${error.context.actual}`)
994
+ * }
995
+ * }
996
+ * ```
997
+ */
302
998
  export declare class CCIPChainFamilyMismatchError extends CCIPError {
303
999
  readonly name = "CCIPChainFamilyMismatchError";
304
1000
  /** Creates a chain family mismatch error. */
305
1001
  constructor(chainName: string, expected: string, actual: string, options?: CCIPErrorOptions);
306
1002
  }
307
- /** Thrown when merkle proof is empty. */
1003
+ /**
1004
+ * Thrown when legacy (pre-1.5) token pools are not supported.
1005
+ *
1006
+ * @example
1007
+ * ```typescript
1008
+ * try {
1009
+ * await chain.getTokenPoolConfigs(legacyPool)
1010
+ * } catch (error) {
1011
+ * if (error instanceof CCIPLegacyTokenPoolsUnsupportedError) {
1012
+ * console.log('Upgrade to CCIP v1.5+ token pools')
1013
+ * }
1014
+ * }
1015
+ * ```
1016
+ */
1017
+ export declare class CCIPLegacyTokenPoolsUnsupportedError extends CCIPError {
1018
+ readonly name = "CCIPLegacyTokenPoolsUnsupportedError";
1019
+ /** Creates a legacy token pools unsupported error. */
1020
+ constructor(options?: CCIPErrorOptions);
1021
+ }
1022
+ /**
1023
+ * Thrown when merkle proof is empty.
1024
+ *
1025
+ * @example
1026
+ * ```typescript
1027
+ * try {
1028
+ * verifyMerkleProof({ leaves: [], proofs: [] })
1029
+ * } catch (error) {
1030
+ * if (error instanceof CCIPMerkleProofEmptyError) {
1031
+ * console.log('Cannot verify empty merkle proof')
1032
+ * }
1033
+ * }
1034
+ * ```
1035
+ */
308
1036
  export declare class CCIPMerkleProofEmptyError extends CCIPError {
309
1037
  readonly name = "CCIPMerkleProofEmptyError";
310
1038
  /** Creates a merkle proof empty error. */
311
1039
  constructor(options?: CCIPErrorOptions);
312
1040
  }
313
- /** Thrown when merkle leaves or proofs exceed max limit. */
1041
+ /**
1042
+ * Thrown when merkle leaves or proofs exceed max limit.
1043
+ *
1044
+ * @example
1045
+ * ```typescript
1046
+ * try {
1047
+ * verifyMerkleProof({ leaves: largeArray, proofs })
1048
+ * } catch (error) {
1049
+ * if (error instanceof CCIPMerkleProofTooLargeError) {
1050
+ * console.log(`Proof exceeds limit: ${error.context.limit}`)
1051
+ * }
1052
+ * }
1053
+ * ```
1054
+ */
314
1055
  export declare class CCIPMerkleProofTooLargeError extends CCIPError {
315
1056
  readonly name = "CCIPMerkleProofTooLargeError";
316
1057
  /** Creates a merkle proof too large error. */
317
1058
  constructor(limit: number, options?: CCIPErrorOptions);
318
1059
  }
319
- /** Thrown when total hashes exceed max merkle tree size. */
1060
+ /**
1061
+ * Thrown when total hashes exceed max merkle tree size.
1062
+ *
1063
+ * @example
1064
+ * ```typescript
1065
+ * try {
1066
+ * createMerkleTree(hashes)
1067
+ * } catch (error) {
1068
+ * if (error instanceof CCIPMerkleHashesTooLargeError) {
1069
+ * console.log(`${error.context.totalHashes} exceeds limit ${error.context.limit}`)
1070
+ * }
1071
+ * }
1072
+ * ```
1073
+ */
320
1074
  export declare class CCIPMerkleHashesTooLargeError extends CCIPError {
321
1075
  readonly name = "CCIPMerkleHashesTooLargeError";
322
1076
  /** Creates a merkle hashes too large error. */
323
1077
  constructor(totalHashes: number, limit: number, options?: CCIPErrorOptions);
324
1078
  }
325
- /** Thrown when source flags count does not match expected total. */
1079
+ /**
1080
+ * Thrown when source flags count does not match expected total.
1081
+ *
1082
+ * @example
1083
+ * ```typescript
1084
+ * try {
1085
+ * verifyMerkleProof({ hashes, sourceFlags })
1086
+ * } catch (error) {
1087
+ * if (error instanceof CCIPMerkleFlagsMismatchError) {
1088
+ * console.log(`Hashes: ${error.context.totalHashes}, Flags: ${error.context.flagsLength}`)
1089
+ * }
1090
+ * }
1091
+ * ```
1092
+ */
326
1093
  export declare class CCIPMerkleFlagsMismatchError extends CCIPError {
327
1094
  readonly name = "CCIPMerkleFlagsMismatchError";
328
1095
  /** Creates a merkle flags mismatch error. */
329
1096
  constructor(totalHashes: number, flagsLength: number, options?: CCIPErrorOptions);
330
1097
  }
331
- /** Thrown when proof source flags count does not match proof hashes. */
1098
+ /**
1099
+ * Thrown when proof source flags count does not match proof hashes.
1100
+ *
1101
+ * @example
1102
+ * ```typescript
1103
+ * try {
1104
+ * verifyMerkleProof({ sourceFlags, proofs })
1105
+ * } catch (error) {
1106
+ * if (error instanceof CCIPMerkleProofFlagsMismatchError) {
1107
+ * console.log(`Flags: ${error.context.sourceProofCount}, Proofs: ${error.context.proofsLength}`)
1108
+ * }
1109
+ * }
1110
+ * ```
1111
+ */
332
1112
  export declare class CCIPMerkleProofFlagsMismatchError extends CCIPError {
333
1113
  readonly name = "CCIPMerkleProofFlagsMismatchError";
334
1114
  /** Creates a merkle proof flags mismatch error. */
335
1115
  constructor(sourceProofCount: number, proofsLength: number, options?: CCIPErrorOptions);
336
1116
  }
337
- /** Thrown when not all proofs were consumed during verification. */
1117
+ /**
1118
+ * Thrown when not all proofs were consumed during verification.
1119
+ *
1120
+ * @example
1121
+ * ```typescript
1122
+ * try {
1123
+ * verifyMerkleProof({ leaves, proofs, root })
1124
+ * } catch (error) {
1125
+ * if (error instanceof CCIPMerkleProofIncompleteError) {
1126
+ * console.log('Merkle proof verification incomplete')
1127
+ * }
1128
+ * }
1129
+ * ```
1130
+ */
338
1131
  export declare class CCIPMerkleProofIncompleteError extends CCIPError {
339
1132
  readonly name = "CCIPMerkleProofIncompleteError";
340
1133
  /** Creates a merkle proof incomplete error. */
341
1134
  constructor(options?: CCIPErrorOptions);
342
1135
  }
343
- /** Thrown on internal merkle computation error. */
1136
+ /**
1137
+ * Thrown on internal merkle computation error.
1138
+ *
1139
+ * @example
1140
+ * ```typescript
1141
+ * try {
1142
+ * computeMerkleRoot(hashes)
1143
+ * } catch (error) {
1144
+ * if (error instanceof CCIPMerkleInternalError) {
1145
+ * console.log(`Internal merkle error: ${error.message}`)
1146
+ * }
1147
+ * }
1148
+ * ```
1149
+ */
344
1150
  export declare class CCIPMerkleInternalError extends CCIPError {
345
1151
  readonly name = "CCIPMerkleInternalError";
346
1152
  /** Creates a merkle internal error. */
347
1153
  constructor(message: string, options?: CCIPErrorOptions);
348
1154
  }
349
- /** Thrown when EVM address is invalid. */
1155
+ /**
1156
+ * Thrown when EVM address is invalid.
1157
+ *
1158
+ * @example
1159
+ * ```typescript
1160
+ * try {
1161
+ * EVMChain.getAddress('not-an-address')
1162
+ * } catch (error) {
1163
+ * if (error instanceof CCIPAddressInvalidEvmError) {
1164
+ * console.log(`Invalid address: ${error.context.address}`)
1165
+ * }
1166
+ * }
1167
+ * ```
1168
+ */
350
1169
  export declare class CCIPAddressInvalidEvmError extends CCIPError {
351
1170
  readonly name = "CCIPAddressInvalidEvmError";
352
1171
  /** Creates an EVM address invalid error. */
353
1172
  constructor(address: string, options?: CCIPErrorOptions);
354
1173
  }
355
- /** Thrown when CCIP version requires lane info. */
1174
+ /**
1175
+ * Thrown when CCIP version requires lane info.
1176
+ *
1177
+ * @example
1178
+ * ```typescript
1179
+ * try {
1180
+ * EVMChain.decodeCommits(log) // Missing lane for v1.6
1181
+ * } catch (error) {
1182
+ * if (error instanceof CCIPVersionRequiresLaneError) {
1183
+ * console.log(`Version ${error.context.version} requires lane parameter`)
1184
+ * }
1185
+ * }
1186
+ * ```
1187
+ */
356
1188
  export declare class CCIPVersionRequiresLaneError extends CCIPError {
357
1189
  readonly name = "CCIPVersionRequiresLaneError";
358
1190
  /** Creates a version requires lane error. */
359
1191
  constructor(version: string, options?: CCIPErrorOptions);
360
1192
  }
361
- /** Thrown when version feature is unavailable. */
1193
+ /**
1194
+ * Thrown when version feature is unavailable.
1195
+ *
1196
+ * @example
1197
+ * ```typescript
1198
+ * try {
1199
+ * await chain.getFeature(oldVersion)
1200
+ * } catch (error) {
1201
+ * if (error instanceof CCIPVersionFeatureUnavailableError) {
1202
+ * console.log(`${error.context.feature} requires v${error.context.minVersion}+`)
1203
+ * }
1204
+ * }
1205
+ * ```
1206
+ */
362
1207
  export declare class CCIPVersionFeatureUnavailableError extends CCIPError {
363
1208
  readonly name = "CCIPVersionFeatureUnavailableError";
364
1209
  /** Creates a version feature unavailable error. */
365
1210
  constructor(feature: string, version: string, minVersion?: string, options?: CCIPErrorOptions);
366
1211
  }
367
- /** Thrown when contract is not a Router or expected CCIP contract. */
1212
+ /**
1213
+ * Thrown when contract is not a Router or expected CCIP contract.
1214
+ *
1215
+ * @example
1216
+ * ```typescript
1217
+ * try {
1218
+ * await chain.getRouterForOnRamp(address)
1219
+ * } catch (error) {
1220
+ * if (error instanceof CCIPContractNotRouterError) {
1221
+ * console.log(`${error.context.address} is "${error.context.typeAndVersion}"`)
1222
+ * }
1223
+ * }
1224
+ * ```
1225
+ */
368
1226
  export declare class CCIPContractNotRouterError extends CCIPError {
369
1227
  readonly name = "CCIPContractNotRouterError";
370
1228
  /** Creates a contract not router error. */
371
1229
  constructor(address: string, typeAndVersion: string, options?: CCIPErrorOptions);
372
1230
  }
373
- /** Thrown when log data is invalid. */
1231
+ /**
1232
+ * Thrown when log data is invalid.
1233
+ *
1234
+ * @example
1235
+ * ```typescript
1236
+ * try {
1237
+ * const message = EVMChain.decodeMessage(log)
1238
+ * } catch (error) {
1239
+ * if (error instanceof CCIPLogDataInvalidError) {
1240
+ * console.log(`Invalid log data: ${error.context.data}`)
1241
+ * }
1242
+ * }
1243
+ * ```
1244
+ */
374
1245
  export declare class CCIPLogDataInvalidError extends CCIPError {
375
1246
  readonly name = "CCIPLogDataInvalidError";
376
1247
  /** Creates a log data invalid error. */
377
1248
  constructor(data: unknown, options?: CCIPErrorOptions);
378
1249
  }
379
- /** Thrown when wallet is not a valid signer. */
1250
+ /**
1251
+ * Thrown when wallet is not a valid signer.
1252
+ *
1253
+ * @example
1254
+ * ```typescript
1255
+ * try {
1256
+ * await chain.sendMessage({ ...opts, wallet: invalidWallet })
1257
+ * } catch (error) {
1258
+ * if (error instanceof CCIPWalletInvalidError) {
1259
+ * console.log('Provide a valid signer wallet')
1260
+ * }
1261
+ * }
1262
+ * ```
1263
+ */
380
1264
  export declare class CCIPWalletInvalidError extends CCIPError {
381
1265
  readonly name = "CCIPWalletInvalidError";
382
1266
  /** Creates a wallet invalid error. */
383
1267
  constructor(wallet: unknown, options?: CCIPErrorOptions);
384
1268
  }
385
- /** Thrown when source chain is unsupported for EVM hasher. */
1269
+ /**
1270
+ * Thrown when source chain is unsupported for EVM hasher.
1271
+ *
1272
+ * @example
1273
+ * ```typescript
1274
+ * try {
1275
+ * const hasher = chain.getDestLeafHasher(lane)
1276
+ * } catch (error) {
1277
+ * if (error instanceof CCIPSourceChainUnsupportedError) {
1278
+ * console.log(`Unsupported source: ${error.context.chainSelector}`)
1279
+ * }
1280
+ * }
1281
+ * ```
1282
+ */
386
1283
  export declare class CCIPSourceChainUnsupportedError extends CCIPError {
387
1284
  readonly name = "CCIPSourceChainUnsupportedError";
388
1285
  /** Creates a source chain unsupported error. */
389
1286
  constructor(chainSelector: bigint, options?: CCIPErrorOptions);
390
1287
  }
391
- /** Thrown when block time cannot be retrieved for a slot. */
1288
+ /**
1289
+ * Thrown when block time cannot be retrieved for a slot. Transient: slot may not be indexed.
1290
+ *
1291
+ * @example
1292
+ * ```typescript
1293
+ * try {
1294
+ * const timestamp = await solanaChain.getBlockTimestamp(slot)
1295
+ * } catch (error) {
1296
+ * if (error instanceof CCIPBlockTimeNotFoundError) {
1297
+ * if (error.isTransient) {
1298
+ * await sleep(error.retryAfterMs ?? 5000)
1299
+ * }
1300
+ * }
1301
+ * }
1302
+ * ```
1303
+ */
392
1304
  export declare class CCIPBlockTimeNotFoundError extends CCIPError {
393
1305
  readonly name = "CCIPBlockTimeNotFoundError";
394
1306
  /** Creates a block time not found error. */
395
1307
  constructor(block: number | string, options?: CCIPErrorOptions);
396
1308
  }
397
- /** Thrown when topics are not valid strings. */
1309
+ /**
1310
+ * Thrown when topics are not valid strings.
1311
+ *
1312
+ * @example
1313
+ * ```typescript
1314
+ * try {
1315
+ * await chain.getLogs({ topics: [123] }) // Invalid topic type
1316
+ * } catch (error) {
1317
+ * if (error instanceof CCIPTopicsInvalidError) {
1318
+ * console.log('Topics must be string values')
1319
+ * }
1320
+ * }
1321
+ * ```
1322
+ */
398
1323
  export declare class CCIPTopicsInvalidError extends CCIPError {
399
1324
  readonly name = "CCIPTopicsInvalidError";
400
1325
  /** Creates a Solana topics invalid error. */
401
1326
  constructor(topics: unknown[], options?: CCIPErrorOptions);
402
1327
  }
403
- /** Thrown when reference addresses account not found for offRamp. */
1328
+ /**
1329
+ * Thrown when reference addresses account not found for offRamp. Transient: may not be synced.
1330
+ *
1331
+ * @example
1332
+ * ```typescript
1333
+ * try {
1334
+ * await solanaChain.getOffRampForRouter(router)
1335
+ * } catch (error) {
1336
+ * if (error instanceof CCIPSolanaRefAddressesNotFoundError) {
1337
+ * if (error.isTransient) {
1338
+ * await sleep(error.retryAfterMs ?? 5000)
1339
+ * }
1340
+ * }
1341
+ * }
1342
+ * ```
1343
+ */
404
1344
  export declare class CCIPSolanaRefAddressesNotFoundError extends CCIPError {
405
1345
  readonly name = "CCIPSolanaRefAddressesNotFoundError";
406
1346
  /** Creates a reference addresses not found error. */
407
1347
  constructor(offRamp: string, options?: CCIPErrorOptions);
408
1348
  }
409
- /** Thrown when OffRamp events not found in feeQuoter transactions. */
1349
+ /**
1350
+ * Thrown when OffRamp events not found in feeQuoter transactions. Transient: events may not be indexed.
1351
+ *
1352
+ * @example
1353
+ * ```typescript
1354
+ * try {
1355
+ * await solanaChain.getOffRampsForRouter(router)
1356
+ * } catch (error) {
1357
+ * if (error instanceof CCIPSolanaOffRampEventsNotFoundError) {
1358
+ * if (error.isTransient) {
1359
+ * await sleep(error.retryAfterMs ?? 10000)
1360
+ * }
1361
+ * }
1362
+ * }
1363
+ * ```
1364
+ */
410
1365
  export declare class CCIPSolanaOffRampEventsNotFoundError extends CCIPError {
411
1366
  readonly name = "CCIPSolanaOffRampEventsNotFoundError";
412
1367
  /** Creates an offRamp events not found error. */
413
1368
  constructor(feeQuoter: string, options?: CCIPErrorOptions);
414
1369
  }
415
- /** Thrown when token pool info not found. */
1370
+ /**
1371
+ * Thrown when token pool info not found.
1372
+ *
1373
+ * @example
1374
+ * ```typescript
1375
+ * try {
1376
+ * await chain.getTokenPoolConfigs(tokenPool)
1377
+ * } catch (error) {
1378
+ * if (error instanceof CCIPTokenPoolInfoNotFoundError) {
1379
+ * console.log(`TokenPool not found: ${error.context.tokenPool}`)
1380
+ * }
1381
+ * }
1382
+ * ```
1383
+ */
416
1384
  export declare class CCIPTokenPoolInfoNotFoundError extends CCIPError {
417
1385
  readonly name = "CCIPTokenPoolInfoNotFoundError";
418
1386
  /** Creates a token pool info not found error. */
419
1387
  constructor(tokenPool: string, options?: CCIPErrorOptions);
420
1388
  }
421
- /** Thrown when SPL token is invalid or not Token-2022. */
1389
+ /**
1390
+ * Thrown when SPL token is invalid or not Token-2022.
1391
+ *
1392
+ * @example
1393
+ * ```typescript
1394
+ * try {
1395
+ * await solanaChain.getTokenInfo(tokenAddress)
1396
+ * } catch (error) {
1397
+ * if (error instanceof CCIPSplTokenInvalidError) {
1398
+ * console.log(`Invalid SPL token: ${error.context.token}`)
1399
+ * }
1400
+ * }
1401
+ * ```
1402
+ */
422
1403
  export declare class CCIPSplTokenInvalidError extends CCIPError {
423
1404
  readonly name = "CCIPSplTokenInvalidError";
424
1405
  /** Creates an SPL token invalid error. */
425
1406
  constructor(token: string, options?: CCIPErrorOptions);
426
1407
  }
427
- /** Thrown when token data cannot be parsed. */
1408
+ /**
1409
+ * Thrown when token data cannot be parsed.
1410
+ *
1411
+ * @example
1412
+ * ```typescript
1413
+ * try {
1414
+ * await chain.getTokenInfo(tokenAddress)
1415
+ * } catch (error) {
1416
+ * if (error instanceof CCIPTokenDataParseError) {
1417
+ * console.log(`Cannot parse token: ${error.context.token}`)
1418
+ * }
1419
+ * }
1420
+ * ```
1421
+ */
428
1422
  export declare class CCIPTokenDataParseError extends CCIPError {
429
1423
  readonly name = "CCIPTokenDataParseError";
430
1424
  /** Creates a token data parse error. */
431
1425
  constructor(token: string, options?: CCIPErrorOptions);
432
1426
  }
433
- /** Thrown when EVMExtraArgsV2 has unsupported length. */
1427
+ /**
1428
+ * Thrown when EVMExtraArgsV2 has unsupported length.
1429
+ *
1430
+ * @example
1431
+ * ```typescript
1432
+ * try {
1433
+ * SolanaChain.decodeExtraArgs(data)
1434
+ * } catch (error) {
1435
+ * if (error instanceof CCIPExtraArgsLengthInvalidError) {
1436
+ * console.log(`Unsupported length: ${error.context.length}`)
1437
+ * }
1438
+ * }
1439
+ * ```
1440
+ */
434
1441
  export declare class CCIPExtraArgsLengthInvalidError extends CCIPError {
435
1442
  readonly name = "CCIPExtraArgsLengthInvalidError";
436
1443
  /** Creates an extraArgs length invalid error. */
437
1444
  constructor(length: number, options?: CCIPErrorOptions);
438
1445
  }
439
- /** Thrown when Solana can only encode EVMExtraArgsV2 but got different args. */
1446
+ /**
1447
+ * Thrown when Solana can only encode EVMExtraArgsV2 but got different args.
1448
+ *
1449
+ * @example
1450
+ * ```typescript
1451
+ * try {
1452
+ * SolanaChain.encodeExtraArgs(unsupportedArgs)
1453
+ * } catch (error) {
1454
+ * if (error instanceof CCIPSolanaExtraArgsEncodingError) {
1455
+ * console.log('Use EVMExtraArgsV2 format for Solana')
1456
+ * }
1457
+ * }
1458
+ * ```
1459
+ */
440
1460
  export declare class CCIPSolanaExtraArgsEncodingError extends CCIPError {
441
1461
  readonly name = "CCIPSolanaExtraArgsEncodingError";
442
1462
  /** Creates a Solana extraArgs encoding error. */
443
1463
  constructor(options?: CCIPErrorOptions);
444
1464
  }
445
- /** Thrown when log data is missing or not a string. */
1465
+ /**
1466
+ * Thrown when log data is missing or not a string.
1467
+ *
1468
+ * @example
1469
+ * ```typescript
1470
+ * try {
1471
+ * const message = Chain.decodeMessage(log)
1472
+ * } catch (error) {
1473
+ * if (error instanceof CCIPLogDataMissingError) {
1474
+ * console.log('Log data is missing or invalid')
1475
+ * }
1476
+ * }
1477
+ * ```
1478
+ */
446
1479
  export declare class CCIPLogDataMissingError extends CCIPError {
447
1480
  readonly name = "CCIPLogDataMissingError";
448
1481
  /** Creates a log data missing error. */
449
1482
  constructor(options?: CCIPErrorOptions);
450
1483
  }
451
- /** Thrown when ExecutionState is invalid. */
1484
+ /**
1485
+ * Thrown when ExecutionState is invalid.
1486
+ *
1487
+ * @example
1488
+ * ```typescript
1489
+ * try {
1490
+ * const receipt = Chain.decodeReceipt(log)
1491
+ * } catch (error) {
1492
+ * if (error instanceof CCIPExecutionStateInvalidError) {
1493
+ * console.log(`Invalid state: ${error.context.state}`)
1494
+ * }
1495
+ * }
1496
+ * ```
1497
+ */
452
1498
  export declare class CCIPExecutionStateInvalidError extends CCIPError {
453
1499
  readonly name = "CCIPExecutionStateInvalidError";
454
1500
  /** Creates an execution state invalid error. */
455
1501
  constructor(state: unknown, options?: CCIPErrorOptions);
456
1502
  }
457
- /** Thrown when execution report message is not for Solana. */
1503
+ /**
1504
+ * Thrown when execution report message is not for the expected chain.
1505
+ *
1506
+ * @example
1507
+ * ```typescript
1508
+ * try {
1509
+ * await chain.execute({ offRamp, input, wallet })
1510
+ * } catch (error) {
1511
+ * if (error instanceof CCIPExecutionReportChainMismatchError) {
1512
+ * console.log(`Message not for ${error.context.chain}`)
1513
+ * }
1514
+ * }
1515
+ * ```
1516
+ */
458
1517
  export declare class CCIPExecutionReportChainMismatchError extends CCIPError {
459
1518
  readonly name = "CCIPExecutionReportChainMismatchError";
460
1519
  /** Creates an execution report chain mismatch error. */
461
1520
  constructor(chain: string, options?: CCIPErrorOptions);
462
1521
  }
463
- /** Thrown when token pool state PDA not found. */
1522
+ /**
1523
+ * Thrown when token pool state PDA not found.
1524
+ *
1525
+ * @example
1526
+ * ```typescript
1527
+ * try {
1528
+ * await solanaChain.getTokenPoolConfigs(tokenPool)
1529
+ * } catch (error) {
1530
+ * if (error instanceof CCIPTokenPoolStateNotFoundError) {
1531
+ * console.log(`State not found at: ${error.context.tokenPool}`)
1532
+ * }
1533
+ * }
1534
+ * ```
1535
+ */
464
1536
  export declare class CCIPTokenPoolStateNotFoundError extends CCIPError {
465
1537
  readonly name = "CCIPTokenPoolStateNotFoundError";
466
1538
  /** Creates a token pool state not found error. */
467
1539
  constructor(tokenPool: string, options?: CCIPErrorOptions);
468
1540
  }
469
- /** Thrown when ChainConfig not found for token pool and remote chain. */
1541
+ /**
1542
+ * Thrown when ChainConfig not found for token pool and remote chain.
1543
+ *
1544
+ * @example
1545
+ * ```typescript
1546
+ * try {
1547
+ * await chain.getTokenPoolRemotes(tokenPool, destChainSelector)
1548
+ * } catch (error) {
1549
+ * if (error instanceof CCIPTokenPoolChainConfigNotFoundError) {
1550
+ * console.log(`No config for ${error.context.remoteNetwork}`)
1551
+ * }
1552
+ * }
1553
+ * ```
1554
+ */
470
1555
  export declare class CCIPTokenPoolChainConfigNotFoundError extends CCIPError {
471
1556
  readonly name = "CCIPTokenPoolChainConfigNotFoundError";
472
1557
  /** Creates a token pool chain config not found error. */
473
1558
  constructor(address: string, tokenPool: string, remoteNetwork: string, options?: CCIPErrorOptions);
474
1559
  }
475
- /** Thrown when Aptos network is unknown. */
1560
+ /**
1561
+ * Thrown when Aptos network is unknown.
1562
+ *
1563
+ * @example
1564
+ * ```typescript
1565
+ * try {
1566
+ * const chain = await AptosChain.fromUrl('https://unknown-network')
1567
+ * } catch (error) {
1568
+ * if (error instanceof CCIPAptosNetworkUnknownError) {
1569
+ * console.log(`Unknown network: ${error.context.url}`)
1570
+ * }
1571
+ * }
1572
+ * ```
1573
+ */
476
1574
  export declare class CCIPAptosNetworkUnknownError extends CCIPError {
477
1575
  readonly name = "CCIPAptosNetworkUnknownError";
478
1576
  /** Creates an Aptos network unknown error. */
479
1577
  constructor(url: string, options?: CCIPErrorOptions);
480
1578
  }
481
- /** Thrown when Aptos transaction type is invalid. */
1579
+ /**
1580
+ * Thrown when Aptos transaction type is invalid.
1581
+ *
1582
+ * @example
1583
+ * ```typescript
1584
+ * try {
1585
+ * await aptosChain.getMessagesInTx(txHash)
1586
+ * } catch (error) {
1587
+ * if (error instanceof CCIPAptosTransactionTypeInvalidError) {
1588
+ * console.log('Expected user_transaction type')
1589
+ * }
1590
+ * }
1591
+ * ```
1592
+ */
482
1593
  export declare class CCIPAptosTransactionTypeInvalidError extends CCIPError {
483
1594
  readonly name = "CCIPAptosTransactionTypeInvalidError";
484
1595
  /** Creates an Aptos transaction type invalid error. */
485
1596
  constructor(options?: CCIPErrorOptions);
486
1597
  }
487
- /** Thrown when Aptos registry type is invalid. */
1598
+ /**
1599
+ * Thrown when Aptos registry type is invalid.
1600
+ *
1601
+ * @example
1602
+ * ```typescript
1603
+ * try {
1604
+ * await aptosChain.getTokenAdminRegistryFor(registry)
1605
+ * } catch (error) {
1606
+ * if (error instanceof CCIPAptosRegistryTypeInvalidError) {
1607
+ * console.log(`Expected TokenAdminRegistry, got: ${error.context.actualType}`)
1608
+ * }
1609
+ * }
1610
+ * ```
1611
+ */
488
1612
  export declare class CCIPAptosRegistryTypeInvalidError extends CCIPError {
489
1613
  readonly name = "CCIPAptosRegistryTypeInvalidError";
490
1614
  /** Creates an Aptos registry type invalid error. */
491
1615
  constructor(registry: string, actualType: string, options?: CCIPErrorOptions);
492
1616
  }
493
- /** Thrown when Aptos log data is invalid. */
1617
+ /**
1618
+ * Thrown when Aptos log data is invalid.
1619
+ *
1620
+ * @example
1621
+ * ```typescript
1622
+ * try {
1623
+ * const message = AptosChain.decodeMessage(log)
1624
+ * } catch (error) {
1625
+ * if (error instanceof CCIPAptosLogInvalidError) {
1626
+ * console.log(`Invalid log: ${error.context.log}`)
1627
+ * }
1628
+ * }
1629
+ * ```
1630
+ */
494
1631
  export declare class CCIPAptosLogInvalidError extends CCIPError {
495
1632
  readonly name = "CCIPAptosLogInvalidError";
496
1633
  /** Creates an Aptos log invalid error. */
497
1634
  constructor(log: unknown, options?: CCIPErrorOptions);
498
1635
  }
499
- /** Thrown when Aptos address is invalid. */
1636
+ /**
1637
+ * Thrown when Aptos address is invalid.
1638
+ *
1639
+ * @example
1640
+ * ```typescript
1641
+ * import { CCIPDataFormatUnsupportedError } from '@chainlink/ccip-sdk'
1642
+ *
1643
+ * try {
1644
+ * AptosChain.getAddress('invalid-address')
1645
+ * } catch (error) {
1646
+ * if (error instanceof CCIPDataFormatUnsupportedError) {
1647
+ * console.log(`Invalid address: ${error.message}`)
1648
+ * }
1649
+ * }
1650
+ * ```
1651
+ */
500
1652
  export declare class CCIPAptosAddressInvalidError extends CCIPError {
501
1653
  readonly name = "CCIPAptosAddressInvalidError";
502
1654
  /** Creates an Aptos address invalid error. */
503
1655
  constructor(address: string, options?: CCIPErrorOptions);
504
1656
  }
505
- /** Thrown when Aptos can only encode specific extra args types. */
1657
+ /**
1658
+ * Thrown when Aptos can only encode specific extra args types.
1659
+ *
1660
+ * @example
1661
+ * ```typescript
1662
+ * try {
1663
+ * AptosChain.encodeExtraArgs(unsupportedArgs)
1664
+ * } catch (error) {
1665
+ * if (error instanceof CCIPAptosExtraArgsEncodingError) {
1666
+ * console.log('Use EVMExtraArgsV2 or SVMExtraArgsV1 for Aptos')
1667
+ * }
1668
+ * }
1669
+ * ```
1670
+ */
506
1671
  export declare class CCIPAptosExtraArgsEncodingError extends CCIPError {
507
1672
  readonly name = "CCIPAptosExtraArgsEncodingError";
508
1673
  /** Creates an Aptos extraArgs encoding error. */
509
1674
  constructor(options?: CCIPErrorOptions);
510
1675
  }
511
- /** Thrown when Aptos wallet is invalid. */
1676
+ /**
1677
+ * Thrown when Aptos wallet is invalid.
1678
+ *
1679
+ * @example
1680
+ * ```typescript
1681
+ * try {
1682
+ * await aptosChain.sendMessage({ ...opts, wallet: invalidWallet })
1683
+ * } catch (error) {
1684
+ * if (error instanceof CCIPAptosWalletInvalidError) {
1685
+ * console.log('Provide a valid Aptos account wallet')
1686
+ * }
1687
+ * }
1688
+ * ```
1689
+ */
512
1690
  export declare class CCIPAptosWalletInvalidError extends CCIPError {
513
1691
  readonly name = "CCIPAptosWalletInvalidError";
514
1692
  /** Creates an Aptos wallet invalid error. */
515
1693
  constructor(className: string, wallet: string, options?: CCIPErrorOptions);
516
1694
  }
517
- /** Thrown when Aptos expects EVMExtraArgsV2 reports. */
1695
+ /**
1696
+ * Thrown when Aptos expects EVMExtraArgsV2 reports.
1697
+ *
1698
+ * @example
1699
+ * ```typescript
1700
+ * try {
1701
+ * await aptosChain.execute({ offRamp, input, wallet })
1702
+ * } catch (error) {
1703
+ * if (error instanceof CCIPAptosExtraArgsV2RequiredError) {
1704
+ * console.log('Aptos requires EVMExtraArgsV2 format')
1705
+ * }
1706
+ * }
1707
+ * ```
1708
+ */
518
1709
  export declare class CCIPAptosExtraArgsV2RequiredError extends CCIPError {
519
1710
  readonly name = "CCIPAptosExtraArgsV2RequiredError";
520
1711
  /** Creates an Aptos EVMExtraArgsV2 required error. */
521
1712
  constructor(options?: CCIPErrorOptions);
522
1713
  }
523
- /** Thrown when token is not registered in Aptos registry. */
1714
+ /**
1715
+ * Thrown when token is not registered in Aptos registry.
1716
+ *
1717
+ * @example
1718
+ * ```typescript
1719
+ * try {
1720
+ * await aptosChain.getRegistryTokenConfig(registry, token)
1721
+ * } catch (error) {
1722
+ * if (error instanceof CCIPAptosTokenNotRegisteredError) {
1723
+ * console.log(`Token ${error.context.token} not in registry`)
1724
+ * }
1725
+ * }
1726
+ * ```
1727
+ */
524
1728
  export declare class CCIPAptosTokenNotRegisteredError extends CCIPError {
525
1729
  readonly name = "CCIPAptosTokenNotRegisteredError";
526
1730
  /** Creates an Aptos token not registered error. */
527
1731
  constructor(token: string, registry: string, options?: CCIPErrorOptions);
528
1732
  }
529
- /** Thrown for unexpected Aptos transaction type. */
1733
+ /**
1734
+ * Thrown for unexpected Aptos transaction type.
1735
+ *
1736
+ * @example
1737
+ * ```typescript
1738
+ * try {
1739
+ * await aptosChain.getTransaction(txHash)
1740
+ * } catch (error) {
1741
+ * if (error instanceof CCIPAptosTransactionTypeUnexpectedError) {
1742
+ * console.log(`Unexpected type: ${error.context.type}`)
1743
+ * }
1744
+ * }
1745
+ * ```
1746
+ */
530
1747
  export declare class CCIPAptosTransactionTypeUnexpectedError extends CCIPError {
531
1748
  readonly name = "CCIPAptosTransactionTypeUnexpectedError";
532
1749
  /** Creates an Aptos transaction type unexpected error. */
533
1750
  constructor(type: string, options?: CCIPErrorOptions);
534
1751
  }
535
- /** Thrown when Aptos address with module is required. */
1752
+ /**
1753
+ * Thrown when Aptos address with module is required.
1754
+ *
1755
+ * @example
1756
+ * ```typescript
1757
+ * try {
1758
+ * await aptosChain.getLogs({ address: '0x1' }) // Missing module
1759
+ * } catch (error) {
1760
+ * if (error instanceof CCIPAptosAddressModuleRequiredError) {
1761
+ * console.log('Provide address with module name')
1762
+ * }
1763
+ * }
1764
+ * ```
1765
+ */
536
1766
  export declare class CCIPAptosAddressModuleRequiredError extends CCIPError {
537
1767
  readonly name = "CCIPAptosAddressModuleRequiredError";
538
1768
  /** Creates an Aptos address module required error. */
539
1769
  constructor(options?: CCIPErrorOptions);
540
1770
  }
541
- /** Thrown when Borsh type is unknown. */
1771
+ /**
1772
+ * Thrown when Aptos topic is invalid.
1773
+ *
1774
+ * @example
1775
+ * ```typescript
1776
+ * try {
1777
+ * await aptosChain.getLogs({ topics: ['invalid'] })
1778
+ * } catch (error) {
1779
+ * if (error instanceof CCIPAptosTopicInvalidError) {
1780
+ * console.log(`Invalid topic: ${error.context.topic}`)
1781
+ * }
1782
+ * }
1783
+ * ```
1784
+ */
1785
+ export declare class CCIPAptosTopicInvalidError extends CCIPError {
1786
+ readonly name = "CCIPAptosTopicInvalidError";
1787
+ /** Creates an Aptos topic invalid error. */
1788
+ constructor(topic?: string, options?: CCIPErrorOptions);
1789
+ }
1790
+ /**
1791
+ * Thrown when Borsh type is unknown.
1792
+ *
1793
+ * @example
1794
+ * ```typescript
1795
+ * try {
1796
+ * decodeBorsh(data, 'UnknownType')
1797
+ * } catch (error) {
1798
+ * if (error instanceof CCIPBorshTypeUnknownError) {
1799
+ * console.log(`Unknown type: ${error.context.name}`)
1800
+ * }
1801
+ * }
1802
+ * ```
1803
+ */
542
1804
  export declare class CCIPBorshTypeUnknownError extends CCIPError {
543
1805
  readonly name = "CCIPBorshTypeUnknownError";
544
1806
  /** Creates a Borsh type unknown error. */
545
1807
  constructor(name: string, options?: CCIPErrorOptions);
546
1808
  }
547
- /** Thrown when Borsh method is unknown. */
1809
+ /**
1810
+ * Thrown when Borsh method is unknown.
1811
+ *
1812
+ * @example
1813
+ * ```typescript
1814
+ * try {
1815
+ * callBorshMethod('unknownMethod')
1816
+ * } catch (error) {
1817
+ * if (error instanceof CCIPBorshMethodUnknownError) {
1818
+ * console.log(`Unknown method: ${error.context.method}`)
1819
+ * }
1820
+ * }
1821
+ * ```
1822
+ */
548
1823
  export declare class CCIPBorshMethodUnknownError extends CCIPError {
549
1824
  readonly name = "CCIPBorshMethodUnknownError";
550
1825
  /** Creates a Borsh method unknown error. */
551
1826
  constructor(method: string, options?: CCIPErrorOptions);
552
1827
  }
553
- /** Thrown when CLI argument is invalid. */
1828
+ /**
1829
+ * Thrown when CLI argument is invalid.
1830
+ *
1831
+ * @example
1832
+ * ```typescript
1833
+ * try {
1834
+ * parseArguments(['--invalid-arg'])
1835
+ * } catch (error) {
1836
+ * if (error instanceof CCIPArgumentInvalidError) {
1837
+ * console.log(`${error.context.argument}: ${error.context.reason}`)
1838
+ * }
1839
+ * }
1840
+ * ```
1841
+ */
554
1842
  export declare class CCIPArgumentInvalidError extends CCIPError {
555
1843
  readonly name = "CCIPArgumentInvalidError";
556
1844
  /** Creates an argument invalid error. */
557
1845
  constructor(argument: string, reason: string, options?: CCIPErrorOptions);
558
1846
  }
559
- /** Thrown when execution receipt not found in tx logs. Transient: receipt may not be indexed yet. */
1847
+ /**
1848
+ * Thrown when execution receipt not found in tx logs. Transient: receipt may not be indexed yet.
1849
+ *
1850
+ * @example
1851
+ * ```typescript
1852
+ * try {
1853
+ * const receipt = await chain.getExecutionReceiptInTx(txHash)
1854
+ * } catch (error) {
1855
+ * if (error instanceof CCIPReceiptNotFoundError) {
1856
+ * if (error.isTransient) {
1857
+ * await sleep(error.retryAfterMs ?? 5000)
1858
+ * }
1859
+ * }
1860
+ * }
1861
+ * ```
1862
+ */
560
1863
  export declare class CCIPReceiptNotFoundError extends CCIPError {
561
1864
  readonly name = "CCIPReceiptNotFoundError";
562
1865
  /** Creates a receipt not found error. */
563
1866
  constructor(txHash: string, options?: CCIPErrorOptions);
564
1867
  }
565
- /** Thrown when data cannot be parsed. */
1868
+ /**
1869
+ * Thrown when data cannot be parsed.
1870
+ *
1871
+ * @example
1872
+ * ```typescript
1873
+ * try {
1874
+ * const parsed = Chain.parse(data)
1875
+ * } catch (error) {
1876
+ * if (error instanceof CCIPDataParseError) {
1877
+ * console.log(`Parse failed for: ${error.context.data}`)
1878
+ * }
1879
+ * }
1880
+ * ```
1881
+ */
566
1882
  export declare class CCIPDataParseError extends CCIPError {
567
1883
  readonly name = "CCIPDataParseError";
568
1884
  /** Creates a data parse error. */
569
1885
  constructor(data: string, options?: CCIPErrorOptions);
570
1886
  }
571
- /** Thrown when token not found in supported tokens list. */
1887
+ /**
1888
+ * Thrown when token not found in supported tokens list.
1889
+ *
1890
+ * @example
1891
+ * ```typescript
1892
+ * try {
1893
+ * const tokens = await chain.getSupportedTokens(router, destChainSelector)
1894
+ * } catch (error) {
1895
+ * if (error instanceof CCIPTokenNotFoundError) {
1896
+ * console.log(`Token not found: ${error.context.token}`)
1897
+ * }
1898
+ * }
1899
+ * ```
1900
+ */
572
1901
  export declare class CCIPTokenNotFoundError extends CCIPError {
573
1902
  readonly name = "CCIPTokenNotFoundError";
574
1903
  /** Creates a token not found error. */
@@ -580,97 +1909,319 @@ export declare class CCIPInsufficientBalanceError extends CCIPError {
580
1909
  /** Creates an insufficient balance error. */
581
1910
  constructor(have: string, need: string, symbol: string, options?: CCIPErrorOptions);
582
1911
  }
583
- /** Thrown when router config not found at PDA. */
1912
+ /**
1913
+ * Thrown when router config not found at PDA.
1914
+ *
1915
+ * @example
1916
+ * ```typescript
1917
+ * try {
1918
+ * await solanaChain.getOnRampForRouter(router, destChainSelector)
1919
+ * } catch (error) {
1920
+ * if (error instanceof CCIPSolanaRouterConfigNotFoundError) {
1921
+ * console.log(`Config not found at: ${error.context.configPda}`)
1922
+ * }
1923
+ * }
1924
+ * ```
1925
+ */
584
1926
  export declare class CCIPSolanaRouterConfigNotFoundError extends CCIPError {
585
1927
  readonly name = "CCIPSolanaRouterConfigNotFoundError";
586
1928
  /** Creates a Solana router config not found error. */
587
1929
  constructor(configPda: string, options?: CCIPErrorOptions);
588
1930
  }
589
- /** Thrown when fee result from router is invalid. */
1931
+ /**
1932
+ * Thrown when fee result from router is invalid.
1933
+ *
1934
+ * @example
1935
+ * ```typescript
1936
+ * try {
1937
+ * const fee = await solanaChain.getFee(router, message)
1938
+ * } catch (error) {
1939
+ * if (error instanceof CCIPSolanaFeeResultInvalidError) {
1940
+ * console.log(`Invalid fee result: ${error.context.result}`)
1941
+ * }
1942
+ * }
1943
+ * ```
1944
+ */
590
1945
  export declare class CCIPSolanaFeeResultInvalidError extends CCIPError {
591
1946
  readonly name = "CCIPSolanaFeeResultInvalidError";
592
1947
  /** Creates a Solana fee result invalid error. */
593
1948
  constructor(result: string, options?: CCIPErrorOptions);
594
1949
  }
595
- /** Thrown when token mint not found. */
1950
+ /**
1951
+ * Thrown when token mint not found.
1952
+ *
1953
+ * @example
1954
+ * ```typescript
1955
+ * try {
1956
+ * await solanaChain.getTokenInfo(mintAddress)
1957
+ * } catch (error) {
1958
+ * if (error instanceof CCIPTokenMintNotFoundError) {
1959
+ * console.log(`Mint not found: ${error.context.token}`)
1960
+ * }
1961
+ * }
1962
+ * ```
1963
+ */
596
1964
  export declare class CCIPTokenMintNotFoundError extends CCIPError {
597
1965
  readonly name = "CCIPTokenMintNotFoundError";
598
1966
  /** Creates a token mint not found error. */
599
1967
  constructor(token: string, options?: CCIPErrorOptions);
600
1968
  }
601
- /** Thrown when token mint exists but is not a valid SPL token (wrong owner program). */
1969
+ /**
1970
+ * Thrown when token mint exists but is not a valid SPL token (wrong owner program).
1971
+ *
1972
+ * @example
1973
+ * ```typescript
1974
+ * try {
1975
+ * const tokenInfo = await solanaChain.getTokenInfo(mintAddress)
1976
+ * } catch (error) {
1977
+ * if (error instanceof CCIPTokenMintInvalidError) {
1978
+ * console.log(`Invalid mint: ${error.context.token}`)
1979
+ * console.log(`Owner: ${error.context.actualOwner}`)
1980
+ * console.log(`Expected: ${error.context.expectedOwners.join(' or ')}`)
1981
+ * }
1982
+ * }
1983
+ * ```
1984
+ */
602
1985
  export declare class CCIPTokenMintInvalidError extends CCIPError {
603
1986
  readonly name = "CCIPTokenMintInvalidError";
604
1987
  /** Creates a token mint invalid error. */
605
1988
  constructor(token: string, actualOwner: string, expectedOwners: string[], options?: CCIPErrorOptions);
606
1989
  }
607
- /** Thrown when token amount is invalid. */
1990
+ /**
1991
+ * Thrown when token amount is invalid.
1992
+ *
1993
+ * @example
1994
+ * ```typescript
1995
+ * try {
1996
+ * await chain.sendMessage({ tokenAmounts: [{ token: '', amount: 0n }] })
1997
+ * } catch (error) {
1998
+ * if (error instanceof CCIPTokenAmountInvalidError) {
1999
+ * console.log('Token address and positive amount required')
2000
+ * }
2001
+ * }
2002
+ * ```
2003
+ */
608
2004
  export declare class CCIPTokenAmountInvalidError extends CCIPError {
609
2005
  readonly name = "CCIPTokenAmountInvalidError";
610
2006
  /** Creates a token amount invalid error. */
611
2007
  constructor(options?: CCIPErrorOptions);
612
2008
  }
613
- /** Thrown when token account (e.g., Solana ATA) does not exist for holder. */
2009
+ /**
2010
+ * Thrown when token account (e.g., Solana ATA) does not exist for holder.
2011
+ *
2012
+ * @example
2013
+ * ```typescript
2014
+ * try {
2015
+ * const balance = await solanaChain.getBalance({ address: holder, token: mint })
2016
+ * } catch (error) {
2017
+ * if (error instanceof CCIPTokenAccountNotFoundError) {
2018
+ * console.log(`No ATA for token ${error.context.token}`)
2019
+ * console.log(`Holder: ${error.context.holder}`)
2020
+ * }
2021
+ * }
2022
+ * ```
2023
+ */
614
2024
  export declare class CCIPTokenAccountNotFoundError extends CCIPError {
615
2025
  readonly name = "CCIPTokenAccountNotFoundError";
616
2026
  /** Creates a token account not found error. */
617
2027
  constructor(token: string, holder: string, options?: CCIPErrorOptions);
618
2028
  }
619
- /** Thrown when transaction not finalized after timeout. */
2029
+ /**
2030
+ * Thrown when transaction not finalized after timeout. Transient: may need more time.
2031
+ *
2032
+ * @example
2033
+ * ```typescript
2034
+ * try {
2035
+ * await chain.waitFinalized(txHash)
2036
+ * } catch (error) {
2037
+ * if (error instanceof CCIPTransactionNotFinalizedError) {
2038
+ * if (error.isTransient) {
2039
+ * await sleep(error.retryAfterMs ?? 10000)
2040
+ * }
2041
+ * }
2042
+ * }
2043
+ * ```
2044
+ */
620
2045
  export declare class CCIPTransactionNotFinalizedError extends CCIPError {
621
2046
  readonly name = "CCIPTransactionNotFinalizedError";
622
2047
  /** Creates a transaction not finalized error. */
623
2048
  constructor(signature: string, options?: CCIPErrorOptions);
624
2049
  }
625
- /** Thrown when CCTP event decode fails. */
2050
+ /**
2051
+ * Thrown when CCTP event decode fails.
2052
+ *
2053
+ * @example
2054
+ * ```typescript
2055
+ * try {
2056
+ * const cctpData = decodeCctpEvent(log)
2057
+ * } catch (error) {
2058
+ * if (error instanceof CCIPCctpDecodeError) {
2059
+ * console.log(`CCTP decode failed: ${error.context.log}`)
2060
+ * }
2061
+ * }
2062
+ * ```
2063
+ */
626
2064
  export declare class CCIPCctpDecodeError extends CCIPError {
627
2065
  readonly name = "CCIPCctpDecodeError";
628
2066
  /** Creates a CCTP decode error. */
629
2067
  constructor(log: string, options?: CCIPErrorOptions);
630
2068
  }
631
- /** Thrown when Sui hasher version is unsupported. */
2069
+ /**
2070
+ * Thrown when Sui hasher version is unsupported.
2071
+ *
2072
+ * @example
2073
+ * ```typescript
2074
+ * try {
2075
+ * const hasher = SuiChain.getDestLeafHasher(lane)
2076
+ * } catch (error) {
2077
+ * if (error instanceof CCIPSuiHasherVersionUnsupportedError) {
2078
+ * console.log(`Unsupported hasher: ${error.context.version}`)
2079
+ * }
2080
+ * }
2081
+ * ```
2082
+ */
632
2083
  export declare class CCIPSuiHasherVersionUnsupportedError extends CCIPError {
633
2084
  readonly name = "CCIPSuiHasherVersionUnsupportedError";
634
2085
  /** Creates a Sui hasher version unsupported error. */
635
2086
  constructor(version: string, options?: CCIPErrorOptions);
636
2087
  }
637
- /** Thrown when Sui message version is invalid. */
2088
+ /**
2089
+ * Thrown when Sui message version is invalid.
2090
+ *
2091
+ * @example
2092
+ * ```typescript
2093
+ * try {
2094
+ * const message = SuiChain.decodeMessage(log)
2095
+ * } catch (error) {
2096
+ * if (error instanceof CCIPSuiMessageVersionInvalidError) {
2097
+ * console.log('Only CCIP v1.6 format is supported for Sui')
2098
+ * }
2099
+ * }
2100
+ * ```
2101
+ */
638
2102
  export declare class CCIPSuiMessageVersionInvalidError extends CCIPError {
639
2103
  readonly name = "CCIPSuiMessageVersionInvalidError";
640
2104
  /** Creates a Sui message version invalid error. */
641
2105
  constructor(options?: CCIPErrorOptions);
642
2106
  }
643
- /** Thrown when Sui log data is invalid. */
2107
+ /**
2108
+ * Thrown when Sui log data is invalid.
2109
+ *
2110
+ * This error occurs when attempting to decode a Sui event log that doesn't
2111
+ * conform to the expected CCIP message format.
2112
+ *
2113
+ * @example
2114
+ * ```typescript
2115
+ * try {
2116
+ * const message = SuiChain.decodeMessage(log)
2117
+ * } catch (error) {
2118
+ * if (error instanceof CCIPSuiLogInvalidError) {
2119
+ * console.log('Invalid Sui log format:', error.context.log)
2120
+ * }
2121
+ * }
2122
+ * ```
2123
+ */
644
2124
  export declare class CCIPSuiLogInvalidError extends CCIPError {
645
2125
  readonly name = "CCIPSuiLogInvalidError";
646
- /** Creates a Sui log invalid error. */
2126
+ /**
2127
+ * Creates a Sui log invalid error.
2128
+ *
2129
+ * @param log - The invalid log data
2130
+ * @param options - Additional error options
2131
+ */
647
2132
  constructor(log: unknown, options?: CCIPErrorOptions);
648
2133
  }
649
- /** Thrown when Solana lane version is unsupported. */
2134
+ /**
2135
+ * Thrown when Solana lane version is unsupported.
2136
+ *
2137
+ * @example
2138
+ * ```typescript
2139
+ * try {
2140
+ * const lane = await solanaChain.getLane(onRamp, offRamp)
2141
+ * } catch (error) {
2142
+ * if (error instanceof CCIPSolanaLaneVersionUnsupportedError) {
2143
+ * console.log(`Unsupported version: ${error.context.version}`)
2144
+ * }
2145
+ * }
2146
+ * ```
2147
+ */
650
2148
  export declare class CCIPSolanaLaneVersionUnsupportedError extends CCIPError {
651
2149
  readonly name = "CCIPSolanaLaneVersionUnsupportedError";
652
2150
  /** Creates a Solana lane version unsupported error. */
653
2151
  constructor(version: string, options?: CCIPErrorOptions);
654
2152
  }
655
- /** Thrown when multiple CCTP events found in transaction. */
2153
+ /**
2154
+ * Thrown when multiple CCTP events found in transaction.
2155
+ *
2156
+ * @example
2157
+ * ```typescript
2158
+ * try {
2159
+ * const cctpData = await chain.getOffchainTokenData(request)
2160
+ * } catch (error) {
2161
+ * if (error instanceof CCIPCctpMultipleEventsError) {
2162
+ * console.log(`Found ${error.context.count} events, expected 1`)
2163
+ * }
2164
+ * }
2165
+ * ```
2166
+ */
656
2167
  export declare class CCIPCctpMultipleEventsError extends CCIPError {
657
2168
  readonly name = "CCIPCctpMultipleEventsError";
658
2169
  /** Creates a CCTP multiple events error. */
659
2170
  constructor(count: number, txSignature: string, options?: CCIPErrorOptions);
660
2171
  }
661
- /** Thrown when compute units exceed limit. */
2172
+ /**
2173
+ * Thrown when compute units exceed limit.
2174
+ *
2175
+ * @example
2176
+ * ```typescript
2177
+ * try {
2178
+ * await solanaChain.execute({ offRamp, input, wallet })
2179
+ * } catch (error) {
2180
+ * if (error instanceof CCIPSolanaComputeUnitsExceededError) {
2181
+ * console.log(`CU: ${error.context.simulated} > limit ${error.context.limit}`)
2182
+ * }
2183
+ * }
2184
+ * ```
2185
+ */
662
2186
  export declare class CCIPSolanaComputeUnitsExceededError extends CCIPError {
663
2187
  readonly name = "CCIPSolanaComputeUnitsExceededError";
664
2188
  /** Creates a compute units exceeded error. */
665
2189
  constructor(simulated: number, limit: number, options?: CCIPErrorOptions);
666
2190
  }
667
- /** Thrown when Aptos hasher version is unsupported. */
2191
+ /**
2192
+ * Thrown when Aptos hasher version is unsupported.
2193
+ *
2194
+ * @example
2195
+ * ```typescript
2196
+ * try {
2197
+ * const hasher = AptosChain.getDestLeafHasher(lane)
2198
+ * } catch (error) {
2199
+ * if (error instanceof CCIPAptosHasherVersionUnsupportedError) {
2200
+ * console.log(`Unsupported hasher: ${error.context.version}`)
2201
+ * }
2202
+ * }
2203
+ * ```
2204
+ */
668
2205
  export declare class CCIPAptosHasherVersionUnsupportedError extends CCIPError {
669
2206
  readonly name = "CCIPAptosHasherVersionUnsupportedError";
670
2207
  /** Creates an Aptos hasher version unsupported error. */
671
2208
  constructor(version: string, options?: CCIPErrorOptions);
672
2209
  }
673
- /** Thrown when API client is not available (explicitly opted out). */
2210
+ /**
2211
+ * Thrown when API client is not available (explicitly opted out).
2212
+ *
2213
+ * @example
2214
+ * ```typescript
2215
+ * const chain = await EVMChain.fromUrl(rpc, { apiClient: null }) // Opt-out of API
2216
+ * try {
2217
+ * await chain.getLaneLatency(destChainSelector)
2218
+ * } catch (error) {
2219
+ * if (error instanceof CCIPApiClientNotAvailableError) {
2220
+ * console.log('API client disabled - initialize with apiClient or remove opt-out')
2221
+ * }
2222
+ * }
2223
+ * ```
2224
+ */
674
2225
  export declare class CCIPApiClientNotAvailableError extends CCIPError {
675
2226
  readonly name = "CCIPApiClientNotAvailableError";
676
2227
  /**
@@ -679,18 +2230,42 @@ export declare class CCIPApiClientNotAvailableError extends CCIPError {
679
2230
  */
680
2231
  constructor(options?: CCIPErrorOptions);
681
2232
  }
682
- /** Thrown when API returns hasNextPage=true unexpectedly (more than 100 messages). */
2233
+ /**
2234
+ * Thrown when API returns hasNextPage=true unexpectedly (more than 100 messages).
2235
+ *
2236
+ * @example
2237
+ * ```typescript
2238
+ * try {
2239
+ * const messages = await chain.getMessagesInTx(txHash)
2240
+ * } catch (error) {
2241
+ * if (error instanceof CCIPUnexpectedPaginationError) {
2242
+ * console.log(`Too many messages in tx: ${error.context.txHash}`)
2243
+ * console.log(`Message count: ${error.context.messageCount}+`)
2244
+ * }
2245
+ * }
2246
+ * ```
2247
+ */
683
2248
  export declare class CCIPUnexpectedPaginationError extends CCIPError {
684
2249
  readonly name = "CCIPUnexpectedPaginationError";
685
- /**
686
- * Creates an unexpected pagination error.
687
- * @param txHash - The transaction hash queried
688
- * @param messageCount - Number of messages returned in the response
689
- * @param options - Additional error options
690
- */
2250
+ /** Creates an unexpected pagination error. */
691
2251
  constructor(txHash: string, messageCount: number, options?: CCIPErrorOptions);
692
2252
  }
693
- /** Thrown when viem adapter encounters an issue. */
2253
+ /**
2254
+ * Thrown when viem adapter encounters an issue.
2255
+ *
2256
+ * @example
2257
+ * ```typescript
2258
+ * import { fromViemClient } from '@chainlink/ccip-sdk/viem'
2259
+ *
2260
+ * try {
2261
+ * const chain = await fromViemClient(viemClient)
2262
+ * } catch (error) {
2263
+ * if (error instanceof CCIPViemAdapterError) {
2264
+ * console.log(`Viem adapter error: ${error.message}`)
2265
+ * }
2266
+ * }
2267
+ * ```
2268
+ */
694
2269
  export declare class CCIPViemAdapterError extends CCIPError {
695
2270
  readonly name = "CCIPViemAdapterError";
696
2271
  /**