@circle-fin/app-kit 1.8.1 → 1.10.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/CHANGELOG.md +71 -0
- package/README.md +3 -3
- package/bridge.cjs +1102 -260
- package/bridge.d.cts +161 -10
- package/bridge.d.mts +161 -10
- package/bridge.d.ts +161 -10
- package/bridge.mjs +1102 -260
- package/chains.cjs +102 -2
- package/chains.d.cts +3 -0
- package/chains.d.mts +3 -0
- package/chains.d.ts +3 -0
- package/chains.mjs +102 -2
- package/context.cjs +1 -0
- package/context.d.cts +166 -12
- package/context.d.mts +166 -12
- package/context.d.ts +166 -12
- package/context.mjs +1 -0
- package/earn.cjs +1074 -454
- package/earn.d.cts +546 -99
- package/earn.d.mts +546 -99
- package/earn.d.ts +546 -99
- package/earn.mjs +1074 -455
- package/estimateBridge.cjs +1102 -260
- package/estimateBridge.d.cts +161 -10
- package/estimateBridge.d.mts +161 -10
- package/estimateBridge.d.ts +161 -10
- package/estimateBridge.mjs +1102 -260
- package/estimateSwap.cjs +915 -96
- package/estimateSwap.d.cts +161 -10
- package/estimateSwap.d.mts +161 -10
- package/estimateSwap.d.ts +161 -10
- package/estimateSwap.mjs +915 -96
- package/index.cjs +3029 -862
- package/index.d.cts +1277 -143
- package/index.d.mts +1277 -143
- package/index.d.ts +1277 -143
- package/index.mjs +3029 -862
- package/package.json +12 -6
- package/swap.cjs +915 -96
- package/swap.d.cts +161 -10
- package/swap.d.mts +161 -10
- package/swap.d.ts +161 -10
- package/swap.mjs +915 -96
- package/unifiedBalance.cjs +822 -115
- package/unifiedBalance.d.cts +224 -4
- package/unifiedBalance.d.mts +224 -4
- package/unifiedBalance.d.ts +224 -4
- package/unifiedBalance.mjs +822 -115
package/chains.cjs
CHANGED
|
@@ -63,6 +63,8 @@ var zod = require('zod');
|
|
|
63
63
|
Blockchain["Celo_Alfajores_Testnet"] = "Celo_Alfajores_Testnet";
|
|
64
64
|
Blockchain["Codex"] = "Codex";
|
|
65
65
|
Blockchain["Codex_Testnet"] = "Codex_Testnet";
|
|
66
|
+
Blockchain["Cronos"] = "Cronos";
|
|
67
|
+
Blockchain["Cronos_Testnet"] = "Cronos_Testnet";
|
|
66
68
|
Blockchain["Edge"] = "Edge";
|
|
67
69
|
Blockchain["Edge_Testnet"] = "Edge_Testnet";
|
|
68
70
|
Blockchain["Ethereum"] = "Ethereum";
|
|
@@ -145,6 +147,7 @@ var BridgeChain;
|
|
|
145
147
|
BridgeChain["Avalanche"] = "Avalanche";
|
|
146
148
|
BridgeChain["Base"] = "Base";
|
|
147
149
|
BridgeChain["Codex"] = "Codex";
|
|
150
|
+
BridgeChain["Cronos"] = "Cronos";
|
|
148
151
|
BridgeChain["Edge"] = "Edge";
|
|
149
152
|
BridgeChain["Ethereum"] = "Ethereum";
|
|
150
153
|
BridgeChain["HyperEVM"] = "HyperEVM";
|
|
@@ -169,6 +172,7 @@ var BridgeChain;
|
|
|
169
172
|
BridgeChain["Avalanche_Fuji"] = "Avalanche_Fuji";
|
|
170
173
|
BridgeChain["Base_Sepolia"] = "Base_Sepolia";
|
|
171
174
|
BridgeChain["Codex_Testnet"] = "Codex_Testnet";
|
|
175
|
+
BridgeChain["Cronos_Testnet"] = "Cronos_Testnet";
|
|
172
176
|
BridgeChain["Edge_Testnet"] = "Edge_Testnet";
|
|
173
177
|
BridgeChain["Ethereum_Sepolia"] = "Ethereum_Sepolia";
|
|
174
178
|
BridgeChain["HyperEVM_Testnet"] = "HyperEVM_Testnet";
|
|
@@ -680,7 +684,10 @@ var EarnChain;
|
|
|
680
684
|
contracts: {
|
|
681
685
|
v1: {
|
|
682
686
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
683
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
687
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
688
|
+
// DepositForHandler the GenericExecutor calls to run a fast cross-chain
|
|
689
|
+
// deposit into the GatewayWallet above.
|
|
690
|
+
depositForHandler: '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48'
|
|
684
691
|
}
|
|
685
692
|
},
|
|
686
693
|
forwarderSupported: {
|
|
@@ -1214,6 +1221,96 @@ var EarnChain;
|
|
|
1214
1221
|
}
|
|
1215
1222
|
});
|
|
1216
1223
|
|
|
1224
|
+
/**
|
|
1225
|
+
* Cronos Mainnet chain definition
|
|
1226
|
+
* @remarks
|
|
1227
|
+
* This represents the official production network for the Cronos blockchain.
|
|
1228
|
+
* Cronos is an EVM-compatible blockchain.
|
|
1229
|
+
*/ defineChain({
|
|
1230
|
+
type: 'evm',
|
|
1231
|
+
chain: Blockchain.Cronos,
|
|
1232
|
+
name: 'Cronos',
|
|
1233
|
+
title: 'Cronos Mainnet',
|
|
1234
|
+
nativeCurrency: {
|
|
1235
|
+
name: 'Cronos',
|
|
1236
|
+
symbol: 'CRO',
|
|
1237
|
+
decimals: 18
|
|
1238
|
+
},
|
|
1239
|
+
chainId: 25,
|
|
1240
|
+
isTestnet: false,
|
|
1241
|
+
explorerUrl: 'https://cronoscan.com/tx/{hash}',
|
|
1242
|
+
rpcEndpoints: [
|
|
1243
|
+
'https://evm.cronos.org'
|
|
1244
|
+
],
|
|
1245
|
+
eurcAddress: '0xA6dE01a2d62C6B5f3525d768f34d276652C554c8',
|
|
1246
|
+
usdcAddress: '0x3D7F2C478aAfdB65542BCB44bCeeC05849999d2D',
|
|
1247
|
+
usdtAddress: null,
|
|
1248
|
+
cctp: {
|
|
1249
|
+
domain: 32,
|
|
1250
|
+
contracts: {
|
|
1251
|
+
v2: {
|
|
1252
|
+
type: 'split',
|
|
1253
|
+
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
1254
|
+
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
1255
|
+
confirmations: 1,
|
|
1256
|
+
fastConfirmations: 1
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
forwarderSupported: {
|
|
1260
|
+
source: false,
|
|
1261
|
+
destination: false
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
kitContracts: {
|
|
1265
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
/**
|
|
1270
|
+
* Cronos Testnet chain definition
|
|
1271
|
+
* @remarks
|
|
1272
|
+
* This represents the official test network for the Cronos blockchain.
|
|
1273
|
+
* Cronos is an EVM-compatible blockchain.
|
|
1274
|
+
*/ defineChain({
|
|
1275
|
+
type: 'evm',
|
|
1276
|
+
chain: Blockchain.Cronos_Testnet,
|
|
1277
|
+
name: 'Cronos Testnet',
|
|
1278
|
+
title: 'Cronos Testnet',
|
|
1279
|
+
nativeCurrency: {
|
|
1280
|
+
name: 'CRO',
|
|
1281
|
+
symbol: 'tCRO',
|
|
1282
|
+
decimals: 18
|
|
1283
|
+
},
|
|
1284
|
+
chainId: 338,
|
|
1285
|
+
isTestnet: true,
|
|
1286
|
+
explorerUrl: 'https://explorer.cronos.org/testnet/tx/{hash}',
|
|
1287
|
+
rpcEndpoints: [
|
|
1288
|
+
'https://evm-t3.cronos.org'
|
|
1289
|
+
],
|
|
1290
|
+
eurcAddress: '0x31f7538adb53cF16350e6B0c89d03D91b7D12c46',
|
|
1291
|
+
usdcAddress: '0xEb33dc5fac03833e132593659e1dE7256aB59794',
|
|
1292
|
+
usdtAddress: null,
|
|
1293
|
+
cctp: {
|
|
1294
|
+
domain: 32,
|
|
1295
|
+
contracts: {
|
|
1296
|
+
v2: {
|
|
1297
|
+
type: 'split',
|
|
1298
|
+
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
1299
|
+
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
1300
|
+
confirmations: 1,
|
|
1301
|
+
fastConfirmations: 1
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
forwarderSupported: {
|
|
1305
|
+
source: false,
|
|
1306
|
+
destination: false
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
kitContracts: {
|
|
1310
|
+
bridge: BRIDGE_CONTRACT_EVM_TESTNET
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1217
1314
|
/**
|
|
1218
1315
|
* Edge Mainnet chain definition
|
|
1219
1316
|
* @remarks
|
|
@@ -3566,7 +3663,10 @@ var EarnChain;
|
|
|
3566
3663
|
minter: zod.z.string({
|
|
3567
3664
|
required_error: 'Gateway minter address is required. Please provide a valid contract address.',
|
|
3568
3665
|
invalid_type_error: 'Gateway minter address must be a string.'
|
|
3569
|
-
}).min(1, 'Gateway minter address cannot be empty.')
|
|
3666
|
+
}).min(1, 'Gateway minter address cannot be empty.'),
|
|
3667
|
+
depositForHandler: zod.z.string({
|
|
3668
|
+
invalid_type_error: 'Gateway depositForHandler address must be a string.'
|
|
3669
|
+
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional()
|
|
3570
3670
|
}).strict() // Reject any additional properties not defined in the schema
|
|
3571
3671
|
;
|
|
3572
3672
|
/**
|
package/chains.d.cts
CHANGED
|
@@ -44,6 +44,8 @@ declare enum Blockchain {
|
|
|
44
44
|
Celo_Alfajores_Testnet = "Celo_Alfajores_Testnet",
|
|
45
45
|
Codex = "Codex",
|
|
46
46
|
Codex_Testnet = "Codex_Testnet",
|
|
47
|
+
Cronos = "Cronos",
|
|
48
|
+
Cronos_Testnet = "Cronos_Testnet",
|
|
47
49
|
Edge = "Edge",
|
|
48
50
|
Edge_Testnet = "Edge_Testnet",
|
|
49
51
|
Ethereum = "Ethereum",
|
|
@@ -148,6 +150,7 @@ declare const ArcTestnet: {
|
|
|
148
150
|
readonly v1: {
|
|
149
151
|
readonly wallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9";
|
|
150
152
|
readonly minter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B";
|
|
153
|
+
readonly depositForHandler: "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48";
|
|
151
154
|
};
|
|
152
155
|
};
|
|
153
156
|
readonly forwarderSupported: {
|
package/chains.d.mts
CHANGED
|
@@ -44,6 +44,8 @@ declare enum Blockchain {
|
|
|
44
44
|
Celo_Alfajores_Testnet = "Celo_Alfajores_Testnet",
|
|
45
45
|
Codex = "Codex",
|
|
46
46
|
Codex_Testnet = "Codex_Testnet",
|
|
47
|
+
Cronos = "Cronos",
|
|
48
|
+
Cronos_Testnet = "Cronos_Testnet",
|
|
47
49
|
Edge = "Edge",
|
|
48
50
|
Edge_Testnet = "Edge_Testnet",
|
|
49
51
|
Ethereum = "Ethereum",
|
|
@@ -148,6 +150,7 @@ declare const ArcTestnet: {
|
|
|
148
150
|
readonly v1: {
|
|
149
151
|
readonly wallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9";
|
|
150
152
|
readonly minter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B";
|
|
153
|
+
readonly depositForHandler: "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48";
|
|
151
154
|
};
|
|
152
155
|
};
|
|
153
156
|
readonly forwarderSupported: {
|
package/chains.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ declare enum Blockchain {
|
|
|
44
44
|
Celo_Alfajores_Testnet = "Celo_Alfajores_Testnet",
|
|
45
45
|
Codex = "Codex",
|
|
46
46
|
Codex_Testnet = "Codex_Testnet",
|
|
47
|
+
Cronos = "Cronos",
|
|
48
|
+
Cronos_Testnet = "Cronos_Testnet",
|
|
47
49
|
Edge = "Edge",
|
|
48
50
|
Edge_Testnet = "Edge_Testnet",
|
|
49
51
|
Ethereum = "Ethereum",
|
|
@@ -148,6 +150,7 @@ declare const ArcTestnet: {
|
|
|
148
150
|
readonly v1: {
|
|
149
151
|
readonly wallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9";
|
|
150
152
|
readonly minter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B";
|
|
153
|
+
readonly depositForHandler: "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48";
|
|
151
154
|
};
|
|
152
155
|
};
|
|
153
156
|
readonly forwarderSupported: {
|
package/chains.mjs
CHANGED
|
@@ -61,6 +61,8 @@ import { z } from 'zod';
|
|
|
61
61
|
Blockchain["Celo_Alfajores_Testnet"] = "Celo_Alfajores_Testnet";
|
|
62
62
|
Blockchain["Codex"] = "Codex";
|
|
63
63
|
Blockchain["Codex_Testnet"] = "Codex_Testnet";
|
|
64
|
+
Blockchain["Cronos"] = "Cronos";
|
|
65
|
+
Blockchain["Cronos_Testnet"] = "Cronos_Testnet";
|
|
64
66
|
Blockchain["Edge"] = "Edge";
|
|
65
67
|
Blockchain["Edge_Testnet"] = "Edge_Testnet";
|
|
66
68
|
Blockchain["Ethereum"] = "Ethereum";
|
|
@@ -143,6 +145,7 @@ var BridgeChain;
|
|
|
143
145
|
BridgeChain["Avalanche"] = "Avalanche";
|
|
144
146
|
BridgeChain["Base"] = "Base";
|
|
145
147
|
BridgeChain["Codex"] = "Codex";
|
|
148
|
+
BridgeChain["Cronos"] = "Cronos";
|
|
146
149
|
BridgeChain["Edge"] = "Edge";
|
|
147
150
|
BridgeChain["Ethereum"] = "Ethereum";
|
|
148
151
|
BridgeChain["HyperEVM"] = "HyperEVM";
|
|
@@ -167,6 +170,7 @@ var BridgeChain;
|
|
|
167
170
|
BridgeChain["Avalanche_Fuji"] = "Avalanche_Fuji";
|
|
168
171
|
BridgeChain["Base_Sepolia"] = "Base_Sepolia";
|
|
169
172
|
BridgeChain["Codex_Testnet"] = "Codex_Testnet";
|
|
173
|
+
BridgeChain["Cronos_Testnet"] = "Cronos_Testnet";
|
|
170
174
|
BridgeChain["Edge_Testnet"] = "Edge_Testnet";
|
|
171
175
|
BridgeChain["Ethereum_Sepolia"] = "Ethereum_Sepolia";
|
|
172
176
|
BridgeChain["HyperEVM_Testnet"] = "HyperEVM_Testnet";
|
|
@@ -678,7 +682,10 @@ var EarnChain;
|
|
|
678
682
|
contracts: {
|
|
679
683
|
v1: {
|
|
680
684
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
681
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
685
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
686
|
+
// DepositForHandler the GenericExecutor calls to run a fast cross-chain
|
|
687
|
+
// deposit into the GatewayWallet above.
|
|
688
|
+
depositForHandler: '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48'
|
|
682
689
|
}
|
|
683
690
|
},
|
|
684
691
|
forwarderSupported: {
|
|
@@ -1212,6 +1219,96 @@ var EarnChain;
|
|
|
1212
1219
|
}
|
|
1213
1220
|
});
|
|
1214
1221
|
|
|
1222
|
+
/**
|
|
1223
|
+
* Cronos Mainnet chain definition
|
|
1224
|
+
* @remarks
|
|
1225
|
+
* This represents the official production network for the Cronos blockchain.
|
|
1226
|
+
* Cronos is an EVM-compatible blockchain.
|
|
1227
|
+
*/ defineChain({
|
|
1228
|
+
type: 'evm',
|
|
1229
|
+
chain: Blockchain.Cronos,
|
|
1230
|
+
name: 'Cronos',
|
|
1231
|
+
title: 'Cronos Mainnet',
|
|
1232
|
+
nativeCurrency: {
|
|
1233
|
+
name: 'Cronos',
|
|
1234
|
+
symbol: 'CRO',
|
|
1235
|
+
decimals: 18
|
|
1236
|
+
},
|
|
1237
|
+
chainId: 25,
|
|
1238
|
+
isTestnet: false,
|
|
1239
|
+
explorerUrl: 'https://cronoscan.com/tx/{hash}',
|
|
1240
|
+
rpcEndpoints: [
|
|
1241
|
+
'https://evm.cronos.org'
|
|
1242
|
+
],
|
|
1243
|
+
eurcAddress: '0xA6dE01a2d62C6B5f3525d768f34d276652C554c8',
|
|
1244
|
+
usdcAddress: '0x3D7F2C478aAfdB65542BCB44bCeeC05849999d2D',
|
|
1245
|
+
usdtAddress: null,
|
|
1246
|
+
cctp: {
|
|
1247
|
+
domain: 32,
|
|
1248
|
+
contracts: {
|
|
1249
|
+
v2: {
|
|
1250
|
+
type: 'split',
|
|
1251
|
+
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
1252
|
+
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
1253
|
+
confirmations: 1,
|
|
1254
|
+
fastConfirmations: 1
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
forwarderSupported: {
|
|
1258
|
+
source: false,
|
|
1259
|
+
destination: false
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
kitContracts: {
|
|
1263
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Cronos Testnet chain definition
|
|
1269
|
+
* @remarks
|
|
1270
|
+
* This represents the official test network for the Cronos blockchain.
|
|
1271
|
+
* Cronos is an EVM-compatible blockchain.
|
|
1272
|
+
*/ defineChain({
|
|
1273
|
+
type: 'evm',
|
|
1274
|
+
chain: Blockchain.Cronos_Testnet,
|
|
1275
|
+
name: 'Cronos Testnet',
|
|
1276
|
+
title: 'Cronos Testnet',
|
|
1277
|
+
nativeCurrency: {
|
|
1278
|
+
name: 'CRO',
|
|
1279
|
+
symbol: 'tCRO',
|
|
1280
|
+
decimals: 18
|
|
1281
|
+
},
|
|
1282
|
+
chainId: 338,
|
|
1283
|
+
isTestnet: true,
|
|
1284
|
+
explorerUrl: 'https://explorer.cronos.org/testnet/tx/{hash}',
|
|
1285
|
+
rpcEndpoints: [
|
|
1286
|
+
'https://evm-t3.cronos.org'
|
|
1287
|
+
],
|
|
1288
|
+
eurcAddress: '0x31f7538adb53cF16350e6B0c89d03D91b7D12c46',
|
|
1289
|
+
usdcAddress: '0xEb33dc5fac03833e132593659e1dE7256aB59794',
|
|
1290
|
+
usdtAddress: null,
|
|
1291
|
+
cctp: {
|
|
1292
|
+
domain: 32,
|
|
1293
|
+
contracts: {
|
|
1294
|
+
v2: {
|
|
1295
|
+
type: 'split',
|
|
1296
|
+
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
1297
|
+
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
1298
|
+
confirmations: 1,
|
|
1299
|
+
fastConfirmations: 1
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
forwarderSupported: {
|
|
1303
|
+
source: false,
|
|
1304
|
+
destination: false
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
kitContracts: {
|
|
1308
|
+
bridge: BRIDGE_CONTRACT_EVM_TESTNET
|
|
1309
|
+
}
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1215
1312
|
/**
|
|
1216
1313
|
* Edge Mainnet chain definition
|
|
1217
1314
|
* @remarks
|
|
@@ -3564,7 +3661,10 @@ var EarnChain;
|
|
|
3564
3661
|
minter: z.string({
|
|
3565
3662
|
required_error: 'Gateway minter address is required. Please provide a valid contract address.',
|
|
3566
3663
|
invalid_type_error: 'Gateway minter address must be a string.'
|
|
3567
|
-
}).min(1, 'Gateway minter address cannot be empty.')
|
|
3664
|
+
}).min(1, 'Gateway minter address cannot be empty.'),
|
|
3665
|
+
depositForHandler: z.string({
|
|
3666
|
+
invalid_type_error: 'Gateway depositForHandler address must be a string.'
|
|
3667
|
+
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional()
|
|
3568
3668
|
}).strict() // Reject any additional properties not defined in the schema
|
|
3569
3669
|
;
|
|
3570
3670
|
/**
|
package/context.cjs
CHANGED
package/context.d.cts
CHANGED
|
@@ -374,6 +374,14 @@ interface CCTPSplitConfig {
|
|
|
374
374
|
type: 'split';
|
|
375
375
|
tokenMessenger: string;
|
|
376
376
|
messageTransmitter: string;
|
|
377
|
+
/**
|
|
378
|
+
* Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
|
|
379
|
+
*
|
|
380
|
+
* Optional. Present only on chains that support the prepaid FORWARD path
|
|
381
|
+
* (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
|
|
382
|
+
* it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
|
|
383
|
+
*/
|
|
384
|
+
tokenMessengerWithFees?: string;
|
|
377
385
|
confirmations: number;
|
|
378
386
|
}
|
|
379
387
|
/**
|
|
@@ -394,6 +402,14 @@ interface CCTPSplitConfig {
|
|
|
394
402
|
interface CCTPMergedConfig {
|
|
395
403
|
type: 'merged';
|
|
396
404
|
contract: string;
|
|
405
|
+
/**
|
|
406
|
+
* Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
|
|
407
|
+
*
|
|
408
|
+
* Optional. Present only on chains that support the prepaid FORWARD path
|
|
409
|
+
* (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
|
|
410
|
+
* it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
|
|
411
|
+
*/
|
|
412
|
+
tokenMessengerWithFees?: string;
|
|
397
413
|
confirmations: number;
|
|
398
414
|
}
|
|
399
415
|
/**
|
|
@@ -528,6 +544,21 @@ interface GatewayV1Contracts {
|
|
|
528
544
|
* @example "0xabcdef1234567890abcdef1234567890abcdef12"
|
|
529
545
|
*/
|
|
530
546
|
minter: string;
|
|
547
|
+
/**
|
|
548
|
+
* The address of the `DepositForHandler` contract.
|
|
549
|
+
*
|
|
550
|
+
* @description Optional. The handler the GenericExecutor calls on this chain
|
|
551
|
+
* to run a fast cross-chain deposit into the {@link GatewayV1Contracts.wallet}.
|
|
552
|
+
* Present only on chains that are fast-deposit destinations; other Gateway
|
|
553
|
+
* chains omit it.
|
|
554
|
+
*
|
|
555
|
+
* Address format varies by blockchain:
|
|
556
|
+
* - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
|
|
557
|
+
* - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
|
|
558
|
+
*
|
|
559
|
+
* @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
|
|
560
|
+
*/
|
|
561
|
+
depositForHandler?: string;
|
|
531
562
|
}
|
|
532
563
|
/**
|
|
533
564
|
* Versioned map of Gateway contract configurations.
|
|
@@ -659,6 +690,8 @@ declare enum Blockchain {
|
|
|
659
690
|
Celo_Alfajores_Testnet = "Celo_Alfajores_Testnet",
|
|
660
691
|
Codex = "Codex",
|
|
661
692
|
Codex_Testnet = "Codex_Testnet",
|
|
693
|
+
Cronos = "Cronos",
|
|
694
|
+
Cronos_Testnet = "Cronos_Testnet",
|
|
662
695
|
Edge = "Edge",
|
|
663
696
|
Edge_Testnet = "Edge_Testnet",
|
|
664
697
|
Ethereum = "Ethereum",
|
|
@@ -900,6 +933,7 @@ declare enum BridgeChain {
|
|
|
900
933
|
Avalanche = "Avalanche",
|
|
901
934
|
Base = "Base",
|
|
902
935
|
Codex = "Codex",
|
|
936
|
+
Cronos = "Cronos",
|
|
903
937
|
Edge = "Edge",
|
|
904
938
|
Ethereum = "Ethereum",
|
|
905
939
|
HyperEVM = "HyperEVM",
|
|
@@ -923,6 +957,7 @@ declare enum BridgeChain {
|
|
|
923
957
|
Avalanche_Fuji = "Avalanche_Fuji",
|
|
924
958
|
Base_Sepolia = "Base_Sepolia",
|
|
925
959
|
Codex_Testnet = "Codex_Testnet",
|
|
960
|
+
Cronos_Testnet = "Cronos_Testnet",
|
|
926
961
|
Edge_Testnet = "Edge_Testnet",
|
|
927
962
|
Ethereum_Sepolia = "Ethereum_Sepolia",
|
|
928
963
|
HyperEVM_Testnet = "HyperEVM_Testnet",
|
|
@@ -2173,6 +2208,110 @@ interface CCTPv2ActionMap {
|
|
|
2173
2208
|
*/
|
|
2174
2209
|
hookData: string;
|
|
2175
2210
|
};
|
|
2211
|
+
/**
|
|
2212
|
+
* Initiate a prepaid cross-chain USDC transfer through the `TokenMessengerWithFees` wrapper.
|
|
2213
|
+
*
|
|
2214
|
+
* Burn USDC on the source chain while collecting all fees up front against a
|
|
2215
|
+
* signed quote. The wrapper collects the fee via `FeeManager`, then delegates
|
|
2216
|
+
* to the unmodified `TokenMessengerV2`. When `hookData` is provided (the
|
|
2217
|
+
* GenericExecutor FORWARD path) the wrapper's `depositForBurnWithHookAndFees`
|
|
2218
|
+
* contract method is used; otherwise `depositForBurnWithFees` is used.
|
|
2219
|
+
*
|
|
2220
|
+
* @remarks
|
|
2221
|
+
* SDK/contract naming: this SDK action is `depositForBurnWithFees` but, when a
|
|
2222
|
+
* `hookData` is present, it dispatches to the `depositForBurnWithHookAndFees`
|
|
2223
|
+
* contract method on `TokenMessengerWithFees` (NOT on `TokenMessengerV2`).
|
|
2224
|
+
*
|
|
2225
|
+
* Fee payment channel (must match the quote's `feeToken`):
|
|
2226
|
+
* - Native fee (`feeToken` is the zero address): exactly `feeTotalAmount` is
|
|
2227
|
+
* attached as `msg.value`.
|
|
2228
|
+
* - ERC-20 fee (e.g. USDC): no value is attached; the caller must first approve
|
|
2229
|
+
* the wrapper for `feeTotalAmount` (see the provider's fee approval helper).
|
|
2230
|
+
*
|
|
2231
|
+
* @remarks
|
|
2232
|
+
* Unlike `depositForBurn`, the `TokenMessengerWithFees` contract methods do NOT
|
|
2233
|
+
* take `maxFee` or `minFinalityThreshold` — fee and finality behavior are
|
|
2234
|
+
* derived from the signed quote — so those fields are omitted from this action.
|
|
2235
|
+
*
|
|
2236
|
+
* @example
|
|
2237
|
+
* ```typescript
|
|
2238
|
+
* await adapter.action('cctp.v2.depositForBurnWithFees', {
|
|
2239
|
+
* amount: BigInt('1000000'),
|
|
2240
|
+
* mintRecipient: executorAddress, // GenericExecutor (bytes32)
|
|
2241
|
+
* destinationCaller: executorAddress, // GenericExecutor (bytes32)
|
|
2242
|
+
* fromChain: ethereum,
|
|
2243
|
+
* toChain: arc,
|
|
2244
|
+
* hookData: geForwardHookData, // cctp-forward-wrapped GenericExecutor blob
|
|
2245
|
+
* claim: { signedQuote: '0x...', refundAddress: '0x...' },
|
|
2246
|
+
* feeToken: '0x0000000000000000000000000000000000000000', // native
|
|
2247
|
+
* feeTotalAmount: 3500000n,
|
|
2248
|
+
* })
|
|
2249
|
+
* ```
|
|
2250
|
+
*/
|
|
2251
|
+
depositForBurnWithFees: Omit<CCTPv2ActionMap['depositForBurn'], 'maxFee' | 'minFinalityThreshold'> & {
|
|
2252
|
+
/**
|
|
2253
|
+
* Optional hex-encoded hook data for the GenericExecutor FORWARD path.
|
|
2254
|
+
*
|
|
2255
|
+
* When present, the `depositForBurnWithHookAndFees` contract method is used
|
|
2256
|
+
* and the blob must be wrapped in the `cctp-forward` envelope (the wrapper
|
|
2257
|
+
* rejects a FORWARD fee quote whose hook lacks it). When omitted, the plain
|
|
2258
|
+
* `depositForBurnWithFees` contract method is used.
|
|
2259
|
+
*/
|
|
2260
|
+
hookData?: string;
|
|
2261
|
+
/**
|
|
2262
|
+
* Signed fee quote claim passed to the `TokenMessengerWithFees` wrapper.
|
|
2263
|
+
*
|
|
2264
|
+
* `signedQuote` is the `[uint8 0x01][abi.encode(Quote)]` blob returned by the
|
|
2265
|
+
* Fee Quote service; `refundAddress` receives any fee overpayment refund.
|
|
2266
|
+
*/
|
|
2267
|
+
claim: QuoteClaim;
|
|
2268
|
+
/**
|
|
2269
|
+
* Fee token from the signed quote.
|
|
2270
|
+
*
|
|
2271
|
+
* The zero address (`0x000…0`) means the fee is paid in native currency and
|
|
2272
|
+
* is attached as `msg.value`. Any other address (e.g. USDC) means an ERC-20
|
|
2273
|
+
* fee that must be approved to the wrapper beforehand. This is independent of
|
|
2274
|
+
* `burnToken`, which is always USDC.
|
|
2275
|
+
*/
|
|
2276
|
+
feeToken: string;
|
|
2277
|
+
/**
|
|
2278
|
+
* Total fee amount from the signed quote, in `feeToken` minor units.
|
|
2279
|
+
*
|
|
2280
|
+
* Firm only until the quote's `expiresAt`. For a native fee this is the exact
|
|
2281
|
+
* `msg.value`; for an ERC-20 fee this is the amount approved to the wrapper.
|
|
2282
|
+
*/
|
|
2283
|
+
feeTotalAmount: bigint;
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
/**
|
|
2287
|
+
* Signed fee quote claim consumed by the `TokenMessengerWithFees` wrapper.
|
|
2288
|
+
*
|
|
2289
|
+
* Mirrors the on-chain `IFeeManager.QuoteClaim` struct.
|
|
2290
|
+
*
|
|
2291
|
+
* @example
|
|
2292
|
+
* ```typescript
|
|
2293
|
+
* const claim: QuoteClaim = {
|
|
2294
|
+
* signedQuote: '0x01...', // [uint8 0x01][abi.encode(Quote)]
|
|
2295
|
+
* refundAddress: '0xUserWallet...',
|
|
2296
|
+
* }
|
|
2297
|
+
* ```
|
|
2298
|
+
*/
|
|
2299
|
+
interface QuoteClaim {
|
|
2300
|
+
/**
|
|
2301
|
+
* Opaque signed quote bytes (`0x` hex) from the fee-quote service
|
|
2302
|
+
* (`SignedFeeQuote.signedQuote` returned by `fetchFeeQuote`). Pass verbatim;
|
|
2303
|
+
* do not decode.
|
|
2304
|
+
*
|
|
2305
|
+
* The quote binds the FORWARD fee item to the on-chain call via `argsHash`;
|
|
2306
|
+
* passing a quote that does not match the burn args reverts `QuoteArgsMismatch`.
|
|
2307
|
+
*/
|
|
2308
|
+
signedQuote: string;
|
|
2309
|
+
/**
|
|
2310
|
+
* Address that receives any refund of overpaid fees.
|
|
2311
|
+
*
|
|
2312
|
+
* Typically the user wallet that authorized the burn.
|
|
2313
|
+
*/
|
|
2314
|
+
refundAddress: string;
|
|
2176
2315
|
}
|
|
2177
2316
|
|
|
2178
2317
|
/**
|
|
@@ -6344,26 +6483,28 @@ interface AppKitContext {
|
|
|
6344
6483
|
* Event handlers registered for AppKit operations.
|
|
6345
6484
|
*
|
|
6346
6485
|
* This property stores event handlers that are registered via the AppKit's
|
|
6347
|
-
* `on()` method. Handlers are grouped by operation type. The
|
|
6348
|
-
*
|
|
6349
|
-
* wires action handlers for additional kits.
|
|
6486
|
+
* `on()` method. Handlers are grouped by operation type. The runtime buckets
|
|
6487
|
+
* are `bridge` and `earn`; the context can add more operation buckets as
|
|
6488
|
+
* AppKit wires action handlers for additional kits.
|
|
6350
6489
|
*
|
|
6351
|
-
* Within each operation bucket, handlers are keyed by action name (for
|
|
6352
|
-
* `bridge.approve`) or `*` for wildcard handlers.
|
|
6353
|
-
* handlers registered, allowing multiple
|
|
6490
|
+
* Within each operation bucket, handlers are keyed by action name (for
|
|
6491
|
+
* example, `bridge.approve` or `earn.deposit`) or `*` for wildcard handlers.
|
|
6492
|
+
* Each action can have multiple handlers registered, allowing multiple
|
|
6493
|
+
* subscribers to listen to the same event.
|
|
6354
6494
|
*
|
|
6355
6495
|
* The handlers are stored in the context to allow deferred registration with
|
|
6356
|
-
* underlying operation kits, enabling a clean separation between event
|
|
6357
|
-
* and operation execution.
|
|
6496
|
+
* underlying operation kits, enabling a clean separation between event
|
|
6497
|
+
* registration and operation execution.
|
|
6358
6498
|
*
|
|
6359
6499
|
* @example
|
|
6360
6500
|
* ```typescript
|
|
6361
6501
|
* const context = createContext()
|
|
6362
6502
|
* // Handlers registered via kit.on() are stored by operation type
|
|
6363
|
-
* // Bridge handlers are registered with BridgeKit when bridge()
|
|
6503
|
+
* // Bridge handlers are registered with BridgeKit when bridge() runs
|
|
6504
|
+
* // Earn handlers are registered with EarnKit when earn operations run
|
|
6364
6505
|
* ```
|
|
6365
6506
|
*/
|
|
6366
|
-
actions: Record<'bridge', Record<string, ((payload: unknown) => void)[]>>;
|
|
6507
|
+
actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
|
|
6367
6508
|
/**
|
|
6368
6509
|
* Disable error telemetry for all sub-kits.
|
|
6369
6510
|
*
|
|
@@ -6374,6 +6515,16 @@ interface AppKitContext {
|
|
|
6374
6515
|
* @defaultValue false
|
|
6375
6516
|
*/
|
|
6376
6517
|
disableErrorReporting?: boolean;
|
|
6518
|
+
/**
|
|
6519
|
+
* Custom HTTP headers forwarded with the underlying CCTP provider's
|
|
6520
|
+
* attestation (Iris) API requests made by bridge operations.
|
|
6521
|
+
*
|
|
6522
|
+
* @remarks
|
|
6523
|
+
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
6524
|
+
* rather than replacing them. The header is forwarded as-is to Circle's API;
|
|
6525
|
+
* the SDK does not interpret it.
|
|
6526
|
+
*/
|
|
6527
|
+
headers?: Record<string, string>;
|
|
6377
6528
|
}
|
|
6378
6529
|
|
|
6379
6530
|
/**
|
|
@@ -6381,7 +6532,8 @@ interface AppKitContext {
|
|
|
6381
6532
|
*
|
|
6382
6533
|
* This type allows partial customization of the context while ensuring
|
|
6383
6534
|
* that all required properties have sensible defaults. Users can override
|
|
6384
|
-
* specific methods while keeping the rest intact.
|
|
6535
|
+
* specific methods while keeping the rest intact. Action handler buckets
|
|
6536
|
+
* may also be supplied partially; missing buckets default to empty maps.
|
|
6385
6537
|
*
|
|
6386
6538
|
* @example
|
|
6387
6539
|
* ```typescript
|
|
@@ -6393,7 +6545,9 @@ interface AppKitContext {
|
|
|
6393
6545
|
* })
|
|
6394
6546
|
* ```
|
|
6395
6547
|
*/
|
|
6396
|
-
type CreateContextParams = Partial<AppKitContext
|
|
6548
|
+
type CreateContextParams = Omit<Partial<AppKitContext>, 'actions'> & {
|
|
6549
|
+
actions?: Partial<AppKitContext['actions']>;
|
|
6550
|
+
};
|
|
6397
6551
|
/**
|
|
6398
6552
|
* Creates a AppKit context.
|
|
6399
6553
|
*
|