@chainlink/ccip-cli 0.93.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -40
- package/dist/commands/manual-exec.d.ts.map +1 -1
- package/dist/commands/manual-exec.js +11 -11
- package/dist/commands/manual-exec.js.map +1 -1
- package/dist/commands/send.d.ts +6 -10
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +72 -89
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +2 -4
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/supported-tokens.d.ts +2 -2
- package/dist/commands/supported-tokens.d.ts.map +1 -1
- package/dist/commands/supported-tokens.js +22 -10
- package/dist/commands/supported-tokens.js.map +1 -1
- package/dist/commands/token.d.ts +26 -0
- package/dist/commands/token.d.ts.map +1 -0
- package/dist/commands/token.js +105 -0
- package/dist/commands/token.js.map +1 -0
- package/dist/commands/utils.d.ts.map +1 -1
- package/dist/commands/utils.js +21 -7
- package/dist/commands/utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -3
- package/dist/providers/index.js.map +1 -1
- package/package.json +17 -17
- package/src/commands/manual-exec.ts +13 -23
- package/src/commands/send.ts +78 -107
- package/src/commands/show.ts +1 -4
- package/src/commands/supported-tokens.ts +21 -10
- package/src/commands/token.ts +132 -0
- package/src/commands/utils.ts +23 -6
- package/src/index.ts +2 -2
- package/src/providers/index.ts +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OA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ccip-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"description": "CCIP Command Line Interface, based on @chainlink/ccip-sdk",
|
|
5
5
|
"author": "Chainlink devs",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"repository":
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/smartcontractkit/ccip-tools-ts.git"
|
|
10
|
+
},
|
|
8
11
|
"type": "module",
|
|
9
12
|
"bin": "dist/index.js",
|
|
10
13
|
"scripts": {
|
|
@@ -29,37 +32,34 @@
|
|
|
29
32
|
],
|
|
30
33
|
"devDependencies": {
|
|
31
34
|
"@eslint/js": "^9.39.2",
|
|
32
|
-
"@types/node": "25.0.
|
|
35
|
+
"@types/node": "25.0.10",
|
|
33
36
|
"@types/yargs": "17.0.35",
|
|
34
37
|
"eslint": "^9.39.2",
|
|
35
38
|
"eslint-config-prettier": "10.1.8",
|
|
36
39
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
37
40
|
"eslint-plugin-import": "^2.32.0",
|
|
38
|
-
"eslint-plugin-jsdoc": "^
|
|
39
|
-
"eslint-plugin-prettier": "^5.5.
|
|
41
|
+
"eslint-plugin-jsdoc": "^62.4.1",
|
|
42
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
40
43
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
41
|
-
"prettier": "^3.
|
|
44
|
+
"prettier": "^3.8.1",
|
|
42
45
|
"tsx": "4.21.0",
|
|
43
46
|
"typescript": "5.9.3",
|
|
44
|
-
"typescript-eslint": "8.
|
|
47
|
+
"typescript-eslint": "8.54.0"
|
|
45
48
|
},
|
|
46
49
|
"dependencies": {
|
|
47
|
-
"@aptos-labs/ts-sdk": "^5.2.
|
|
48
|
-
"@chainlink/ccip-sdk": "^0.
|
|
50
|
+
"@aptos-labs/ts-sdk": "^5.2.1",
|
|
51
|
+
"@chainlink/ccip-sdk": "^0.95.0",
|
|
49
52
|
"@coral-xyz/anchor": "^0.29.0",
|
|
50
53
|
"@ethers-ext/signer-ledger": "^6.0.0-beta.1",
|
|
51
|
-
"@inquirer/prompts": "8.
|
|
52
|
-
"@ledgerhq/hw-app-aptos": "^6.
|
|
53
|
-
"@ledgerhq/hw-app-solana": "^7.
|
|
54
|
-
"@ledgerhq/hw-transport-node-hid": "^6.
|
|
54
|
+
"@inquirer/prompts": "8.2.0",
|
|
55
|
+
"@ledgerhq/hw-app-aptos": "^6.35.0",
|
|
56
|
+
"@ledgerhq/hw-app-solana": "^7.7.0",
|
|
57
|
+
"@ledgerhq/hw-transport-node-hid": "^6.30.0",
|
|
55
58
|
"@solana/web3.js": "^1.98.4",
|
|
56
59
|
"@ton-community/ton-ledger": "^7.3.0",
|
|
57
60
|
"bs58": "^6.0.0",
|
|
58
61
|
"ethers": "6.16.0",
|
|
59
|
-
"type-fest": "^5.
|
|
62
|
+
"type-fest": "^5.4.2",
|
|
60
63
|
"yargs": "18.0.0"
|
|
61
|
-
},
|
|
62
|
-
"overrides": {
|
|
63
|
-
"@ledgerhq/types-live": "6.90.0"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type CCIPRequest,
|
|
3
|
-
type CCIPVersion,
|
|
4
|
-
type EVMChain,
|
|
5
2
|
type ExecutionReport,
|
|
6
|
-
CCIPChainFamilyUnsupportedError,
|
|
7
|
-
ChainFamily,
|
|
8
3
|
bigIntReplacer,
|
|
9
4
|
calculateManualExecProof,
|
|
10
5
|
discoverOffRamp,
|
|
11
|
-
|
|
6
|
+
estimateReceiveExecution,
|
|
12
7
|
isSupportedTxHash,
|
|
13
8
|
} from '@chainlink/ccip-sdk/src/index.ts'
|
|
14
9
|
import type { Argv } from 'yargs'
|
|
@@ -180,31 +175,26 @@ async function manualExec(
|
|
|
180
175
|
offchainTokenData,
|
|
181
176
|
}
|
|
182
177
|
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
'gasLimit' in request.message &&
|
|
186
|
-
'extraArgs' in request.message
|
|
187
|
-
) {
|
|
188
|
-
if (dest.network.family !== ChainFamily.EVM)
|
|
189
|
-
throw new CCIPChainFamilyUnsupportedError(dest.network.family, {
|
|
190
|
-
context: { feature: 'gas estimation' },
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
let estimated = await estimateExecGasForRequest(
|
|
178
|
+
if (argv.estimateGasLimit != null) {
|
|
179
|
+
let estimated = await estimateReceiveExecution({
|
|
194
180
|
source,
|
|
195
|
-
dest
|
|
196
|
-
|
|
197
|
-
|
|
181
|
+
dest,
|
|
182
|
+
routerOrRamp: offRamp,
|
|
183
|
+
message: request.message,
|
|
184
|
+
})
|
|
198
185
|
logger.info('Estimated gasLimit override:', estimated)
|
|
199
186
|
estimated += Math.ceil((estimated * argv.estimateGasLimit) / 100)
|
|
200
|
-
|
|
187
|
+
const origLimit = Number(
|
|
188
|
+
'gasLimit' in request.message ? request.message.gasLimit : request.message.computeUnits,
|
|
189
|
+
)
|
|
190
|
+
if (origLimit >= estimated) {
|
|
201
191
|
logger.warn(
|
|
202
192
|
'Estimated +',
|
|
203
193
|
argv.estimateGasLimit,
|
|
204
|
-
'%
|
|
194
|
+
'% =',
|
|
205
195
|
estimated,
|
|
206
196
|
'< original gasLimit =',
|
|
207
|
-
|
|
197
|
+
origLimit,
|
|
208
198
|
'. Leaving unchanged.',
|
|
209
199
|
)
|
|
210
200
|
} else {
|
package/src/commands/send.ts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type AnyMessage,
|
|
3
|
-
type CCIPVersion,
|
|
4
2
|
type ChainStatic,
|
|
5
|
-
type EVMChain,
|
|
6
3
|
type ExtraArgs,
|
|
4
|
+
type MessageInput,
|
|
7
5
|
CCIPArgumentInvalidError,
|
|
8
|
-
CCIPChainFamilyUnsupportedError,
|
|
9
6
|
CCIPTokenNotFoundError,
|
|
10
7
|
ChainFamily,
|
|
11
|
-
|
|
8
|
+
estimateReceiveExecution,
|
|
12
9
|
getDataBytes,
|
|
13
10
|
networkInfo,
|
|
14
|
-
sourceToDestTokenAmounts,
|
|
15
11
|
} from '@chainlink/ccip-sdk/src/index.ts'
|
|
16
|
-
import { type BytesLike,
|
|
12
|
+
import { type BytesLike, formatUnits, toUtf8Bytes } from 'ethers'
|
|
17
13
|
import type { Argv } from 'yargs'
|
|
18
14
|
|
|
19
15
|
import type { GlobalOpts } from '../index.ts'
|
|
@@ -22,8 +18,8 @@ import type { Ctx } from './types.ts'
|
|
|
22
18
|
import { getCtx, logParsedError, parseTokenAmounts } from './utils.ts'
|
|
23
19
|
import { fetchChainsFromRpcs, loadChainWallet } from '../providers/index.ts'
|
|
24
20
|
|
|
25
|
-
export const command = 'send
|
|
26
|
-
export const describe = 'Send a CCIP message from
|
|
21
|
+
export const command = 'send'
|
|
22
|
+
export const describe = 'Send a CCIP message from source to destination chain'
|
|
27
23
|
|
|
28
24
|
/**
|
|
29
25
|
* Yargs builder for the send command.
|
|
@@ -32,108 +28,107 @@ export const describe = 'Send a CCIP message from router on source to dest'
|
|
|
32
28
|
*/
|
|
33
29
|
export const builder = (yargs: Argv) =>
|
|
34
30
|
yargs
|
|
35
|
-
.
|
|
31
|
+
.option('source', {
|
|
32
|
+
alias: 's',
|
|
36
33
|
type: 'string',
|
|
37
34
|
demandOption: true,
|
|
38
|
-
describe: '
|
|
39
|
-
example: 'ethereum-testnet-sepolia',
|
|
35
|
+
describe: 'Source chain: chainId, selector, or name',
|
|
40
36
|
})
|
|
41
|
-
.
|
|
37
|
+
.option('dest', {
|
|
38
|
+
alias: 'd',
|
|
42
39
|
type: 'string',
|
|
43
40
|
demandOption: true,
|
|
44
|
-
describe: '
|
|
41
|
+
describe: 'Destination chain: chainId, selector, or name',
|
|
45
42
|
})
|
|
46
|
-
.
|
|
43
|
+
.option('router', {
|
|
44
|
+
alias: 'r',
|
|
47
45
|
type: 'string',
|
|
48
46
|
demandOption: true,
|
|
49
|
-
describe: '
|
|
50
|
-
example: 'ethereum-testnet-sepolia-arbitrum-1',
|
|
47
|
+
describe: 'Router contract address on source',
|
|
51
48
|
})
|
|
52
49
|
.options({
|
|
53
50
|
receiver: {
|
|
54
|
-
alias: '
|
|
51
|
+
alias: 'to',
|
|
55
52
|
type: 'string',
|
|
56
|
-
describe:
|
|
57
|
-
'Receiver of the message; defaults to the sender wallet address if same network family',
|
|
53
|
+
describe: 'Receiver address on destination; defaults to sender if same chain family',
|
|
58
54
|
},
|
|
59
55
|
data: {
|
|
60
|
-
alias: 'd',
|
|
61
56
|
type: 'string',
|
|
62
|
-
describe: 'Data to send
|
|
63
|
-
example: '0x1234',
|
|
57
|
+
describe: 'Data payload to send (non-hex will be UTF-8 encoded)',
|
|
64
58
|
},
|
|
65
59
|
'gas-limit': {
|
|
66
60
|
alias: ['L', 'compute-units'],
|
|
67
61
|
type: 'number',
|
|
68
|
-
describe:
|
|
69
|
-
'Gas limit for receiver callback execution; defaults to default configured on ramps',
|
|
70
|
-
default: 0,
|
|
62
|
+
describe: 'Gas limit for receiver callback; defaults to ramp config',
|
|
71
63
|
},
|
|
72
64
|
'estimate-gas-limit': {
|
|
73
65
|
type: 'number',
|
|
74
|
-
describe:
|
|
75
|
-
'Estimate gas limit for receiver callback execution; argument is a % margin to add to the estimate',
|
|
76
|
-
example: '10',
|
|
66
|
+
describe: 'Estimate gas limit with % margin (e.g., 10 for +10%)',
|
|
77
67
|
conflicts: 'gas-limit',
|
|
78
68
|
},
|
|
79
69
|
'allow-out-of-order-exec': {
|
|
80
70
|
alias: 'ooo',
|
|
81
71
|
type: 'boolean',
|
|
82
|
-
describe:
|
|
83
|
-
'Allow execution of messages out of order (i.e. sender nonce not enforced, only v1.5+ lanes, mandatory for some dests)',
|
|
72
|
+
describe: 'Allow out-of-order execution (v1.5+ lanes)',
|
|
84
73
|
},
|
|
85
74
|
'fee-token': {
|
|
86
75
|
type: 'string',
|
|
87
|
-
describe:
|
|
88
|
-
'Address or symbol of the fee token (e.g. LINK address on source); if not provided, will pay in native',
|
|
76
|
+
describe: 'Fee token address or symbol (default: native)',
|
|
89
77
|
},
|
|
90
78
|
'transfer-tokens': {
|
|
91
79
|
alias: 't',
|
|
92
80
|
type: 'array',
|
|
93
81
|
string: true,
|
|
94
|
-
describe: '
|
|
95
|
-
example: '0xtoken=0.1',
|
|
82
|
+
describe: 'Token amounts to transfer: token=amount',
|
|
96
83
|
},
|
|
97
84
|
wallet: {
|
|
98
85
|
alias: 'w',
|
|
99
86
|
type: 'string',
|
|
100
|
-
describe:
|
|
101
|
-
'Wallet to send transactions with; pass `ledger[:index_or_derivation]` to use Ledger USB hardware wallet, or private key in `USER_KEY` environment variable',
|
|
87
|
+
describe: 'Wallet: ledger[:index] or private key',
|
|
102
88
|
},
|
|
103
89
|
'token-receiver': {
|
|
104
90
|
type: 'string',
|
|
105
|
-
describe:
|
|
91
|
+
describe: 'Solana token receiver (if different from program receiver)',
|
|
106
92
|
},
|
|
107
93
|
account: {
|
|
94
|
+
alias: 'receiver-object-id',
|
|
108
95
|
type: 'array',
|
|
109
96
|
string: true,
|
|
110
|
-
describe:
|
|
111
|
-
'List of accounts needed by Solana receiver program; append `=rw` to specify account as writable; can be specified multiple times',
|
|
112
|
-
example: 'requiredPdaAddress=rw',
|
|
97
|
+
describe: 'Solana accounts (append =rw for writable) or Sui object IDs',
|
|
113
98
|
},
|
|
114
99
|
'only-get-fee': {
|
|
115
100
|
type: 'boolean',
|
|
116
|
-
describe: '
|
|
101
|
+
describe: 'Print fee and exit',
|
|
117
102
|
},
|
|
118
103
|
'only-estimate': {
|
|
119
104
|
type: 'boolean',
|
|
120
|
-
describe: '
|
|
105
|
+
describe: 'Print gas estimate and exit',
|
|
106
|
+
implies: 'estimate-gas-limit',
|
|
121
107
|
},
|
|
122
108
|
'approve-max': {
|
|
123
109
|
type: 'boolean',
|
|
124
|
-
describe:
|
|
125
|
-
"Approve the maximum amount of tokens to transfer; default=false approves only what's needed",
|
|
110
|
+
describe: 'Approve max token amount instead of exact',
|
|
126
111
|
},
|
|
127
112
|
wait: {
|
|
128
113
|
type: 'boolean',
|
|
129
114
|
default: false,
|
|
130
|
-
describe: 'Wait for execution',
|
|
115
|
+
describe: 'Wait for execution on destination',
|
|
131
116
|
},
|
|
132
117
|
})
|
|
133
118
|
.check(
|
|
134
119
|
({ 'transfer-tokens': transferTokens }) =>
|
|
135
120
|
!transferTokens || transferTokens.every((t) => /^[^=]+=\d+(\.\d+)?$/.test(t)),
|
|
136
121
|
)
|
|
122
|
+
.example([
|
|
123
|
+
[
|
|
124
|
+
'ccip-cli send -s ethereum-testnet-sepolia -d arbitrum-sepolia -r 0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 --only-get-fee',
|
|
125
|
+
'Get fee estimate',
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
'ccip-cli send -s ethereum-testnet-sepolia -d arbitrum-sepolia -r 0x0BF3... --to 0xABC... --data "Hello"',
|
|
129
|
+
'Send message with data',
|
|
130
|
+
],
|
|
131
|
+
])
|
|
137
132
|
|
|
138
133
|
/**
|
|
139
134
|
* Handler for the send command.
|
|
@@ -159,15 +154,13 @@ async function sendMessage(
|
|
|
159
154
|
const getChain = fetchChainsFromRpcs(ctx, argv)
|
|
160
155
|
const source = await getChain(sourceNetwork.name)
|
|
161
156
|
|
|
162
|
-
let data: BytesLike
|
|
157
|
+
let data: BytesLike | undefined
|
|
163
158
|
if (argv.data) {
|
|
164
159
|
try {
|
|
165
160
|
data = getDataBytes(argv.data)
|
|
166
161
|
} catch (_) {
|
|
167
162
|
data = toUtf8Bytes(argv.data)
|
|
168
163
|
}
|
|
169
|
-
} else {
|
|
170
|
-
data = '0x'
|
|
171
164
|
}
|
|
172
165
|
|
|
173
166
|
const tokenAmounts: { token: string; amount: bigint }[] = argv.transferTokens?.length
|
|
@@ -175,25 +168,11 @@ async function sendMessage(
|
|
|
175
168
|
: []
|
|
176
169
|
|
|
177
170
|
let receiver = argv.receiver
|
|
178
|
-
let tokenReceiver
|
|
179
171
|
let accounts,
|
|
180
172
|
accountIsWritableBitmap = 0n
|
|
181
173
|
if (destNetwork.family === ChainFamily.Solana) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
tokenReceiver = '11111111111111111111111111111111'
|
|
185
|
-
} else if (!dataLength(data)) {
|
|
186
|
-
// sending tokens without data, i.e. not for a receiver contract
|
|
187
|
-
tokenReceiver = receiver
|
|
188
|
-
receiver = '11111111111111111111111111111111'
|
|
189
|
-
} else {
|
|
190
|
-
throw new CCIPArgumentInvalidError(
|
|
191
|
-
'token-receiver',
|
|
192
|
-
'required when sending tokens with data to Solana',
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (argv.account) {
|
|
174
|
+
// parse accounts with or without `=rw` suffix
|
|
175
|
+
if (argv.account?.length) {
|
|
197
176
|
accounts = argv.account.map((account, i) => {
|
|
198
177
|
if (account.endsWith('=rw')) {
|
|
199
178
|
accountIsWritableBitmap |= 1n << BigInt(i)
|
|
@@ -201,12 +180,7 @@ async function sendMessage(
|
|
|
201
180
|
}
|
|
202
181
|
return account
|
|
203
182
|
})
|
|
204
|
-
}
|
|
205
|
-
} else if (argv.tokenReceiver || argv.account?.length) {
|
|
206
|
-
throw new CCIPArgumentInvalidError(
|
|
207
|
-
'token-receiver/account',
|
|
208
|
-
'only valid for Solana destination',
|
|
209
|
-
)
|
|
183
|
+
}
|
|
210
184
|
}
|
|
211
185
|
|
|
212
186
|
let walletAddress, wallet
|
|
@@ -219,51 +193,50 @@ async function sendMessage(
|
|
|
219
193
|
|
|
220
194
|
if (argv.estimateGasLimit != null || argv.onlyEstimate) {
|
|
221
195
|
// TODO: implement for all chain families
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
destChainSelector: destNetwork.chainSelector,
|
|
231
|
-
onRamp,
|
|
232
|
-
version: (await source.typeAndVersion(onRamp))[1] as CCIPVersion,
|
|
196
|
+
const dest = await getChain(destNetwork.chainSelector)
|
|
197
|
+
|
|
198
|
+
if (!walletAddress) {
|
|
199
|
+
try {
|
|
200
|
+
;[walletAddress, wallet] = await loadChainWallet(source, argv)
|
|
201
|
+
} catch {
|
|
202
|
+
// pass undefined sender for default
|
|
203
|
+
}
|
|
233
204
|
}
|
|
234
|
-
const
|
|
205
|
+
const estimated = await estimateReceiveExecution({
|
|
235
206
|
source,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
tokenAmounts,
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
if (!walletAddress) [walletAddress, wallet] = await loadChainWallet(source, argv)
|
|
242
|
-
const estimated = await estimateExecGasForRequest(source, dest, {
|
|
243
|
-
lane,
|
|
207
|
+
dest,
|
|
208
|
+
routerOrRamp: argv.router,
|
|
244
209
|
message: {
|
|
245
210
|
sender: walletAddress,
|
|
246
211
|
receiver,
|
|
247
212
|
data,
|
|
248
|
-
tokenAmounts
|
|
213
|
+
tokenAmounts,
|
|
249
214
|
},
|
|
250
215
|
})
|
|
251
|
-
logger.log('Estimated gasLimit:', estimated)
|
|
252
216
|
argv.gasLimit = Math.ceil(estimated * (1 + (argv.estimateGasLimit ?? 0) / 100))
|
|
217
|
+
logger.log(
|
|
218
|
+
'Estimated gasLimit for sender =',
|
|
219
|
+
walletAddress,
|
|
220
|
+
':',
|
|
221
|
+
estimated,
|
|
222
|
+
...(argv.estimateGasLimit ? ['+', argv.estimateGasLimit, '% =', argv.gasLimit] : []),
|
|
223
|
+
)
|
|
253
224
|
if (argv.onlyEstimate) return
|
|
254
225
|
}
|
|
255
226
|
|
|
256
|
-
//
|
|
257
|
-
//
|
|
227
|
+
// builds a catch-all extraArgs object, which can be massaged by
|
|
228
|
+
// [[Chain.buildMessageForDest]] to create suitable extraArgs with defaults if needed
|
|
258
229
|
const extraArgs = {
|
|
259
|
-
...(argv.allowOutOfOrderExec != null
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
...(
|
|
263
|
-
? {
|
|
264
|
-
:
|
|
265
|
-
|
|
266
|
-
|
|
230
|
+
...(argv.allowOutOfOrderExec != null && {
|
|
231
|
+
allowOutOfOrderExecution: !!argv.allowOutOfOrderExec,
|
|
232
|
+
}),
|
|
233
|
+
...(argv.gasLimit == null
|
|
234
|
+
? {}
|
|
235
|
+
: destNetwork.family === ChainFamily.Solana
|
|
236
|
+
? { computeUnits: BigInt(argv.gasLimit) }
|
|
237
|
+
: { gasLimit: BigInt(argv.gasLimit) }),
|
|
238
|
+
...(!!argv.tokenReceiver && { tokenReceiver: argv.tokenReceiver }),
|
|
239
|
+
...(!!accounts && { accounts, accountIsWritableBitmap }), // accounts also used as Sui receiverObjectIds
|
|
267
240
|
}
|
|
268
241
|
|
|
269
242
|
let feeToken, feeTokenInfo
|
|
@@ -287,7 +260,7 @@ async function sendMessage(
|
|
|
287
260
|
feeTokenInfo = await source.getTokenInfo(nativeToken)
|
|
288
261
|
}
|
|
289
262
|
|
|
290
|
-
const message:
|
|
263
|
+
const message: MessageInput = {
|
|
291
264
|
receiver,
|
|
292
265
|
data,
|
|
293
266
|
extraArgs: extraArgs as ExtraArgs,
|
|
@@ -322,9 +295,7 @@ async function sendMessage(
|
|
|
322
295
|
})
|
|
323
296
|
logger.info(
|
|
324
297
|
'🚀 Sending message to',
|
|
325
|
-
|
|
326
|
-
? tokenReceiver
|
|
327
|
-
: receiver,
|
|
298
|
+
receiver,
|
|
328
299
|
'@',
|
|
329
300
|
destNetwork.name,
|
|
330
301
|
', tx =>',
|
package/src/commands/show.ts
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
type CCIPRequest,
|
|
3
3
|
type ChainTransaction,
|
|
4
4
|
CCIPExecTxRevertedError,
|
|
5
|
-
CCIPNotImplementedError,
|
|
6
5
|
ExecutionState,
|
|
7
6
|
MessageStatus,
|
|
8
7
|
bigIntReplacer,
|
|
@@ -88,9 +87,7 @@ export async function showRequests(ctx: Ctx, argv: Parameters<typeof handler>[0]
|
|
|
88
87
|
} else idFromSource = argv.idFromSource
|
|
89
88
|
const sourceNetwork = networkInfo(idFromSource)
|
|
90
89
|
source = await getChain(sourceNetwork.chainId)
|
|
91
|
-
|
|
92
|
-
throw new CCIPNotImplementedError(`getMessageById for ${source.constructor.name}`)
|
|
93
|
-
request = await source.getMessageById(argv.txHash, onRamp, argv)
|
|
90
|
+
request = await source.getMessageById(argv.txHash, { ...argv, onRamp })
|
|
94
91
|
} else {
|
|
95
92
|
const [getChain_, tx$] = fetchChainsFromRpcs(ctx, argv, argv.txHash)
|
|
96
93
|
getChain = getChain_
|
|
@@ -37,7 +37,7 @@ import { formatDuration, getCtx, logParsedError, prettyTable } from './utils.ts'
|
|
|
37
37
|
import type { GlobalOpts } from '../index.ts'
|
|
38
38
|
import { fetchChainsFromRpcs } from '../providers/index.ts'
|
|
39
39
|
|
|
40
|
-
export const command =
|
|
40
|
+
export const command = 'getSupportedTokens'
|
|
41
41
|
export const describe =
|
|
42
42
|
'List supported tokens in a given Router/OnRamp/TokenAdminRegistry, and/or show info about token/pool'
|
|
43
43
|
|
|
@@ -48,23 +48,34 @@ export const describe =
|
|
|
48
48
|
*/
|
|
49
49
|
export const builder = (yargs: Argv) =>
|
|
50
50
|
yargs
|
|
51
|
-
.
|
|
51
|
+
.option('network', {
|
|
52
|
+
alias: 'n',
|
|
52
53
|
type: 'string',
|
|
53
54
|
demandOption: true,
|
|
54
|
-
describe: '
|
|
55
|
-
example: 'ethereum-testnet-sepolia',
|
|
55
|
+
describe: 'Source network: chainId or name (e.g., ethereum-mainnet)',
|
|
56
56
|
})
|
|
57
|
-
.
|
|
57
|
+
.option('address', {
|
|
58
|
+
alias: 'a',
|
|
58
59
|
type: 'string',
|
|
59
60
|
demandOption: true,
|
|
60
|
-
describe: '
|
|
61
|
+
describe: 'Router/OnRamp/TokenAdminRegistry/TokenPool contract address',
|
|
61
62
|
})
|
|
62
|
-
.
|
|
63
|
+
.option('token', {
|
|
64
|
+
alias: 't',
|
|
63
65
|
type: 'string',
|
|
64
66
|
demandOption: false,
|
|
65
|
-
describe:
|
|
66
|
-
'If address is router/onramp/tokenAdminRegistry, token may be used to pre-select a token from the supported list',
|
|
67
|
+
describe: 'Token address to query (pre-selects from list if address is a registry)',
|
|
67
68
|
})
|
|
69
|
+
.example([
|
|
70
|
+
[
|
|
71
|
+
'ccip-cli getSupportedTokens -n ethereum-mainnet -a 0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D',
|
|
72
|
+
'List all supported tokens from router',
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
'ccip-cli getSupportedTokens -n ethereum-mainnet -a 0x80226fc... -t 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
76
|
+
'Get details for specific token',
|
|
77
|
+
],
|
|
78
|
+
])
|
|
68
79
|
|
|
69
80
|
/**
|
|
70
81
|
* Handler for the supported-tokens command.
|
|
@@ -82,7 +93,7 @@ export async function handler(argv: Awaited<ReturnType<typeof builder>['argv']>
|
|
|
82
93
|
|
|
83
94
|
async function getSupportedTokens(ctx: Ctx, argv: Parameters<typeof handler>[0]) {
|
|
84
95
|
const { logger } = ctx
|
|
85
|
-
const sourceNetwork = networkInfo(argv.
|
|
96
|
+
const sourceNetwork = networkInfo(argv.network)
|
|
86
97
|
const getChain = fetchChainsFromRpcs(ctx, argv)
|
|
87
98
|
const source = await getChain(sourceNetwork.name)
|
|
88
99
|
let registry
|