@circle-fin/app-kit 1.13.0 → 1.14.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 +56 -0
- package/bridge.cjs +910 -47
- package/bridge.d.cts +55 -0
- package/bridge.d.mts +55 -0
- package/bridge.d.ts +55 -0
- package/bridge.mjs +911 -48
- package/chains.cjs +129 -10
- package/chains.d.cts +9 -0
- package/chains.d.mts +9 -0
- package/chains.d.ts +9 -0
- package/chains.mjs +129 -10
- package/context.d.cts +55 -0
- package/context.d.mts +55 -0
- package/context.d.ts +55 -0
- package/earn.cjs +432 -27
- package/earn.d.cts +55 -0
- package/earn.d.mts +55 -0
- package/earn.d.ts +55 -0
- package/earn.mjs +428 -27
- package/estimateBridge.cjs +910 -47
- package/estimateBridge.d.cts +61 -0
- package/estimateBridge.d.mts +61 -0
- package/estimateBridge.d.ts +61 -0
- package/estimateBridge.mjs +911 -48
- package/estimateSwap.cjs +428 -26
- package/estimateSwap.d.cts +55 -0
- package/estimateSwap.d.mts +55 -0
- package/estimateSwap.d.ts +55 -0
- package/estimateSwap.mjs +427 -26
- package/index.cjs +4613 -346
- package/index.d.cts +777 -216
- package/index.d.mts +777 -216
- package/index.d.ts +777 -216
- package/index.mjs +4614 -347
- package/package.json +6 -6
- package/swap.cjs +428 -26
- package/swap.d.cts +55 -0
- package/swap.d.mts +55 -0
- package/swap.d.ts +55 -0
- package/swap.mjs +427 -26
- package/unifiedBalance.cjs +20602 -8389
- package/unifiedBalance.d.cts +544 -160
- package/unifiedBalance.d.mts +544 -160
- package/unifiedBalance.d.ts +544 -160
- package/unifiedBalance.mjs +20603 -8391
package/earn.cjs
CHANGED
|
@@ -30,7 +30,7 @@ if (typeof window !== 'undefined' && typeof window.Buffer === 'undefined') {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
var zod = require('zod');
|
|
33
|
-
require('pino');
|
|
33
|
+
var pino = require('pino');
|
|
34
34
|
require('@ethersproject/bytes');
|
|
35
35
|
require('@ethersproject/abi');
|
|
36
36
|
require('@ethersproject/address');
|
|
@@ -43,6 +43,10 @@ var viem = require('viem');
|
|
|
43
43
|
var units = require('@ethersproject/units');
|
|
44
44
|
var keccak256 = require('@ethersproject/keccak256');
|
|
45
45
|
|
|
46
|
+
function _interopDefault (e) { return e && e.__esModule ? e.default : e; }
|
|
47
|
+
|
|
48
|
+
var pino__default = /*#__PURE__*/_interopDefault(pino);
|
|
49
|
+
|
|
46
50
|
// Import global type declarations
|
|
47
51
|
/**
|
|
48
52
|
* Check whether the current runtime is Node.js.
|
|
@@ -2894,8 +2898,45 @@ var EarnChain;
|
|
|
2894
2898
|
* This program handles minting operations for Gateway transactions
|
|
2895
2899
|
* on Solana devnet.
|
|
2896
2900
|
*/ const GATEWAY_MINTER_SOLANA_DEVNET = 'GATEmKK2ECL1brEngQZWCgMWPbvrEYqsV6u29dAaHavr';
|
|
2897
|
-
/**
|
|
2898
|
-
|
|
2901
|
+
/**
|
|
2902
|
+
* The `TokenMessengerWithFees` proxy contract address for EVM mainnet networks
|
|
2903
|
+
* (all chains except Edge).
|
|
2904
|
+
*
|
|
2905
|
+
* Deployed at a CREATE3-derived address; identical across all mainnet EVM
|
|
2906
|
+
* source chains. Present on any chain that supports the prepaid FORWARD path
|
|
2907
|
+
* via `depositForBurnWithHookAndFees`.
|
|
2908
|
+
*/ const TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET = '0x71f54F818671cD0D7ea140Da213e5C8b5C92a408';
|
|
2909
|
+
/**
|
|
2910
|
+
* The `TokenMessengerWithFees` proxy contract address for EVM testnet networks.
|
|
2911
|
+
*
|
|
2912
|
+
* Identical across all testnet EVM source chains. Present on any testnet chain
|
|
2913
|
+
* that supports the prepaid FORWARD path via `depositForBurnWithHookAndFees`.
|
|
2914
|
+
*/ const TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET = '0x8745D906D67C346E5eb1aEEED38Eb87F34DF0C0A';
|
|
2915
|
+
/**
|
|
2916
|
+
* The `DepositForHandler` proxy contract address for EVM mainnet networks.
|
|
2917
|
+
*
|
|
2918
|
+
* The handler the GenericExecutor calls on a fast-deposit destination chain to
|
|
2919
|
+
* run a cross-chain deposit into the GatewayWallet. Deployed at the same
|
|
2920
|
+
* address across all mainnet EVM destination chains.
|
|
2921
|
+
*/ const DEPOSIT_FOR_HANDLER_EVM_MAINNET = '0x16529813203f77E036576666336554a1210dce4D';
|
|
2922
|
+
/**
|
|
2923
|
+
* The `DepositForHandler` proxy contract address for EVM testnet networks.
|
|
2924
|
+
*
|
|
2925
|
+
* Identical across all testnet EVM destination chains.
|
|
2926
|
+
*/ const DEPOSIT_FOR_HANDLER_EVM_TESTNET = '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48';
|
|
2927
|
+
/**
|
|
2928
|
+
* The `GenericExecutor` proxy contract address for EVM mainnet networks.
|
|
2929
|
+
*
|
|
2930
|
+
* The GenericExecutor is the `mintRecipient` and `destinationCaller` on the
|
|
2931
|
+
* destination chain for the CCTP v2 prepaid FORWARD path. It receives the CCTP
|
|
2932
|
+
* mint and calls the `DepositForHandler` to complete the fast deposit.
|
|
2933
|
+
* Deployed at the same address across all mainnet EVM destination chains.
|
|
2934
|
+
*/ const GENERIC_EXECUTOR_EVM_MAINNET = '0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7';
|
|
2935
|
+
/**
|
|
2936
|
+
* The `GenericExecutor` proxy contract address for EVM testnet networks.
|
|
2937
|
+
*
|
|
2938
|
+
* Identical across all testnet EVM destination chains.
|
|
2939
|
+
*/ const GENERIC_EXECUTOR_EVM_TESTNET = '0xEdC81040756AcCfF070c21D37b265b9D0b5Ba45e';
|
|
2899
2940
|
|
|
2900
2941
|
/**
|
|
2901
2942
|
* Arc Testnet chain definition
|
|
@@ -2954,9 +2995,8 @@ var EarnChain;
|
|
|
2954
2995
|
v1: {
|
|
2955
2996
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2956
2997
|
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
depositForHandler: '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48'
|
|
2998
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
2999
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
2960
3000
|
}
|
|
2961
3001
|
},
|
|
2962
3002
|
forwarderSupported: {
|
|
@@ -3151,7 +3191,9 @@ var EarnChain;
|
|
|
3151
3191
|
contracts: {
|
|
3152
3192
|
v1: {
|
|
3153
3193
|
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
3154
|
-
minter: GATEWAY_MINTER_EVM_MAINNET
|
|
3194
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
3195
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_MAINNET,
|
|
3196
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_MAINNET
|
|
3155
3197
|
}
|
|
3156
3198
|
},
|
|
3157
3199
|
forwarderSupported: {
|
|
@@ -3215,7 +3257,9 @@ var EarnChain;
|
|
|
3215
3257
|
contracts: {
|
|
3216
3258
|
v1: {
|
|
3217
3259
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
3218
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
3260
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
3261
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
3262
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
3219
3263
|
}
|
|
3220
3264
|
},
|
|
3221
3265
|
forwarderSupported: {
|
|
@@ -3528,6 +3572,7 @@ var EarnChain;
|
|
|
3528
3572
|
v2: {
|
|
3529
3573
|
type: 'split',
|
|
3530
3574
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3575
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3531
3576
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3532
3577
|
confirmations: 1,
|
|
3533
3578
|
fastConfirmations: 1
|
|
@@ -3573,6 +3618,7 @@ var EarnChain;
|
|
|
3573
3618
|
v2: {
|
|
3574
3619
|
type: 'split',
|
|
3575
3620
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3621
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3576
3622
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3577
3623
|
confirmations: 1,
|
|
3578
3624
|
fastConfirmations: 1
|
|
@@ -3618,6 +3664,7 @@ var EarnChain;
|
|
|
3618
3664
|
v2: {
|
|
3619
3665
|
type: 'split',
|
|
3620
3666
|
tokenMessenger: '0x98706A006bc632Df31CAdFCBD43F38887ce2ca5c',
|
|
3667
|
+
tokenMessengerWithFees: '0x3Ac96675F9a3E6922713e041645D82f3561d3686',
|
|
3621
3668
|
messageTransmitter: '0x5b61381Fc9e58E70EfC13a4A97516997019198ee',
|
|
3622
3669
|
confirmations: 65,
|
|
3623
3670
|
fastConfirmations: 1
|
|
@@ -3663,6 +3710,7 @@ var EarnChain;
|
|
|
3663
3710
|
v2: {
|
|
3664
3711
|
type: 'split',
|
|
3665
3712
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3713
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3666
3714
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3667
3715
|
confirmations: 65,
|
|
3668
3716
|
fastConfirmations: 1
|
|
@@ -4011,6 +4059,7 @@ var EarnChain;
|
|
|
4011
4059
|
v2: {
|
|
4012
4060
|
type: 'split',
|
|
4013
4061
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4062
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4014
4063
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4015
4064
|
confirmations: 1,
|
|
4016
4065
|
fastConfirmations: 1
|
|
@@ -4058,6 +4107,7 @@ var EarnChain;
|
|
|
4058
4107
|
v2: {
|
|
4059
4108
|
type: 'split',
|
|
4060
4109
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4110
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4061
4111
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4062
4112
|
confirmations: 1,
|
|
4063
4113
|
fastConfirmations: 1
|
|
@@ -4339,6 +4389,7 @@ var EarnChain;
|
|
|
4339
4389
|
v2: {
|
|
4340
4390
|
type: 'split',
|
|
4341
4391
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4392
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4342
4393
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4343
4394
|
confirmations: 1,
|
|
4344
4395
|
fastConfirmations: 1
|
|
@@ -4384,6 +4435,7 @@ var EarnChain;
|
|
|
4384
4435
|
v2: {
|
|
4385
4436
|
type: 'split',
|
|
4386
4437
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4438
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4387
4439
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4388
4440
|
confirmations: 64,
|
|
4389
4441
|
fastConfirmations: 1
|
|
@@ -4429,6 +4481,7 @@ var EarnChain;
|
|
|
4429
4481
|
v2: {
|
|
4430
4482
|
type: 'split',
|
|
4431
4483
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4484
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4432
4485
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4433
4486
|
confirmations: 64,
|
|
4434
4487
|
fastConfirmations: 1
|
|
@@ -4730,6 +4783,7 @@ var EarnChain;
|
|
|
4730
4783
|
v2: {
|
|
4731
4784
|
type: 'split',
|
|
4732
4785
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4786
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4733
4787
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4734
4788
|
confirmations: 1,
|
|
4735
4789
|
fastConfirmations: 1
|
|
@@ -4776,6 +4830,7 @@ var EarnChain;
|
|
|
4776
4830
|
v2: {
|
|
4777
4831
|
type: 'split',
|
|
4778
4832
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4833
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4779
4834
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4780
4835
|
confirmations: 1,
|
|
4781
4836
|
fastConfirmations: 1
|
|
@@ -5083,7 +5138,9 @@ var EarnChain;
|
|
|
5083
5138
|
contracts: {
|
|
5084
5139
|
v1: {
|
|
5085
5140
|
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
5086
|
-
minter: GATEWAY_MINTER_EVM_MAINNET
|
|
5141
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
5142
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_MAINNET,
|
|
5143
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_MAINNET
|
|
5087
5144
|
}
|
|
5088
5145
|
},
|
|
5089
5146
|
forwarderSupported: {
|
|
@@ -5148,7 +5205,9 @@ var EarnChain;
|
|
|
5148
5205
|
contracts: {
|
|
5149
5206
|
v1: {
|
|
5150
5207
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
5151
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
5208
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
5209
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
5210
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
5152
5211
|
}
|
|
5153
5212
|
},
|
|
5154
5213
|
forwarderSupported: {
|
|
@@ -6234,6 +6293,67 @@ var Chains = {
|
|
|
6234
6293
|
return chain.cctp?.contracts.v2 !== undefined;
|
|
6235
6294
|
}
|
|
6236
6295
|
|
|
6296
|
+
/**
|
|
6297
|
+
* Chains the Fee Service accepts as a SOURCE for source-paid ("receive-exact")
|
|
6298
|
+
* CCTP v2 fees. An explicit allowlist is required because the
|
|
6299
|
+
* `TokenMessengerWithFees` wrapper address is now shared with the fast-deposit
|
|
6300
|
+
* forwarder path, so wrapper presence no longer implies source-fee support.
|
|
6301
|
+
* Keep in sync with backend coverage.
|
|
6302
|
+
*/ new Set([
|
|
6303
|
+
// Mainnet
|
|
6304
|
+
Blockchain.Ethereum,
|
|
6305
|
+
Blockchain.Base,
|
|
6306
|
+
Blockchain.Arbitrum,
|
|
6307
|
+
Blockchain.Unichain,
|
|
6308
|
+
Blockchain.Optimism,
|
|
6309
|
+
Blockchain.Codex,
|
|
6310
|
+
Blockchain.Ink,
|
|
6311
|
+
Blockchain.Plume,
|
|
6312
|
+
Blockchain.Linea,
|
|
6313
|
+
Blockchain.World_Chain,
|
|
6314
|
+
// Testnet counterparts
|
|
6315
|
+
Blockchain.Ethereum_Sepolia,
|
|
6316
|
+
Blockchain.Base_Sepolia,
|
|
6317
|
+
Blockchain.Arbitrum_Sepolia,
|
|
6318
|
+
Blockchain.Unichain_Sepolia,
|
|
6319
|
+
Blockchain.Optimism_Sepolia,
|
|
6320
|
+
Blockchain.Codex_Testnet,
|
|
6321
|
+
Blockchain.Ink_Testnet,
|
|
6322
|
+
Blockchain.Plume_Testnet,
|
|
6323
|
+
Blockchain.Linea_Sepolia,
|
|
6324
|
+
Blockchain.World_Chain_Sepolia
|
|
6325
|
+
]);
|
|
6326
|
+
|
|
6327
|
+
/**
|
|
6328
|
+
* Temporary allowlist of chains permitted to initiate Gateway fast deposits.
|
|
6329
|
+
* Only chains keyed here are eligible; all others are rejected. Using the
|
|
6330
|
+
* {@link Blockchain} enum keeps entries type-safe and catches typos at compile
|
|
6331
|
+
* time. Remove this allowlist once roll-out is complete.
|
|
6332
|
+
*/ new Set([
|
|
6333
|
+
// Mainnet
|
|
6334
|
+
Blockchain.Ethereum,
|
|
6335
|
+
Blockchain.Base,
|
|
6336
|
+
Blockchain.Arbitrum,
|
|
6337
|
+
Blockchain.Unichain,
|
|
6338
|
+
Blockchain.Optimism,
|
|
6339
|
+
Blockchain.Codex,
|
|
6340
|
+
Blockchain.Ink,
|
|
6341
|
+
Blockchain.Plume,
|
|
6342
|
+
Blockchain.Linea,
|
|
6343
|
+
Blockchain.World_Chain,
|
|
6344
|
+
// Testnet counterparts
|
|
6345
|
+
Blockchain.Ethereum_Sepolia,
|
|
6346
|
+
Blockchain.Base_Sepolia,
|
|
6347
|
+
Blockchain.Arbitrum_Sepolia,
|
|
6348
|
+
Blockchain.Unichain_Sepolia,
|
|
6349
|
+
Blockchain.Optimism_Sepolia,
|
|
6350
|
+
Blockchain.Codex_Testnet,
|
|
6351
|
+
Blockchain.Ink_Testnet,
|
|
6352
|
+
Blockchain.Plume_Testnet,
|
|
6353
|
+
Blockchain.Linea_Sepolia,
|
|
6354
|
+
Blockchain.World_Chain_Sepolia
|
|
6355
|
+
]);
|
|
6356
|
+
|
|
6237
6357
|
/**
|
|
6238
6358
|
* Zod schema for validating Gateway v1 contract addresses.
|
|
6239
6359
|
*
|
|
@@ -6255,7 +6375,10 @@ var Chains = {
|
|
|
6255
6375
|
}).min(1, 'Gateway minter address cannot be empty.'),
|
|
6256
6376
|
depositForHandler: zod.z.string({
|
|
6257
6377
|
invalid_type_error: 'Gateway depositForHandler address must be a string.'
|
|
6258
|
-
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional()
|
|
6378
|
+
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional(),
|
|
6379
|
+
genericExecutor: zod.z.string({
|
|
6380
|
+
invalid_type_error: 'Gateway genericExecutor address must be a string.'
|
|
6381
|
+
}).min(1, 'Gateway genericExecutor address cannot be empty.').optional()
|
|
6259
6382
|
}).strict() // Reject any additional properties not defined in the schema
|
|
6260
6383
|
;
|
|
6261
6384
|
/**
|
|
@@ -8469,7 +8592,7 @@ const swapTokenEnumSchema = zod.z.enum([
|
|
|
8469
8592
|
* allowlisted {@link ClientLogPayload} fields (and the allowlisted
|
|
8470
8593
|
* sub-fields of `errorDetails` / `clientContext`) are copied across.
|
|
8471
8594
|
* A regressing upstream mapper — or a plain-JS caller that bypasses the
|
|
8472
|
-
* type — therefore cannot exfiltrate stray properties (secrets,
|
|
8595
|
+
* type — therefore cannot exfiltrate stray properties (secrets,
|
|
8473
8596
|
* raw error stacks) through the analytics channel. Optional fields are
|
|
8474
8597
|
* only included when present so the serialised shape matches the
|
|
8475
8598
|
* server's strict schema.
|
|
@@ -8492,6 +8615,9 @@ const swapTokenEnumSchema = zod.z.enum([
|
|
|
8492
8615
|
if (payload.destinationChain !== undefined) safe['destinationChain'] = payload.destinationChain;
|
|
8493
8616
|
if (payload.tokenIn !== undefined) safe['tokenIn'] = payload.tokenIn;
|
|
8494
8617
|
if (payload.tokenOut !== undefined) safe['tokenOut'] = payload.tokenOut;
|
|
8618
|
+
if (payload.amountIn !== undefined) safe['amountIn'] = payload.amountIn;
|
|
8619
|
+
if (payload.durationMs !== undefined) safe['durationMs'] = payload.durationMs;
|
|
8620
|
+
if (payload.sourceAddress !== undefined) safe['sourceAddress'] = payload.sourceAddress;
|
|
8495
8621
|
if (payload.txHash !== undefined) safe['txHash'] = payload.txHash;
|
|
8496
8622
|
if (payload.correlationId !== undefined) safe['correlationId'] = payload.correlationId;
|
|
8497
8623
|
if (payload.errorDetails !== undefined) {
|
|
@@ -8688,14 +8814,28 @@ const swapTokenEnumSchema = zod.z.enum([
|
|
|
8688
8814
|
}
|
|
8689
8815
|
|
|
8690
8816
|
/**
|
|
8691
|
-
*
|
|
8692
|
-
*
|
|
8817
|
+
* Emit a stable console warning when building or emitting a telemetry payload
|
|
8818
|
+
* throws — for example, a buggy `TelemetryContextResolver`, a regression in
|
|
8693
8819
|
* `extractErrorDetails`, or a synchronous failure inside `emitAnalyticsLog`
|
|
8694
|
-
* before it could swallow the error itself.
|
|
8695
|
-
*
|
|
8696
|
-
*
|
|
8820
|
+
* before it could swallow the error itself. Uses a stable prefix so the
|
|
8821
|
+
* drop is discoverable via grep. Never re-throws: the caller's original
|
|
8822
|
+
* operation error must always win.
|
|
8697
8823
|
*
|
|
8698
8824
|
* @internal
|
|
8825
|
+
*
|
|
8826
|
+
* @param eventType - The telemetry event type that was being emitted.
|
|
8827
|
+
* @param cause - The error or value that caused the drop.
|
|
8828
|
+
*
|
|
8829
|
+
* @example
|
|
8830
|
+
* ```typescript
|
|
8831
|
+
* import { warnTelemetryDrop } from '@core/utils'
|
|
8832
|
+
*
|
|
8833
|
+
* try {
|
|
8834
|
+
* void emitAnalyticsLog(payload)
|
|
8835
|
+
* } catch (err) {
|
|
8836
|
+
* warnTelemetryDrop('my_event', err)
|
|
8837
|
+
* }
|
|
8838
|
+
* ```
|
|
8699
8839
|
*/ function warnTelemetryDrop(eventType, cause) {
|
|
8700
8840
|
try {
|
|
8701
8841
|
// Pass `cause` as the second console.warn argument rather than
|
|
@@ -8735,6 +8875,9 @@ const swapTokenEnumSchema = zod.z.enum([
|
|
|
8735
8875
|
...context?.tokenOut != null && {
|
|
8736
8876
|
tokenOut: context.tokenOut
|
|
8737
8877
|
},
|
|
8878
|
+
...context?.amountIn != null && {
|
|
8879
|
+
amountIn: context.amountIn
|
|
8880
|
+
},
|
|
8738
8881
|
...context?.txHash != null && {
|
|
8739
8882
|
txHash: context.txHash
|
|
8740
8883
|
},
|
|
@@ -8834,7 +8977,7 @@ const swapTokenEnumSchema = zod.z.enum([
|
|
|
8834
8977
|
}
|
|
8835
8978
|
|
|
8836
8979
|
var name$3 = "@circle-fin/bridge-kit";
|
|
8837
|
-
var version$3 = "1.14.
|
|
8980
|
+
var version$3 = "1.14.1";
|
|
8838
8981
|
var pkg$3 = {
|
|
8839
8982
|
name: name$3,
|
|
8840
8983
|
version: version$3};
|
|
@@ -9766,6 +9909,241 @@ var TransferSpeed;
|
|
|
9766
9909
|
message: 'Invalid metrics'
|
|
9767
9910
|
});
|
|
9768
9911
|
|
|
9912
|
+
/**
|
|
9913
|
+
* Omit undefined values from an object.
|
|
9914
|
+
*
|
|
9915
|
+
* @param obj - The object to process.
|
|
9916
|
+
* @returns A new object with undefined values removed.
|
|
9917
|
+
*
|
|
9918
|
+
* @internal
|
|
9919
|
+
* @remarks
|
|
9920
|
+
* Used by both production and mock loggers to ensure consistent behavior.
|
|
9921
|
+
* This prevents undefined values from being serialized in log output,
|
|
9922
|
+
* which can cause issues with some log transports.
|
|
9923
|
+
*/ function omitUndefined(obj) {
|
|
9924
|
+
const result = {};
|
|
9925
|
+
for (const [key, value] of Object.entries(obj)){
|
|
9926
|
+
if (value !== undefined) {
|
|
9927
|
+
result[key] = value;
|
|
9928
|
+
}
|
|
9929
|
+
}
|
|
9930
|
+
return result;
|
|
9931
|
+
}
|
|
9932
|
+
|
|
9933
|
+
/**
|
|
9934
|
+
* Default redaction paths for web3/blockchain SDKs.
|
|
9935
|
+
*
|
|
9936
|
+
* @remarks
|
|
9937
|
+
* These paths target common sensitive fields in blockchain applications.
|
|
9938
|
+
* All user fields are nested under `context`, so paths start with `context.`.
|
|
9939
|
+
* Wildcard `*` matches any key at that level.
|
|
9940
|
+
*/ const DEFAULT_REDACT_PATHS = [
|
|
9941
|
+
// Generic Credentials
|
|
9942
|
+
'context.password',
|
|
9943
|
+
'context.passphrase',
|
|
9944
|
+
'context.secret',
|
|
9945
|
+
'context.token',
|
|
9946
|
+
'context.*.password',
|
|
9947
|
+
'context.*.passphrase',
|
|
9948
|
+
'context.*.secret',
|
|
9949
|
+
'context.*.token',
|
|
9950
|
+
// API Keys & Auth Tokens
|
|
9951
|
+
'context.apiKey',
|
|
9952
|
+
'context.apiSecret',
|
|
9953
|
+
'context.accessToken',
|
|
9954
|
+
'context.refreshToken',
|
|
9955
|
+
'context.jwt',
|
|
9956
|
+
'context.bearerToken',
|
|
9957
|
+
'context.sessionId',
|
|
9958
|
+
'context.authorization',
|
|
9959
|
+
'context.cookie',
|
|
9960
|
+
'context.*.apiKey',
|
|
9961
|
+
'context.*.apiSecret',
|
|
9962
|
+
'context.*.accessToken',
|
|
9963
|
+
'context.*.refreshToken',
|
|
9964
|
+
'context.*.jwt',
|
|
9965
|
+
'context.*.bearerToken',
|
|
9966
|
+
'context.*.sessionId',
|
|
9967
|
+
'context.*.authorization',
|
|
9968
|
+
'context.*.cookie',
|
|
9969
|
+
// Web3 / Crypto Keys
|
|
9970
|
+
'context.privateKey',
|
|
9971
|
+
'context.secretKey',
|
|
9972
|
+
'context.signingKey',
|
|
9973
|
+
'context.encryptionKey',
|
|
9974
|
+
'context.*.privateKey',
|
|
9975
|
+
'context.*.secretKey',
|
|
9976
|
+
'context.*.signingKey',
|
|
9977
|
+
'context.*.encryptionKey',
|
|
9978
|
+
// Web3 / Crypto Mnemonics and Seeds
|
|
9979
|
+
'context.mnemonic',
|
|
9980
|
+
'context.seed',
|
|
9981
|
+
'context.seedPhrase',
|
|
9982
|
+
'context.*.mnemonic',
|
|
9983
|
+
'context.*.seed',
|
|
9984
|
+
'context.*.seedPhrase',
|
|
9985
|
+
// OTP / Verification Codes
|
|
9986
|
+
'context.otp',
|
|
9987
|
+
'context.verificationCode',
|
|
9988
|
+
'context.*.otp',
|
|
9989
|
+
'context.*.verificationCode',
|
|
9990
|
+
// Payment Information
|
|
9991
|
+
'context.cardNumber',
|
|
9992
|
+
'context.cvv',
|
|
9993
|
+
'context.accountNumber',
|
|
9994
|
+
'context.*.cardNumber',
|
|
9995
|
+
'context.*.cvv',
|
|
9996
|
+
'context.*.accountNumber'
|
|
9997
|
+
];
|
|
9998
|
+
/**
|
|
9999
|
+
* Wrap user fields under `context` to prevent collision with pino internals.
|
|
10000
|
+
*
|
|
10001
|
+
* @param fields - User-provided log fields.
|
|
10002
|
+
* @returns Object with fields nested under `context`, or undefined if empty.
|
|
10003
|
+
*
|
|
10004
|
+
* @remarks
|
|
10005
|
+
* This function handles edge cases by returning undefined for null, undefined,
|
|
10006
|
+
* or empty objects to avoid unnecessary wrapping in log output.
|
|
10007
|
+
* Undefined values are cleaned before wrapping.
|
|
10008
|
+
*/ function wrapInContext(fields) {
|
|
10009
|
+
if (!fields) return undefined;
|
|
10010
|
+
// Clean undefined values for consistency and transport compatibility
|
|
10011
|
+
const cleaned = omitUndefined(fields);
|
|
10012
|
+
// Handle edge case: all values were undefined, resulting in empty object
|
|
10013
|
+
const keys = Object.keys(cleaned);
|
|
10014
|
+
if (keys.length === 0) return undefined;
|
|
10015
|
+
return {
|
|
10016
|
+
context: cleaned
|
|
10017
|
+
};
|
|
10018
|
+
}
|
|
10019
|
+
/**
|
|
10020
|
+
* Wrap a pino instance to conform to our Logger interface.
|
|
10021
|
+
*
|
|
10022
|
+
* @param pinoInstance - The pino logger instance to wrap.
|
|
10023
|
+
* @returns A Logger instance conforming to our stable interface.
|
|
10024
|
+
*/ function wrapPino(pinoInstance) {
|
|
10025
|
+
return {
|
|
10026
|
+
debug (message, fields) {
|
|
10027
|
+
const wrapped = wrapInContext(fields);
|
|
10028
|
+
if (wrapped) {
|
|
10029
|
+
pinoInstance.debug(wrapped, message);
|
|
10030
|
+
} else {
|
|
10031
|
+
pinoInstance.debug(message);
|
|
10032
|
+
}
|
|
10033
|
+
},
|
|
10034
|
+
info (message, fields) {
|
|
10035
|
+
const wrapped = wrapInContext(fields);
|
|
10036
|
+
if (wrapped) {
|
|
10037
|
+
pinoInstance.info(wrapped, message);
|
|
10038
|
+
} else {
|
|
10039
|
+
pinoInstance.info(message);
|
|
10040
|
+
}
|
|
10041
|
+
},
|
|
10042
|
+
warn (message, fields) {
|
|
10043
|
+
const wrapped = wrapInContext(fields);
|
|
10044
|
+
if (wrapped) {
|
|
10045
|
+
pinoInstance.warn(wrapped, message);
|
|
10046
|
+
} else {
|
|
10047
|
+
pinoInstance.warn(message);
|
|
10048
|
+
}
|
|
10049
|
+
},
|
|
10050
|
+
error (message, fields) {
|
|
10051
|
+
const wrapped = wrapInContext(fields);
|
|
10052
|
+
if (wrapped) {
|
|
10053
|
+
pinoInstance.error(wrapped, message);
|
|
10054
|
+
} else {
|
|
10055
|
+
pinoInstance.error(message);
|
|
10056
|
+
}
|
|
10057
|
+
},
|
|
10058
|
+
child (tags) {
|
|
10059
|
+
// Child bindings stay flat (not wrapped) - they're part of logger's base context
|
|
10060
|
+
const cleaned = omitUndefined(tags);
|
|
10061
|
+
return wrapPino(pinoInstance.child(cleaned));
|
|
10062
|
+
}
|
|
10063
|
+
};
|
|
10064
|
+
}
|
|
10065
|
+
/**
|
|
10066
|
+
* Build pino redact configuration from our simplified options.
|
|
10067
|
+
*
|
|
10068
|
+
* @param redact - The redact configuration option.
|
|
10069
|
+
* @returns Pino-compatible redact configuration or undefined.
|
|
10070
|
+
*/ function buildRedactConfig(redact) {
|
|
10071
|
+
// Explicitly disabled
|
|
10072
|
+
if (redact === false) {
|
|
10073
|
+
return undefined;
|
|
10074
|
+
}
|
|
10075
|
+
// Custom paths provided
|
|
10076
|
+
if (Array.isArray(redact)) {
|
|
10077
|
+
return redact.length > 0 ? {
|
|
10078
|
+
paths: redact,
|
|
10079
|
+
censor: '[REDACTED]'
|
|
10080
|
+
} : undefined;
|
|
10081
|
+
}
|
|
10082
|
+
// Default: use web3 sensible defaults
|
|
10083
|
+
return {
|
|
10084
|
+
paths: [
|
|
10085
|
+
...DEFAULT_REDACT_PATHS
|
|
10086
|
+
],
|
|
10087
|
+
censor: '[REDACTED]'
|
|
10088
|
+
};
|
|
10089
|
+
}
|
|
10090
|
+
/**
|
|
10091
|
+
* Create a logger backed by pino.
|
|
10092
|
+
*
|
|
10093
|
+
* @param options - Logger options (optional).
|
|
10094
|
+
* @param stream - Destination stream (optional).
|
|
10095
|
+
* @returns A Logger instance.
|
|
10096
|
+
* @throws Error if invalid pino options are provided.
|
|
10097
|
+
*
|
|
10098
|
+
* @remarks
|
|
10099
|
+
* This is a thin wrapper around pino that exposes our stable Logger interface.
|
|
10100
|
+
* Pino handles all transport concerns: JSON, pretty printing, file, remote, browser, etc.
|
|
10101
|
+
*
|
|
10102
|
+
* **Security**: By default, sensitive web3 fields (privateKey, mnemonic, apiKey, etc.)
|
|
10103
|
+
* are automatically redacted from log output. Use `redact: false` to disable.
|
|
10104
|
+
*
|
|
10105
|
+
* @example
|
|
10106
|
+
* ```typescript
|
|
10107
|
+
* import { createLogger } from '@core/runtime'
|
|
10108
|
+
*
|
|
10109
|
+
* // Default: web3 sensitive fields are redacted
|
|
10110
|
+
* const logger = createLogger({ level: 'info' })
|
|
10111
|
+
* logger.info('Signing', { privateKey: '0x123...' })
|
|
10112
|
+
* // Output: { context: { privateKey: '[REDACTED]' }, msg: 'Signing' }
|
|
10113
|
+
*
|
|
10114
|
+
* // Disable redaction (use with caution)
|
|
10115
|
+
* const unsafeLogger = createLogger({ level: 'debug', redact: false })
|
|
10116
|
+
*
|
|
10117
|
+
* // Custom redaction paths
|
|
10118
|
+
* const customLogger = createLogger({
|
|
10119
|
+
* level: 'info',
|
|
10120
|
+
* redact: ['context.mySecret', 'context.*.credentials']
|
|
10121
|
+
* })
|
|
10122
|
+
*
|
|
10123
|
+
* // Pretty output for development
|
|
10124
|
+
* const devLogger = createLogger({
|
|
10125
|
+
* level: 'debug',
|
|
10126
|
+
* transport: { target: 'pino-pretty' }
|
|
10127
|
+
* })
|
|
10128
|
+
*
|
|
10129
|
+
* // Browser logger
|
|
10130
|
+
* const browserLogger = createLogger({
|
|
10131
|
+
* browser: { asObject: true }
|
|
10132
|
+
* })
|
|
10133
|
+
* ```
|
|
10134
|
+
*/ function createLogger(options, stream) {
|
|
10135
|
+
const { redact, ...pinoOptions } = options ?? {};
|
|
10136
|
+
// Build redaction config
|
|
10137
|
+
const redactConfig = buildRedactConfig(redact);
|
|
10138
|
+
// Build final pino options, only include redact if defined
|
|
10139
|
+
const finalOptions = redactConfig ? {
|
|
10140
|
+
...pinoOptions,
|
|
10141
|
+
redact: redactConfig
|
|
10142
|
+
} : pinoOptions;
|
|
10143
|
+
const pinoInstance = pino__default(finalOptions);
|
|
10144
|
+
return wrapPino(pinoInstance);
|
|
10145
|
+
}
|
|
10146
|
+
|
|
9769
10147
|
// ============================================================================
|
|
9770
10148
|
// Validation Schema
|
|
9771
10149
|
// ============================================================================
|
|
@@ -9873,6 +10251,9 @@ var TransferSpeed;
|
|
|
9873
10251
|
[TransferSpeed.SLOW]: 2000
|
|
9874
10252
|
});
|
|
9875
10253
|
|
|
10254
|
+
createLogger({
|
|
10255
|
+
name: 'provider-cctp-v2'
|
|
10256
|
+
});
|
|
9876
10257
|
/**
|
|
9877
10258
|
* All chains that are supported by the CCTP v2 provider.
|
|
9878
10259
|
*
|
|
@@ -9882,7 +10263,11 @@ var TransferSpeed;
|
|
|
9882
10263
|
* @internal
|
|
9883
10264
|
*/ Object.values(Chains).filter((chain)=>isCCTPV2Supported(chain));
|
|
9884
10265
|
|
|
9885
|
-
/**
|
|
10266
|
+
/**
|
|
10267
|
+
* Decimal string in token minor units, constrained to be strictly positive.
|
|
10268
|
+
*
|
|
10269
|
+
* @internal
|
|
10270
|
+
*/ const positiveAmountSchema = zod.z.string().regex(/^\d+$/, 'must be a non-negative integer string')// Re-check the digit shape here: zod still runs this refinement when the
|
|
9886
10271
|
// regex check above fails ("dirty"), so guard BigInt() against throwing on a
|
|
9887
10272
|
// non-numeric value before comparing.
|
|
9888
10273
|
.refine((value)=>/^\d+$/.test(value) && BigInt(value) > 0n, 'must be greater than zero');
|
|
@@ -9917,11 +10302,19 @@ const forwardRequestSchema = zod.z.object({
|
|
|
9917
10302
|
const preFinalityRequestSchema = zod.z.object({
|
|
9918
10303
|
type: zod.z.literal('PRE_FINALITY')
|
|
9919
10304
|
}).strict();
|
|
9920
|
-
/**
|
|
10305
|
+
/**
|
|
10306
|
+
* A single quote request item (`FORWARD` or `PRE_FINALITY`).
|
|
10307
|
+
*
|
|
10308
|
+
* @internal
|
|
10309
|
+
*/ const feeQuoteRequestSchema = zod.z.discriminatedUnion('type', [
|
|
9921
10310
|
forwardRequestSchema,
|
|
9922
10311
|
preFinalityRequestSchema
|
|
9923
10312
|
]);
|
|
9924
|
-
/**
|
|
10313
|
+
/**
|
|
10314
|
+
* A non-empty list of quote request items with unique types.
|
|
10315
|
+
*
|
|
10316
|
+
* @internal
|
|
10317
|
+
*/ const feeQuoteRequestsSchema = zod.z.array(feeQuoteRequestSchema).min(1, 'at least one request item is required').refine((items)=>new Set(items.map((item)=>item.type)).size === items.length, 'request item types must be unique');
|
|
9925
10318
|
/**
|
|
9926
10319
|
* A structured `Partial<ApiPollingConfig>` polling override.
|
|
9927
10320
|
*
|
|
@@ -9949,6 +10342,8 @@ const preFinalityRequestSchema = zod.z.object({
|
|
|
9949
10342
|
* it `undefined`, which is falsy and silently selects the production base URL.
|
|
9950
10343
|
* (`buildFeeQuoteUrl` independently re-validates the domains for standalone
|
|
9951
10344
|
* callers.)
|
|
10345
|
+
*
|
|
10346
|
+
* @internal
|
|
9952
10347
|
*/ zod.z.object({
|
|
9953
10348
|
sourceDomain: zod.z.number().int().nonnegative(),
|
|
9954
10349
|
destinationDomain: zod.z.number().int().nonnegative(),
|
|
@@ -9984,7 +10379,11 @@ const metadataSchema = zod.z.object({
|
|
|
9984
10379
|
blockEstimatedAt: zod.z.number().int().nonnegative().optional()
|
|
9985
10380
|
}).passthrough()
|
|
9986
10381
|
]);
|
|
9987
|
-
/**
|
|
10382
|
+
/**
|
|
10383
|
+
* Schema for a signed fee quote returned by the Quote API.
|
|
10384
|
+
*
|
|
10385
|
+
* @internal
|
|
10386
|
+
*/ zod.z.object({
|
|
9988
10387
|
// The runtime YAML spec maps signedQuote to a looser `hex` (which allows
|
|
9989
10388
|
// an empty `0x`); we keep the stricter non-empty form. Do not relax
|
|
9990
10389
|
// without a reason.
|
|
@@ -9998,7 +10397,11 @@ const metadataSchema = zod.z.object({
|
|
|
9998
10397
|
items: zod.z.array(feeQuoteItemSchema),
|
|
9999
10398
|
metadata: metadataSchema.optional()
|
|
10000
10399
|
}).passthrough();
|
|
10001
|
-
/**
|
|
10400
|
+
/**
|
|
10401
|
+
* Validates input to {@link validateQuote}.
|
|
10402
|
+
*
|
|
10403
|
+
* @internal
|
|
10404
|
+
*/ zod.z.object({
|
|
10002
10405
|
sourceDomain: zod.z.number().int().nonnegative(),
|
|
10003
10406
|
abiSignature: zod.z.string().min(1),
|
|
10004
10407
|
args: zod.z.array(zod.z.union([
|
|
@@ -10033,11 +10436,13 @@ const validateQuoteItemSchema = zod.z.object({
|
|
|
10033
10436
|
computedArgsHash: bytes32Schema.optional()
|
|
10034
10437
|
}).passthrough();
|
|
10035
10438
|
/**
|
|
10036
|
-
* Schema for a
|
|
10439
|
+
* Schema for a validate-quote result returned by the Iris `/validate/usdc/:sourceDomain` endpoint.
|
|
10037
10440
|
*
|
|
10038
10441
|
* The endpoint takes the source domain as a URL path parameter and does not
|
|
10039
10442
|
* return it in the response body, so `sourceDomain` is intentionally not part
|
|
10040
10443
|
* of this schema.
|
|
10444
|
+
*
|
|
10445
|
+
* @internal
|
|
10041
10446
|
*/ zod.z.object({
|
|
10042
10447
|
signedQuote: nonEmptyHexSchema,
|
|
10043
10448
|
expiry: quoteExpiryStatusSchema,
|
|
@@ -10057,7 +10462,7 @@ const validateQuoteItemSchema = zod.z.object({
|
|
|
10057
10462
|
registerKit(`${pkg$3.name}/${pkg$3.version}`);
|
|
10058
10463
|
|
|
10059
10464
|
var name$2 = "@circle-fin/swap-kit";
|
|
10060
|
-
var version$2 = "1.6.
|
|
10465
|
+
var version$2 = "1.6.1";
|
|
10061
10466
|
var pkg$2 = {
|
|
10062
10467
|
name: name$2,
|
|
10063
10468
|
version: version$2};
|
|
@@ -13756,7 +14161,7 @@ new Set(Object.values(Blockchain));
|
|
|
13756
14161
|
registerKit(`${pkg$2.name}/${pkg$2.version}`);
|
|
13757
14162
|
|
|
13758
14163
|
var name$1 = "@circle-fin/earn-kit";
|
|
13759
|
-
var version$1 = "1.6.
|
|
14164
|
+
var version$1 = "1.6.1";
|
|
13760
14165
|
var pkg$1 = {
|
|
13761
14166
|
name: name$1,
|
|
13762
14167
|
version: version$1};
|
|
@@ -16660,7 +17065,7 @@ const bridgeDepositPrepareReviewSchema = zod.z.object({
|
|
|
16660
17065
|
}
|
|
16661
17066
|
|
|
16662
17067
|
var name = "@circle-fin/provider-earn-service";
|
|
16663
|
-
var version = "1.5.
|
|
17068
|
+
var version = "1.5.1";
|
|
16664
17069
|
var pkg = {
|
|
16665
17070
|
name: name,
|
|
16666
17071
|
version: version};
|