@chainlink/ccip-sdk 0.96.0 → 0.97.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 (199) hide show
  1. package/dist/api/index.d.ts +17 -8
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/api/index.js +27 -10
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/types.d.ts +0 -2
  6. package/dist/api/types.d.ts.map +1 -1
  7. package/dist/aptos/exec.d.ts +2 -2
  8. package/dist/aptos/exec.d.ts.map +1 -1
  9. package/dist/aptos/exec.js.map +1 -1
  10. package/dist/aptos/hasher.d.ts.map +1 -1
  11. package/dist/aptos/hasher.js +1 -1
  12. package/dist/aptos/hasher.js.map +1 -1
  13. package/dist/aptos/index.d.ts +13 -10
  14. package/dist/aptos/index.d.ts.map +1 -1
  15. package/dist/aptos/index.js +42 -68
  16. package/dist/aptos/index.js.map +1 -1
  17. package/dist/aptos/types.d.ts +2 -19
  18. package/dist/aptos/types.d.ts.map +1 -1
  19. package/dist/aptos/types.js +0 -11
  20. package/dist/aptos/types.js.map +1 -1
  21. package/dist/chain.d.ts +532 -151
  22. package/dist/chain.d.ts.map +1 -1
  23. package/dist/chain.js +113 -18
  24. package/dist/chain.js.map +1 -1
  25. package/dist/commits.d.ts +4 -6
  26. package/dist/commits.d.ts.map +1 -1
  27. package/dist/commits.js +4 -4
  28. package/dist/commits.js.map +1 -1
  29. package/dist/errors/CCIPError.d.ts +33 -4
  30. package/dist/errors/CCIPError.d.ts.map +1 -1
  31. package/dist/errors/CCIPError.js +33 -4
  32. package/dist/errors/CCIPError.js.map +1 -1
  33. package/dist/errors/codes.d.ts +3 -0
  34. package/dist/errors/codes.d.ts.map +1 -1
  35. package/dist/errors/codes.js +3 -1
  36. package/dist/errors/codes.js.map +1 -1
  37. package/dist/errors/index.d.ts +1 -1
  38. package/dist/errors/index.d.ts.map +1 -1
  39. package/dist/errors/index.js +1 -1
  40. package/dist/errors/index.js.map +1 -1
  41. package/dist/errors/recovery.d.ts.map +1 -1
  42. package/dist/errors/recovery.js +4 -1
  43. package/dist/errors/recovery.js.map +1 -1
  44. package/dist/errors/specialized.d.ts +1695 -120
  45. package/dist/errors/specialized.d.ts.map +1 -1
  46. package/dist/errors/specialized.js +1715 -123
  47. package/dist/errors/specialized.js.map +1 -1
  48. package/dist/errors/utils.d.ts.map +1 -1
  49. package/dist/errors/utils.js +0 -1
  50. package/dist/errors/utils.js.map +1 -1
  51. package/dist/evm/abi/OffRamp_2_0.d.ts +764 -0
  52. package/dist/evm/abi/OffRamp_2_0.d.ts.map +1 -0
  53. package/dist/evm/abi/OffRamp_2_0.js +744 -0
  54. package/dist/evm/abi/OffRamp_2_0.js.map +1 -0
  55. package/dist/evm/abi/OnRamp_2_0.d.ts +925 -0
  56. package/dist/evm/abi/OnRamp_2_0.d.ts.map +1 -0
  57. package/dist/evm/abi/OnRamp_2_0.js +992 -0
  58. package/dist/evm/abi/OnRamp_2_0.js.map +1 -0
  59. package/dist/evm/const.d.ts +12 -2
  60. package/dist/evm/const.d.ts.map +1 -1
  61. package/dist/evm/const.js +8 -2
  62. package/dist/evm/const.js.map +1 -1
  63. package/dist/evm/errors.d.ts.map +1 -1
  64. package/dist/evm/errors.js +7 -2
  65. package/dist/evm/errors.js.map +1 -1
  66. package/dist/evm/extra-args.d.ts.map +1 -1
  67. package/dist/evm/extra-args.js +5 -24
  68. package/dist/evm/extra-args.js.map +1 -1
  69. package/dist/evm/hasher.d.ts.map +1 -1
  70. package/dist/evm/hasher.js +23 -13
  71. package/dist/evm/hasher.js.map +1 -1
  72. package/dist/evm/index.d.ts +73 -14
  73. package/dist/evm/index.d.ts.map +1 -1
  74. package/dist/evm/index.js +240 -141
  75. package/dist/evm/index.js.map +1 -1
  76. package/dist/evm/messages.d.ts +59 -5
  77. package/dist/evm/messages.d.ts.map +1 -1
  78. package/dist/evm/messages.js +210 -0
  79. package/dist/evm/messages.js.map +1 -1
  80. package/dist/evm/offchain.js.map +1 -1
  81. package/dist/evm/types.d.ts +7 -2
  82. package/dist/evm/types.d.ts.map +1 -1
  83. package/dist/evm/types.js +22 -1
  84. package/dist/evm/types.js.map +1 -1
  85. package/dist/execution.d.ts +62 -22
  86. package/dist/execution.d.ts.map +1 -1
  87. package/dist/execution.js +98 -61
  88. package/dist/execution.js.map +1 -1
  89. package/dist/extra-args.d.ts +13 -3
  90. package/dist/extra-args.d.ts.map +1 -1
  91. package/dist/extra-args.js +13 -3
  92. package/dist/extra-args.js.map +1 -1
  93. package/dist/gas.d.ts +25 -2
  94. package/dist/gas.d.ts.map +1 -1
  95. package/dist/gas.js +30 -4
  96. package/dist/gas.js.map +1 -1
  97. package/dist/index.d.ts +1 -1
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/requests.d.ts +85 -14
  100. package/dist/requests.d.ts.map +1 -1
  101. package/dist/requests.js +99 -16
  102. package/dist/requests.js.map +1 -1
  103. package/dist/selectors.d.ts.map +1 -1
  104. package/dist/selectors.js +12 -0
  105. package/dist/selectors.js.map +1 -1
  106. package/dist/shared/bcs-codecs.d.ts +61 -0
  107. package/dist/shared/bcs-codecs.d.ts.map +1 -0
  108. package/dist/shared/bcs-codecs.js +102 -0
  109. package/dist/shared/bcs-codecs.js.map +1 -0
  110. package/dist/shared/constants.d.ts +3 -0
  111. package/dist/shared/constants.d.ts.map +1 -0
  112. package/dist/shared/constants.js +3 -0
  113. package/dist/shared/constants.js.map +1 -0
  114. package/dist/solana/exec.d.ts +2 -2
  115. package/dist/solana/exec.d.ts.map +1 -1
  116. package/dist/solana/exec.js.map +1 -1
  117. package/dist/solana/index.d.ts +80 -17
  118. package/dist/solana/index.d.ts.map +1 -1
  119. package/dist/solana/index.js +67 -30
  120. package/dist/solana/index.js.map +1 -1
  121. package/dist/sui/hasher.d.ts.map +1 -1
  122. package/dist/sui/hasher.js +1 -1
  123. package/dist/sui/hasher.js.map +1 -1
  124. package/dist/sui/index.d.ts +14 -12
  125. package/dist/sui/index.d.ts.map +1 -1
  126. package/dist/sui/index.js +38 -34
  127. package/dist/sui/index.js.map +1 -1
  128. package/dist/sui/manuallyExec/encoder.d.ts +2 -2
  129. package/dist/sui/manuallyExec/encoder.d.ts.map +1 -1
  130. package/dist/sui/manuallyExec/encoder.js.map +1 -1
  131. package/dist/sui/manuallyExec/index.d.ts +2 -2
  132. package/dist/sui/manuallyExec/index.d.ts.map +1 -1
  133. package/dist/ton/exec.d.ts +2 -2
  134. package/dist/ton/exec.d.ts.map +1 -1
  135. package/dist/ton/exec.js.map +1 -1
  136. package/dist/ton/index.d.ts +9 -16
  137. package/dist/ton/index.d.ts.map +1 -1
  138. package/dist/ton/index.js +26 -31
  139. package/dist/ton/index.js.map +1 -1
  140. package/dist/ton/types.d.ts +2 -2
  141. package/dist/ton/types.d.ts.map +1 -1
  142. package/dist/ton/types.js.map +1 -1
  143. package/dist/types.d.ts +46 -11
  144. package/dist/types.d.ts.map +1 -1
  145. package/dist/types.js +6 -1
  146. package/dist/types.js.map +1 -1
  147. package/dist/utils.d.ts +65 -2
  148. package/dist/utils.d.ts.map +1 -1
  149. package/dist/utils.js +74 -2
  150. package/dist/utils.js.map +1 -1
  151. package/package.json +9 -9
  152. package/src/api/index.ts +33 -10
  153. package/src/api/types.ts +0 -2
  154. package/src/aptos/exec.ts +2 -2
  155. package/src/aptos/hasher.ts +1 -1
  156. package/src/aptos/index.ts +51 -89
  157. package/src/aptos/types.ts +2 -15
  158. package/src/chain.ts +581 -163
  159. package/src/commits.ts +9 -9
  160. package/src/errors/CCIPError.ts +33 -4
  161. package/src/errors/codes.ts +3 -1
  162. package/src/errors/index.ts +1 -0
  163. package/src/errors/recovery.ts +7 -1
  164. package/src/errors/specialized.ts +1726 -130
  165. package/src/errors/utils.ts +0 -1
  166. package/src/evm/abi/OffRamp_2_0.ts +743 -0
  167. package/src/evm/abi/OnRamp_2_0.ts +991 -0
  168. package/src/evm/const.ts +10 -3
  169. package/src/evm/errors.ts +6 -2
  170. package/src/evm/extra-args.ts +4 -21
  171. package/src/evm/hasher.ts +30 -18
  172. package/src/evm/index.ts +310 -166
  173. package/src/evm/messages.ts +323 -11
  174. package/src/evm/offchain.ts +2 -2
  175. package/src/evm/types.ts +20 -2
  176. package/src/execution.ts +125 -86
  177. package/src/extra-args.ts +13 -3
  178. package/src/gas.ts +29 -3
  179. package/src/index.ts +2 -2
  180. package/src/requests.ts +112 -16
  181. package/src/selectors.ts +12 -0
  182. package/src/shared/bcs-codecs.ts +132 -0
  183. package/src/shared/constants.ts +2 -0
  184. package/src/solana/exec.ts +4 -4
  185. package/src/solana/index.ts +100 -68
  186. package/src/sui/hasher.ts +1 -1
  187. package/src/sui/index.ts +50 -47
  188. package/src/sui/manuallyExec/encoder.ts +2 -2
  189. package/src/sui/manuallyExec/index.ts +2 -2
  190. package/src/ton/exec.ts +2 -2
  191. package/src/ton/index.ts +37 -40
  192. package/src/ton/types.ts +2 -2
  193. package/src/types.ts +70 -29
  194. package/src/utils.ts +73 -2
  195. package/dist/aptos/utils.d.ts +0 -12
  196. package/dist/aptos/utils.d.ts.map +0 -1
  197. package/dist/aptos/utils.js +0 -15
  198. package/dist/aptos/utils.js.map +0 -1
  199. package/src/aptos/utils.ts +0 -24
@@ -7,16 +7,7 @@ import {
7
7
  SimpleTransaction,
8
8
  TransactionResponseType,
9
9
  } from '@aptos-labs/ts-sdk'
10
- import {
11
- type BytesLike,
12
- concat,
13
- dataSlice,
14
- getBytes,
15
- hexlify,
16
- isBytesLike,
17
- isHexString,
18
- zeroPadValue,
19
- } from 'ethers'
10
+ import { type BytesLike, concat, isBytesLike, isHexString } from 'ethers'
20
11
  import { memoize } from 'micro-memoize'
21
12
  import type { PickDeep } from 'type-fest'
22
13
 
@@ -28,9 +19,11 @@ import {
28
19
  type TokenPoolRemote,
29
20
  Chain,
30
21
  } from '../chain.ts'
22
+ import { generateUnsignedExecuteReport } from './exec.ts'
23
+ import { getAptosLeafHasher } from './hasher.ts'
24
+ import { getUserTxByVersion, getVersionTimestamp, streamAptosLogs } from './logs.ts'
31
25
  import { generateUnsignedCcipSend, getFee } from './send.ts'
32
26
  import {
33
- CCIPAptosAddressInvalidError,
34
27
  CCIPAptosExtraArgsEncodingError,
35
28
  CCIPAptosExtraArgsV2RequiredError,
36
29
  CCIPAptosLogInvalidError,
@@ -50,13 +43,14 @@ import {
50
43
  EVMExtraArgsV2Tag,
51
44
  SVMExtraArgsV1Tag,
52
45
  } from '../extra-args.ts'
53
- import {
54
- type UnsignedAptosTx,
55
- EVMExtraArgsV2Codec,
56
- SVMExtraArgsV1Codec,
57
- isAptosAccount,
58
- } from './types.ts'
46
+ import { type UnsignedAptosTx, isAptosAccount } from './types.ts'
59
47
  import type { LeafHasher } from '../hasher/common.ts'
48
+ import {
49
+ BcsEVMExtraArgsV2Codec,
50
+ BcsSVMExtraArgsV1Codec,
51
+ decodeMoveExtraArgs,
52
+ getMoveAddress,
53
+ } from '../shared/bcs-codecs.ts'
60
54
  import { supportedChains } from '../supported-chains.ts'
61
55
  import {
62
56
  type CCIPExecution,
@@ -64,8 +58,8 @@ import {
64
58
  type CCIPRequest,
65
59
  type ChainTransaction,
66
60
  type CommitReport,
61
+ type ExecutionInput,
67
62
  type ExecutionReceipt,
68
- type ExecutionReport,
69
63
  type Lane,
70
64
  type Log_,
71
65
  type NetworkInfo,
@@ -78,14 +72,10 @@ import {
78
72
  decodeAddress,
79
73
  decodeOnRampAddress,
80
74
  getAddressBytes,
81
- getDataBytes,
82
75
  networkInfo,
83
76
  parseTypeAndVersion,
84
77
  util,
85
78
  } from '../utils.ts'
86
- import { generateUnsignedExecuteReport } from './exec.ts'
87
- import { getAptosLeafHasher } from './hasher.ts'
88
- import { getUserTxByVersion, getVersionTimestamp, streamAptosLogs } from './logs.ts'
89
79
  import { getTokenInfo } from './token.ts'
90
80
  import type { CCIPMessage_V1_6_EVM } from '../evm/messages.ts'
91
81
  import { buildMessageForDest, decodeMessage, getMessagesInBatch } from '../requests.ts'
@@ -98,13 +88,18 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
98
88
  static {
99
89
  supportedChains[ChainFamily.Aptos] = AptosChain
100
90
  }
91
+ /** Chain family identifier for Aptos networks. */
101
92
  static readonly family = ChainFamily.Aptos
93
+ /** Native token decimals (8 for APT). */
102
94
  static readonly decimals = 8
103
95
 
104
96
  readonly destroy$: Promise<void>
97
+ /** The Aptos SDK provider for blockchain interactions. */
105
98
  provider: Aptos
106
99
 
100
+ /** Retrieves token information for a given token address. */
107
101
  getTokenInfo: (token: string) => Promise<TokenInfo>
102
+ /** @internal */
108
103
  _getAccountModulesNames: (address: string) => Promise<string[]>
109
104
 
110
105
  /**
@@ -246,17 +241,17 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
246
241
  }
247
242
 
248
243
  /** {@inheritDoc Chain.getMessagesInBatch} */
249
- async getMessagesInBatch<
244
+ override async getMessagesInBatch<
250
245
  R extends PickDeep<
251
246
  CCIPRequest,
252
247
  'lane' | `log.${'topics' | 'address' | 'blockNumber'}` | 'message.sequenceNumber'
253
248
  >,
254
249
  >(
255
250
  request: R,
256
- commit: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
251
+ range: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>,
257
252
  opts?: { page?: number },
258
253
  ): Promise<R['message'][]> {
259
- return getMessagesInBatch(this, request, commit, opts)
254
+ return getMessagesInBatch(this, request, range, opts)
260
255
  }
261
256
 
262
257
  /** {@inheritDoc Chain.typeAndVersion} */
@@ -296,8 +291,8 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
296
291
  return Promise.resolve(router.split('::')[0] + '::onramp')
297
292
  }
298
293
 
299
- /** {@inheritDoc Chain.getOnRampForOffRamp} */
300
- async getOnRampForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string> {
294
+ /** {@inheritDoc Chain.getOnRampsForOffRamp} */
295
+ async getOnRampsForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string[]> {
301
296
  const [sourceChainConfig] = await this.provider.view<[{ on_ramp: string }]>({
302
297
  payload: {
303
298
  function:
@@ -305,12 +300,7 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
305
300
  functionArguments: [sourceChainSelector],
306
301
  },
307
302
  })
308
- return decodeAddress(sourceChainConfig.on_ramp, networkInfo(sourceChainSelector).family)
309
- }
310
-
311
- /** {@inheritDoc Chain.getCommitStoreForOffRamp} */
312
- getCommitStoreForOffRamp(offRamp: string): Promise<string> {
313
- return Promise.resolve(offRamp.split('::')[0] + '::offramp')
303
+ return [decodeAddress(sourceChainConfig.on_ramp, networkInfo(sourceChainSelector).family)]
314
304
  }
315
305
 
316
306
  /** {@inheritDoc Chain.getTokenForTokenPool} */
@@ -393,33 +383,7 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
393
383
  | (EVMExtraArgsV2 & { _tag: 'EVMExtraArgsV2' })
394
384
  | (SVMExtraArgsV1 & { _tag: 'SVMExtraArgsV1' })
395
385
  | undefined {
396
- const data = getDataBytes(extraArgs),
397
- tag = dataSlice(data, 0, 4)
398
- switch (tag) {
399
- case EVMExtraArgsV2Tag: {
400
- const parsed = EVMExtraArgsV2Codec.parse(getBytes(dataSlice(data, 4)))
401
- // Aptos serialization of EVMExtraArgsV2: 37 bytes total: 4 tag + 32 LE gasLimit + 1 allowOOOE
402
- return {
403
- _tag: 'EVMExtraArgsV2',
404
- ...parsed,
405
- gasLimit: BigInt(parsed.gasLimit),
406
- }
407
- }
408
- case SVMExtraArgsV1Tag: {
409
- const parsed = SVMExtraArgsV1Codec.parse(getBytes(dataSlice(data, 4)))
410
- // Aptos serialization of SVMExtraArgsV1: 13 bytes total: 4 tag + 8 LE computeUnits
411
- return {
412
- _tag: 'SVMExtraArgsV1',
413
- ...parsed,
414
- computeUnits: BigInt(parsed.computeUnits),
415
- accountIsWritableBitmap: BigInt(parsed.accountIsWritableBitmap),
416
- tokenReceiver: decodeAddress(new Uint8Array(parsed.tokenReceiver), ChainFamily.Solana),
417
- accounts: parsed.accounts.map((account) =>
418
- decodeAddress(new Uint8Array(account), ChainFamily.Solana),
419
- ),
420
- }
421
- }
422
- }
386
+ return decodeMoveExtraArgs(extraArgs)
423
387
  }
424
388
 
425
389
  /**
@@ -430,11 +394,11 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
430
394
  */
431
395
  static encodeExtraArgs(extraArgs: ExtraArgs): string {
432
396
  if ('gasLimit' in extraArgs && 'allowOutOfOrderExecution' in extraArgs)
433
- return concat([EVMExtraArgsV2Tag, EVMExtraArgsV2Codec.serialize(extraArgs).toBytes()])
397
+ return concat([EVMExtraArgsV2Tag, BcsEVMExtraArgsV2Codec.serialize(extraArgs).toBytes()])
434
398
  else if ('computeUnits' in extraArgs)
435
399
  return concat([
436
400
  SVMExtraArgsV1Tag,
437
- SVMExtraArgsV1Codec.serialize({
401
+ BcsSVMExtraArgsV1Codec.serialize({
438
402
  ...extraArgs,
439
403
  computeUnits: Number(extraArgs.computeUnits),
440
404
  tokenReceiver: getAddressBytes(extraArgs.tokenReceiver),
@@ -498,21 +462,10 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
498
462
  * Converts bytes to an Aptos address.
499
463
  * @param bytes - Bytes to convert.
500
464
  * @returns Aptos address (0x-prefixed hex, 32 bytes padded).
501
- * @throws {@link CCIPAptosAddressInvalidError} if bytes length exceeds 32
465
+ * @throws {@link CCIPDataFormatUnsupportedError} if bytes length exceeds 32
502
466
  */
503
467
  static getAddress(bytes: BytesLike | readonly number[]): string {
504
- let suffix = ''
505
- if (Array.isArray(bytes)) bytes = new Uint8Array(bytes)
506
- if (typeof bytes === 'string' && bytes.startsWith('0x')) {
507
- const idx = bytes.indexOf('::')
508
- if (idx > 0) {
509
- suffix = bytes.slice(idx)
510
- bytes = bytes.slice(0, idx)
511
- }
512
- }
513
- bytes = getDataBytes(bytes)
514
- if (bytes.length > 32) throw new CCIPAptosAddressInvalidError(hexlify(bytes))
515
- return zeroPadValue(bytes, 32) + suffix
468
+ return getMoveAddress(bytes)
516
469
  }
517
470
 
518
471
  /**
@@ -607,24 +560,29 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
607
560
  }
608
561
 
609
562
  /**
610
- * {@inheritDoc Chain.generateUnsignedExecuteReport}
563
+ * {@inheritDoc Chain.generateUnsignedExecute}
611
564
  * @throws {@link CCIPAptosExtraArgsV2RequiredError} if message missing EVMExtraArgsV2 fields
612
565
  */
613
- async generateUnsignedExecuteReport({
566
+ async generateUnsignedExecute({
614
567
  payer,
615
- offRamp,
616
- execReport,
617
568
  ...opts
618
- }: Parameters<Chain['generateUnsignedExecuteReport']>[0]): Promise<UnsignedAptosTx> {
619
- if (!('allowOutOfOrderExecution' in execReport.message && 'gasLimit' in execReport.message)) {
569
+ }: Parameters<Chain['generateUnsignedExecute']>[0]): Promise<UnsignedAptosTx> {
570
+ if (
571
+ !(
572
+ 'input' in opts &&
573
+ 'message' in opts.input &&
574
+ 'allowOutOfOrderExecution' in opts.input.message &&
575
+ 'gasLimit' in opts.input.message
576
+ )
577
+ ) {
620
578
  throw new CCIPAptosExtraArgsV2RequiredError()
621
579
  }
622
580
 
623
581
  const tx = await generateUnsignedExecuteReport(
624
582
  this.provider,
625
583
  payer,
626
- offRamp,
627
- execReport as ExecutionReport<CCIPMessage_V1_6_EVM>,
584
+ opts.offRamp,
585
+ opts.input as ExecutionInput<CCIPMessage_V1_6_EVM>,
628
586
  opts,
629
587
  )
630
588
  return {
@@ -634,16 +592,16 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
634
592
  }
635
593
 
636
594
  /**
637
- * {@inheritDoc Chain.executeReport}
595
+ * {@inheritDoc Chain.execute}
638
596
  * @throws {@link CCIPAptosWalletInvalidError} if wallet is not a valid Aptos account
639
597
  */
640
- async executeReport(opts: Parameters<Chain['executeReport']>[0]): Promise<CCIPExecution> {
598
+ async execute(opts: Parameters<Chain['execute']>[0]): Promise<CCIPExecution> {
641
599
  const account = opts.wallet
642
600
  if (!isAptosAccount(account)) {
643
601
  throw new CCIPAptosWalletInvalidError(this.constructor.name, util.inspect(opts.wallet))
644
602
  }
645
603
 
646
- const unsignedTx = await this.generateUnsignedExecuteReport({
604
+ const unsignedTx = await this.generateUnsignedExecute({
647
605
  ...opts,
648
606
  payer: account.accountAddress.toString(),
649
607
  })
@@ -670,9 +628,13 @@ export class AptosChain extends Chain<typeof ChainFamily.Aptos> {
670
628
  * @returns Parsed data or undefined.
671
629
  */
672
630
  static parse(data: unknown) {
673
- if (isBytesLike(data)) {
674
- const parsedExtraArgs = this.decodeExtraArgs(data)
675
- if (parsedExtraArgs) return parsedExtraArgs
631
+ try {
632
+ if (isBytesLike(data)) {
633
+ const parsedExtraArgs = this.decodeExtraArgs(data)
634
+ if (parsedExtraArgs) return parsedExtraArgs
635
+ }
636
+ } catch {
637
+ // ignore
676
638
  }
677
639
  }
678
640
 
@@ -8,7 +8,7 @@ import { bcs } from '@mysten/bcs'
8
8
  import { getBytes } from 'ethers'
9
9
 
10
10
  import type { CCIPMessage_V1_6_EVM } from '../evm/messages.ts'
11
- import type { ChainFamily, ExecutionReport } from '../types.ts'
11
+ import type { ChainFamily, ExecutionInput } from '../types.ts'
12
12
  import { getAddressBytes } from '../utils.ts'
13
13
 
14
14
  /** Aptos account type with async transaction signing capability. */
@@ -31,19 +31,6 @@ export function isAptosAccount(account: unknown): account is AptosAsyncAccount {
31
31
  )
32
32
  }
33
33
 
34
- export const EVMExtraArgsV2Codec = bcs.struct('EVMExtraArgsV2', {
35
- gasLimit: bcs.u256(),
36
- allowOutOfOrderExecution: bcs.bool(),
37
- })
38
-
39
- export const SVMExtraArgsV1Codec = bcs.struct('SVMExtraArgsV1', {
40
- computeUnits: bcs.u32(),
41
- accountIsWritableBitmap: bcs.u64(),
42
- allowOutOfOrderExecution: bcs.bool(),
43
- tokenReceiver: bcs.vector(bcs.u8()),
44
- accounts: bcs.vector(bcs.vector(bcs.u8())),
45
- })
46
-
47
34
  export const ExecutionReportCodec = bcs.struct('ExecutionReport', {
48
35
  sourceChainSelector: bcs.u64(),
49
36
  messageId: bcs.fixedArray(32, bcs.u8()),
@@ -74,7 +61,7 @@ export const ExecutionReportCodec = bcs.struct('ExecutionReport', {
74
61
  * @returns BCS-encoded bytes.
75
62
  */
76
63
  export function serializeExecutionReport(
77
- execReport: ExecutionReport<CCIPMessage_V1_6_EVM>,
64
+ execReport: ExecutionInput<CCIPMessage_V1_6_EVM>,
78
65
  ): Uint8Array {
79
66
  const message = execReport.message
80
67
  return ExecutionReportCodec.serialize({