@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
package/src/sui/index.ts CHANGED
@@ -7,7 +7,6 @@ import { isValidSuiAddress, isValidTransactionDigest, normalizeSuiAddress } from
7
7
  import { type BytesLike, dataLength, hexlify, isBytesLike, isHexString } from 'ethers'
8
8
  import type { PickDeep, SetOptional } from 'type-fest'
9
9
 
10
- import { AptosChain } from '../aptos/index.ts'
11
10
  import {
12
11
  type ChainContext,
13
12
  type ChainStatic,
@@ -15,39 +14,47 @@ import {
15
14
  type LogFilter,
16
15
  Chain,
17
16
  } from '../chain.ts'
17
+ import { getCcipStateAddress, getOffRampForCcip } from './discovery.ts'
18
+ import { type CommitEvent, streamSuiLogs } from './events.ts'
19
+ import { getSuiLeafHasher } from './hasher.ts'
20
+ import {
21
+ deriveObjectID,
22
+ fetchTokenConfigs,
23
+ getLatestPackageId,
24
+ getObjectRef,
25
+ getReceiverModule,
26
+ } from './objects.ts'
18
27
  import {
19
28
  CCIPContractNotRouterError,
20
29
  CCIPDataFormatUnsupportedError,
21
30
  CCIPError,
22
31
  CCIPErrorCode,
23
32
  CCIPExecTxRevertedError,
24
- CCIPNotImplementedError,
25
- } from '../errors/index.ts'
26
- import {
33
+ CCIPExecutionReportChainMismatchError,
27
34
  CCIPLogsAddressRequiredError,
35
+ CCIPNotImplementedError,
28
36
  CCIPSuiLogInvalidError,
29
37
  CCIPTopicsInvalidError,
30
- } from '../errors/specialized.ts'
38
+ } from '../errors/index.ts'
31
39
  import type { EVMExtraArgsV2, ExtraArgs, SVMExtraArgsV1, SuiExtraArgsV1 } from '../extra-args.ts'
32
40
  import type { LeafHasher } from '../hasher/common.ts'
33
41
  import { decodeMessage, getMessagesInBatch } from '../requests.ts'
42
+ import { decodeMoveExtraArgs, getMoveAddress } from '../shared/bcs-codecs.ts'
34
43
  import { supportedChains } from '../supported-chains.ts'
35
- import { getSuiLeafHasher } from './hasher.ts'
36
44
  import {
37
45
  type AnyMessage,
38
46
  type CCIPExecution,
39
47
  type CCIPMessage,
40
48
  type CCIPRequest,
41
49
  type CCIPVersion,
50
+ type ChainLog,
42
51
  type ChainTransaction,
43
52
  type CommitReport,
53
+ type ExecutionInput,
44
54
  type ExecutionReceipt,
45
- type ExecutionReport,
46
55
  type ExecutionState,
47
56
  type Lane,
48
- type Log_,
49
57
  type NetworkInfo,
50
- type OffchainTokenData,
51
58
  type WithLogger,
52
59
  ChainFamily,
53
60
  } from '../types.ts'
@@ -59,20 +66,11 @@ import {
59
66
  parseTypeAndVersion,
60
67
  util,
61
68
  } from '../utils.ts'
62
- import { getCcipStateAddress, getOffRampForCcip } from './discovery.ts'
63
- import { type CommitEvent, streamSuiLogs } from './events.ts'
64
69
  import {
65
70
  type SuiManuallyExecuteInput,
66
71
  type TokenConfig,
67
72
  buildManualExecutionPTB,
68
73
  } from './manuallyExec/index.ts'
69
- import {
70
- deriveObjectID,
71
- fetchTokenConfigs,
72
- getLatestPackageId,
73
- getObjectRef,
74
- getReceiverModule,
75
- } from './objects.ts'
76
74
  import type { CCIPMessage_V1_6_Sui } from './types.ts'
77
75
 
78
76
  const DEFAULT_GAS_LIMIT = 1000000n
@@ -182,7 +180,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
182
180
  })
183
181
 
184
182
  // Extract events from the transaction
185
- const events: Log_[] = []
183
+ const events: ChainLog[] = []
186
184
  if (txResponse.events?.length) {
187
185
  for (const [i, event] of txResponse.events.entries()) {
188
186
  const eventType = event.type
@@ -246,10 +244,10 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
246
244
  >,
247
245
  >(
248
246
  request: R,
249
- commit: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
250
- opts?: { page?: number },
247
+ range: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
248
+ opts?: Pick<LogFilter, 'page'>,
251
249
  ): Promise<R['message'][]> {
252
- return getMessagesInBatch(this, request, commit, opts)
250
+ return getMessagesInBatch(this, request, range, opts)
253
251
  }
254
252
 
255
253
  /**
@@ -318,10 +316,10 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
318
316
  }
319
317
 
320
318
  /**
321
- * {@inheritDoc Chain.getOnRampForOffRamp}
319
+ * {@inheritDoc Chain.getOnRampsForOffRamp}
322
320
  * @throws {@link CCIPDataFormatUnsupportedError} if view call fails
323
321
  */
324
- async getOnRampForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string> {
322
+ async getOnRampsForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string[]> {
325
323
  offRamp = await getLatestPackageId(offRamp, this.client)
326
324
  const functionName = 'get_source_chain_config'
327
325
  // Preserve module suffix if present, otherwise add it
@@ -390,12 +388,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
390
388
  const onRampBytes = configBytes.slice(offset, offset + onRampLength)
391
389
 
392
390
  // Decode the address from the onRamp bytes
393
- return decodeAddress(onRampBytes, networkInfo(sourceChainSelector).family)
394
- }
395
-
396
- /** {@inheritDoc Chain.getCommitStoreForOffRamp} */
397
- getCommitStoreForOffRamp(offRamp: string): Promise<string> {
398
- return Promise.resolve(offRamp)
391
+ return [decodeAddress(onRampBytes, networkInfo(sourceChainSelector).family)]
399
392
  }
400
393
 
401
394
  /**
@@ -582,7 +575,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
582
575
  * @returns Decoded CCIPMessage or undefined if not valid.
583
576
  * @throws {@link CCIPSuiLogInvalidError} if log data format is invalid
584
577
  */
585
- static decodeMessage(log: Log_): CCIPMessage | undefined {
578
+ static decodeMessage(log: ChainLog): CCIPMessage | undefined {
586
579
  const { data } = log
587
580
  if (
588
581
  (typeof data !== 'string' || !data.startsWith('{')) &&
@@ -608,7 +601,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
608
601
  | (EVMExtraArgsV2 & { _tag: 'EVMExtraArgsV2' })
609
602
  | (SVMExtraArgsV1 & { _tag: 'SVMExtraArgsV1' })
610
603
  | undefined {
611
- return AptosChain.decodeExtraArgs(extraArgs)
604
+ return decodeMoveExtraArgs(extraArgs)
612
605
  }
613
606
 
614
607
  /**
@@ -628,7 +621,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
628
621
  * @returns Array of decoded commit reports or undefined.
629
622
  */
630
623
  static decodeCommits(
631
- { data, topics }: SetOptional<Pick<Log_, 'data' | 'topics'>, 'topics'>,
624
+ { data, topics }: SetOptional<Pick<ChainLog, 'data' | 'topics'>, 'topics'>,
632
625
  lane?: Lane,
633
626
  ): CommitReport[] | undefined {
634
627
  // Check if this is an CommitReportAccepted event
@@ -664,7 +657,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
664
657
  static decodeReceipt({
665
658
  data,
666
659
  topics,
667
- }: SetOptional<Pick<Log_, 'data' | 'topics'>, 'topics'>): ExecutionReceipt | undefined {
660
+ }: SetOptional<Pick<ChainLog, 'data' | 'topics'>, 'topics'>): ExecutionReceipt | undefined {
668
661
  // Check if this is an ExecutionStateChanged event
669
662
  if (topics?.[0] && topics[0] !== 'ExecutionStateChanged') return
670
663
 
@@ -696,7 +689,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
696
689
  * @returns Sui address.
697
690
  */
698
691
  static getAddress(bytes: BytesLike | readonly number[]): string {
699
- return AptosChain.getAddress(bytes)
692
+ return getMoveAddress(bytes)
700
693
  }
701
694
 
702
695
  /**
@@ -734,30 +727,27 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
734
727
  return Promise.reject(new CCIPNotImplementedError('SuiChain.sendMessage'))
735
728
  }
736
729
 
737
- /** {@inheritDoc Chain.getOffchainTokenData} */
738
- getOffchainTokenData(request: CCIPRequest): Promise<OffchainTokenData[]> {
739
- // default offchain token data
740
- return Promise.resolve(request.message.tokenAmounts.map(() => undefined))
741
- }
742
-
743
- /** {@inheritDoc Chain.generateUnsignedExecuteReport} */
744
- override generateUnsignedExecuteReport(
745
- _opts: Parameters<Chain['generateUnsignedExecuteReport']>[0],
730
+ /** {@inheritDoc Chain.generateUnsignedExecute} */
731
+ override generateUnsignedExecute(
732
+ _opts: Parameters<Chain['generateUnsignedExecute']>[0],
746
733
  ): Promise<never> {
747
- return Promise.reject(new CCIPNotImplementedError('SuiChain.generateUnsignedExecuteReport'))
734
+ return Promise.reject(new CCIPNotImplementedError('SuiChain.generateUnsignedExecute'))
748
735
  }
749
736
 
750
737
  /**
751
- * {@inheritDoc Chain.executeReport}
738
+ * {@inheritDoc Chain.execute}
752
739
  * @throws {@link CCIPError} if transaction submission fails
753
740
  * @throws {@link CCIPExecTxRevertedError} if transaction reverts
754
741
  */
755
- async executeReport(
756
- opts: Parameters<Chain['executeReport']>[0] & {
742
+ async execute(
743
+ opts: Parameters<Chain['execute']>[0] & {
757
744
  receiverObjectIds?: string[]
758
745
  },
759
746
  ): Promise<CCIPExecution> {
760
- const { execReport, offRamp } = opts
747
+ if (!('input' in opts && 'message' in opts.input)) {
748
+ throw new CCIPExecutionReportChainMismatchError('Sui')
749
+ }
750
+ const { input, offRamp } = opts
761
751
  const wallet = opts.wallet as Keypair
762
752
 
763
753
  // Discover the CCIP package from the offramp
@@ -769,20 +759,20 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
769
759
  this.client,
770
760
  ccip,
771
761
  ccipObjectRef,
772
- execReport.message.receiver,
762
+ input.message.receiver,
773
763
  )
774
764
  let tokenConfigs: TokenConfig[] = []
775
- if (execReport.message.tokenAmounts.length !== 0) {
765
+ if (input.message.tokenAmounts.length !== 0) {
776
766
  tokenConfigs = await fetchTokenConfigs(
777
767
  this.client,
778
768
  ccip,
779
769
  ccipObjectRef,
780
- execReport.message.tokenAmounts as CCIPMessage<typeof CCIPVersion.V1_6>['tokenAmounts'],
770
+ input.message.tokenAmounts as CCIPMessage<typeof CCIPVersion.V1_6>['tokenAmounts'],
781
771
  )
782
772
  }
783
773
 
784
- const input: SuiManuallyExecuteInput = {
785
- executionReport: execReport as ExecutionReport<CCIPMessage_V1_6_Sui>,
774
+ const suiInput: SuiManuallyExecuteInput = {
775
+ executionReport: input as ExecutionInput<CCIPMessage_V1_6_Sui>,
786
776
  offrampAddress: offRamp,
787
777
  ccipAddress: ccip,
788
778
  ccipObjectRef,
@@ -794,16 +784,16 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
794
784
  this.logger.info(
795
785
  `Overriding Sui Manual Execution receiverObjectIds with: ${opts.receiverObjectIds.join(', ')}`,
796
786
  )
797
- input.overrideReceiverObjectIds = opts.receiverObjectIds
787
+ suiInput.overrideReceiverObjectIds = opts.receiverObjectIds
798
788
  }
799
- const tx = buildManualExecutionPTB(input)
789
+ const tx = buildManualExecutionPTB(suiInput)
800
790
 
801
791
  // Set gas budget if provided
802
792
  if (opts.gasLimit) {
803
793
  tx.setGasBudget(opts.gasLimit)
804
794
  }
805
795
 
806
- this.logger.info(`Executing Sui CCIP executeReport transaction...`)
796
+ this.logger.info(`Executing Sui CCIP execute transaction...`)
807
797
  // Sign and execute the transaction
808
798
  let result: SuiTransactionBlockResponse
809
799
  try {
@@ -818,7 +808,7 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
818
808
  } catch (e) {
819
809
  throw new CCIPError(
820
810
  CCIPErrorCode.TRANSACTION_NOT_FINALIZED,
821
- `Failed to send Sui executeReport transaction: ${(e as Error).message}`,
811
+ `Failed to send Sui execute transaction: ${(e as Error).message}`,
822
812
  )
823
813
  }
824
814
 
@@ -881,7 +871,13 @@ export class SuiChain extends Chain<typeof ChainFamily.Sui> {
881
871
  return Promise.reject(new CCIPNotImplementedError('SuiChain.getFeeTokens'))
882
872
  }
883
873
 
884
- /** {@inheritDoc ChainStatic.buildMessageForDest} */
874
+ /**
875
+ * Returns a copy of a message, populating missing fields like `extraArgs` with defaults.
876
+ * It's expected to return a message suitable at least for basic token transfers.
877
+ *
878
+ * @param message - AnyMessage (from source), containing at least `receiver`
879
+ * @returns A message suitable for `sendMessage` to this destination chain family
880
+ */
885
881
  static override buildMessageForDest(
886
882
  message: Parameters<ChainStatic['buildMessageForDest']>[0],
887
883
  ): AnyMessage & { extraArgs: SuiExtraArgsV1 } {
@@ -5,7 +5,7 @@ import type { BytesLike } from 'ethers'
5
5
 
6
6
  import { CCIPMessageInvalidError } from '../../errors/specialized.ts'
7
7
  import { decodeExtraArgs } from '../../extra-args.ts'
8
- import type { CCIPMessage, CCIPVersion, ExecutionReport } from '../../types.ts'
8
+ import type { CCIPMessage, CCIPVersion, ExecutionInput } from '../../types.ts'
9
9
  import { bytesToBuffer, getAddressBytes, getDataBytes, networkInfo } from '../../utils.ts'
10
10
 
11
11
  const Any2SuiTokenTransferBCS = bcs.struct('Any2SuiTokenTransfer', {
@@ -39,7 +39,7 @@ const ExecutionReportBCS = bcs.struct('ExecutionReport', {
39
39
  * @returns Serialized execution report as Uint8Array.
40
40
  */
41
41
  export function serializeExecutionReport(
42
- executionReport: ExecutionReport<CCIPMessage<typeof CCIPVersion.V1_6>>,
42
+ executionReport: ExecutionInput<CCIPMessage<typeof CCIPVersion.V1_6>>,
43
43
  ): Uint8Array {
44
44
  const { message, offchainTokenData, proofs } = executionReport
45
45
 
@@ -5,7 +5,7 @@ import { Transaction } from '@mysten/sui/transactions'
5
5
  import { serializeExecutionReport } from './encoder.ts'
6
6
  import { CCIPMessageInvalidError } from '../../errors/specialized.ts'
7
7
  import { decodeExtraArgs } from '../../extra-args.ts'
8
- import type { ExecutionReport } from '../../types.ts'
8
+ import type { ExecutionInput } from '../../types.ts'
9
9
  import { networkInfo } from '../../utils.ts'
10
10
  import type { CCIPMessage_V1_6_Sui } from '../types.ts'
11
11
 
@@ -30,7 +30,7 @@ export type TokenConfig = {
30
30
  /** Input parameters for building a Sui manual execution transaction. */
31
31
  export type SuiManuallyExecuteInput = {
32
32
  offrampAddress: string
33
- executionReport: ExecutionReport<CCIPMessage_V1_6_Sui>
33
+ executionReport: ExecutionInput<CCIPMessage_V1_6_Sui>
34
34
  ccipAddress: string
35
35
  ccipObjectRef: string
36
36
  offrampStateObject: string
package/src/ton/exec.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { type Cell, beginCell } from '@ton/core'
2
2
 
3
- import type { ExecutionReport } from '../types.ts'
4
- import {
5
- type CCIPMessage_V1_6_TON,
6
- MANUALLY_EXECUTE_OPCODE,
7
- serializeExecutionReport,
8
- } from './types.ts'
3
+ import type { ExecutionInput } from '../types.ts'
4
+ import { MANUALLY_EXECUTE_OPCODE, serializeExecutionReport } from './types.ts'
5
+ import type { CCIPMessage_V1_6_EVM } from '../evm/messages.ts'
9
6
 
10
7
  /**
11
8
  * Generates an unsigned execute report payload for the TON OffRamp contract.
@@ -17,7 +14,7 @@ import {
17
14
  */
18
15
  export function generateUnsignedExecuteReport(
19
16
  offRamp: string,
20
- execReport: ExecutionReport<CCIPMessage_V1_6_TON>,
17
+ execReport: ExecutionInput<CCIPMessage_V1_6_EVM>,
21
18
  opts?: { gasLimit?: number },
22
19
  ): { to: string; body: Cell } {
23
20
  // Serialize the execution report
package/src/ton/index.ts CHANGED
@@ -12,6 +12,7 @@ import { generateUnsignedCcipSend, getFee as getFeeImpl } from './send.ts'
12
12
  import { type ChainContext, type GetBalanceOpts, type LogFilter, Chain } from '../chain.ts'
13
13
  import {
14
14
  CCIPArgumentInvalidError,
15
+ CCIPExecutionReportChainMismatchError,
15
16
  CCIPExtraArgsInvalidError,
16
17
  CCIPHttpError,
17
18
  CCIPNotImplementedError,
@@ -20,22 +21,21 @@ import {
20
21
  CCIPTopicsInvalidError,
21
22
  CCIPTransactionNotFoundError,
22
23
  CCIPWalletInvalidError,
23
- } from '../errors/specialized.ts'
24
+ } from '../errors/index.ts'
24
25
  import { type EVMExtraArgsV2, type ExtraArgs, EVMExtraArgsV2Tag } from '../extra-args.ts'
25
26
  import type { LeafHasher } from '../hasher/common.ts'
26
- import { buildMessageForDest } from '../requests.ts'
27
+ import { buildMessageForDest, getMessagesInBatch } from '../requests.ts'
27
28
  import { supportedChains } from '../supported-chains.ts'
28
29
  import {
29
30
  type CCIPExecution,
30
31
  type CCIPRequest,
32
+ type ChainLog,
31
33
  type ChainTransaction,
32
34
  type CommitReport,
35
+ type ExecutionInput,
33
36
  type ExecutionReceipt,
34
- type ExecutionReport,
35
37
  type Lane,
36
- type Log_,
37
38
  type NetworkInfo,
38
- type OffchainTokenData,
39
39
  type WithLogger,
40
40
  CCIPVersion,
41
41
  ChainFamily,
@@ -49,10 +49,11 @@ import {
49
49
  parseTypeAndVersion,
50
50
  sleep,
51
51
  } from '../utils.ts'
52
- import { generateUnsignedExecuteReport as generateUnsignedExecuteReportImpl } from './exec.ts'
52
+ import { generateUnsignedExecuteReport } from './exec.ts'
53
53
  import { getTONLeafHasher } from './hasher.ts'
54
- import { type CCIPMessage_V1_6_TON, type UnsignedTONTx, isTONWallet } from './types.ts'
54
+ import { type UnsignedTONTx, isTONWallet } from './types.ts'
55
55
  import { crc32, lookupTxByRawHash, parseJettonContent } from './utils.ts'
56
+ import type { CCIPMessage_V1_6_EVM } from '../evm/messages.ts'
56
57
  export type { TONWallet, UnsignedTONTx } from './types.ts'
57
58
 
58
59
  /**
@@ -307,13 +308,13 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
307
308
  const compositeHash = `${address.toRawString()}:${tx.lt}:${tx.hash().toString('hex')}`
308
309
  const res = {
309
310
  hash: compositeHash,
310
- logs: [] as Log_[],
311
+ logs: [] as ChainLog[],
311
312
  blockNumber: Number(tx.lt), // Note: This is lt (logical time), not block seqno
312
313
  timestamp: tx.now,
313
314
  from: address.toRawString(),
314
315
  tx,
315
316
  }
316
- const logs: Log_[] = []
317
+ const logs: ChainLog[] = []
317
318
  for (const [index, msg] of tx.outMessages) {
318
319
  if (msg.info.type !== 'external-out') continue
319
320
  const topics = []
@@ -349,7 +350,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
349
350
  * @param opts - Log filter options (startBlock/endBlock are interpreted as lt values)
350
351
  * @throws {@link CCIPTopicsInvalidError} if topics format is invalid
351
352
  */
352
- async *getLogs(opts: LogFilter): AsyncIterableIterator<Log_> {
353
+ async *getLogs(opts: LogFilter): AsyncIterableIterator<ChainLog> {
353
354
  let topics
354
355
  if (opts.topics?.length) {
355
356
  if (!opts.topics.every((topic) => typeof topic === 'string'))
@@ -370,21 +371,18 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
370
371
  }
371
372
  }
372
373
 
373
- /**
374
- * {@inheritDoc Chain.getMessagesInBatch}
375
- * @throws {@link CCIPNotImplementedError} always (not implemented for TON)
376
- */
374
+ /** {@inheritDoc Chain.getMessagesInBatch} */
377
375
  override async getMessagesInBatch<
378
376
  R extends PickDeep<
379
377
  CCIPRequest,
380
378
  'lane' | `log.${'topics' | 'address' | 'blockNumber'}` | 'message.sequenceNumber'
381
379
  >,
382
380
  >(
383
- _request: R,
384
- _commit: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
385
- _opts?: { page?: number },
381
+ request: R,
382
+ range: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
383
+ opts?: Pick<LogFilter, 'page'>,
386
384
  ): Promise<R['message'][]> {
387
- return Promise.reject(new CCIPNotImplementedError('getMessagesInBatch'))
385
+ return getMessagesInBatch(this, request, range, opts)
388
386
  }
389
387
 
390
388
  /** {@inheritDoc Chain.typeAndVersion} */
@@ -462,10 +460,10 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
462
460
  }
463
461
 
464
462
  /**
465
- * {@inheritDoc Chain.getOnRampForOffRamp}
463
+ * {@inheritDoc Chain.getOnRampsForOffRamp}
466
464
  * @throws {@link CCIPSourceChainUnsupportedError} if source chain is not configured
467
465
  */
468
- async getOnRampForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string> {
466
+ async getOnRampsForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string[]> {
469
467
  try {
470
468
  const offRampContract = this.provider.provider(Address.parse(offRamp))
471
469
 
@@ -493,7 +491,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
493
491
  const onRampLength = onRampSlice.loadUint(8)
494
492
  onRamp = onRampSlice.loadBuffer(onRampLength)
495
493
  }
496
- return decodeAddress(onRamp, networkInfo(sourceChainSelector).family)
494
+ return [decodeAddress(onRamp, networkInfo(sourceChainSelector).family)]
497
495
  } catch (error) {
498
496
  if (isTvmError(error) && error.exitCode === 266) {
499
497
  throw new CCIPSourceChainUnsupportedError(sourceChainSelector, {
@@ -504,12 +502,6 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
504
502
  }
505
503
  }
506
504
 
507
- /** {@inheritDoc Chain.getCommitStoreForOffRamp} */
508
- async getCommitStoreForOffRamp(offRamp: string): Promise<string> {
509
- // TODO: FIXME: check assumption
510
- return Promise.resolve(offRamp)
511
- }
512
-
513
505
  /**
514
506
  * {@inheritDoc Chain.getTokenForTokenPool}
515
507
  * @throws {@link CCIPNotImplementedError} always (not implemented for TON)
@@ -595,7 +587,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
595
587
  }: {
596
588
  data: unknown
597
589
  topics?: readonly string[]
598
- }): CCIPMessage_V1_6_TON | undefined {
590
+ }): CCIPMessage_V1_6_EVM | undefined {
599
591
  if (!data || typeof data !== 'string') return
600
592
  if (topics?.length && topics[0] !== crc32('CCIPMessageSent')) return
601
593
 
@@ -617,7 +609,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
617
609
  }
618
610
 
619
611
  // Load sender address
620
- const sender = slice.loadAddress().toString()
612
+ const sender = slice.loadAddress().toRawString()
621
613
 
622
614
  // Load body cell ref
623
615
  const bodyCell = slice.loadRef()
@@ -664,14 +656,11 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
664
656
  const allowOutOfOrderExecution = extraArgsSlice.loadBit()
665
657
 
666
658
  // Build extraArgs as raw hex matching reference format
667
- const tagHex = extraArgsTag.toString(16).padStart(8, '0')
668
- const gasLimitHex = (hasGasLimit ? '8' : '0') + gasLimit.toString(16).padStart(63, '0')
669
- const oooByte = allowOutOfOrderExecution ? '40' : '00'
670
- const extraArgs = '0x' + tagHex + gasLimitHex + oooByte
659
+ const extraArgs = '0x' + extraArgsCell.toBoc().toString('hex')
671
660
 
672
661
  // Load tokenAmounts from ref 3
673
662
  const _tokenAmountsCell = bodySlice.loadRef()
674
- const tokenAmounts: CCIPMessage_V1_6_TON['tokenAmounts'] = [] // TODO: FIXME: parse when implemented
663
+ const tokenAmounts: CCIPMessage_V1_6_EVM['tokenAmounts'] = [] // TODO: FIXME: parse when implemented
675
664
 
676
665
  // Load feeToken (inline address in body)
677
666
  const feeToken = bodySlice.loadMaybeAddress()?.toString() ?? ''
@@ -832,7 +821,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
832
821
  * - sourceChainSelector: uint64 (8 bytes)
833
822
  * - sequenceNumber: uint64 (8 bytes)
834
823
  * - messageId: uint256 (32 bytes)
835
- * - state: uint8 (1 byte) - Untouched=0, InProgress=1, Success=2, Failure=3
824
+ * - state: uint8 (1 byte) - InProgress=1, Success=2, Failed=3
836
825
  *
837
826
  * @param log - Log with data field (base64-encoded BOC).
838
827
  * @returns ExecutionReceipt or undefined if not valid.
@@ -1110,27 +1099,28 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
1110
1099
  throw new CCIPTransactionNotFoundError(seqno.toString())
1111
1100
  }
1112
1101
 
1113
- /** {@inheritDoc Chain.getOffchainTokenData} */
1114
- getOffchainTokenData(request: CCIPRequest): Promise<OffchainTokenData[]> {
1115
- return Promise.resolve(request.message.tokenAmounts.map(() => undefined))
1116
- }
1117
-
1118
1102
  /**
1119
- * {@inheritDoc Chain.generateUnsignedExecuteReport}
1103
+ * {@inheritDoc Chain.generateUnsignedExecute}
1120
1104
  * @throws {@link CCIPExtraArgsInvalidError} if extra args are not EVMExtraArgsV2 format
1121
1105
  */
1122
- generateUnsignedExecuteReport({
1123
- offRamp,
1124
- execReport,
1125
- ...opts
1126
- }: Parameters<Chain['generateUnsignedExecuteReport']>[0]): Promise<UnsignedTONTx> {
1127
- if (!('allowOutOfOrderExecution' in execReport.message && 'gasLimit' in execReport.message)) {
1106
+ generateUnsignedExecute(
1107
+ opts: Parameters<Chain['generateUnsignedExecute']>[0],
1108
+ ): Promise<UnsignedTONTx> {
1109
+ if (
1110
+ !(
1111
+ 'input' in opts &&
1112
+ 'message' in opts.input &&
1113
+ 'allowOutOfOrderExecution' in opts.input.message &&
1114
+ 'gasLimit' in opts.input.message
1115
+ )
1116
+ ) {
1128
1117
  throw new CCIPExtraArgsInvalidError('TON')
1129
1118
  }
1119
+ const { offRamp, input } = opts
1130
1120
 
1131
- const unsigned = generateUnsignedExecuteReportImpl(
1121
+ const unsigned = generateUnsignedExecuteReport(
1132
1122
  offRamp,
1133
- execReport as ExecutionReport<CCIPMessage_V1_6_TON>,
1123
+ input as ExecutionInput<CCIPMessage_V1_6_EVM>,
1134
1124
  opts,
1135
1125
  )
1136
1126
 
@@ -1141,18 +1131,20 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
1141
1131
  }
1142
1132
 
1143
1133
  /**
1144
- * {@inheritDoc Chain.executeReport}
1134
+ * {@inheritDoc Chain.execute}
1145
1135
  * @throws {@link CCIPWalletInvalidError} if wallet is not a valid TON wallet
1146
1136
  * @throws {@link CCIPReceiptNotFoundError} if execution receipt not found within timeout
1147
1137
  */
1148
- async executeReport(opts: Parameters<Chain['executeReport']>[0]): Promise<CCIPExecution> {
1138
+ async execute(opts: Parameters<Chain['execute']>[0]): Promise<CCIPExecution> {
1139
+ if (!('input' in opts && 'message' in opts.input))
1140
+ throw new CCIPExecutionReportChainMismatchError('TON')
1149
1141
  const { offRamp, wallet } = opts
1150
1142
  if (!isTONWallet(wallet)) {
1151
1143
  throw new CCIPWalletInvalidError(wallet)
1152
1144
  }
1153
1145
  const payer = await wallet.getAddress()
1154
1146
 
1155
- const { family: _, ...unsigned } = await this.generateUnsignedExecuteReport({
1147
+ const { family: _, ...unsigned } = await this.generateUnsignedExecute({
1156
1148
  ...opts,
1157
1149
  payer,
1158
1150
  })
@@ -1164,7 +1156,7 @@ export class TONChain extends Chain<typeof ChainFamily.TON> {
1164
1156
  ...unsigned,
1165
1157
  })
1166
1158
 
1167
- const message = opts.execReport.message as CCIPMessage_V1_6_TON
1159
+ const message = opts.input.message as CCIPMessage_V1_6_EVM
1168
1160
  for await (const exec of this.getExecutionReceipts({
1169
1161
  offRamp,
1170
1162
  messageId: message.messageId,
package/src/ton/types.ts CHANGED
@@ -2,13 +2,10 @@ import { type Builder, Address, Cell, beginCell } from '@ton/core'
2
2
  import { toBigInt } from 'ethers'
3
3
 
4
4
  import { CCIPDataFormatUnsupportedError } from '../errors/specialized.ts'
5
- import type { EVMExtraArgsV2 } from '../extra-args.ts'
6
- import type { CCIPMessage_V1_6, ChainFamily, ExecutionReport } from '../types.ts'
5
+ import type { CCIPMessage_V1_6_EVM } from '../evm/messages.ts'
6
+ import type { CCIPMessage_V1_6, ChainFamily, ExecutionInput } from '../types.ts'
7
7
  import { bytesToBuffer } from '../utils.ts'
8
8
 
9
- /** TON-specific CCIP v1.6 message type with EVMExtraArgsV2 (GenericExtraArgsV2) */
10
- export type CCIPMessage_V1_6_TON = CCIPMessage_V1_6 & EVMExtraArgsV2
11
-
12
9
  /** Opcode for OffRamp_ManuallyExecute message on TON */
13
10
  export const MANUALLY_EXECUTE_OPCODE = 0xa00785cf
14
11
 
@@ -83,7 +80,7 @@ function asSnakeData<T>(array: T[], builderFn: (item: T) => Builder): Cell {
83
80
  * @returns BOC-serialized Cell containing the execution report.
84
81
  */
85
82
  export function serializeExecutionReport(
86
- execReport: ExecutionReport<CCIPMessage_V1_6_TON>,
83
+ execReport: ExecutionInput<CCIPMessage_V1_6_EVM>,
87
84
  ): Builder {
88
85
  return beginCell()
89
86
  .storeUint(execReport.message.sourceChainSelector, 64)
@@ -97,7 +94,7 @@ export function serializeExecutionReport(
97
94
  .storeUint(execReport.proofFlagBits, 256)
98
95
  }
99
96
 
100
- function serializeMessage(message: CCIPMessage_V1_6_TON): Builder {
97
+ function serializeMessage(message: CCIPMessage_V1_6_EVM): Builder {
101
98
  return beginCell()
102
99
  .storeUint(BigInt(message.messageId), 256)
103
100
  .storeUint(message.sourceChainSelector, 64)