@circle-fin/app-kit 1.8.0 → 1.8.1

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.
@@ -8146,13 +8146,20 @@ const swapTokenEnumSchema = zod.z.enum([
8146
8146
  symbol: 'EURC',
8147
8147
  decimals: 6,
8148
8148
  locators: {
8149
+ // =========================================================================
8150
+ // Mainnets
8151
+ // =========================================================================
8149
8152
  [Blockchain.Avalanche]: '0xc891EB4cbdEFf6e073e859e987815Ed1505c2ACD',
8150
8153
  [Blockchain.Base]: '0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42',
8151
8154
  [Blockchain.Ethereum]: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
8152
8155
  [Blockchain.Solana]: 'HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr',
8153
8156
  [Blockchain.World_Chain]: '0x1C60ba0A0eD1019e8Eb035E6daF4155A5cE2380B',
8157
+ // =========================================================================
8154
8158
  // Testnets
8155
- [Blockchain.Arc_Testnet]: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a'
8159
+ // =========================================================================
8160
+ [Blockchain.Arc_Testnet]: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',
8161
+ [Blockchain.Base_Sepolia]: '0x808456652fdb597867f38412077A9182bf77359F',
8162
+ [Blockchain.Ethereum_Sepolia]: '0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4'
8156
8163
  }
8157
8164
  };
8158
8165
 
@@ -8362,8 +8369,7 @@ const swapTokenEnumSchema = zod.z.enum([
8362
8369
  * cirBTC (Circle Bitcoin) token definition with addresses and metadata.
8363
8370
  *
8364
8371
  * @remarks
8365
- * Built-in cirBTC definition for the TokenRegistry. Currently deployed
8366
- * on Arc Testnet.
8372
+ * Built-in cirBTC definition for the TokenRegistry.
8367
8373
  *
8368
8374
  * @example
8369
8375
  * ```typescript
@@ -8379,7 +8385,15 @@ const swapTokenEnumSchema = zod.z.enum([
8379
8385
  symbol: 'cirBTC',
8380
8386
  decimals: 8,
8381
8387
  locators: {
8382
- [Blockchain.Arc_Testnet]: '0xf0C4a4CE82A5746AbAAd9425360Ab04fbBA432BF'
8388
+ // =========================================================================
8389
+ // Mainnets
8390
+ // =========================================================================
8391
+ [Blockchain.Ethereum]: '0x72DFB2E44f59C5AD2bAFE84314E5b99a7cd5075E',
8392
+ // =========================================================================
8393
+ // Testnets
8394
+ // =========================================================================
8395
+ [Blockchain.Arc_Testnet]: '0xf0C4a4CE82A5746AbAAd9425360Ab04fbBA432BF',
8396
+ [Blockchain.Ethereum_Sepolia]: '0x3a3fe695F684Bf9b9e43CF43C2b895Ea5e392bB3'
8383
8397
  }
8384
8398
  };
8385
8399
 
@@ -9495,7 +9509,7 @@ function resolveOptions(options) {
9495
9509
  }
9496
9510
 
9497
9511
  var name$2 = "@circle-fin/bridge-kit";
9498
- var version$3 = "1.11.0";
9512
+ var version$3 = "1.11.1";
9499
9513
  var pkg$3 = {
9500
9514
  name: name$2,
9501
9515
  version: version$3};
@@ -14247,7 +14261,7 @@ const mockAttestationMessage = {
14247
14261
  return step;
14248
14262
  }
14249
14263
 
14250
- var version$2 = "1.8.4";
14264
+ var version$2 = "1.8.5";
14251
14265
  var pkg$2 = {
14252
14266
  version: version$2};
14253
14267
 
@@ -16654,7 +16668,7 @@ registerKit(`${pkg$3.name}/${pkg$3.version}`);
16654
16668
  };
16655
16669
 
16656
16670
  var name$1 = "@circle-fin/swap-kit";
16657
- var version$1 = "1.3.0";
16671
+ var version$1 = "1.3.1";
16658
16672
  var pkg$1 = {
16659
16673
  name: name$1,
16660
16674
  version: version$1};
@@ -18582,7 +18596,7 @@ new Set(Object.values(Blockchain));
18582
18596
  registerKit(`${pkg$1.name}/${pkg$1.version}`);
18583
18597
 
18584
18598
  var name = "@circle-fin/earn-kit";
18585
- var version = "1.2.0";
18599
+ var version = "1.2.1";
18586
18600
  var pkg = {
18587
18601
  name: name,
18588
18602
  version: version};
@@ -18621,20 +18635,7 @@ var pkg = {
18621
18635
  */ ({
18622
18636
  [Blockchain.Arc_Testnet]: CHAIN_TO_API[Blockchain.Arc_Testnet]
18623
18637
  });
18624
- /**
18625
- * Expected EIP-712 domain of the ERC-3009 authorization token per source
18626
- * chain.
18627
- *
18628
- * Cross-chain Earn deposits are USDC-only, but USDC deployments differ on the
18629
- * EIP-712 domain name: newer deployments use `USDC` while older ones (for
18630
- * example Arbitrum Sepolia) kept `USD Coin` from the FiatToken V2 upgrade.
18631
- * These values mirror the bridge service's per-chain domain table and the
18632
- * on-chain `DOMAIN_SEPARATOR` inputs. Asserted before signing so a tampered
18633
- * prepare response cannot point the signature at another token. The
18634
- * `satisfies` check forces a domain entry whenever a source chain is added.
18635
- *
18636
- * @internal
18637
- */ ({
18638
+ ({
18638
18639
  [Blockchain.Arbitrum_Sepolia]: {
18639
18640
  },
18640
18641
  [Blockchain.Base_Sepolia]: {
@@ -18670,6 +18671,7 @@ const hexSignatureSchema = evmSignatureSchema;
18670
18671
  const hexAddressSchema = evmAddressSchema;
18671
18672
  // '0x' prefix + 32 bytes * 2 hex chars.
18672
18673
  const BYTES32_HEX_LENGTH = 66;
18674
+ const bridgeFeeTokenSchema = hexAddressSchema;
18673
18675
  /**
18674
18676
  * Zod schema for a non-negative uint256-like value.
18675
18677
  *
@@ -18956,14 +18958,12 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18956
18958
  *
18957
18959
  * The bridge prepare path returns one item per collected source fee (e.g.
18958
18960
  * `PRE_FINALITY` for the fast-burn fee and `FORWARD` for the destination
18959
- * forward fee), all denominated in the shared `feeToken`. The signed
18960
- * authorization `value` is `principal + sum(items[].amount)`, so the pre-sign
18961
- * guard parses these to recompute the expected value. Each item's `amount` is
18962
- * a base-unit decimal string in `feeToken` units.
18961
+ * forward fee), all denominated in the shared `feeToken`. Each item's `amount`
18962
+ * is a base-unit decimal string in `feeToken` units.
18963
18963
  *
18964
18964
  * @internal
18965
18965
  */ const bridgeFeeQuoteSchema = zod.z.object({
18966
- feeToken: hexAddressSchema,
18966
+ feeToken: bridgeFeeTokenSchema,
18967
18967
  items: zod.z.array(zod.z.object({
18968
18968
  type: zod.z.string(),
18969
18969
  amount: uint256LikeSchema
@@ -18979,6 +18979,12 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18979
18979
  erc3009TypedData: erc3009TypedDataSchema,
18980
18980
  feeQuote: bridgeFeeQuoteSchema
18981
18981
  }).passthrough();
18982
+ const bridgeDepositPrepareReviewSchema = zod.z.object({
18983
+ sourceChain: zod.z.string(),
18984
+ destinationChain: zod.z.string(),
18985
+ amount: amountJsonSchema,
18986
+ vaultAddress: hexAddressSchema
18987
+ }).passthrough();
18982
18988
  /**
18983
18989
  * Zod schema for the bridge deposit prepare payload.
18984
18990
  *
@@ -18990,7 +18996,7 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18990
18996
  execId: bridgeDepositExecIdSchema,
18991
18997
  erc3009TypedData: bridgeDepositPreparedBundleSchema,
18992
18998
  expiresAt: zod.z.string().datetime(),
18993
- review: zod.z.unknown().optional()
18999
+ review: bridgeDepositPrepareReviewSchema
18994
19000
  });
18995
19001
  /**
18996
19002
  * Zod schema for the `POST /v1/earnKit/bridge/deposit/prepare` API response.
@@ -19269,6 +19275,10 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
19269
19275
  data: exploreVaultsPayloadSchema
19270
19276
  });
19271
19277
 
19278
+ // Intentionally built-ins-only: Earn bridge support is limited to SDK-known
19279
+ // token contracts plus the explicit ERC-3009 domain allowlist below.
19280
+ createTokenRegistry();
19281
+
19272
19282
  /**
19273
19283
  * Shared UTF-8 encoder for building the keccak input in
19274
19284
  * {@link isValidEip55Checksum}, hoisted to module scope to avoid allocating a
@@ -19391,10 +19401,9 @@ const sourceAdapterContextSchema = zod.z.object({
19391
19401
  * Schema for validating human-readable decimal amount strings.
19392
19402
  *
19393
19403
  * Accept positive decimal strings like '100', '100.50', '0.001'. Reject
19394
- * zero, negative, non-numeric, and non-canonical strings. EarnKit
19395
- * same-chain amounts are USDC/EURC (6 decimals), so precision is capped at
19396
- * 6 to match the Earn Service and fail fast locally instead of leaking
19397
- * 7+ decimal-place inputs to the server.
19404
+ * zero, negative, non-numeric, and non-canonical strings. Same-chain
19405
+ * EarnKit vaults can use different asset precisions, so the service enforces
19406
+ * the vault-specific decimal cap after resolving the vault asset.
19398
19407
  *
19399
19408
  * @internal
19400
19409
  */ const amountSchema = zod.z.string({
@@ -19403,32 +19412,15 @@ const sourceAdapterContextSchema = zod.z.object({
19403
19412
  allowZero: false,
19404
19413
  regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19405
19414
  attributeName: 'amount',
19406
- maxDecimals: 6
19407
- })(zod.z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19408
- /**
19409
- * Schema for cross-chain deposit amount strings.
19410
- *
19411
- * Cross-chain Earn deposits are USDC-only, and the signed ERC-3009 value is
19412
- * denominated in USDC's 6 decimals. Reject more precise inputs up front so
19413
- * the signed value always equals the requested amount instead of a silent
19414
- * truncation. Non-canonical forms (leading dot, leading zeros) are rejected
19415
- * too, matching the Earn Service.
19416
- *
19417
- * @internal
19418
- */ const crossChainAmountSchema = zod.z.string({
19419
- required_error: 'amount is required'
19420
- }).min(1, 'amount is required').pipe(createDecimalStringValidator({
19421
- allowZero: false,
19422
- regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19423
- attributeName: 'amount',
19424
- maxDecimals: 6
19415
+ maxDecimals: 18
19425
19416
  })(zod.z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19426
19417
  /**
19427
19418
  * Schema for cross-chain source fee caps.
19428
19419
  *
19429
- * Cross-chain source fees are denominated in USDC base units. Zero is valid
19430
- * when the quote contains no source-collected fees; otherwise the cap should be
19431
- * the caller-accepted total from a recent quote.
19420
+ * Cross-chain source fees are denominated in the quote's fee token. Zero is
19421
+ * valid when the quote contains no source-collected fees; otherwise the cap
19422
+ * should be the caller-accepted total from a recent quote. The provider
19423
+ * enforces the prepared bundle's fee-token precision before signing.
19432
19424
  *
19433
19425
  * @internal
19434
19426
  */ const crossChainMaxFeeSchema = zod.z.string({
@@ -19437,7 +19429,7 @@ const sourceAdapterContextSchema = zod.z.object({
19437
19429
  allowZero: true,
19438
19430
  regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19439
19431
  attributeName: 'maxFee',
19440
- maxDecimals: 6
19432
+ maxDecimals: 18
19441
19433
  })(zod.z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19442
19434
  /**
19443
19435
  * Build a schema for an optional non-negative decimal filter string.
@@ -19598,7 +19590,7 @@ const crossChainDepositDestinationSchema = zod.z.object({
19598
19590
  from: sourceAdapterContextSchema,
19599
19591
  to: crossChainDepositDestinationSchema,
19600
19592
  vaultAddress: vaultAddressSchema,
19601
- amount: crossChainAmountSchema,
19593
+ amount: amountSchema,
19602
19594
  maxFee: crossChainMaxFeeSchema,
19603
19595
  transferSpeed: zod.z.enum([
19604
19596
  'FAST',
@@ -6043,8 +6043,8 @@ interface CrossChainDepositParams<TFromAdapterCapabilities extends AdapterCapabi
6043
6043
  */
6044
6044
  readonly amount: string;
6045
6045
  /**
6046
- * Maximum source-collected bridge fee the caller is willing to sign for, in
6047
- * human-readable source token units.
6046
+ * Maximum source-collected bridge fee the caller is willing to accept, in
6047
+ * human-readable fee token units from the quote.
6048
6048
  *
6049
6049
  * Derive this from a recent cross-chain deposit quote by summing
6050
6050
  * `quote.fees[].amount`. The prepared bridge bundle must not exceed this cap
@@ -6043,8 +6043,8 @@ interface CrossChainDepositParams<TFromAdapterCapabilities extends AdapterCapabi
6043
6043
  */
6044
6044
  readonly amount: string;
6045
6045
  /**
6046
- * Maximum source-collected bridge fee the caller is willing to sign for, in
6047
- * human-readable source token units.
6046
+ * Maximum source-collected bridge fee the caller is willing to accept, in
6047
+ * human-readable fee token units from the quote.
6048
6048
  *
6049
6049
  * Derive this from a recent cross-chain deposit quote by summing
6050
6050
  * `quote.fees[].amount`. The prepared bridge bundle must not exceed this cap
@@ -6043,8 +6043,8 @@ interface CrossChainDepositParams<TFromAdapterCapabilities extends AdapterCapabi
6043
6043
  */
6044
6044
  readonly amount: string;
6045
6045
  /**
6046
- * Maximum source-collected bridge fee the caller is willing to sign for, in
6047
- * human-readable source token units.
6046
+ * Maximum source-collected bridge fee the caller is willing to accept, in
6047
+ * human-readable fee token units from the quote.
6048
6048
  *
6049
6049
  * Derive this from a recent cross-chain deposit quote by summing
6050
6050
  * `quote.fees[].amount`. The prepared bridge bundle must not exceed this cap
@@ -8139,13 +8139,20 @@ const swapTokenEnumSchema = z.enum([
8139
8139
  symbol: 'EURC',
8140
8140
  decimals: 6,
8141
8141
  locators: {
8142
+ // =========================================================================
8143
+ // Mainnets
8144
+ // =========================================================================
8142
8145
  [Blockchain.Avalanche]: '0xc891EB4cbdEFf6e073e859e987815Ed1505c2ACD',
8143
8146
  [Blockchain.Base]: '0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42',
8144
8147
  [Blockchain.Ethereum]: '0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c',
8145
8148
  [Blockchain.Solana]: 'HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr',
8146
8149
  [Blockchain.World_Chain]: '0x1C60ba0A0eD1019e8Eb035E6daF4155A5cE2380B',
8150
+ // =========================================================================
8147
8151
  // Testnets
8148
- [Blockchain.Arc_Testnet]: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a'
8152
+ // =========================================================================
8153
+ [Blockchain.Arc_Testnet]: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',
8154
+ [Blockchain.Base_Sepolia]: '0x808456652fdb597867f38412077A9182bf77359F',
8155
+ [Blockchain.Ethereum_Sepolia]: '0x08210F9170F89Ab7658F0B5E3fF39b0E03C594D4'
8149
8156
  }
8150
8157
  };
8151
8158
 
@@ -8355,8 +8362,7 @@ const swapTokenEnumSchema = z.enum([
8355
8362
  * cirBTC (Circle Bitcoin) token definition with addresses and metadata.
8356
8363
  *
8357
8364
  * @remarks
8358
- * Built-in cirBTC definition for the TokenRegistry. Currently deployed
8359
- * on Arc Testnet.
8365
+ * Built-in cirBTC definition for the TokenRegistry.
8360
8366
  *
8361
8367
  * @example
8362
8368
  * ```typescript
@@ -8372,7 +8378,15 @@ const swapTokenEnumSchema = z.enum([
8372
8378
  symbol: 'cirBTC',
8373
8379
  decimals: 8,
8374
8380
  locators: {
8375
- [Blockchain.Arc_Testnet]: '0xf0C4a4CE82A5746AbAAd9425360Ab04fbBA432BF'
8381
+ // =========================================================================
8382
+ // Mainnets
8383
+ // =========================================================================
8384
+ [Blockchain.Ethereum]: '0x72DFB2E44f59C5AD2bAFE84314E5b99a7cd5075E',
8385
+ // =========================================================================
8386
+ // Testnets
8387
+ // =========================================================================
8388
+ [Blockchain.Arc_Testnet]: '0xf0C4a4CE82A5746AbAAd9425360Ab04fbBA432BF',
8389
+ [Blockchain.Ethereum_Sepolia]: '0x3a3fe695F684Bf9b9e43CF43C2b895Ea5e392bB3'
8376
8390
  }
8377
8391
  };
8378
8392
 
@@ -9488,7 +9502,7 @@ function resolveOptions(options) {
9488
9502
  }
9489
9503
 
9490
9504
  var name$2 = "@circle-fin/bridge-kit";
9491
- var version$3 = "1.11.0";
9505
+ var version$3 = "1.11.1";
9492
9506
  var pkg$3 = {
9493
9507
  name: name$2,
9494
9508
  version: version$3};
@@ -14240,7 +14254,7 @@ const mockAttestationMessage = {
14240
14254
  return step;
14241
14255
  }
14242
14256
 
14243
- var version$2 = "1.8.4";
14257
+ var version$2 = "1.8.5";
14244
14258
  var pkg$2 = {
14245
14259
  version: version$2};
14246
14260
 
@@ -16647,7 +16661,7 @@ registerKit(`${pkg$3.name}/${pkg$3.version}`);
16647
16661
  };
16648
16662
 
16649
16663
  var name$1 = "@circle-fin/swap-kit";
16650
- var version$1 = "1.3.0";
16664
+ var version$1 = "1.3.1";
16651
16665
  var pkg$1 = {
16652
16666
  name: name$1,
16653
16667
  version: version$1};
@@ -18575,7 +18589,7 @@ new Set(Object.values(Blockchain));
18575
18589
  registerKit(`${pkg$1.name}/${pkg$1.version}`);
18576
18590
 
18577
18591
  var name = "@circle-fin/earn-kit";
18578
- var version = "1.2.0";
18592
+ var version = "1.2.1";
18579
18593
  var pkg = {
18580
18594
  name: name,
18581
18595
  version: version};
@@ -18614,20 +18628,7 @@ var pkg = {
18614
18628
  */ ({
18615
18629
  [Blockchain.Arc_Testnet]: CHAIN_TO_API[Blockchain.Arc_Testnet]
18616
18630
  });
18617
- /**
18618
- * Expected EIP-712 domain of the ERC-3009 authorization token per source
18619
- * chain.
18620
- *
18621
- * Cross-chain Earn deposits are USDC-only, but USDC deployments differ on the
18622
- * EIP-712 domain name: newer deployments use `USDC` while older ones (for
18623
- * example Arbitrum Sepolia) kept `USD Coin` from the FiatToken V2 upgrade.
18624
- * These values mirror the bridge service's per-chain domain table and the
18625
- * on-chain `DOMAIN_SEPARATOR` inputs. Asserted before signing so a tampered
18626
- * prepare response cannot point the signature at another token. The
18627
- * `satisfies` check forces a domain entry whenever a source chain is added.
18628
- *
18629
- * @internal
18630
- */ ({
18631
+ ({
18631
18632
  [Blockchain.Arbitrum_Sepolia]: {
18632
18633
  },
18633
18634
  [Blockchain.Base_Sepolia]: {
@@ -18663,6 +18664,7 @@ const hexSignatureSchema = evmSignatureSchema;
18663
18664
  const hexAddressSchema = evmAddressSchema;
18664
18665
  // '0x' prefix + 32 bytes * 2 hex chars.
18665
18666
  const BYTES32_HEX_LENGTH = 66;
18667
+ const bridgeFeeTokenSchema = hexAddressSchema;
18666
18668
  /**
18667
18669
  * Zod schema for a non-negative uint256-like value.
18668
18670
  *
@@ -18949,14 +18951,12 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18949
18951
  *
18950
18952
  * The bridge prepare path returns one item per collected source fee (e.g.
18951
18953
  * `PRE_FINALITY` for the fast-burn fee and `FORWARD` for the destination
18952
- * forward fee), all denominated in the shared `feeToken`. The signed
18953
- * authorization `value` is `principal + sum(items[].amount)`, so the pre-sign
18954
- * guard parses these to recompute the expected value. Each item's `amount` is
18955
- * a base-unit decimal string in `feeToken` units.
18954
+ * forward fee), all denominated in the shared `feeToken`. Each item's `amount`
18955
+ * is a base-unit decimal string in `feeToken` units.
18956
18956
  *
18957
18957
  * @internal
18958
18958
  */ const bridgeFeeQuoteSchema = z.object({
18959
- feeToken: hexAddressSchema,
18959
+ feeToken: bridgeFeeTokenSchema,
18960
18960
  items: z.array(z.object({
18961
18961
  type: z.string(),
18962
18962
  amount: uint256LikeSchema
@@ -18972,6 +18972,12 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18972
18972
  erc3009TypedData: erc3009TypedDataSchema,
18973
18973
  feeQuote: bridgeFeeQuoteSchema
18974
18974
  }).passthrough();
18975
+ const bridgeDepositPrepareReviewSchema = z.object({
18976
+ sourceChain: z.string(),
18977
+ destinationChain: z.string(),
18978
+ amount: amountJsonSchema,
18979
+ vaultAddress: hexAddressSchema
18980
+ }).passthrough();
18975
18981
  /**
18976
18982
  * Zod schema for the bridge deposit prepare payload.
18977
18983
  *
@@ -18983,7 +18989,7 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
18983
18989
  execId: bridgeDepositExecIdSchema,
18984
18990
  erc3009TypedData: bridgeDepositPreparedBundleSchema,
18985
18991
  expiresAt: z.string().datetime(),
18986
- review: z.unknown().optional()
18992
+ review: bridgeDepositPrepareReviewSchema
18987
18993
  });
18988
18994
  /**
18989
18995
  * Zod schema for the `POST /v1/earnKit/bridge/deposit/prepare` API response.
@@ -19262,6 +19268,10 @@ const eip712DomainSchema = eip712DomainSchema$1.extend({
19262
19268
  data: exploreVaultsPayloadSchema
19263
19269
  });
19264
19270
 
19271
+ // Intentionally built-ins-only: Earn bridge support is limited to SDK-known
19272
+ // token contracts plus the explicit ERC-3009 domain allowlist below.
19273
+ createTokenRegistry();
19274
+
19265
19275
  /**
19266
19276
  * Shared UTF-8 encoder for building the keccak input in
19267
19277
  * {@link isValidEip55Checksum}, hoisted to module scope to avoid allocating a
@@ -19384,10 +19394,9 @@ const sourceAdapterContextSchema = z.object({
19384
19394
  * Schema for validating human-readable decimal amount strings.
19385
19395
  *
19386
19396
  * Accept positive decimal strings like '100', '100.50', '0.001'. Reject
19387
- * zero, negative, non-numeric, and non-canonical strings. EarnKit
19388
- * same-chain amounts are USDC/EURC (6 decimals), so precision is capped at
19389
- * 6 to match the Earn Service and fail fast locally instead of leaking
19390
- * 7+ decimal-place inputs to the server.
19397
+ * zero, negative, non-numeric, and non-canonical strings. Same-chain
19398
+ * EarnKit vaults can use different asset precisions, so the service enforces
19399
+ * the vault-specific decimal cap after resolving the vault asset.
19391
19400
  *
19392
19401
  * @internal
19393
19402
  */ const amountSchema = z.string({
@@ -19396,32 +19405,15 @@ const sourceAdapterContextSchema = z.object({
19396
19405
  allowZero: false,
19397
19406
  regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19398
19407
  attributeName: 'amount',
19399
- maxDecimals: 6
19400
- })(z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19401
- /**
19402
- * Schema for cross-chain deposit amount strings.
19403
- *
19404
- * Cross-chain Earn deposits are USDC-only, and the signed ERC-3009 value is
19405
- * denominated in USDC's 6 decimals. Reject more precise inputs up front so
19406
- * the signed value always equals the requested amount instead of a silent
19407
- * truncation. Non-canonical forms (leading dot, leading zeros) are rejected
19408
- * too, matching the Earn Service.
19409
- *
19410
- * @internal
19411
- */ const crossChainAmountSchema = z.string({
19412
- required_error: 'amount is required'
19413
- }).min(1, 'amount is required').pipe(createDecimalStringValidator({
19414
- allowZero: false,
19415
- regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19416
- attributeName: 'amount',
19417
- maxDecimals: 6
19408
+ maxDecimals: 18
19418
19409
  })(z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19419
19410
  /**
19420
19411
  * Schema for cross-chain source fee caps.
19421
19412
  *
19422
- * Cross-chain source fees are denominated in USDC base units. Zero is valid
19423
- * when the quote contains no source-collected fees; otherwise the cap should be
19424
- * the caller-accepted total from a recent quote.
19413
+ * Cross-chain source fees are denominated in the quote's fee token. Zero is
19414
+ * valid when the quote contains no source-collected fees; otherwise the cap
19415
+ * should be the caller-accepted total from a recent quote. The provider
19416
+ * enforces the prepared bundle's fee-token precision before signing.
19425
19417
  *
19426
19418
  * @internal
19427
19419
  */ const crossChainMaxFeeSchema = z.string({
@@ -19430,7 +19422,7 @@ const sourceAdapterContextSchema = z.object({
19430
19422
  allowZero: true,
19431
19423
  regexMessage: AMOUNT_FORMAT_ERROR_MESSAGE,
19432
19424
  attributeName: 'maxFee',
19433
- maxDecimals: 6
19425
+ maxDecimals: 18
19434
19426
  })(z.string())).refine((value)=>CANONICAL_AMOUNT_REGEX.test(value), AMOUNT_FORMAT_ERROR_MESSAGE);
19435
19427
  /**
19436
19428
  * Build a schema for an optional non-negative decimal filter string.
@@ -19591,7 +19583,7 @@ const crossChainDepositDestinationSchema = z.object({
19591
19583
  from: sourceAdapterContextSchema,
19592
19584
  to: crossChainDepositDestinationSchema,
19593
19585
  vaultAddress: vaultAddressSchema,
19594
- amount: crossChainAmountSchema,
19586
+ amount: amountSchema,
19595
19587
  maxFee: crossChainMaxFeeSchema,
19596
19588
  transferSpeed: z.enum([
19597
19589
  'FAST',