@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.mjs
CHANGED
|
@@ -28,7 +28,7 @@ if (typeof window !== 'undefined' && typeof window.Buffer === 'undefined') {
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
import { z } from 'zod';
|
|
31
|
-
import 'pino';
|
|
31
|
+
import pino from 'pino';
|
|
32
32
|
import '@ethersproject/bytes';
|
|
33
33
|
import '@ethersproject/abi';
|
|
34
34
|
import '@ethersproject/address';
|
|
@@ -2892,8 +2892,45 @@ var EarnChain;
|
|
|
2892
2892
|
* This program handles minting operations for Gateway transactions
|
|
2893
2893
|
* on Solana devnet.
|
|
2894
2894
|
*/ const GATEWAY_MINTER_SOLANA_DEVNET = 'GATEmKK2ECL1brEngQZWCgMWPbvrEYqsV6u29dAaHavr';
|
|
2895
|
-
/**
|
|
2896
|
-
|
|
2895
|
+
/**
|
|
2896
|
+
* The `TokenMessengerWithFees` proxy contract address for EVM mainnet networks
|
|
2897
|
+
* (all chains except Edge).
|
|
2898
|
+
*
|
|
2899
|
+
* Deployed at a CREATE3-derived address; identical across all mainnet EVM
|
|
2900
|
+
* source chains. Present on any chain that supports the prepaid FORWARD path
|
|
2901
|
+
* via `depositForBurnWithHookAndFees`.
|
|
2902
|
+
*/ const TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET = '0x71f54F818671cD0D7ea140Da213e5C8b5C92a408';
|
|
2903
|
+
/**
|
|
2904
|
+
* The `TokenMessengerWithFees` proxy contract address for EVM testnet networks.
|
|
2905
|
+
*
|
|
2906
|
+
* Identical across all testnet EVM source chains. Present on any testnet chain
|
|
2907
|
+
* that supports the prepaid FORWARD path via `depositForBurnWithHookAndFees`.
|
|
2908
|
+
*/ const TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET = '0x8745D906D67C346E5eb1aEEED38Eb87F34DF0C0A';
|
|
2909
|
+
/**
|
|
2910
|
+
* The `DepositForHandler` proxy contract address for EVM mainnet networks.
|
|
2911
|
+
*
|
|
2912
|
+
* The handler the GenericExecutor calls on a fast-deposit destination chain to
|
|
2913
|
+
* run a cross-chain deposit into the GatewayWallet. Deployed at the same
|
|
2914
|
+
* address across all mainnet EVM destination chains.
|
|
2915
|
+
*/ const DEPOSIT_FOR_HANDLER_EVM_MAINNET = '0x16529813203f77E036576666336554a1210dce4D';
|
|
2916
|
+
/**
|
|
2917
|
+
* The `DepositForHandler` proxy contract address for EVM testnet networks.
|
|
2918
|
+
*
|
|
2919
|
+
* Identical across all testnet EVM destination chains.
|
|
2920
|
+
*/ const DEPOSIT_FOR_HANDLER_EVM_TESTNET = '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48';
|
|
2921
|
+
/**
|
|
2922
|
+
* The `GenericExecutor` proxy contract address for EVM mainnet networks.
|
|
2923
|
+
*
|
|
2924
|
+
* The GenericExecutor is the `mintRecipient` and `destinationCaller` on the
|
|
2925
|
+
* destination chain for the CCTP v2 prepaid FORWARD path. It receives the CCTP
|
|
2926
|
+
* mint and calls the `DepositForHandler` to complete the fast deposit.
|
|
2927
|
+
* Deployed at the same address across all mainnet EVM destination chains.
|
|
2928
|
+
*/ const GENERIC_EXECUTOR_EVM_MAINNET = '0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7';
|
|
2929
|
+
/**
|
|
2930
|
+
* The `GenericExecutor` proxy contract address for EVM testnet networks.
|
|
2931
|
+
*
|
|
2932
|
+
* Identical across all testnet EVM destination chains.
|
|
2933
|
+
*/ const GENERIC_EXECUTOR_EVM_TESTNET = '0xEdC81040756AcCfF070c21D37b265b9D0b5Ba45e';
|
|
2897
2934
|
|
|
2898
2935
|
/**
|
|
2899
2936
|
* Arc Testnet chain definition
|
|
@@ -2952,9 +2989,8 @@ var EarnChain;
|
|
|
2952
2989
|
v1: {
|
|
2953
2990
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
2954
2991
|
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
depositForHandler: '0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48'
|
|
2992
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
2993
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
2958
2994
|
}
|
|
2959
2995
|
},
|
|
2960
2996
|
forwarderSupported: {
|
|
@@ -3149,7 +3185,9 @@ var EarnChain;
|
|
|
3149
3185
|
contracts: {
|
|
3150
3186
|
v1: {
|
|
3151
3187
|
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
3152
|
-
minter: GATEWAY_MINTER_EVM_MAINNET
|
|
3188
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
3189
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_MAINNET,
|
|
3190
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_MAINNET
|
|
3153
3191
|
}
|
|
3154
3192
|
},
|
|
3155
3193
|
forwarderSupported: {
|
|
@@ -3213,7 +3251,9 @@ var EarnChain;
|
|
|
3213
3251
|
contracts: {
|
|
3214
3252
|
v1: {
|
|
3215
3253
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
3216
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
3254
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
3255
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
3256
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
3217
3257
|
}
|
|
3218
3258
|
},
|
|
3219
3259
|
forwarderSupported: {
|
|
@@ -3526,6 +3566,7 @@ var EarnChain;
|
|
|
3526
3566
|
v2: {
|
|
3527
3567
|
type: 'split',
|
|
3528
3568
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3569
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3529
3570
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3530
3571
|
confirmations: 1,
|
|
3531
3572
|
fastConfirmations: 1
|
|
@@ -3571,6 +3612,7 @@ var EarnChain;
|
|
|
3571
3612
|
v2: {
|
|
3572
3613
|
type: 'split',
|
|
3573
3614
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3615
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3574
3616
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3575
3617
|
confirmations: 1,
|
|
3576
3618
|
fastConfirmations: 1
|
|
@@ -3616,6 +3658,7 @@ var EarnChain;
|
|
|
3616
3658
|
v2: {
|
|
3617
3659
|
type: 'split',
|
|
3618
3660
|
tokenMessenger: '0x98706A006bc632Df31CAdFCBD43F38887ce2ca5c',
|
|
3661
|
+
tokenMessengerWithFees: '0x3Ac96675F9a3E6922713e041645D82f3561d3686',
|
|
3619
3662
|
messageTransmitter: '0x5b61381Fc9e58E70EfC13a4A97516997019198ee',
|
|
3620
3663
|
confirmations: 65,
|
|
3621
3664
|
fastConfirmations: 1
|
|
@@ -3661,6 +3704,7 @@ var EarnChain;
|
|
|
3661
3704
|
v2: {
|
|
3662
3705
|
type: 'split',
|
|
3663
3706
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3707
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3664
3708
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3665
3709
|
confirmations: 65,
|
|
3666
3710
|
fastConfirmations: 1
|
|
@@ -4009,6 +4053,7 @@ var EarnChain;
|
|
|
4009
4053
|
v2: {
|
|
4010
4054
|
type: 'split',
|
|
4011
4055
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4056
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4012
4057
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4013
4058
|
confirmations: 1,
|
|
4014
4059
|
fastConfirmations: 1
|
|
@@ -4056,6 +4101,7 @@ var EarnChain;
|
|
|
4056
4101
|
v2: {
|
|
4057
4102
|
type: 'split',
|
|
4058
4103
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4104
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4059
4105
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4060
4106
|
confirmations: 1,
|
|
4061
4107
|
fastConfirmations: 1
|
|
@@ -4337,6 +4383,7 @@ var EarnChain;
|
|
|
4337
4383
|
v2: {
|
|
4338
4384
|
type: 'split',
|
|
4339
4385
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4386
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4340
4387
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4341
4388
|
confirmations: 1,
|
|
4342
4389
|
fastConfirmations: 1
|
|
@@ -4382,6 +4429,7 @@ var EarnChain;
|
|
|
4382
4429
|
v2: {
|
|
4383
4430
|
type: 'split',
|
|
4384
4431
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4432
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4385
4433
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4386
4434
|
confirmations: 64,
|
|
4387
4435
|
fastConfirmations: 1
|
|
@@ -4427,6 +4475,7 @@ var EarnChain;
|
|
|
4427
4475
|
v2: {
|
|
4428
4476
|
type: 'split',
|
|
4429
4477
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4478
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4430
4479
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4431
4480
|
confirmations: 64,
|
|
4432
4481
|
fastConfirmations: 1
|
|
@@ -4728,6 +4777,7 @@ var EarnChain;
|
|
|
4728
4777
|
v2: {
|
|
4729
4778
|
type: 'split',
|
|
4730
4779
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4780
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4731
4781
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4732
4782
|
confirmations: 1,
|
|
4733
4783
|
fastConfirmations: 1
|
|
@@ -4774,6 +4824,7 @@ var EarnChain;
|
|
|
4774
4824
|
v2: {
|
|
4775
4825
|
type: 'split',
|
|
4776
4826
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4827
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4777
4828
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4778
4829
|
confirmations: 1,
|
|
4779
4830
|
fastConfirmations: 1
|
|
@@ -5081,7 +5132,9 @@ var EarnChain;
|
|
|
5081
5132
|
contracts: {
|
|
5082
5133
|
v1: {
|
|
5083
5134
|
wallet: GATEWAY_WALLET_EVM_MAINNET,
|
|
5084
|
-
minter: GATEWAY_MINTER_EVM_MAINNET
|
|
5135
|
+
minter: GATEWAY_MINTER_EVM_MAINNET,
|
|
5136
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_MAINNET,
|
|
5137
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_MAINNET
|
|
5085
5138
|
}
|
|
5086
5139
|
},
|
|
5087
5140
|
forwarderSupported: {
|
|
@@ -5146,7 +5199,9 @@ var EarnChain;
|
|
|
5146
5199
|
contracts: {
|
|
5147
5200
|
v1: {
|
|
5148
5201
|
wallet: GATEWAY_WALLET_EVM_TESTNET,
|
|
5149
|
-
minter: GATEWAY_MINTER_EVM_TESTNET
|
|
5202
|
+
minter: GATEWAY_MINTER_EVM_TESTNET,
|
|
5203
|
+
depositForHandler: DEPOSIT_FOR_HANDLER_EVM_TESTNET,
|
|
5204
|
+
genericExecutor: GENERIC_EXECUTOR_EVM_TESTNET
|
|
5150
5205
|
}
|
|
5151
5206
|
},
|
|
5152
5207
|
forwarderSupported: {
|
|
@@ -6232,6 +6287,67 @@ var Chains = /*#__PURE__*/Object.freeze({
|
|
|
6232
6287
|
return chain.cctp?.contracts.v2 !== undefined;
|
|
6233
6288
|
}
|
|
6234
6289
|
|
|
6290
|
+
/**
|
|
6291
|
+
* Chains the Fee Service accepts as a SOURCE for source-paid ("receive-exact")
|
|
6292
|
+
* CCTP v2 fees. An explicit allowlist is required because the
|
|
6293
|
+
* `TokenMessengerWithFees` wrapper address is now shared with the fast-deposit
|
|
6294
|
+
* forwarder path, so wrapper presence no longer implies source-fee support.
|
|
6295
|
+
* Keep in sync with backend coverage.
|
|
6296
|
+
*/ new Set([
|
|
6297
|
+
// Mainnet
|
|
6298
|
+
Blockchain.Ethereum,
|
|
6299
|
+
Blockchain.Base,
|
|
6300
|
+
Blockchain.Arbitrum,
|
|
6301
|
+
Blockchain.Unichain,
|
|
6302
|
+
Blockchain.Optimism,
|
|
6303
|
+
Blockchain.Codex,
|
|
6304
|
+
Blockchain.Ink,
|
|
6305
|
+
Blockchain.Plume,
|
|
6306
|
+
Blockchain.Linea,
|
|
6307
|
+
Blockchain.World_Chain,
|
|
6308
|
+
// Testnet counterparts
|
|
6309
|
+
Blockchain.Ethereum_Sepolia,
|
|
6310
|
+
Blockchain.Base_Sepolia,
|
|
6311
|
+
Blockchain.Arbitrum_Sepolia,
|
|
6312
|
+
Blockchain.Unichain_Sepolia,
|
|
6313
|
+
Blockchain.Optimism_Sepolia,
|
|
6314
|
+
Blockchain.Codex_Testnet,
|
|
6315
|
+
Blockchain.Ink_Testnet,
|
|
6316
|
+
Blockchain.Plume_Testnet,
|
|
6317
|
+
Blockchain.Linea_Sepolia,
|
|
6318
|
+
Blockchain.World_Chain_Sepolia
|
|
6319
|
+
]);
|
|
6320
|
+
|
|
6321
|
+
/**
|
|
6322
|
+
* Temporary allowlist of chains permitted to initiate Gateway fast deposits.
|
|
6323
|
+
* Only chains keyed here are eligible; all others are rejected. Using the
|
|
6324
|
+
* {@link Blockchain} enum keeps entries type-safe and catches typos at compile
|
|
6325
|
+
* time. Remove this allowlist once roll-out is complete.
|
|
6326
|
+
*/ new Set([
|
|
6327
|
+
// Mainnet
|
|
6328
|
+
Blockchain.Ethereum,
|
|
6329
|
+
Blockchain.Base,
|
|
6330
|
+
Blockchain.Arbitrum,
|
|
6331
|
+
Blockchain.Unichain,
|
|
6332
|
+
Blockchain.Optimism,
|
|
6333
|
+
Blockchain.Codex,
|
|
6334
|
+
Blockchain.Ink,
|
|
6335
|
+
Blockchain.Plume,
|
|
6336
|
+
Blockchain.Linea,
|
|
6337
|
+
Blockchain.World_Chain,
|
|
6338
|
+
// Testnet counterparts
|
|
6339
|
+
Blockchain.Ethereum_Sepolia,
|
|
6340
|
+
Blockchain.Base_Sepolia,
|
|
6341
|
+
Blockchain.Arbitrum_Sepolia,
|
|
6342
|
+
Blockchain.Unichain_Sepolia,
|
|
6343
|
+
Blockchain.Optimism_Sepolia,
|
|
6344
|
+
Blockchain.Codex_Testnet,
|
|
6345
|
+
Blockchain.Ink_Testnet,
|
|
6346
|
+
Blockchain.Plume_Testnet,
|
|
6347
|
+
Blockchain.Linea_Sepolia,
|
|
6348
|
+
Blockchain.World_Chain_Sepolia
|
|
6349
|
+
]);
|
|
6350
|
+
|
|
6235
6351
|
/**
|
|
6236
6352
|
* Zod schema for validating Gateway v1 contract addresses.
|
|
6237
6353
|
*
|
|
@@ -6253,7 +6369,10 @@ var Chains = /*#__PURE__*/Object.freeze({
|
|
|
6253
6369
|
}).min(1, 'Gateway minter address cannot be empty.'),
|
|
6254
6370
|
depositForHandler: z.string({
|
|
6255
6371
|
invalid_type_error: 'Gateway depositForHandler address must be a string.'
|
|
6256
|
-
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional()
|
|
6372
|
+
}).min(1, 'Gateway depositForHandler address cannot be empty.').optional(),
|
|
6373
|
+
genericExecutor: z.string({
|
|
6374
|
+
invalid_type_error: 'Gateway genericExecutor address must be a string.'
|
|
6375
|
+
}).min(1, 'Gateway genericExecutor address cannot be empty.').optional()
|
|
6257
6376
|
}).strict() // Reject any additional properties not defined in the schema
|
|
6258
6377
|
;
|
|
6259
6378
|
/**
|
|
@@ -8467,7 +8586,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8467
8586
|
* allowlisted {@link ClientLogPayload} fields (and the allowlisted
|
|
8468
8587
|
* sub-fields of `errorDetails` / `clientContext`) are copied across.
|
|
8469
8588
|
* A regressing upstream mapper — or a plain-JS caller that bypasses the
|
|
8470
|
-
* type — therefore cannot exfiltrate stray properties (secrets,
|
|
8589
|
+
* type — therefore cannot exfiltrate stray properties (secrets,
|
|
8471
8590
|
* raw error stacks) through the analytics channel. Optional fields are
|
|
8472
8591
|
* only included when present so the serialised shape matches the
|
|
8473
8592
|
* server's strict schema.
|
|
@@ -8490,6 +8609,9 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8490
8609
|
if (payload.destinationChain !== undefined) safe['destinationChain'] = payload.destinationChain;
|
|
8491
8610
|
if (payload.tokenIn !== undefined) safe['tokenIn'] = payload.tokenIn;
|
|
8492
8611
|
if (payload.tokenOut !== undefined) safe['tokenOut'] = payload.tokenOut;
|
|
8612
|
+
if (payload.amountIn !== undefined) safe['amountIn'] = payload.amountIn;
|
|
8613
|
+
if (payload.durationMs !== undefined) safe['durationMs'] = payload.durationMs;
|
|
8614
|
+
if (payload.sourceAddress !== undefined) safe['sourceAddress'] = payload.sourceAddress;
|
|
8493
8615
|
if (payload.txHash !== undefined) safe['txHash'] = payload.txHash;
|
|
8494
8616
|
if (payload.correlationId !== undefined) safe['correlationId'] = payload.correlationId;
|
|
8495
8617
|
if (payload.errorDetails !== undefined) {
|
|
@@ -8686,14 +8808,28 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8686
8808
|
}
|
|
8687
8809
|
|
|
8688
8810
|
/**
|
|
8689
|
-
*
|
|
8690
|
-
*
|
|
8811
|
+
* Emit a stable console warning when building or emitting a telemetry payload
|
|
8812
|
+
* throws — for example, a buggy `TelemetryContextResolver`, a regression in
|
|
8691
8813
|
* `extractErrorDetails`, or a synchronous failure inside `emitAnalyticsLog`
|
|
8692
|
-
* before it could swallow the error itself.
|
|
8693
|
-
*
|
|
8694
|
-
*
|
|
8814
|
+
* before it could swallow the error itself. Uses a stable prefix so the
|
|
8815
|
+
* drop is discoverable via grep. Never re-throws: the caller's original
|
|
8816
|
+
* operation error must always win.
|
|
8695
8817
|
*
|
|
8696
8818
|
* @internal
|
|
8819
|
+
*
|
|
8820
|
+
* @param eventType - The telemetry event type that was being emitted.
|
|
8821
|
+
* @param cause - The error or value that caused the drop.
|
|
8822
|
+
*
|
|
8823
|
+
* @example
|
|
8824
|
+
* ```typescript
|
|
8825
|
+
* import { warnTelemetryDrop } from '@core/utils'
|
|
8826
|
+
*
|
|
8827
|
+
* try {
|
|
8828
|
+
* void emitAnalyticsLog(payload)
|
|
8829
|
+
* } catch (err) {
|
|
8830
|
+
* warnTelemetryDrop('my_event', err)
|
|
8831
|
+
* }
|
|
8832
|
+
* ```
|
|
8697
8833
|
*/ function warnTelemetryDrop(eventType, cause) {
|
|
8698
8834
|
try {
|
|
8699
8835
|
// Pass `cause` as the second console.warn argument rather than
|
|
@@ -8733,6 +8869,9 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8733
8869
|
...context?.tokenOut != null && {
|
|
8734
8870
|
tokenOut: context.tokenOut
|
|
8735
8871
|
},
|
|
8872
|
+
...context?.amountIn != null && {
|
|
8873
|
+
amountIn: context.amountIn
|
|
8874
|
+
},
|
|
8736
8875
|
...context?.txHash != null && {
|
|
8737
8876
|
txHash: context.txHash
|
|
8738
8877
|
},
|
|
@@ -8832,7 +8971,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8832
8971
|
}
|
|
8833
8972
|
|
|
8834
8973
|
var name$3 = "@circle-fin/bridge-kit";
|
|
8835
|
-
var version$3 = "1.14.
|
|
8974
|
+
var version$3 = "1.14.1";
|
|
8836
8975
|
var pkg$3 = {
|
|
8837
8976
|
name: name$3,
|
|
8838
8977
|
version: version$3};
|
|
@@ -9764,6 +9903,241 @@ var TransferSpeed;
|
|
|
9764
9903
|
message: 'Invalid metrics'
|
|
9765
9904
|
});
|
|
9766
9905
|
|
|
9906
|
+
/**
|
|
9907
|
+
* Omit undefined values from an object.
|
|
9908
|
+
*
|
|
9909
|
+
* @param obj - The object to process.
|
|
9910
|
+
* @returns A new object with undefined values removed.
|
|
9911
|
+
*
|
|
9912
|
+
* @internal
|
|
9913
|
+
* @remarks
|
|
9914
|
+
* Used by both production and mock loggers to ensure consistent behavior.
|
|
9915
|
+
* This prevents undefined values from being serialized in log output,
|
|
9916
|
+
* which can cause issues with some log transports.
|
|
9917
|
+
*/ function omitUndefined(obj) {
|
|
9918
|
+
const result = {};
|
|
9919
|
+
for (const [key, value] of Object.entries(obj)){
|
|
9920
|
+
if (value !== undefined) {
|
|
9921
|
+
result[key] = value;
|
|
9922
|
+
}
|
|
9923
|
+
}
|
|
9924
|
+
return result;
|
|
9925
|
+
}
|
|
9926
|
+
|
|
9927
|
+
/**
|
|
9928
|
+
* Default redaction paths for web3/blockchain SDKs.
|
|
9929
|
+
*
|
|
9930
|
+
* @remarks
|
|
9931
|
+
* These paths target common sensitive fields in blockchain applications.
|
|
9932
|
+
* All user fields are nested under `context`, so paths start with `context.`.
|
|
9933
|
+
* Wildcard `*` matches any key at that level.
|
|
9934
|
+
*/ const DEFAULT_REDACT_PATHS = [
|
|
9935
|
+
// Generic Credentials
|
|
9936
|
+
'context.password',
|
|
9937
|
+
'context.passphrase',
|
|
9938
|
+
'context.secret',
|
|
9939
|
+
'context.token',
|
|
9940
|
+
'context.*.password',
|
|
9941
|
+
'context.*.passphrase',
|
|
9942
|
+
'context.*.secret',
|
|
9943
|
+
'context.*.token',
|
|
9944
|
+
// API Keys & Auth Tokens
|
|
9945
|
+
'context.apiKey',
|
|
9946
|
+
'context.apiSecret',
|
|
9947
|
+
'context.accessToken',
|
|
9948
|
+
'context.refreshToken',
|
|
9949
|
+
'context.jwt',
|
|
9950
|
+
'context.bearerToken',
|
|
9951
|
+
'context.sessionId',
|
|
9952
|
+
'context.authorization',
|
|
9953
|
+
'context.cookie',
|
|
9954
|
+
'context.*.apiKey',
|
|
9955
|
+
'context.*.apiSecret',
|
|
9956
|
+
'context.*.accessToken',
|
|
9957
|
+
'context.*.refreshToken',
|
|
9958
|
+
'context.*.jwt',
|
|
9959
|
+
'context.*.bearerToken',
|
|
9960
|
+
'context.*.sessionId',
|
|
9961
|
+
'context.*.authorization',
|
|
9962
|
+
'context.*.cookie',
|
|
9963
|
+
// Web3 / Crypto Keys
|
|
9964
|
+
'context.privateKey',
|
|
9965
|
+
'context.secretKey',
|
|
9966
|
+
'context.signingKey',
|
|
9967
|
+
'context.encryptionKey',
|
|
9968
|
+
'context.*.privateKey',
|
|
9969
|
+
'context.*.secretKey',
|
|
9970
|
+
'context.*.signingKey',
|
|
9971
|
+
'context.*.encryptionKey',
|
|
9972
|
+
// Web3 / Crypto Mnemonics and Seeds
|
|
9973
|
+
'context.mnemonic',
|
|
9974
|
+
'context.seed',
|
|
9975
|
+
'context.seedPhrase',
|
|
9976
|
+
'context.*.mnemonic',
|
|
9977
|
+
'context.*.seed',
|
|
9978
|
+
'context.*.seedPhrase',
|
|
9979
|
+
// OTP / Verification Codes
|
|
9980
|
+
'context.otp',
|
|
9981
|
+
'context.verificationCode',
|
|
9982
|
+
'context.*.otp',
|
|
9983
|
+
'context.*.verificationCode',
|
|
9984
|
+
// Payment Information
|
|
9985
|
+
'context.cardNumber',
|
|
9986
|
+
'context.cvv',
|
|
9987
|
+
'context.accountNumber',
|
|
9988
|
+
'context.*.cardNumber',
|
|
9989
|
+
'context.*.cvv',
|
|
9990
|
+
'context.*.accountNumber'
|
|
9991
|
+
];
|
|
9992
|
+
/**
|
|
9993
|
+
* Wrap user fields under `context` to prevent collision with pino internals.
|
|
9994
|
+
*
|
|
9995
|
+
* @param fields - User-provided log fields.
|
|
9996
|
+
* @returns Object with fields nested under `context`, or undefined if empty.
|
|
9997
|
+
*
|
|
9998
|
+
* @remarks
|
|
9999
|
+
* This function handles edge cases by returning undefined for null, undefined,
|
|
10000
|
+
* or empty objects to avoid unnecessary wrapping in log output.
|
|
10001
|
+
* Undefined values are cleaned before wrapping.
|
|
10002
|
+
*/ function wrapInContext(fields) {
|
|
10003
|
+
if (!fields) return undefined;
|
|
10004
|
+
// Clean undefined values for consistency and transport compatibility
|
|
10005
|
+
const cleaned = omitUndefined(fields);
|
|
10006
|
+
// Handle edge case: all values were undefined, resulting in empty object
|
|
10007
|
+
const keys = Object.keys(cleaned);
|
|
10008
|
+
if (keys.length === 0) return undefined;
|
|
10009
|
+
return {
|
|
10010
|
+
context: cleaned
|
|
10011
|
+
};
|
|
10012
|
+
}
|
|
10013
|
+
/**
|
|
10014
|
+
* Wrap a pino instance to conform to our Logger interface.
|
|
10015
|
+
*
|
|
10016
|
+
* @param pinoInstance - The pino logger instance to wrap.
|
|
10017
|
+
* @returns A Logger instance conforming to our stable interface.
|
|
10018
|
+
*/ function wrapPino(pinoInstance) {
|
|
10019
|
+
return {
|
|
10020
|
+
debug (message, fields) {
|
|
10021
|
+
const wrapped = wrapInContext(fields);
|
|
10022
|
+
if (wrapped) {
|
|
10023
|
+
pinoInstance.debug(wrapped, message);
|
|
10024
|
+
} else {
|
|
10025
|
+
pinoInstance.debug(message);
|
|
10026
|
+
}
|
|
10027
|
+
},
|
|
10028
|
+
info (message, fields) {
|
|
10029
|
+
const wrapped = wrapInContext(fields);
|
|
10030
|
+
if (wrapped) {
|
|
10031
|
+
pinoInstance.info(wrapped, message);
|
|
10032
|
+
} else {
|
|
10033
|
+
pinoInstance.info(message);
|
|
10034
|
+
}
|
|
10035
|
+
},
|
|
10036
|
+
warn (message, fields) {
|
|
10037
|
+
const wrapped = wrapInContext(fields);
|
|
10038
|
+
if (wrapped) {
|
|
10039
|
+
pinoInstance.warn(wrapped, message);
|
|
10040
|
+
} else {
|
|
10041
|
+
pinoInstance.warn(message);
|
|
10042
|
+
}
|
|
10043
|
+
},
|
|
10044
|
+
error (message, fields) {
|
|
10045
|
+
const wrapped = wrapInContext(fields);
|
|
10046
|
+
if (wrapped) {
|
|
10047
|
+
pinoInstance.error(wrapped, message);
|
|
10048
|
+
} else {
|
|
10049
|
+
pinoInstance.error(message);
|
|
10050
|
+
}
|
|
10051
|
+
},
|
|
10052
|
+
child (tags) {
|
|
10053
|
+
// Child bindings stay flat (not wrapped) - they're part of logger's base context
|
|
10054
|
+
const cleaned = omitUndefined(tags);
|
|
10055
|
+
return wrapPino(pinoInstance.child(cleaned));
|
|
10056
|
+
}
|
|
10057
|
+
};
|
|
10058
|
+
}
|
|
10059
|
+
/**
|
|
10060
|
+
* Build pino redact configuration from our simplified options.
|
|
10061
|
+
*
|
|
10062
|
+
* @param redact - The redact configuration option.
|
|
10063
|
+
* @returns Pino-compatible redact configuration or undefined.
|
|
10064
|
+
*/ function buildRedactConfig(redact) {
|
|
10065
|
+
// Explicitly disabled
|
|
10066
|
+
if (redact === false) {
|
|
10067
|
+
return undefined;
|
|
10068
|
+
}
|
|
10069
|
+
// Custom paths provided
|
|
10070
|
+
if (Array.isArray(redact)) {
|
|
10071
|
+
return redact.length > 0 ? {
|
|
10072
|
+
paths: redact,
|
|
10073
|
+
censor: '[REDACTED]'
|
|
10074
|
+
} : undefined;
|
|
10075
|
+
}
|
|
10076
|
+
// Default: use web3 sensible defaults
|
|
10077
|
+
return {
|
|
10078
|
+
paths: [
|
|
10079
|
+
...DEFAULT_REDACT_PATHS
|
|
10080
|
+
],
|
|
10081
|
+
censor: '[REDACTED]'
|
|
10082
|
+
};
|
|
10083
|
+
}
|
|
10084
|
+
/**
|
|
10085
|
+
* Create a logger backed by pino.
|
|
10086
|
+
*
|
|
10087
|
+
* @param options - Logger options (optional).
|
|
10088
|
+
* @param stream - Destination stream (optional).
|
|
10089
|
+
* @returns A Logger instance.
|
|
10090
|
+
* @throws Error if invalid pino options are provided.
|
|
10091
|
+
*
|
|
10092
|
+
* @remarks
|
|
10093
|
+
* This is a thin wrapper around pino that exposes our stable Logger interface.
|
|
10094
|
+
* Pino handles all transport concerns: JSON, pretty printing, file, remote, browser, etc.
|
|
10095
|
+
*
|
|
10096
|
+
* **Security**: By default, sensitive web3 fields (privateKey, mnemonic, apiKey, etc.)
|
|
10097
|
+
* are automatically redacted from log output. Use `redact: false` to disable.
|
|
10098
|
+
*
|
|
10099
|
+
* @example
|
|
10100
|
+
* ```typescript
|
|
10101
|
+
* import { createLogger } from '@core/runtime'
|
|
10102
|
+
*
|
|
10103
|
+
* // Default: web3 sensitive fields are redacted
|
|
10104
|
+
* const logger = createLogger({ level: 'info' })
|
|
10105
|
+
* logger.info('Signing', { privateKey: '0x123...' })
|
|
10106
|
+
* // Output: { context: { privateKey: '[REDACTED]' }, msg: 'Signing' }
|
|
10107
|
+
*
|
|
10108
|
+
* // Disable redaction (use with caution)
|
|
10109
|
+
* const unsafeLogger = createLogger({ level: 'debug', redact: false })
|
|
10110
|
+
*
|
|
10111
|
+
* // Custom redaction paths
|
|
10112
|
+
* const customLogger = createLogger({
|
|
10113
|
+
* level: 'info',
|
|
10114
|
+
* redact: ['context.mySecret', 'context.*.credentials']
|
|
10115
|
+
* })
|
|
10116
|
+
*
|
|
10117
|
+
* // Pretty output for development
|
|
10118
|
+
* const devLogger = createLogger({
|
|
10119
|
+
* level: 'debug',
|
|
10120
|
+
* transport: { target: 'pino-pretty' }
|
|
10121
|
+
* })
|
|
10122
|
+
*
|
|
10123
|
+
* // Browser logger
|
|
10124
|
+
* const browserLogger = createLogger({
|
|
10125
|
+
* browser: { asObject: true }
|
|
10126
|
+
* })
|
|
10127
|
+
* ```
|
|
10128
|
+
*/ function createLogger(options, stream) {
|
|
10129
|
+
const { redact, ...pinoOptions } = options ?? {};
|
|
10130
|
+
// Build redaction config
|
|
10131
|
+
const redactConfig = buildRedactConfig(redact);
|
|
10132
|
+
// Build final pino options, only include redact if defined
|
|
10133
|
+
const finalOptions = redactConfig ? {
|
|
10134
|
+
...pinoOptions,
|
|
10135
|
+
redact: redactConfig
|
|
10136
|
+
} : pinoOptions;
|
|
10137
|
+
const pinoInstance = pino(finalOptions);
|
|
10138
|
+
return wrapPino(pinoInstance);
|
|
10139
|
+
}
|
|
10140
|
+
|
|
9767
10141
|
// ============================================================================
|
|
9768
10142
|
// Validation Schema
|
|
9769
10143
|
// ============================================================================
|
|
@@ -9871,6 +10245,9 @@ var TransferSpeed;
|
|
|
9871
10245
|
[TransferSpeed.SLOW]: 2000
|
|
9872
10246
|
});
|
|
9873
10247
|
|
|
10248
|
+
createLogger({
|
|
10249
|
+
name: 'provider-cctp-v2'
|
|
10250
|
+
});
|
|
9874
10251
|
/**
|
|
9875
10252
|
* All chains that are supported by the CCTP v2 provider.
|
|
9876
10253
|
*
|
|
@@ -9880,7 +10257,11 @@ var TransferSpeed;
|
|
|
9880
10257
|
* @internal
|
|
9881
10258
|
*/ Object.values(Chains).filter((chain)=>isCCTPV2Supported(chain));
|
|
9882
10259
|
|
|
9883
|
-
/**
|
|
10260
|
+
/**
|
|
10261
|
+
* Decimal string in token minor units, constrained to be strictly positive.
|
|
10262
|
+
*
|
|
10263
|
+
* @internal
|
|
10264
|
+
*/ const positiveAmountSchema = z.string().regex(/^\d+$/, 'must be a non-negative integer string')// Re-check the digit shape here: zod still runs this refinement when the
|
|
9884
10265
|
// regex check above fails ("dirty"), so guard BigInt() against throwing on a
|
|
9885
10266
|
// non-numeric value before comparing.
|
|
9886
10267
|
.refine((value)=>/^\d+$/.test(value) && BigInt(value) > 0n, 'must be greater than zero');
|
|
@@ -9915,11 +10296,19 @@ const forwardRequestSchema = z.object({
|
|
|
9915
10296
|
const preFinalityRequestSchema = z.object({
|
|
9916
10297
|
type: z.literal('PRE_FINALITY')
|
|
9917
10298
|
}).strict();
|
|
9918
|
-
/**
|
|
10299
|
+
/**
|
|
10300
|
+
* A single quote request item (`FORWARD` or `PRE_FINALITY`).
|
|
10301
|
+
*
|
|
10302
|
+
* @internal
|
|
10303
|
+
*/ const feeQuoteRequestSchema = z.discriminatedUnion('type', [
|
|
9919
10304
|
forwardRequestSchema,
|
|
9920
10305
|
preFinalityRequestSchema
|
|
9921
10306
|
]);
|
|
9922
|
-
/**
|
|
10307
|
+
/**
|
|
10308
|
+
* A non-empty list of quote request items with unique types.
|
|
10309
|
+
*
|
|
10310
|
+
* @internal
|
|
10311
|
+
*/ const feeQuoteRequestsSchema = 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');
|
|
9923
10312
|
/**
|
|
9924
10313
|
* A structured `Partial<ApiPollingConfig>` polling override.
|
|
9925
10314
|
*
|
|
@@ -9947,6 +10336,8 @@ const preFinalityRequestSchema = z.object({
|
|
|
9947
10336
|
* it `undefined`, which is falsy and silently selects the production base URL.
|
|
9948
10337
|
* (`buildFeeQuoteUrl` independently re-validates the domains for standalone
|
|
9949
10338
|
* callers.)
|
|
10339
|
+
*
|
|
10340
|
+
* @internal
|
|
9950
10341
|
*/ z.object({
|
|
9951
10342
|
sourceDomain: z.number().int().nonnegative(),
|
|
9952
10343
|
destinationDomain: z.number().int().nonnegative(),
|
|
@@ -9982,7 +10373,11 @@ const metadataSchema = z.object({
|
|
|
9982
10373
|
blockEstimatedAt: z.number().int().nonnegative().optional()
|
|
9983
10374
|
}).passthrough()
|
|
9984
10375
|
]);
|
|
9985
|
-
/**
|
|
10376
|
+
/**
|
|
10377
|
+
* Schema for a signed fee quote returned by the Quote API.
|
|
10378
|
+
*
|
|
10379
|
+
* @internal
|
|
10380
|
+
*/ z.object({
|
|
9986
10381
|
// The runtime YAML spec maps signedQuote to a looser `hex` (which allows
|
|
9987
10382
|
// an empty `0x`); we keep the stricter non-empty form. Do not relax
|
|
9988
10383
|
// without a reason.
|
|
@@ -9996,7 +10391,11 @@ const metadataSchema = z.object({
|
|
|
9996
10391
|
items: z.array(feeQuoteItemSchema),
|
|
9997
10392
|
metadata: metadataSchema.optional()
|
|
9998
10393
|
}).passthrough();
|
|
9999
|
-
/**
|
|
10394
|
+
/**
|
|
10395
|
+
* Validates input to {@link validateQuote}.
|
|
10396
|
+
*
|
|
10397
|
+
* @internal
|
|
10398
|
+
*/ z.object({
|
|
10000
10399
|
sourceDomain: z.number().int().nonnegative(),
|
|
10001
10400
|
abiSignature: z.string().min(1),
|
|
10002
10401
|
args: z.array(z.union([
|
|
@@ -10031,11 +10430,13 @@ const validateQuoteItemSchema = z.object({
|
|
|
10031
10430
|
computedArgsHash: bytes32Schema.optional()
|
|
10032
10431
|
}).passthrough();
|
|
10033
10432
|
/**
|
|
10034
|
-
* Schema for a
|
|
10433
|
+
* Schema for a validate-quote result returned by the Iris `/validate/usdc/:sourceDomain` endpoint.
|
|
10035
10434
|
*
|
|
10036
10435
|
* The endpoint takes the source domain as a URL path parameter and does not
|
|
10037
10436
|
* return it in the response body, so `sourceDomain` is intentionally not part
|
|
10038
10437
|
* of this schema.
|
|
10438
|
+
*
|
|
10439
|
+
* @internal
|
|
10039
10440
|
*/ z.object({
|
|
10040
10441
|
signedQuote: nonEmptyHexSchema,
|
|
10041
10442
|
expiry: quoteExpiryStatusSchema,
|
|
@@ -10055,7 +10456,7 @@ const validateQuoteItemSchema = z.object({
|
|
|
10055
10456
|
registerKit(`${pkg$3.name}/${pkg$3.version}`);
|
|
10056
10457
|
|
|
10057
10458
|
var name$2 = "@circle-fin/swap-kit";
|
|
10058
|
-
var version$2 = "1.6.
|
|
10459
|
+
var version$2 = "1.6.1";
|
|
10059
10460
|
var pkg$2 = {
|
|
10060
10461
|
name: name$2,
|
|
10061
10462
|
version: version$2};
|
|
@@ -13754,7 +14155,7 @@ new Set(Object.values(Blockchain));
|
|
|
13754
14155
|
registerKit(`${pkg$2.name}/${pkg$2.version}`);
|
|
13755
14156
|
|
|
13756
14157
|
var name$1 = "@circle-fin/earn-kit";
|
|
13757
|
-
var version$1 = "1.6.
|
|
14158
|
+
var version$1 = "1.6.1";
|
|
13758
14159
|
var pkg$1 = {
|
|
13759
14160
|
name: name$1,
|
|
13760
14161
|
version: version$1};
|
|
@@ -16658,7 +17059,7 @@ const bridgeDepositPrepareReviewSchema = z.object({
|
|
|
16658
17059
|
}
|
|
16659
17060
|
|
|
16660
17061
|
var name = "@circle-fin/provider-earn-service";
|
|
16661
|
-
var version = "1.5.
|
|
17062
|
+
var version = "1.5.1";
|
|
16662
17063
|
var pkg = {
|
|
16663
17064
|
name: name,
|
|
16664
17065
|
version: version};
|