@circle-fin/app-kit 1.12.0 → 1.13.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 +73 -0
- package/README.md +31 -12
- package/bridge.cjs +3893 -1714
- package/bridge.d.cts +186 -18
- package/bridge.d.mts +186 -18
- package/bridge.d.ts +186 -18
- package/bridge.mjs +3895 -1716
- package/chains.cjs +134 -0
- package/chains.d.cts +126 -1
- package/chains.d.mts +126 -1
- package/chains.d.ts +126 -1
- package/chains.mjs +133 -1
- package/context.d.cts +185 -17
- package/context.d.mts +185 -17
- package/context.d.ts +185 -17
- package/earn.cjs +651 -85
- package/earn.d.cts +185 -17
- package/earn.d.mts +185 -17
- package/earn.d.ts +185 -17
- package/earn.mjs +651 -85
- package/estimateBridge.cjs +3892 -1713
- package/estimateBridge.d.cts +295 -18
- package/estimateBridge.d.mts +295 -18
- package/estimateBridge.d.ts +295 -18
- package/estimateBridge.mjs +3894 -1715
- package/estimateSwap.cjs +748 -136
- package/estimateSwap.d.cts +185 -17
- package/estimateSwap.d.mts +185 -17
- package/estimateSwap.d.ts +185 -17
- package/estimateSwap.mjs +748 -136
- package/index.cjs +3806 -1952
- package/index.d.cts +2775 -1874
- package/index.d.mts +2775 -1874
- package/index.d.ts +2775 -1874
- package/index.mjs +3808 -1954
- package/package.json +6 -6
- package/swap.cjs +748 -136
- package/swap.d.cts +192 -18
- package/swap.d.mts +192 -18
- package/swap.d.ts +192 -18
- package/swap.mjs +748 -136
- package/unifiedBalance.cjs +509 -87
- package/unifiedBalance.d.cts +206 -33
- package/unifiedBalance.d.mts +206 -33
- package/unifiedBalance.d.ts +206 -33
- package/unifiedBalance.mjs +509 -87
package/earn.mjs
CHANGED
|
@@ -2347,6 +2347,8 @@ function getOptionalString(value) {
|
|
|
2347
2347
|
Blockchain["Optimism_Sepolia"] = "Optimism_Sepolia";
|
|
2348
2348
|
Blockchain["Pharos"] = "Pharos";
|
|
2349
2349
|
Blockchain["Pharos_Testnet"] = "Pharos_Testnet";
|
|
2350
|
+
Blockchain["Plasma"] = "Plasma";
|
|
2351
|
+
Blockchain["Plasma_Testnet"] = "Plasma_Testnet";
|
|
2350
2352
|
Blockchain["Polkadot_Asset_Hub"] = "Polkadot_Asset_Hub";
|
|
2351
2353
|
Blockchain["Polkadot_Westmint"] = "Polkadot_Westmint";
|
|
2352
2354
|
Blockchain["Plume"] = "Plume";
|
|
@@ -2416,6 +2418,7 @@ var BridgeChain;
|
|
|
2416
2418
|
BridgeChain["Morph"] = "Morph";
|
|
2417
2419
|
BridgeChain["Optimism"] = "Optimism";
|
|
2418
2420
|
BridgeChain["Pharos"] = "Pharos";
|
|
2421
|
+
BridgeChain["Plasma"] = "Plasma";
|
|
2419
2422
|
BridgeChain["Plume"] = "Plume";
|
|
2420
2423
|
BridgeChain["Polygon"] = "Polygon";
|
|
2421
2424
|
BridgeChain["Sei"] = "Sei";
|
|
@@ -2442,6 +2445,7 @@ var BridgeChain;
|
|
|
2442
2445
|
BridgeChain["Morph_Testnet"] = "Morph_Testnet";
|
|
2443
2446
|
BridgeChain["Optimism_Sepolia"] = "Optimism_Sepolia";
|
|
2444
2447
|
BridgeChain["Pharos_Testnet"] = "Pharos_Testnet";
|
|
2448
|
+
BridgeChain["Plasma_Testnet"] = "Plasma_Testnet";
|
|
2445
2449
|
BridgeChain["Plume_Testnet"] = "Plume_Testnet";
|
|
2446
2450
|
BridgeChain["Polygon_Amoy_Testnet"] = "Polygon_Amoy_Testnet";
|
|
2447
2451
|
BridgeChain["Sei_Testnet"] = "Sei_Testnet";
|
|
@@ -2888,6 +2892,8 @@ var EarnChain;
|
|
|
2888
2892
|
* This program handles minting operations for Gateway transactions
|
|
2889
2893
|
* on Solana devnet.
|
|
2890
2894
|
*/ const GATEWAY_MINTER_SOLANA_DEVNET = 'GATEmKK2ECL1brEngQZWCgMWPbvrEYqsV6u29dAaHavr';
|
|
2895
|
+
/** TokenMessengerWithFees address shared by enabled EVM mainnet sources. */ const TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET = '0x71f54F818671cD0D7ea140Da213e5C8b5C92a408';
|
|
2896
|
+
/** TokenMessengerWithFees address shared by enabled EVM testnet sources. */ const TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET = '0x8745D906D67C346E5eb1aEEED38Eb87F34DF0C0A';
|
|
2891
2897
|
|
|
2892
2898
|
/**
|
|
2893
2899
|
* Arc Testnet chain definition
|
|
@@ -2925,6 +2931,7 @@ var EarnChain;
|
|
|
2925
2931
|
v2: {
|
|
2926
2932
|
type: 'split',
|
|
2927
2933
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
2934
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
2928
2935
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
2929
2936
|
confirmations: 1,
|
|
2930
2937
|
fastConfirmations: 1
|
|
@@ -2992,6 +2999,7 @@ var EarnChain;
|
|
|
2992
2999
|
v2: {
|
|
2993
3000
|
type: 'split',
|
|
2994
3001
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3002
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
2995
3003
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
2996
3004
|
confirmations: 65,
|
|
2997
3005
|
fastConfirmations: 1
|
|
@@ -3056,6 +3064,7 @@ var EarnChain;
|
|
|
3056
3064
|
v2: {
|
|
3057
3065
|
type: 'split',
|
|
3058
3066
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3067
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3059
3068
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3060
3069
|
confirmations: 65,
|
|
3061
3070
|
fastConfirmations: 1
|
|
@@ -3120,6 +3129,7 @@ var EarnChain;
|
|
|
3120
3129
|
v2: {
|
|
3121
3130
|
type: 'split',
|
|
3122
3131
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3132
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3123
3133
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3124
3134
|
confirmations: 1,
|
|
3125
3135
|
fastConfirmations: 1
|
|
@@ -3181,6 +3191,7 @@ var EarnChain;
|
|
|
3181
3191
|
v2: {
|
|
3182
3192
|
type: 'split',
|
|
3183
3193
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
3194
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3184
3195
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
3185
3196
|
confirmations: 1,
|
|
3186
3197
|
fastConfirmations: 1
|
|
@@ -3248,6 +3259,7 @@ var EarnChain;
|
|
|
3248
3259
|
v2: {
|
|
3249
3260
|
type: 'split',
|
|
3250
3261
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3262
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3251
3263
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3252
3264
|
confirmations: 65,
|
|
3253
3265
|
fastConfirmations: 1
|
|
@@ -3312,6 +3324,7 @@ var EarnChain;
|
|
|
3312
3324
|
v2: {
|
|
3313
3325
|
type: 'split',
|
|
3314
3326
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
3327
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3315
3328
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
3316
3329
|
confirmations: 65,
|
|
3317
3330
|
fastConfirmations: 1
|
|
@@ -3422,6 +3435,7 @@ var EarnChain;
|
|
|
3422
3435
|
v2: {
|
|
3423
3436
|
type: 'split',
|
|
3424
3437
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3438
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3425
3439
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3426
3440
|
confirmations: 65,
|
|
3427
3441
|
fastConfirmations: 1
|
|
@@ -3466,6 +3480,7 @@ var EarnChain;
|
|
|
3466
3480
|
v2: {
|
|
3467
3481
|
type: 'split',
|
|
3468
3482
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
3483
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3469
3484
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
3470
3485
|
confirmations: 65,
|
|
3471
3486
|
fastConfirmations: 1
|
|
@@ -3697,6 +3712,7 @@ var EarnChain;
|
|
|
3697
3712
|
v2: {
|
|
3698
3713
|
type: 'split',
|
|
3699
3714
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3715
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3700
3716
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3701
3717
|
confirmations: 65,
|
|
3702
3718
|
fastConfirmations: 2
|
|
@@ -3761,6 +3777,7 @@ var EarnChain;
|
|
|
3761
3777
|
v2: {
|
|
3762
3778
|
type: 'split',
|
|
3763
3779
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
3780
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3764
3781
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
3765
3782
|
confirmations: 65,
|
|
3766
3783
|
fastConfirmations: 2
|
|
@@ -3871,6 +3888,7 @@ var EarnChain;
|
|
|
3871
3888
|
v2: {
|
|
3872
3889
|
type: 'split',
|
|
3873
3890
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
3891
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
3874
3892
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
3875
3893
|
confirmations: 1,
|
|
3876
3894
|
fastConfirmations: 1
|
|
@@ -3930,6 +3948,7 @@ var EarnChain;
|
|
|
3930
3948
|
v2: {
|
|
3931
3949
|
type: 'split',
|
|
3932
3950
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
3951
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
3933
3952
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
3934
3953
|
confirmations: 1,
|
|
3935
3954
|
fastConfirmations: 1
|
|
@@ -4084,6 +4103,7 @@ var EarnChain;
|
|
|
4084
4103
|
v2: {
|
|
4085
4104
|
type: 'split',
|
|
4086
4105
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4106
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4087
4107
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4088
4108
|
confirmations: 65,
|
|
4089
4109
|
fastConfirmations: 1
|
|
@@ -4131,6 +4151,7 @@ var EarnChain;
|
|
|
4131
4151
|
v2: {
|
|
4132
4152
|
type: 'split',
|
|
4133
4153
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4154
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4134
4155
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4135
4156
|
confirmations: 65,
|
|
4136
4157
|
fastConfirmations: 1
|
|
@@ -4175,6 +4196,7 @@ var EarnChain;
|
|
|
4175
4196
|
v2: {
|
|
4176
4197
|
type: 'split',
|
|
4177
4198
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4199
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4178
4200
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4179
4201
|
confirmations: 1,
|
|
4180
4202
|
fastConfirmations: 1
|
|
@@ -4220,6 +4242,7 @@ var EarnChain;
|
|
|
4220
4242
|
v2: {
|
|
4221
4243
|
type: 'split',
|
|
4222
4244
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
4245
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4223
4246
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
4224
4247
|
confirmations: 1,
|
|
4225
4248
|
fastConfirmations: 1
|
|
@@ -4266,6 +4289,7 @@ var EarnChain;
|
|
|
4266
4289
|
v2: {
|
|
4267
4290
|
type: 'split',
|
|
4268
4291
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4292
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4269
4293
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4270
4294
|
confirmations: 1,
|
|
4271
4295
|
fastConfirmations: 1
|
|
@@ -4579,6 +4603,7 @@ var EarnChain;
|
|
|
4579
4603
|
v2: {
|
|
4580
4604
|
type: 'split',
|
|
4581
4605
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4606
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4582
4607
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4583
4608
|
confirmations: 65,
|
|
4584
4609
|
fastConfirmations: 1
|
|
@@ -4643,6 +4668,7 @@ var EarnChain;
|
|
|
4643
4668
|
v2: {
|
|
4644
4669
|
type: 'split',
|
|
4645
4670
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
4671
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4646
4672
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
4647
4673
|
confirmations: 65,
|
|
4648
4674
|
fastConfirmations: 1
|
|
@@ -4763,6 +4789,98 @@ var EarnChain;
|
|
|
4763
4789
|
}
|
|
4764
4790
|
});
|
|
4765
4791
|
|
|
4792
|
+
/**
|
|
4793
|
+
* Plasma Mainnet chain definition
|
|
4794
|
+
* @remarks
|
|
4795
|
+
* This represents the official production network for the Plasma blockchain.
|
|
4796
|
+
* Plasma is an EVM-equivalent Layer 1 blockchain purpose-built for global
|
|
4797
|
+
* stablecoin payments, with deterministic BFT finality (PlasmaBFT/Fast-HotStuff).
|
|
4798
|
+
*/ const Plasma = defineChain({
|
|
4799
|
+
type: 'evm',
|
|
4800
|
+
chain: Blockchain.Plasma,
|
|
4801
|
+
name: 'Plasma',
|
|
4802
|
+
title: 'Plasma Mainnet',
|
|
4803
|
+
nativeCurrency: {
|
|
4804
|
+
name: 'Plasma',
|
|
4805
|
+
symbol: 'XPL',
|
|
4806
|
+
decimals: 18
|
|
4807
|
+
},
|
|
4808
|
+
chainId: 9745,
|
|
4809
|
+
isTestnet: false,
|
|
4810
|
+
explorerUrl: 'https://plasmascan.to/tx/{hash}',
|
|
4811
|
+
rpcEndpoints: [
|
|
4812
|
+
'https://rpc.plasma.to'
|
|
4813
|
+
],
|
|
4814
|
+
eurcAddress: '0x3EE196E78d4d4248b849B8E1C7F44C5457FAFD2C',
|
|
4815
|
+
usdcAddress: '0x2d661C89D812261039AF9764eceaAee884f5F67F',
|
|
4816
|
+
usdtAddress: null,
|
|
4817
|
+
cctp: {
|
|
4818
|
+
domain: 33,
|
|
4819
|
+
contracts: {
|
|
4820
|
+
v2: {
|
|
4821
|
+
type: 'split',
|
|
4822
|
+
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4823
|
+
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4824
|
+
confirmations: 3,
|
|
4825
|
+
fastConfirmations: 1
|
|
4826
|
+
}
|
|
4827
|
+
},
|
|
4828
|
+
forwarderSupported: {
|
|
4829
|
+
source: false,
|
|
4830
|
+
destination: false
|
|
4831
|
+
}
|
|
4832
|
+
},
|
|
4833
|
+
kitContracts: {
|
|
4834
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
4835
|
+
}
|
|
4836
|
+
});
|
|
4837
|
+
|
|
4838
|
+
/**
|
|
4839
|
+
* Plasma Testnet chain definition
|
|
4840
|
+
* @remarks
|
|
4841
|
+
* This represents the official test network for the Plasma blockchain.
|
|
4842
|
+
* Plasma is an EVM-equivalent Layer 1 blockchain purpose-built for global
|
|
4843
|
+
* stablecoin payments, with deterministic BFT finality (PlasmaBFT/Fast-HotStuff).
|
|
4844
|
+
*/ const PlasmaTestnet = defineChain({
|
|
4845
|
+
type: 'evm',
|
|
4846
|
+
chain: Blockchain.Plasma_Testnet,
|
|
4847
|
+
name: 'Plasma Testnet',
|
|
4848
|
+
title: 'Plasma Testnet',
|
|
4849
|
+
nativeCurrency: {
|
|
4850
|
+
name: 'Plasma',
|
|
4851
|
+
symbol: 'XPL',
|
|
4852
|
+
decimals: 18
|
|
4853
|
+
},
|
|
4854
|
+
chainId: 9746,
|
|
4855
|
+
isTestnet: true,
|
|
4856
|
+
explorerUrl: 'https://testnet.plasmascan.to/tx/{hash}',
|
|
4857
|
+
rpcEndpoints: [
|
|
4858
|
+
'https://testnet-rpc.plasma.to'
|
|
4859
|
+
],
|
|
4860
|
+
eurcAddress: '0x98AfA0F93Dd993B736399f9074eDcEBD1985A330',
|
|
4861
|
+
usdcAddress: '0xE67Fb267022cBA8064Dd388CC2FED724F3120D9D',
|
|
4862
|
+
usdtAddress: null,
|
|
4863
|
+
cctp: {
|
|
4864
|
+
domain: 33,
|
|
4865
|
+
contracts: {
|
|
4866
|
+
v2: {
|
|
4867
|
+
type: 'split',
|
|
4868
|
+
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4869
|
+
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4870
|
+
confirmations: 3,
|
|
4871
|
+
fastConfirmations: 1
|
|
4872
|
+
}
|
|
4873
|
+
},
|
|
4874
|
+
forwarderSupported: {
|
|
4875
|
+
source: false,
|
|
4876
|
+
destination: false
|
|
4877
|
+
}
|
|
4878
|
+
},
|
|
4879
|
+
kitContracts: {
|
|
4880
|
+
bridge: BRIDGE_CONTRACT_EVM_TESTNET
|
|
4881
|
+
}
|
|
4882
|
+
});
|
|
4883
|
+
|
|
4766
4884
|
/**
|
|
4767
4885
|
* Plume Mainnet chain definition
|
|
4768
4886
|
* @remarks
|
|
@@ -4794,6 +4912,7 @@ var EarnChain;
|
|
|
4794
4912
|
v2: {
|
|
4795
4913
|
type: 'split',
|
|
4796
4914
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
4915
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4797
4916
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4798
4917
|
confirmations: 65,
|
|
4799
4918
|
fastConfirmations: 1
|
|
@@ -4840,6 +4959,7 @@ var EarnChain;
|
|
|
4840
4959
|
v2: {
|
|
4841
4960
|
type: 'split',
|
|
4842
4961
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
4962
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
4843
4963
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
4844
4964
|
confirmations: 65,
|
|
4845
4965
|
fastConfirmations: 1
|
|
@@ -4941,6 +5061,7 @@ var EarnChain;
|
|
|
4941
5061
|
v2: {
|
|
4942
5062
|
type: 'split',
|
|
4943
5063
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
5064
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
4944
5065
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
4945
5066
|
confirmations: 33,
|
|
4946
5067
|
fastConfirmations: 13
|
|
@@ -5006,6 +5127,7 @@ var EarnChain;
|
|
|
5006
5127
|
v2: {
|
|
5007
5128
|
type: 'split',
|
|
5008
5129
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
5130
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5009
5131
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
5010
5132
|
confirmations: 33,
|
|
5011
5133
|
fastConfirmations: 13
|
|
@@ -5065,6 +5187,7 @@ var EarnChain;
|
|
|
5065
5187
|
v2: {
|
|
5066
5188
|
type: 'split',
|
|
5067
5189
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
5190
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
5068
5191
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
5069
5192
|
confirmations: 1,
|
|
5070
5193
|
fastConfirmations: 1
|
|
@@ -5124,6 +5247,7 @@ var EarnChain;
|
|
|
5124
5247
|
v2: {
|
|
5125
5248
|
type: 'split',
|
|
5126
5249
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
5250
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5127
5251
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
5128
5252
|
confirmations: 1,
|
|
5129
5253
|
fastConfirmations: 1
|
|
@@ -5181,6 +5305,7 @@ var EarnChain;
|
|
|
5181
5305
|
v2: {
|
|
5182
5306
|
type: 'split',
|
|
5183
5307
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
5308
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
5184
5309
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
5185
5310
|
confirmations: 1,
|
|
5186
5311
|
fastConfirmations: 1
|
|
@@ -5239,6 +5364,7 @@ var EarnChain;
|
|
|
5239
5364
|
v2: {
|
|
5240
5365
|
type: 'split',
|
|
5241
5366
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
5367
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5242
5368
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
5243
5369
|
confirmations: 1,
|
|
5244
5370
|
fastConfirmations: 1
|
|
@@ -5554,6 +5680,7 @@ var EarnChain;
|
|
|
5554
5680
|
v2: {
|
|
5555
5681
|
type: 'split',
|
|
5556
5682
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
5683
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
5557
5684
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
5558
5685
|
confirmations: 65,
|
|
5559
5686
|
fastConfirmations: 1
|
|
@@ -5618,6 +5745,7 @@ var EarnChain;
|
|
|
5618
5745
|
v2: {
|
|
5619
5746
|
type: 'split',
|
|
5620
5747
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
5748
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5621
5749
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
5622
5750
|
confirmations: 65,
|
|
5623
5751
|
fastConfirmations: 1
|
|
@@ -5675,6 +5803,7 @@ var EarnChain;
|
|
|
5675
5803
|
v2: {
|
|
5676
5804
|
type: 'split',
|
|
5677
5805
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cF5d',
|
|
5806
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
5678
5807
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
5679
5808
|
confirmations: 65,
|
|
5680
5809
|
fastConfirmations: 1
|
|
@@ -5734,6 +5863,7 @@ var EarnChain;
|
|
|
5734
5863
|
v2: {
|
|
5735
5864
|
type: 'split',
|
|
5736
5865
|
tokenMessenger: '0x8fe6b999dc680ccfdd5bf7eb0974218be2542daa',
|
|
5866
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5737
5867
|
messageTransmitter: '0xe737e5cebeeba77efe34d4aa090756590b1ce275',
|
|
5738
5868
|
confirmations: 65,
|
|
5739
5869
|
fastConfirmations: 1
|
|
@@ -5794,6 +5924,7 @@ var EarnChain;
|
|
|
5794
5924
|
v2: {
|
|
5795
5925
|
type: 'split',
|
|
5796
5926
|
tokenMessenger: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
|
|
5927
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_MAINNET,
|
|
5797
5928
|
messageTransmitter: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
|
|
5798
5929
|
confirmations: 3,
|
|
5799
5930
|
fastConfirmations: 3
|
|
@@ -5839,6 +5970,7 @@ var EarnChain;
|
|
|
5839
5970
|
v2: {
|
|
5840
5971
|
type: 'split',
|
|
5841
5972
|
tokenMessenger: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
|
|
5973
|
+
tokenMessengerWithFees: TOKEN_MESSENGER_WITH_FEES_EVM_TESTNET,
|
|
5842
5974
|
messageTransmitter: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
|
|
5843
5975
|
confirmations: 3,
|
|
5844
5976
|
fastConfirmations: 1
|
|
@@ -6049,6 +6181,8 @@ var Chains = /*#__PURE__*/Object.freeze({
|
|
|
6049
6181
|
OptimismSepolia: OptimismSepolia,
|
|
6050
6182
|
Pharos: Pharos,
|
|
6051
6183
|
PharosTestnet: PharosTestnet,
|
|
6184
|
+
Plasma: Plasma,
|
|
6185
|
+
PlasmaTestnet: PlasmaTestnet,
|
|
6052
6186
|
Plume: Plume,
|
|
6053
6187
|
PlumeTestnet: PlumeTestnet,
|
|
6054
6188
|
PolkadotAssetHub: PolkadotAssetHub,
|
|
@@ -7505,6 +7639,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
7505
7639
|
[Blockchain.Noble]: 'uusdc',
|
|
7506
7640
|
[Blockchain.Optimism]: '0x0b2c639c533813f4aa9d7837caf62653d097ff85',
|
|
7507
7641
|
[Blockchain.Pharos]: '0xC879C018dB60520F4355C26eD1a6D572cdAC1815',
|
|
7642
|
+
[Blockchain.Plasma]: '0x2d661C89D812261039AF9764eceaAee884f5F67F',
|
|
7508
7643
|
[Blockchain.Plume]: '0x222365EF19F7947e5484218551B56bb3965Aa7aF',
|
|
7509
7644
|
[Blockchain.Polkadot_Asset_Hub]: '1337',
|
|
7510
7645
|
[Blockchain.Polygon]: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
|
|
@@ -7525,6 +7660,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
7525
7660
|
[Blockchain.Arbitrum_Sepolia]: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
|
|
7526
7661
|
[Blockchain.Avalanche_Fuji]: '0x5425890298aed601595a70AB815c96711a31Bc65',
|
|
7527
7662
|
[Blockchain.Base_Sepolia]: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
|
|
7663
|
+
[Blockchain.Celo_Alfajores_Testnet]: '0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B',
|
|
7528
7664
|
[Blockchain.Codex_Testnet]: '0x6d7f141b6819C2c9CC2f818e6ad549E7Ca090F8f',
|
|
7529
7665
|
[Blockchain.Cronos_Testnet]: '0xEb33dc5fac03833e132593659e1dE7256aB59794',
|
|
7530
7666
|
[Blockchain.Edge_Testnet]: '0x2d9F7CAD728051AA35Ecdc472a14cf8cDF5CFD6B',
|
|
@@ -7540,6 +7676,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
7540
7676
|
[Blockchain.Noble_Testnet]: 'uusdc',
|
|
7541
7677
|
[Blockchain.Optimism_Sepolia]: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7',
|
|
7542
7678
|
[Blockchain.Pharos_Testnet]: '0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B',
|
|
7679
|
+
[Blockchain.Plasma_Testnet]: '0xE67Fb267022cBA8064Dd388CC2FED724F3120D9D',
|
|
7543
7680
|
[Blockchain.Plume_Testnet]: '0xcB5f30e335672893c7eb944B374c196392C19D18',
|
|
7544
7681
|
[Blockchain.Polkadot_Westmint]: '31337',
|
|
7545
7682
|
[Blockchain.Polygon_Amoy_Testnet]: '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582',
|
|
@@ -7602,6 +7739,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
7602
7739
|
[Blockchain.Base]: '0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42',
|
|
7603
7740
|
[Blockchain.Cronos]: '0xA6dE01a2d62C6B5f3525d768f34d276652C554c8',
|
|
7604
7741
|
[Blockchain.Ethereum]: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
|
|
7742
|
+
[Blockchain.Plasma]: '0x3EE196E78d4d4248b849B8E1C7F44C5457FAFD2C',
|
|
7605
7743
|
[Blockchain.Solana]: 'HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr',
|
|
7606
7744
|
[Blockchain.World_Chain]: '0x1C60ba0A0eD1019e8Eb035E6daF4155A5cE2380B',
|
|
7607
7745
|
// =========================================================================
|
|
@@ -7610,7 +7748,8 @@ const swapTokenEnumSchema = z.enum([
|
|
|
7610
7748
|
[Blockchain.Arc_Testnet]: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',
|
|
7611
7749
|
[Blockchain.Base_Sepolia]: '0x808456652fdb597867f38412077A9182bf77359F',
|
|
7612
7750
|
[Blockchain.Cronos_Testnet]: '0x31f7538adb53cF16350e6B0c89d03D91b7D12c46',
|
|
7613
|
-
[Blockchain.Ethereum_Sepolia]: '0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4'
|
|
7751
|
+
[Blockchain.Ethereum_Sepolia]: '0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4',
|
|
7752
|
+
[Blockchain.Plasma_Testnet]: '0x98AfA0F93Dd993B736399f9074eDcEBD1985A330'
|
|
7614
7753
|
}
|
|
7615
7754
|
};
|
|
7616
7755
|
|
|
@@ -8693,7 +8832,7 @@ const swapTokenEnumSchema = z.enum([
|
|
|
8693
8832
|
}
|
|
8694
8833
|
|
|
8695
8834
|
var name$3 = "@circle-fin/bridge-kit";
|
|
8696
|
-
var version$3 = "1.
|
|
8835
|
+
var version$3 = "1.14.0";
|
|
8697
8836
|
var pkg$3 = {
|
|
8698
8837
|
name: name$3,
|
|
8699
8838
|
version: version$3};
|
|
@@ -8746,6 +8885,179 @@ var pkg$3 = {
|
|
|
8746
8885
|
}
|
|
8747
8886
|
});
|
|
8748
8887
|
|
|
8888
|
+
/**
|
|
8889
|
+
* Canonical list of actions that do not prepare or submit transactions.
|
|
8890
|
+
*
|
|
8891
|
+
* @internal
|
|
8892
|
+
*/ const READ_ACTION_KEYS = [
|
|
8893
|
+
'token.allowance',
|
|
8894
|
+
'token.balanceOf',
|
|
8895
|
+
'token.name',
|
|
8896
|
+
'native.balanceOf',
|
|
8897
|
+
'usdc.allowance',
|
|
8898
|
+
'usdc.balanceOf',
|
|
8899
|
+
'usdc.name',
|
|
8900
|
+
'gateway.v1.isDelegate',
|
|
8901
|
+
'gateway.v1.withdrawingBalance',
|
|
8902
|
+
'gateway.v1.withdrawalBlock',
|
|
8903
|
+
'gateway.v1.signBurnIntents'
|
|
8904
|
+
];
|
|
8905
|
+
const READ_ACTION_KEY_SET = new Set(READ_ACTION_KEYS);
|
|
8906
|
+
/**
|
|
8907
|
+
* Check whether a runtime value identifies a read action.
|
|
8908
|
+
*
|
|
8909
|
+
* @param action - The value to classify.
|
|
8910
|
+
* @returns Whether the value is a registered read-action key.
|
|
8911
|
+
*
|
|
8912
|
+
* @example
|
|
8913
|
+
* ```typescript
|
|
8914
|
+
* import { isReadActionKey } from '@core/adapter'
|
|
8915
|
+
*
|
|
8916
|
+
* if (isReadActionKey(value)) {
|
|
8917
|
+
* await adapter.readAction(value, params, context)
|
|
8918
|
+
* }
|
|
8919
|
+
* ```
|
|
8920
|
+
*
|
|
8921
|
+
* @internal
|
|
8922
|
+
*/ function isReadActionKey(action) {
|
|
8923
|
+
return READ_ACTION_KEY_SET.has(action);
|
|
8924
|
+
}
|
|
8925
|
+
|
|
8926
|
+
/**
|
|
8927
|
+
* Create the standard error for a missing or non-read action.
|
|
8928
|
+
*
|
|
8929
|
+
* @param action - The unsupported action value.
|
|
8930
|
+
* @returns A fatal unsupported-action error.
|
|
8931
|
+
*
|
|
8932
|
+
* @internal
|
|
8933
|
+
*/ function createUnsupportedReadActionError(action) {
|
|
8934
|
+
return new KitError({
|
|
8935
|
+
...InputError.UNSUPPORTED_ACTION,
|
|
8936
|
+
recoverability: 'FATAL',
|
|
8937
|
+
message: `Read action "${String(action)}" is not registered in this adapter.`
|
|
8938
|
+
});
|
|
8939
|
+
}
|
|
8940
|
+
/**
|
|
8941
|
+
* Execute a read through the adapter's dedicated read seam when available.
|
|
8942
|
+
*
|
|
8943
|
+
* @remarks
|
|
8944
|
+
* Fall back to the legacy `prepareAction().execute()` contract so providers
|
|
8945
|
+
* remain runtime-compatible with adapter versions released before `readAction`.
|
|
8946
|
+
* Consumers must upgrade their adapter package for reads to bypass custom
|
|
8947
|
+
* `prepareAction` wrappers.
|
|
8948
|
+
*
|
|
8949
|
+
* @typeParam TAdapterCapabilities - The adapter capabilities type.
|
|
8950
|
+
* @typeParam TActionKey - The read action key.
|
|
8951
|
+
* @param adapter - The adapter that owns the read action.
|
|
8952
|
+
* @param action - The read action to execute.
|
|
8953
|
+
* @param params - The parameters for the read action.
|
|
8954
|
+
* @param ctx - The operation context.
|
|
8955
|
+
* @returns The raw read-action result.
|
|
8956
|
+
* @throws {KitError} When `action` is not a supported read-action key.
|
|
8957
|
+
*
|
|
8958
|
+
* @example
|
|
8959
|
+
* ```typescript
|
|
8960
|
+
* import { executeAdapterReadAction } from '@core/adapter'
|
|
8961
|
+
* import { Ethereum } from '@core/chains'
|
|
8962
|
+
*
|
|
8963
|
+
* const allowance = await executeAdapterReadAction(
|
|
8964
|
+
* adapter,
|
|
8965
|
+
* 'token.allowance',
|
|
8966
|
+
* { tokenAddress, delegate },
|
|
8967
|
+
* { chain: Ethereum },
|
|
8968
|
+
* )
|
|
8969
|
+
* ```
|
|
8970
|
+
*
|
|
8971
|
+
* @internal
|
|
8972
|
+
*/ async function executeAdapterReadAction(adapter, action, params, ctx) {
|
|
8973
|
+
if (!isReadActionKey(action)) {
|
|
8974
|
+
throw createUnsupportedReadActionError(action);
|
|
8975
|
+
}
|
|
8976
|
+
const runtimeAdapter = adapter;
|
|
8977
|
+
if (typeof runtimeAdapter.readAction === 'function') {
|
|
8978
|
+
return runtimeAdapter.readAction(action, params, ctx);
|
|
8979
|
+
}
|
|
8980
|
+
let request;
|
|
8981
|
+
try {
|
|
8982
|
+
request = await adapter.prepareAction(action, params, ctx);
|
|
8983
|
+
} catch (error) {
|
|
8984
|
+
if (error instanceof Error && error.message === `Action ${action} is not supported`) {
|
|
8985
|
+
throw createUnsupportedReadActionError(action);
|
|
8986
|
+
}
|
|
8987
|
+
throw error;
|
|
8988
|
+
}
|
|
8989
|
+
return request.execute();
|
|
8990
|
+
}
|
|
8991
|
+
/**
|
|
8992
|
+
* Read and parse a token allowance while supporting older adapter versions.
|
|
8993
|
+
*
|
|
8994
|
+
* @remarks
|
|
8995
|
+
* Prefer the adapter's dedicated read seam and fall back to the legacy
|
|
8996
|
+
* `prepareAction().execute()` contract when the runtime adapter predates it.
|
|
8997
|
+
*
|
|
8998
|
+
* @typeParam TAdapterCapabilities - The adapter capabilities type.
|
|
8999
|
+
* @param adapter - The adapter that owns the allowance action.
|
|
9000
|
+
* @param params - The token and delegate whose allowance is being read.
|
|
9001
|
+
* @param ctx - The operation context.
|
|
9002
|
+
* @returns The non-negative allowance in token base units.
|
|
9003
|
+
* @throws {KitError} When the action is unsupported or its response is malformed.
|
|
9004
|
+
*
|
|
9005
|
+
* @example
|
|
9006
|
+
* ```typescript
|
|
9007
|
+
* import { readTokenAllowance } from '@core/adapter'
|
|
9008
|
+
* import { Ethereum } from '@core/chains'
|
|
9009
|
+
*
|
|
9010
|
+
* const allowance = await readTokenAllowance(
|
|
9011
|
+
* adapter,
|
|
9012
|
+
* { tokenAddress, delegate },
|
|
9013
|
+
* { chain: Ethereum },
|
|
9014
|
+
* )
|
|
9015
|
+
* ```
|
|
9016
|
+
*
|
|
9017
|
+
* @internal
|
|
9018
|
+
*/ async function readTokenAllowance(adapter, params, ctx) {
|
|
9019
|
+
return parseAllowanceResponse(await executeAdapterReadAction(adapter, 'token.allowance', params, ctx));
|
|
9020
|
+
}
|
|
9021
|
+
/**
|
|
9022
|
+
* Parse a raw token allowance response into base units.
|
|
9023
|
+
*
|
|
9024
|
+
* @param allowanceRaw - The adapter response, optionally wrapped as an Amount output.
|
|
9025
|
+
* @returns The non-negative allowance as a bigint, or zero for a missing value.
|
|
9026
|
+
* @throws {KitError} When the response cannot represent a non-negative bigint.
|
|
9027
|
+
*
|
|
9028
|
+
* @example
|
|
9029
|
+
* ```typescript
|
|
9030
|
+
* import { parseAllowanceResponse } from '@core/adapter'
|
|
9031
|
+
*
|
|
9032
|
+
* const allowance = parseAllowanceResponse({ amount: { raw: 1000000n } })
|
|
9033
|
+
* ```
|
|
9034
|
+
*/ function parseAllowanceResponse(allowanceRaw) {
|
|
9035
|
+
let value = allowanceRaw;
|
|
9036
|
+
if (typeof value === 'object' && value !== null && 'amount' in value) {
|
|
9037
|
+
const amount = value.amount;
|
|
9038
|
+
if (typeof amount === 'object' && amount !== null && 'raw' in amount) {
|
|
9039
|
+
value = amount.raw;
|
|
9040
|
+
}
|
|
9041
|
+
}
|
|
9042
|
+
if (value === undefined || value === null) {
|
|
9043
|
+
return 0n;
|
|
9044
|
+
}
|
|
9045
|
+
let allowance;
|
|
9046
|
+
if (typeof value === 'bigint') {
|
|
9047
|
+
allowance = value;
|
|
9048
|
+
} else if (typeof value === 'string') {
|
|
9049
|
+
try {
|
|
9050
|
+
allowance = BigInt(value);
|
|
9051
|
+
} catch {
|
|
9052
|
+
allowance = undefined;
|
|
9053
|
+
}
|
|
9054
|
+
}
|
|
9055
|
+
if (allowance === undefined || allowance < 0n) {
|
|
9056
|
+
throw createValidationFailedError('token.allowance', value, 'token.allowance response must be a non-negative bigint-compatible string or bigint');
|
|
9057
|
+
}
|
|
9058
|
+
return allowance;
|
|
9059
|
+
}
|
|
9060
|
+
|
|
8749
9061
|
/**
|
|
8750
9062
|
* Schema for validating hexadecimal strings with '0x' prefix.
|
|
8751
9063
|
*
|
|
@@ -8795,7 +9107,7 @@ var pkg$3 = {
|
|
|
8795
9107
|
* const result = evmAddressSchema.safeParse(validAddress)
|
|
8796
9108
|
* console.log(result.success) // true
|
|
8797
9109
|
* ```
|
|
8798
|
-
*/ const evmAddressSchema = hexStringSchema.refine((value)=>value.length === 42, 'EVM address must be exactly 42 characters long (0x + 40 hex characters)').transform((value)=>value);
|
|
9110
|
+
*/ const evmAddressSchema$1 = hexStringSchema.refine((value)=>value.length === 42, 'EVM address must be exactly 42 characters long (0x + 40 hex characters)').transform((value)=>value);
|
|
8799
9111
|
/**
|
|
8800
9112
|
* Schema for validating transaction hashes.
|
|
8801
9113
|
*
|
|
@@ -9332,6 +9644,10 @@ var TransferSpeed;
|
|
|
9332
9644
|
token: z.literal('USDC').optional(),
|
|
9333
9645
|
config: z.object({
|
|
9334
9646
|
transferSpeed: z.nativeEnum(TransferSpeed).optional(),
|
|
9647
|
+
feePayment: z.enum([
|
|
9648
|
+
'source',
|
|
9649
|
+
'destination'
|
|
9650
|
+
]).optional(),
|
|
9335
9651
|
maxFee: z.string().min(1, 'Required').pipe(createDecimalStringValidator({
|
|
9336
9652
|
allowZero: true,
|
|
9337
9653
|
regexMessage: MAX_FEE_FORMAT_ERROR_MESSAGE,
|
|
@@ -9339,7 +9655,8 @@ var TransferSpeed;
|
|
|
9339
9655
|
maxDecimals: 6
|
|
9340
9656
|
})(z.string())).optional(),
|
|
9341
9657
|
customFee: customFeeSchema.optional()
|
|
9342
|
-
}).optional()
|
|
9658
|
+
}).optional(),
|
|
9659
|
+
quote: z.string().regex(/^0x([a-fA-F0-9]{2})+$/, 'must be non-empty 0x hex').optional()
|
|
9343
9660
|
});
|
|
9344
9661
|
|
|
9345
9662
|
// ============================================================================
|
|
@@ -9563,13 +9880,182 @@ var TransferSpeed;
|
|
|
9563
9880
|
* @internal
|
|
9564
9881
|
*/ Object.values(Chains).filter((chain)=>isCCTPV2Supported(chain));
|
|
9565
9882
|
|
|
9883
|
+
/** Decimal string in token minor units, constrained to be strictly positive. */ 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
|
+
// regex check above fails ("dirty"), so guard BigInt() against throwing on a
|
|
9885
|
+
// non-numeric value before comparing.
|
|
9886
|
+
.refine((value)=>/^\d+$/.test(value) && BigInt(value) > 0n, 'must be greater than zero');
|
|
9887
|
+
/**
|
|
9888
|
+
* A 20-byte EVM address in `0x` hex.
|
|
9889
|
+
*
|
|
9890
|
+
* The MVP prepaid-`FORWARD` `burn/usdc` path targets EVM contracts
|
|
9891
|
+
* (`TokenMessengerWithFees` / `GenericExecutor`), so `feeToken` and
|
|
9892
|
+
* `destinationCaller` are constrained to EVM addresses by design. This is an
|
|
9893
|
+
* intentional scope limit, not a permanent one: it can be widened to other
|
|
9894
|
+
* address formats as the fee service expands to more chains.
|
|
9895
|
+
*/ const evmAddressSchema = z.string().regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 20-byte 0x address');
|
|
9896
|
+
/** Even-length `0x` hex (the empty `0x` is allowed). */ const hexSchema = z.string().regex(/^0x([a-fA-F0-9]{2})*$/, 'must be even-length 0x hex');
|
|
9897
|
+
/** Non-empty, even-length `0x` hex. */ const nonEmptyHexSchema = z.string().regex(/^0x([a-fA-F0-9]{2})+$/, 'must be non-empty 0x hex');
|
|
9898
|
+
/** A 32-byte `0x` hex hash. */ const bytes32Schema = z.string().regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 32-byte 0x hash');
|
|
9899
|
+
/** Decimal string in minor units, allowing zero. */ const numericStringSchema = z.string().regex(/^\d+$/, 'must be a non-negative integer string');
|
|
9900
|
+
/** An `https:` URL, used for the optional base-URL override. */ const httpsUrlSchema = z.string().refine((value)=>{
|
|
9901
|
+
try {
|
|
9902
|
+
return new URL(value).protocol === 'https:';
|
|
9903
|
+
} catch {
|
|
9904
|
+
return false;
|
|
9905
|
+
}
|
|
9906
|
+
}, 'must be an https URL');
|
|
9907
|
+
const forwardParamsSchema = z.object({
|
|
9908
|
+
hookData: hexSchema.optional(),
|
|
9909
|
+
destinationCaller: evmAddressSchema.optional()
|
|
9910
|
+
}).strict();
|
|
9911
|
+
const forwardRequestSchema = z.object({
|
|
9912
|
+
type: z.literal('FORWARD'),
|
|
9913
|
+
params: forwardParamsSchema.optional()
|
|
9914
|
+
}).strict();
|
|
9915
|
+
const preFinalityRequestSchema = z.object({
|
|
9916
|
+
type: z.literal('PRE_FINALITY')
|
|
9917
|
+
}).strict();
|
|
9918
|
+
/** A single quote request item (`FORWARD` or `PRE_FINALITY`). */ const feeQuoteRequestSchema = z.discriminatedUnion('type', [
|
|
9919
|
+
forwardRequestSchema,
|
|
9920
|
+
preFinalityRequestSchema
|
|
9921
|
+
]);
|
|
9922
|
+
/** A non-empty list of quote request items with unique types. */ 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
|
+
/**
|
|
9924
|
+
* A structured `Partial<ApiPollingConfig>` polling override.
|
|
9925
|
+
*
|
|
9926
|
+
* Validates the field types callers actually set, so a plain-JS caller passing
|
|
9927
|
+
* `{ timeout: 'soon' }` is rejected at the boundary rather than failing opaquely
|
|
9928
|
+
* inside the transport. Unknown keys pass through so a future `ApiPollingConfig`
|
|
9929
|
+
* field is forwarded rather than silently dropped.
|
|
9930
|
+
*/ const apiPollingConfigSchema = z.object({
|
|
9931
|
+
timeout: z.number().int().positive().optional(),
|
|
9932
|
+
maxRetries: z.number().int().nonnegative().optional(),
|
|
9933
|
+
retryDelay: z.number().int().nonnegative().optional(),
|
|
9934
|
+
backoff: z.enum([
|
|
9935
|
+
'fixed',
|
|
9936
|
+
'exponential'
|
|
9937
|
+
]).optional(),
|
|
9938
|
+
maxRetryDelayMs: z.number().int().positive().optional(),
|
|
9939
|
+
headers: z.record(z.string()).optional()
|
|
9940
|
+
}).passthrough();
|
|
9941
|
+
/**
|
|
9942
|
+
* The validatable input for {@link fetchFeeQuote}.
|
|
9943
|
+
*
|
|
9944
|
+
* This is the single source of truth for input validation, including the CCTP
|
|
9945
|
+
* domains and the `isTestnet` environment flag. Validating `isTestnet` at
|
|
9946
|
+
* runtime matters because a plain-JS caller who omits it would otherwise leave
|
|
9947
|
+
* it `undefined`, which is falsy and silently selects the production base URL.
|
|
9948
|
+
* (`buildFeeQuoteUrl` independently re-validates the domains for standalone
|
|
9949
|
+
* callers.)
|
|
9950
|
+
*/ z.object({
|
|
9951
|
+
sourceDomain: z.number().int().nonnegative(),
|
|
9952
|
+
destinationDomain: z.number().int().nonnegative(),
|
|
9953
|
+
amount: positiveAmountSchema,
|
|
9954
|
+
feeToken: evmAddressSchema.optional(),
|
|
9955
|
+
requests: feeQuoteRequestsSchema,
|
|
9956
|
+
isTestnet: z.boolean(),
|
|
9957
|
+
baseUrl: httpsUrlSchema.optional(),
|
|
9958
|
+
config: apiPollingConfigSchema.optional()
|
|
9959
|
+
}).strict();
|
|
9960
|
+
const feeQuoteItemSchema = z.object({
|
|
9961
|
+
type: z.string().min(1),
|
|
9962
|
+
amount: numericStringSchema,
|
|
9963
|
+
args: z.array(z.string()),
|
|
9964
|
+
argsHash: bytes32Schema
|
|
9965
|
+
}).passthrough();
|
|
9966
|
+
const exchangeRatesSchema = z.object({
|
|
9967
|
+
feeTokenUsd: z.string(),
|
|
9968
|
+
destinationTokenUsd: z.string()
|
|
9969
|
+
}).passthrough();
|
|
9970
|
+
const metadataSchema = z.object({
|
|
9971
|
+
destinationGasPrice: z.string().optional(),
|
|
9972
|
+
exchangeRates: exchangeRatesSchema.optional()
|
|
9973
|
+
}).passthrough();
|
|
9974
|
+
/** The `expiry` object the Quote API nests the quote TTL under. */ const expirySchema = z.discriminatedUnion('mode', [
|
|
9975
|
+
z.object({
|
|
9976
|
+
mode: z.literal('TIMESTAMP'),
|
|
9977
|
+
expiresAt: z.number().int().nonnegative()
|
|
9978
|
+
}).passthrough(),
|
|
9979
|
+
z.object({
|
|
9980
|
+
mode: z.literal('BLOCK_NUMBER'),
|
|
9981
|
+
expiresAtBlock: z.number().int().nonnegative(),
|
|
9982
|
+
blockEstimatedAt: z.number().int().nonnegative().optional()
|
|
9983
|
+
}).passthrough()
|
|
9984
|
+
]);
|
|
9985
|
+
/** Schema for a signed fee quote returned by the Quote API. */ z.object({
|
|
9986
|
+
// The runtime YAML spec maps signedQuote to a looser `hex` (which allows
|
|
9987
|
+
// an empty `0x`); we keep the stricter non-empty form. Do not relax
|
|
9988
|
+
// without a reason.
|
|
9989
|
+
signedQuote: nonEmptyHexSchema,
|
|
9990
|
+
issuedAt: z.number().int().nonnegative(),
|
|
9991
|
+
// The API returns a mode-specific timestamp or source-block deadline.
|
|
9992
|
+
expiry: expirySchema,
|
|
9993
|
+
feeTotalAmount: numericStringSchema,
|
|
9994
|
+
feeToken: evmAddressSchema,
|
|
9995
|
+
nonce: numericStringSchema,
|
|
9996
|
+
items: z.array(feeQuoteItemSchema),
|
|
9997
|
+
metadata: metadataSchema.optional()
|
|
9998
|
+
}).passthrough();
|
|
9999
|
+
/** Validate input to {@link validateQuote}. */ z.object({
|
|
10000
|
+
sourceDomain: z.number().int().nonnegative(),
|
|
10001
|
+
abiSignature: z.string().min(1),
|
|
10002
|
+
args: z.array(z.union([
|
|
10003
|
+
z.string(),
|
|
10004
|
+
z.array(z.string())
|
|
10005
|
+
])),
|
|
10006
|
+
isTestnet: z.boolean(),
|
|
10007
|
+
baseUrl: httpsUrlSchema.optional(),
|
|
10008
|
+
config: apiPollingConfigSchema.optional()
|
|
10009
|
+
}).strict();
|
|
10010
|
+
const quoteExpiryStatusSchema = z.discriminatedUnion('mode', [
|
|
10011
|
+
z.object({
|
|
10012
|
+
mode: z.literal('TIMESTAMP'),
|
|
10013
|
+
expired: z.boolean(),
|
|
10014
|
+
secondsRemaining: z.number().int().nonnegative(),
|
|
10015
|
+
expiresAt: z.number().int().nonnegative()
|
|
10016
|
+
}).passthrough(),
|
|
10017
|
+
z.object({
|
|
10018
|
+
mode: z.literal('BLOCK_NUMBER'),
|
|
10019
|
+
expired: z.boolean(),
|
|
10020
|
+
secondsRemaining: z.number().int().nonnegative(),
|
|
10021
|
+
expiresAtBlock: z.number().int().nonnegative(),
|
|
10022
|
+
blockEstimatedAt: z.number().int().nonnegative().optional()
|
|
10023
|
+
}).passthrough()
|
|
10024
|
+
]);
|
|
10025
|
+
const validateQuoteItemSchema = z.object({
|
|
10026
|
+
type: z.string().min(1),
|
|
10027
|
+
argsMatch: z.boolean(),
|
|
10028
|
+
amount: numericStringSchema.optional(),
|
|
10029
|
+
args: z.array(z.string()).optional(),
|
|
10030
|
+
argsHash: bytes32Schema.optional(),
|
|
10031
|
+
computedArgsHash: bytes32Schema.optional()
|
|
10032
|
+
}).passthrough();
|
|
10033
|
+
/**
|
|
10034
|
+
* Schema for a response from the Quote API validation endpoint.
|
|
10035
|
+
*
|
|
10036
|
+
* The endpoint takes the source domain as a URL path parameter and does not
|
|
10037
|
+
* return it in the response body, so `sourceDomain` is intentionally not part
|
|
10038
|
+
* of this schema.
|
|
10039
|
+
*/ z.object({
|
|
10040
|
+
signedQuote: nonEmptyHexSchema,
|
|
10041
|
+
expiry: quoteExpiryStatusSchema,
|
|
10042
|
+
feeTotalAmount: numericStringSchema,
|
|
10043
|
+
feeToken: evmAddressSchema,
|
|
10044
|
+
nonce: numericStringSchema,
|
|
10045
|
+
claimable: z.boolean(),
|
|
10046
|
+
// Preserve newly introduced server-side reasons as opaque strings rather
|
|
10047
|
+
// than rejecting the entire safety response before the SDK is updated.
|
|
10048
|
+
failedChecks: z.array(z.string().min(1)),
|
|
10049
|
+
items: z.array(validateQuoteItemSchema)
|
|
10050
|
+
}).passthrough();
|
|
10051
|
+
|
|
9566
10052
|
/** SDK name used in telemetry payloads. */ resolveKitSdkName(pkg$3.name);
|
|
9567
10053
|
|
|
9568
10054
|
// Auto-register this kit for user agent tracking
|
|
9569
10055
|
registerKit(`${pkg$3.name}/${pkg$3.version}`);
|
|
9570
10056
|
|
|
9571
10057
|
var name$2 = "@circle-fin/swap-kit";
|
|
9572
|
-
var version$2 = "1.
|
|
10058
|
+
var version$2 = "1.6.0";
|
|
9573
10059
|
var pkg$2 = {
|
|
9574
10060
|
name: name$2,
|
|
9575
10061
|
version: version$2};
|
|
@@ -9583,7 +10069,7 @@ const optionalChainIdentifierField = chainIdentifierField.optional();
|
|
|
9583
10069
|
* Catches obviously malformed addresses at parse time; chain-specific validation
|
|
9584
10070
|
* is performed in buildServiceParams.
|
|
9585
10071
|
*/ const destinationAddressSchema = z.union([
|
|
9586
|
-
evmAddressSchema,
|
|
10072
|
+
evmAddressSchema$1,
|
|
9587
10073
|
solanaAddressSchema
|
|
9588
10074
|
]);
|
|
9589
10075
|
/**
|
|
@@ -9629,9 +10115,16 @@ const optionalChainIdentifierField = chainIdentifierField.optional();
|
|
|
9629
10115
|
message: 'stopLimit must be greater than 0'
|
|
9630
10116
|
}).optional(),
|
|
9631
10117
|
customFee: serviceSwapCustomFeeSchema.optional(),
|
|
10118
|
+
apiKey: z.string({
|
|
10119
|
+
invalid_type_error: 'apiKey must be a string'
|
|
10120
|
+
})// Tolerate '' so the `process.env.CIRCLE_API_KEY ?? ''` idiom falls back to
|
|
10121
|
+
// kitKey via resolveApiKey instead of being rejected here.
|
|
10122
|
+
.optional(),
|
|
9632
10123
|
kitKey: z.string({
|
|
9633
10124
|
invalid_type_error: 'kitKey must be a string'
|
|
9634
|
-
})
|
|
10125
|
+
})// Tolerate '' so an unset kit-key env var yields the permissionless path,
|
|
10126
|
+
// matching buildServiceParams (which already omits an empty credential).
|
|
10127
|
+
.optional(),
|
|
9635
10128
|
provider: z.string({
|
|
9636
10129
|
invalid_type_error: 'provider must be a string'
|
|
9637
10130
|
}).min(1, 'provider must be a non-empty string').optional(),
|
|
@@ -9804,6 +10297,41 @@ const optionalChainIdentifierField = chainIdentifierField.optional();
|
|
|
9804
10297
|
*
|
|
9805
10298
|
* @internal
|
|
9806
10299
|
*/ const MAX_RATE_ADDRESSES_PER_REQUEST = 100;
|
|
10300
|
+
/**
|
|
10301
|
+
* Environment prefixes carried by Circle platform API keys.
|
|
10302
|
+
*
|
|
10303
|
+
* A Circle API key is `<ENV>_API_KEY:<keyId>:<keySecret>`, where `<ENV>` is one
|
|
10304
|
+
* of these prefixes.
|
|
10305
|
+
*
|
|
10306
|
+
* @internal
|
|
10307
|
+
*/ const API_KEY_ENV_PREFIXES = [
|
|
10308
|
+
'TEST',
|
|
10309
|
+
'LIVE',
|
|
10310
|
+
'SAND',
|
|
10311
|
+
'SANDBOX',
|
|
10312
|
+
'SMOK',
|
|
10313
|
+
'PROD',
|
|
10314
|
+
'STAG',
|
|
10315
|
+
'DEV'
|
|
10316
|
+
];
|
|
10317
|
+
/**
|
|
10318
|
+
* Accepted credential formats for Stablecoin Service authentication.
|
|
10319
|
+
*
|
|
10320
|
+
* Matches a Circle platform API key (`<ENV>_API_KEY:<keyId>:<keySecret>`) and
|
|
10321
|
+
* the legacy kit key (`KIT_KEY:<keyId>:<keySecret>`). API keys are the
|
|
10322
|
+
* recommended credential; kit keys remain accepted as the legacy path.
|
|
10323
|
+
*
|
|
10324
|
+
* @remarks
|
|
10325
|
+
* This is a local pre-flight check, not the authority — the Stablecoin Service
|
|
10326
|
+
* validates the credential and answers 401 when it rejects one. The prefix list
|
|
10327
|
+
* is therefore deliberately permissive: a valid key carrying a prefix this SDK
|
|
10328
|
+
* has not been taught about should reach the service and be judged there rather
|
|
10329
|
+
* than be refused locally, since refusing locally is indistinguishable from an
|
|
10330
|
+
* outage to the caller. Kept as the single source of truth so the pattern is
|
|
10331
|
+
* not restated per call site.
|
|
10332
|
+
*
|
|
10333
|
+
* @internal
|
|
10334
|
+
*/ const API_KEY_PATTERN = new RegExp(`^(?:KIT_KEY|(?:${API_KEY_ENV_PREFIXES.join('|')})_API_KEY)` + ':[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+$');
|
|
9807
10335
|
|
|
9808
10336
|
/**
|
|
9809
10337
|
* Zod schema for validating stop limits.
|
|
@@ -9872,13 +10400,14 @@ const optionalChainIdentifierField = chainIdentifierField.optional();
|
|
|
9872
10400
|
/**
|
|
9873
10401
|
* Zod schema for validating API keys.
|
|
9874
10402
|
*
|
|
9875
|
-
*
|
|
10403
|
+
* Accepts a Circle platform API key (`<ENV>_API_KEY:<keyId>:<keySecret>`) and
|
|
10404
|
+
* the legacy kit key (`KIT_KEY:<keyId>:<keySecret>`).
|
|
9876
10405
|
*
|
|
9877
10406
|
* @example
|
|
9878
10407
|
* ```typescript
|
|
9879
10408
|
* import { apiKeySchema } from '@core/service-client'
|
|
9880
10409
|
*
|
|
9881
|
-
* const result = apiKeySchema.safeParse('
|
|
10410
|
+
* const result = apiKeySchema.safeParse('TEST_API_KEY:e84d2546d4e321b2ff427dc988c89503:f84d2548d4e322b2ff427fc989c87503')
|
|
9882
10411
|
* if (!result.success) {
|
|
9883
10412
|
* console.error('Invalid API key format:', result.error.issues)
|
|
9884
10413
|
* }
|
|
@@ -9886,7 +10415,7 @@ const optionalChainIdentifierField = chainIdentifierField.optional();
|
|
|
9886
10415
|
*/ const apiKeySchema = z.string({
|
|
9887
10416
|
required_error: 'API key is required',
|
|
9888
10417
|
invalid_type_error: 'Invalid API key format'
|
|
9889
|
-
}).regex(
|
|
10418
|
+
}).regex(API_KEY_PATTERN, 'Invalid API key format');
|
|
9890
10419
|
/**
|
|
9891
10420
|
* Zod schema for platform fees configuration.
|
|
9892
10421
|
*
|
|
@@ -10329,8 +10858,8 @@ getQuoteRequestBaseSchema.superRefine(requireCrossChainQuoteToAddress);
|
|
|
10329
10858
|
* Validates that an API key is properly formatted for Circle Stablecoin Service.
|
|
10330
10859
|
*
|
|
10331
10860
|
* This function performs validation on API keys to ensure they conform to the
|
|
10332
|
-
* expected format before making API requests. The key must follow the structure
|
|
10333
|
-
* `KIT_KEY:keyId:keySecret
|
|
10861
|
+
* expected format before making API requests. The key must follow the structure
|
|
10862
|
+
* `<ENV>_API_KEY:keyId:keySecret`, or the legacy `KIT_KEY:keyId:keySecret`.
|
|
10334
10863
|
*
|
|
10335
10864
|
* @param apiKey - The API key to validate (can be any type for graceful handling).
|
|
10336
10865
|
* @returns True if the API key is valid, false otherwise.
|
|
@@ -10338,7 +10867,8 @@ getQuoteRequestBaseSchema.superRefine(requireCrossChainQuoteToAddress);
|
|
|
10338
10867
|
* @remarks
|
|
10339
10868
|
* This function handles invalid inputs gracefully by returning false rather than
|
|
10340
10869
|
* throwing errors. It validates:
|
|
10341
|
-
* - The key
|
|
10870
|
+
* - The key carries a recognized prefix — `<ENV>_API_KEY:` for a Circle platform
|
|
10871
|
+
* API key, or `KIT_KEY:` for the legacy kit key
|
|
10342
10872
|
* - Contains exactly three colon-separated parts
|
|
10343
10873
|
* - keyId and keySecret contain only valid characters (alphanumeric, `-`, `_`, `.`)
|
|
10344
10874
|
* - keyId and keySecret are non-empty
|
|
@@ -10346,23 +10876,62 @@ getQuoteRequestBaseSchema.superRefine(requireCrossChainQuoteToAddress);
|
|
|
10346
10876
|
*
|
|
10347
10877
|
* Valid characters in keyId and keySecret: `a-z`, `A-Z`, `0-9`, `-`, `_`, `.`
|
|
10348
10878
|
*
|
|
10879
|
+
* Format is checked locally only so an obviously malformed credential fails
|
|
10880
|
+
* before a request is made. The Stablecoin Service remains the authority on
|
|
10881
|
+
* whether a well-formed key is actually accepted.
|
|
10882
|
+
*
|
|
10349
10883
|
* @example
|
|
10350
10884
|
* ```typescript
|
|
10351
10885
|
* import { isValidApiKey } from '@core/service-client'
|
|
10352
10886
|
*
|
|
10353
10887
|
* // Valid API key
|
|
10354
|
-
* const isValid = isValidApiKey('
|
|
10888
|
+
* const isValid = isValidApiKey('TEST_API_KEY:e84d2546d4e321b2ff427dc988c89503:f84d2548d4e322b2ff427fc989c87503')
|
|
10355
10889
|
* console.log(isValid) // true
|
|
10356
10890
|
*
|
|
10891
|
+
* // Legacy kit keys remain valid
|
|
10892
|
+
* console.log(isValidApiKey('KIT_KEY:my-key-id:my-key-secret')) // true
|
|
10893
|
+
*
|
|
10357
10894
|
* ```
|
|
10358
10895
|
*/ const isValidApiKey = (apiKey)=>{
|
|
10359
10896
|
// Handle invalid input types
|
|
10360
10897
|
if (typeof apiKey !== 'string') {
|
|
10361
10898
|
return false;
|
|
10362
10899
|
}
|
|
10363
|
-
const apiKeyPattern = /^KIT_KEY:[a-zA-Z0-9._-]+:[a-zA-Z0-9._-]+$/;
|
|
10364
10900
|
// Validate without trimming - any whitespace will cause validation to fail
|
|
10365
|
-
return
|
|
10901
|
+
return API_KEY_PATTERN.test(apiKey);
|
|
10902
|
+
};
|
|
10903
|
+
/**
|
|
10904
|
+
* Resolve the credential to authenticate a Stablecoin Service request with.
|
|
10905
|
+
*
|
|
10906
|
+
* `apiKey` is the supported field; `kitKey` is the deprecated alias kept for
|
|
10907
|
+
* existing integrations. When both are supplied `apiKey` wins, so a caller
|
|
10908
|
+
* migrating field-by-field cannot be silently pinned to a stale credential.
|
|
10909
|
+
*
|
|
10910
|
+
* An empty-string value is treated as absent on either field. Without this, the
|
|
10911
|
+
* common `process.env.CIRCLE_API_KEY ?? ''` idiom (which yields `''` when the
|
|
10912
|
+
* variable is unset) would either shadow a working `kitKey` or, on a bare
|
|
10913
|
+
* `kitKey: ''`, reach downstream validation as an invalid credential instead of
|
|
10914
|
+
* falling through to the permissionless path.
|
|
10915
|
+
*
|
|
10916
|
+
* @param source - Object carrying either credential field, or neither.
|
|
10917
|
+
* @returns The credential to use, or `undefined` for the permissionless
|
|
10918
|
+
* (keyless) path.
|
|
10919
|
+
*
|
|
10920
|
+
* @example
|
|
10921
|
+
* ```typescript
|
|
10922
|
+
* import { resolveApiKey } from '@core/service-client'
|
|
10923
|
+
*
|
|
10924
|
+
* resolveApiKey({ apiKey: 'TEST_API_KEY:id:secret' }) // 'TEST_API_KEY:id:secret'
|
|
10925
|
+
* resolveApiKey({ kitKey: 'KIT_KEY:id:secret' }) // 'KIT_KEY:id:secret'
|
|
10926
|
+
* resolveApiKey({ apiKey: '', kitKey: 'KIT_KEY:id:secret' }) // 'KIT_KEY:id:secret'
|
|
10927
|
+
* resolveApiKey({ kitKey: '' }) // undefined
|
|
10928
|
+
* resolveApiKey({}) // undefined
|
|
10929
|
+
* ```
|
|
10930
|
+
*/ const resolveApiKey = (source)=>{
|
|
10931
|
+
// Treat an empty-string value as absent on either field so the
|
|
10932
|
+
// `env ?? ''` idiom falls through to the next credential (or permissionless).
|
|
10933
|
+
const normalize = (value)=>value !== undefined && value !== '' ? value : undefined;
|
|
10934
|
+
return normalize(source.apiKey) ?? normalize(source.kitKey);
|
|
10366
10935
|
};
|
|
10367
10936
|
|
|
10368
10937
|
/**
|
|
@@ -11099,7 +11668,7 @@ const abiParameterSchema = z.object({
|
|
|
11099
11668
|
*/ z.object({
|
|
11100
11669
|
type: z.literal('evm'),
|
|
11101
11670
|
abi: abiSchema,
|
|
11102
|
-
address: evmAddressSchema,
|
|
11671
|
+
address: evmAddressSchema$1,
|
|
11103
11672
|
functionName: z.string({
|
|
11104
11673
|
required_error: 'Function name is required',
|
|
11105
11674
|
invalid_type_error: 'Function name must be a string'
|
|
@@ -11136,7 +11705,7 @@ const abiParameterSchema = z.object({
|
|
|
11136
11705
|
* }
|
|
11137
11706
|
* ```
|
|
11138
11707
|
*/ z.object({
|
|
11139
|
-
address: evmAddressSchema,
|
|
11708
|
+
address: evmAddressSchema$1,
|
|
11140
11709
|
value: z.bigint({
|
|
11141
11710
|
required_error: 'Value is required for native transfers',
|
|
11142
11711
|
invalid_type_error: 'Value must be a bigint'
|
|
@@ -11304,7 +11873,7 @@ z.object({
|
|
|
11304
11873
|
signature: evmSignatureSchema,
|
|
11305
11874
|
tokenInputs: z.array(z.object({
|
|
11306
11875
|
permitType: z.nativeEnum(PermitType),
|
|
11307
|
-
token: evmAddressSchema,
|
|
11876
|
+
token: evmAddressSchema$1,
|
|
11308
11877
|
amount: z.bigint().refine((value)=>value >= 0n, {
|
|
11309
11878
|
message: 'amount must be a non-negative bigint'
|
|
11310
11879
|
}),
|
|
@@ -11724,7 +12293,7 @@ const optionalSwapChainIdentifierField = swapChainIdentifierField.optional();
|
|
|
11724
12293
|
/**
|
|
11725
12294
|
* Fee recipient address (required).
|
|
11726
12295
|
* Must be a valid EVM address or Solana address.
|
|
11727
|
-
*/ recipientAddress: z.string().refine((value)=>evmAddressSchema.safeParse(value).success || solanaAddressSchema.safeParse(value).success, {
|
|
12296
|
+
*/ recipientAddress: z.string().refine((value)=>evmAddressSchema$1.safeParse(value).success || solanaAddressSchema.safeParse(value).success, {
|
|
11728
12297
|
message: 'recipientAddress must be a valid blockchain address: EVM (0x + 40 hex chars) or Solana (base58, 32-44 chars)'
|
|
11729
12298
|
})
|
|
11730
12299
|
}).strict();
|
|
@@ -11736,7 +12305,8 @@ const optionalSwapChainIdentifierField = swapChainIdentifierField.optional();
|
|
|
11736
12305
|
* - slippageBps: Optional positive number for slippage tolerance
|
|
11737
12306
|
* - stopLimit: Optional decimal string for minimum output
|
|
11738
12307
|
* - customFee: Optional fee configuration
|
|
11739
|
-
* -
|
|
12308
|
+
* - apiKey: Optional credential string
|
|
12309
|
+
* - kitKey: Optional credential string (deprecated alias for apiKey)
|
|
11740
12310
|
*/ const swapConfigSchema = z.object({
|
|
11741
12311
|
allowanceStrategy: allowanceStrategySchema.optional(),
|
|
11742
12312
|
slippageBps: z.number().int().min(0).optional(),
|
|
@@ -11746,11 +12316,12 @@ const optionalSwapChainIdentifierField = swapChainIdentifierField.optional();
|
|
|
11746
12316
|
attributeName: 'stopLimit'
|
|
11747
12317
|
})(z.string())).optional(),
|
|
11748
12318
|
customFee: swapCustomFeeSchema.optional(),
|
|
12319
|
+
apiKey: z.string().optional(),
|
|
11749
12320
|
kitKey: z.string().optional()
|
|
11750
12321
|
});
|
|
11751
12322
|
const swapDestinationSchema = z.object({
|
|
11752
12323
|
chain: optionalSwapChainIdentifierField,
|
|
11753
|
-
recipientAddress: z.string().refine((value)=>evmAddressSchema.safeParse(value).success || solanaAddressSchema.safeParse(value).success, {
|
|
12324
|
+
recipientAddress: z.string().refine((value)=>evmAddressSchema$1.safeParse(value).success || solanaAddressSchema.safeParse(value).success, {
|
|
11754
12325
|
message: 'recipientAddress must be a valid blockchain address: EVM (0x + 40 hex chars) or Solana (base58, 32-44 chars)'
|
|
11755
12326
|
}).optional()
|
|
11756
12327
|
}).strict();
|
|
@@ -13183,7 +13754,7 @@ new Set(Object.values(Blockchain));
|
|
|
13183
13754
|
registerKit(`${pkg$2.name}/${pkg$2.version}`);
|
|
13184
13755
|
|
|
13185
13756
|
var name$1 = "@circle-fin/earn-kit";
|
|
13186
|
-
var version$1 = "1.
|
|
13757
|
+
var version$1 = "1.6.0";
|
|
13187
13758
|
var pkg$1 = {
|
|
13188
13759
|
name: name$1,
|
|
13189
13760
|
version: version$1};
|
|
@@ -13399,7 +13970,7 @@ function toSdkChain(chain) {
|
|
|
13399
13970
|
*
|
|
13400
13971
|
* @internal
|
|
13401
13972
|
*/ function assertHexAddress(field, value, message = `${field} must be a 0x-prefixed 20-byte hex address`) {
|
|
13402
|
-
const result = evmAddressSchema.safeParse(value);
|
|
13973
|
+
const result = evmAddressSchema$1.safeParse(value);
|
|
13403
13974
|
if (!result.success) {
|
|
13404
13975
|
throw createValidationFailedError(field, value, message);
|
|
13405
13976
|
}
|
|
@@ -13430,30 +14001,6 @@ function toSdkChain(chain) {
|
|
|
13430
14001
|
return assertHexAddress('chain.kitContracts.adapter', adapterContractAddress, `Adapter contract for chain ${chain.name} must be a 0x-prefixed 20-byte hex address.`);
|
|
13431
14002
|
}
|
|
13432
14003
|
|
|
13433
|
-
/**
|
|
13434
|
-
* Parse the raw `token.allowance` adapter response into a bigint.
|
|
13435
|
-
*
|
|
13436
|
-
* @internal
|
|
13437
|
-
*/ function parseAllowanceResponse(allowanceRaw) {
|
|
13438
|
-
if (allowanceRaw === undefined || allowanceRaw === null) {
|
|
13439
|
-
return 0n;
|
|
13440
|
-
}
|
|
13441
|
-
let allowance;
|
|
13442
|
-
if (typeof allowanceRaw === 'bigint') {
|
|
13443
|
-
allowance = allowanceRaw;
|
|
13444
|
-
} else if (typeof allowanceRaw === 'string') {
|
|
13445
|
-
try {
|
|
13446
|
-
allowance = BigInt(allowanceRaw);
|
|
13447
|
-
} catch {
|
|
13448
|
-
allowance = undefined;
|
|
13449
|
-
}
|
|
13450
|
-
}
|
|
13451
|
-
if (allowance === undefined || allowance < 0n) {
|
|
13452
|
-
throw createValidationFailedError('token.allowance', allowanceRaw, 'token.allowance response must be a non-negative bigint-compatible string or bigint');
|
|
13453
|
-
}
|
|
13454
|
-
return allowance;
|
|
13455
|
-
}
|
|
13456
|
-
|
|
13457
14004
|
/**
|
|
13458
14005
|
* Safety multiplier applied to locally estimated gas for earn transactions.
|
|
13459
14006
|
*
|
|
@@ -13675,17 +14222,15 @@ const GAS_SAFETY_MULTIPLIER_DENOMINATOR = 10n;
|
|
|
13675
14222
|
if (requiredAllowance <= 0n) {
|
|
13676
14223
|
return undefined;
|
|
13677
14224
|
}
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
// propagation polls.
|
|
13688
|
-
const readAllowance = async ()=>parseAllowanceResponse(await allowancePrepared.execute());
|
|
14225
|
+
// Each call is a fresh allowance read at `latest`, so the same function serves
|
|
14226
|
+
// both the pre-approval decision and post-approval propagation polls.
|
|
14227
|
+
const readAllowance = async ()=>readTokenAllowance(adapter, {
|
|
14228
|
+
tokenAddress,
|
|
14229
|
+
delegate
|
|
14230
|
+
}, {
|
|
14231
|
+
chain,
|
|
14232
|
+
address
|
|
14233
|
+
});
|
|
13689
14234
|
const currentAllowance = await readAllowance();
|
|
13690
14235
|
if (currentAllowance >= requiredAllowance) {
|
|
13691
14236
|
return undefined;
|
|
@@ -14730,14 +15275,13 @@ function throwBatchFailure(result, executeReceipt, chain, actionKey, revertMessa
|
|
|
14730
15275
|
// approveAllowanceIfNeeded guard and avoids an increaseAllowance underflow
|
|
14731
15276
|
// (requiredAllowance - currentAllowance would be negative, which reverts as
|
|
14732
15277
|
// an out-of-range uint256).
|
|
14733
|
-
const
|
|
15278
|
+
const currentAllowance = await readTokenAllowance(adapter, {
|
|
14734
15279
|
tokenAddress: approvalToken,
|
|
14735
15280
|
delegate
|
|
14736
15281
|
}, {
|
|
14737
15282
|
chain,
|
|
14738
15283
|
address
|
|
14739
15284
|
});
|
|
14740
|
-
const currentAllowance = parseAllowanceResponse(await allowancePrepared.execute());
|
|
14741
15285
|
const approvalNeeded = currentAllowance < requiredAllowance;
|
|
14742
15286
|
const executePrepared = await adapter.prepareAction(actionKey, {
|
|
14743
15287
|
executeParams,
|
|
@@ -15074,7 +15618,7 @@ const EARN_OPERATIONS = new Set([
|
|
|
15074
15618
|
// Store the original service params non-enumerably. `retry()` reads them by
|
|
15075
15619
|
// direct property access (`trace.params`), but JSON.stringify, console.log,
|
|
15076
15620
|
// and telemetry serializers skip non-enumerable properties — so a
|
|
15077
|
-
// permissioned call's `config.
|
|
15621
|
+
// permissioned call's `config.apiKey` (a credential value) and
|
|
15078
15622
|
// the in-memory adapter never leak through a logged error. defineProperty
|
|
15079
15623
|
// also redefines any enumerable `params` an upstream trace may have carried.
|
|
15080
15624
|
Object.defineProperty(trace, 'params', {
|
|
@@ -15145,7 +15689,7 @@ function isNonNegativeBigIntLike(value) {
|
|
|
15145
15689
|
}
|
|
15146
15690
|
}
|
|
15147
15691
|
const hexSignatureSchema = evmSignatureSchema;
|
|
15148
|
-
const hexAddressSchema = evmAddressSchema;
|
|
15692
|
+
const hexAddressSchema = evmAddressSchema$1;
|
|
15149
15693
|
// '0x' prefix + 32 bytes * 2 hex chars.
|
|
15150
15694
|
const BYTES32_HEX_LENGTH = 66;
|
|
15151
15695
|
const bridgeFeeTokenSchema = hexAddressSchema;
|
|
@@ -16114,7 +16658,7 @@ const bridgeDepositPrepareReviewSchema = z.object({
|
|
|
16114
16658
|
}
|
|
16115
16659
|
|
|
16116
16660
|
var name = "@circle-fin/provider-earn-service";
|
|
16117
|
-
var version = "1.
|
|
16661
|
+
var version = "1.5.0";
|
|
16118
16662
|
var pkg = {
|
|
16119
16663
|
name: name,
|
|
16120
16664
|
version: version};
|
|
@@ -16176,10 +16720,12 @@ var pkg = {
|
|
|
16176
16720
|
*
|
|
16177
16721
|
* @internal
|
|
16178
16722
|
*/ function buildConfig(serviceConfig) {
|
|
16179
|
-
|
|
16180
|
-
//
|
|
16181
|
-
|
|
16182
|
-
|
|
16723
|
+
const apiKey = resolveApiKey(serviceConfig ?? {});
|
|
16724
|
+
// The credential is a server-only secret. Reject it in the browser so it
|
|
16725
|
+
// cannot leak into a client bundle (no-op in Node.js). Keyless usage stays
|
|
16726
|
+
// allowed.
|
|
16727
|
+
if (apiKey !== undefined && isBrowserEnvironment()) {
|
|
16728
|
+
throw createValidationFailedError('apiKey', '[redacted]', 'apiKey must not be provided in a browser environment — it is a server-only secret. Run EarnKit operations that use an API key on your server, or omit apiKey (and the legacy kitKey) to use the permissionless (keyless) client path');
|
|
16183
16729
|
}
|
|
16184
16730
|
const baseUrl = serviceConfig?.baseUrl ?? EARN_SERVICE_BASE_URL;
|
|
16185
16731
|
// The API CORS policy does not allow this custom header. Keep the existing
|
|
@@ -16188,7 +16734,7 @@ var pkg = {
|
|
|
16188
16734
|
const sdkVersionHeader = isNodeEnvironment() ? {
|
|
16189
16735
|
[SDK_VERSION_HEADER]: resolveSdkVersionHeader()
|
|
16190
16736
|
} : {};
|
|
16191
|
-
if (
|
|
16737
|
+
if (apiKey === undefined) {
|
|
16192
16738
|
return {
|
|
16193
16739
|
pollingConfig: {
|
|
16194
16740
|
...DEFAULT_CONFIG,
|
|
@@ -16200,11 +16746,11 @@ var pkg = {
|
|
|
16200
16746
|
baseUrl
|
|
16201
16747
|
};
|
|
16202
16748
|
}
|
|
16203
|
-
if (!isValidApiKey(
|
|
16749
|
+
if (!isValidApiKey(apiKey)) {
|
|
16204
16750
|
throw new KitError({
|
|
16205
16751
|
...InputError.VALIDATION_FAILED,
|
|
16206
16752
|
recoverability: 'FATAL',
|
|
16207
|
-
message: 'Invalid
|
|
16753
|
+
message: 'Invalid apiKey format. Expected <ENV>_API_KEY:<keyId>:<keySecret> (for example TEST_API_KEY:...), or a legacy KIT_KEY:<keyId>:<keySecret>.'
|
|
16208
16754
|
});
|
|
16209
16755
|
}
|
|
16210
16756
|
return {
|
|
@@ -16213,7 +16759,7 @@ var pkg = {
|
|
|
16213
16759
|
headers: {
|
|
16214
16760
|
...DEFAULT_CONFIG.headers,
|
|
16215
16761
|
...sdkVersionHeader,
|
|
16216
|
-
Authorization: `Bearer ${
|
|
16762
|
+
Authorization: `Bearer ${apiKey}`
|
|
16217
16763
|
}
|
|
16218
16764
|
},
|
|
16219
16765
|
baseUrl
|
|
@@ -17520,9 +18066,9 @@ function finishElapsedWait(lastStatus, lastError) {
|
|
|
17520
18066
|
* // Permissionless mode
|
|
17521
18067
|
* const provider = new EarnServiceProvider()
|
|
17522
18068
|
*
|
|
17523
|
-
* // Permissioned mode with
|
|
18069
|
+
* // Permissioned mode with an API key
|
|
17524
18070
|
* const provider = new EarnServiceProvider({
|
|
17525
|
-
*
|
|
18071
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
17526
18072
|
* })
|
|
17527
18073
|
*
|
|
17528
18074
|
* // Custom base URL for testing
|
|
@@ -18749,7 +19295,7 @@ function findProvider(context, chain, operation = 'earn') {
|
|
|
18749
19295
|
* fast instead of round-tripping to the service.
|
|
18750
19296
|
*
|
|
18751
19297
|
* @internal
|
|
18752
|
-
*/ const recipientEvmAddressSchema = evmAddressSchema.refine((address)=>!ZERO_EVM_ADDRESS_REGEX.test(address), 'address must not be the zero address').refine(isValidEip55Checksum, 'address has an invalid EIP-55 checksum');
|
|
19298
|
+
*/ const recipientEvmAddressSchema = evmAddressSchema$1.refine((address)=>!ZERO_EVM_ADDRESS_REGEX.test(address), 'address must not be the zero address').refine(isValidEip55Checksum, 'address has an invalid EIP-55 checksum');
|
|
18753
19299
|
/**
|
|
18754
19300
|
* Schema for the adapter context within earn operations.
|
|
18755
19301
|
*
|
|
@@ -18781,19 +19327,39 @@ const sourceAdapterContextSchema = z.object({
|
|
|
18781
19327
|
/**
|
|
18782
19328
|
* Schema for the EarnConfig options.
|
|
18783
19329
|
*
|
|
18784
|
-
* Validate the
|
|
18785
|
-
*
|
|
18786
|
-
*
|
|
18787
|
-
*
|
|
18788
|
-
*
|
|
18789
|
-
*
|
|
19330
|
+
* Validate the *resolved* credential using the standard `apiKeySchema` format
|
|
19331
|
+
* (`<ENV>_API_KEY:<keyId>:<keySecret>`, or a legacy
|
|
19332
|
+
* `KIT_KEY:<keyId>:<keySecret>`). `apiKey` takes precedence over the deprecated
|
|
19333
|
+
* `kitKey`, so a malformed `kitKey` that is being ignored must not fail a config
|
|
19334
|
+
* that supplies a valid `apiKey` (and vice versa) — only the credential that
|
|
19335
|
+
* would actually be sent is format-checked. When neither is supplied the SDK
|
|
19336
|
+
* operates in permissionless mode. `baseUrl` overrides the Earn Service endpoint
|
|
19337
|
+
* (e.g. staging); `batchTransactions: false` opts out of atomic batched
|
|
19338
|
+
* execution. All are forwarded to the provider, so this `.strict()` schema must
|
|
19339
|
+
* accept them or a valid config object is rejected.
|
|
18790
19340
|
*
|
|
18791
19341
|
* @internal
|
|
18792
19342
|
*/ const earnConfigSchema = z.object({
|
|
18793
|
-
|
|
19343
|
+
apiKey: z.string().optional(),
|
|
19344
|
+
kitKey: z.string().optional(),
|
|
18794
19345
|
baseUrl: z.string().optional(),
|
|
18795
19346
|
batchTransactions: z.boolean().optional()
|
|
18796
|
-
}).strict()
|
|
19347
|
+
}).strict().superRefine((config, ctx)=>{
|
|
19348
|
+
const credential = resolveApiKey(config);
|
|
19349
|
+
if (credential === undefined) {
|
|
19350
|
+
return;
|
|
19351
|
+
}
|
|
19352
|
+
const result = apiKeySchema.safeParse(credential);
|
|
19353
|
+
if (!result.success) {
|
|
19354
|
+
ctx.addIssue({
|
|
19355
|
+
code: z.ZodIssueCode.custom,
|
|
19356
|
+
path: [
|
|
19357
|
+
credential === config.apiKey ? 'apiKey' : 'kitKey'
|
|
19358
|
+
],
|
|
19359
|
+
message: result.error.issues[0]?.message ?? 'Invalid API key format'
|
|
19360
|
+
});
|
|
19361
|
+
}
|
|
19362
|
+
});
|
|
18797
19363
|
/**
|
|
18798
19364
|
* Canonical decimal form: a leading digit with no leading zeros (a single
|
|
18799
19365
|
* '0' is only allowed immediately before the decimal point). Rejects the
|
|
@@ -18865,7 +19431,7 @@ const sourceAdapterContextSchema = z.object({
|
|
|
18865
19431
|
* currently supports EVM vault addresses on Arc Testnet.
|
|
18866
19432
|
*
|
|
18867
19433
|
* @internal
|
|
18868
|
-
*/ const vaultAddressSchema = evmAddressSchema.refine(isValidEip55Checksum, 'address has an invalid EIP-55 checksum');
|
|
19434
|
+
*/ const vaultAddressSchema = evmAddressSchema$1.refine(isValidEip55Checksum, 'address has an invalid EIP-55 checksum');
|
|
18869
19435
|
/**
|
|
18870
19436
|
* Validation schema for VaultQuery.
|
|
18871
19437
|
*
|
|
@@ -19140,7 +19706,7 @@ const sameChainGetDepositQuoteParamsSchema = z.object({
|
|
|
19140
19706
|
const crossChainGetDepositQuoteParamsSchema = z.object({
|
|
19141
19707
|
from: sourceAdapterContextSchema,
|
|
19142
19708
|
chain: earnBridgeDestinationChainIdentifierSchema,
|
|
19143
|
-
address: evmAddressSchema,
|
|
19709
|
+
address: evmAddressSchema$1,
|
|
19144
19710
|
vaultAddress: vaultAddressSchema,
|
|
19145
19711
|
amount: amountSchema,
|
|
19146
19712
|
transferSpeed: z.enum([
|