@circle-fin/app-kit 1.16.0 → 1.17.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.
@@ -2411,22 +2411,73 @@ let activeRedactor = defaultMessageRedactor;
2411
2411
  '0x9147d463': 'Final balance is less than the initial balance',
2412
2412
  '0xf4b3b1bc': 'Native token transfer to the beneficiary failed'
2413
2413
  };
2414
+ /**
2415
+ * Matches revert data: a 4-byte selector followed by whole ABI-encoded bytes.
2416
+ */ const REVERT_DATA_PATTERN = /^0x[0-9a-f]{8}(?:[0-9a-f]{2})*$/i;
2417
+ /**
2418
+ * Returns the revert data held by one error in a `cause` chain.
2419
+ *
2420
+ * Browser wallets (EIP-1193) wrap the node's error, so the revert data sits
2421
+ * one level down as `data.data`. viem's `getContractError` reads it the same
2422
+ * way, then keeps it on `ContractFunctionRevertedError.raw` and drops the
2423
+ * node's error from the chain.
2424
+ *
2425
+ * @param link - One error in the `cause` chain
2426
+ * @returns The `raw` or `data` string, or undefined if there is none
2427
+ */ function getRevertData(link) {
2428
+ if ('raw' in link && typeof link.raw === 'string' && REVERT_DATA_PATTERN.test(link.raw)) {
2429
+ return link.raw;
2430
+ }
2431
+ if (!('data' in link)) {
2432
+ return undefined;
2433
+ }
2434
+ const { data } = link;
2435
+ if (typeof data === 'string') {
2436
+ return data;
2437
+ }
2438
+ if (data !== null && typeof data === 'object' && 'data' in data && typeof data.data === 'string') {
2439
+ return data.data;
2440
+ }
2441
+ return undefined;
2442
+ }
2443
+ /**
2444
+ * Finds the first revert data on the error or in its `cause` chain that
2445
+ * `accept` takes.
2446
+ *
2447
+ * viem keeps the node's revert data on an inner `RpcRequestError`, not on
2448
+ * the error it throws. The `seen` set stops a self-referencing `cause` chain.
2449
+ *
2450
+ * @param error - The error object
2451
+ * @param accept - Returns true for the data shape the caller wants
2452
+ * @returns The data as written on the error, or undefined if not found
2453
+ */ function findRevertData(error, accept) {
2454
+ const seen = new Set();
2455
+ let current = error;
2456
+ while(current !== null && typeof current === 'object' && !seen.has(current)){
2457
+ seen.add(current);
2458
+ const data = getRevertData(current);
2459
+ if (data !== undefined && accept(data)) {
2460
+ return data;
2461
+ }
2462
+ current = 'cause' in current ? current.cause : undefined;
2463
+ }
2464
+ return undefined;
2465
+ }
2414
2466
  /**
2415
2467
  * Attempts to extract an error selector from an error object or message.
2416
2468
  *
2417
2469
  * Checks multiple sources in priority order:
2418
- * 1. `error.data` field
2470
+ * 1. `raw` or `data` field (or nested `data.data`) on the error or anywhere
2471
+ * in its `cause` chain
2419
2472
  * 2. Message pattern: "custom error 0x8baa579f"
2420
2473
  *
2421
2474
  * @param msg - The error message
2422
2475
  * @param error - The error object (optional)
2423
2476
  * @returns The 4 bytes selector , or undefined if not found
2424
2477
  */ function extractErrorSelector(msg, error) {
2425
- // Check error.data field
2426
- if (error !== null && typeof error === 'object' && 'data' in error) {
2427
- if (typeof error.data === 'string' && /^0x[0-9a-f]{8}$/i.test(error.data)) {
2428
- return error.data.toLowerCase();
2429
- }
2478
+ const data = findRevertData(error, (value)=>/^0x[0-9a-f]{8}$/i.test(value));
2479
+ if (data !== undefined) {
2480
+ return data.toLowerCase();
2430
2481
  }
2431
2482
  // Check for "custom error 0x8baa579f" in the message
2432
2483
  const match = /custom error (0x[0-9a-f]{8})\b/i.exec(msg);
@@ -3651,6 +3702,8 @@ var SwapChain;
3651
3702
  SwapChain["HyperEVM"] = "HyperEVM";
3652
3703
  SwapChain["Monad"] = "Monad";
3653
3704
  SwapChain["Arc"] = "Arc";
3705
+ SwapChain["Cronos"] = "Cronos";
3706
+ SwapChain["Morph"] = "Morph";
3654
3707
  // Testnet chains with swap support
3655
3708
  SwapChain["Arc_Testnet"] = "Arc_Testnet";
3656
3709
  })(SwapChain || (SwapChain = {}));
@@ -4993,7 +5046,8 @@ var BorrowChain;
4993
5046
  }
4994
5047
  },
4995
5048
  kitContracts: {
4996
- bridge: BRIDGE_CONTRACT_EVM_MAINNET
5049
+ bridge: BRIDGE_CONTRACT_EVM_MAINNET,
5050
+ adapter: ADAPTER_CONTRACT_EVM_MAINNET
4997
5051
  }
4998
5052
  });
4999
5053
 
@@ -5862,7 +5916,8 @@ var BorrowChain;
5862
5916
  }
5863
5917
  },
5864
5918
  kitContracts: {
5865
- bridge: BRIDGE_CONTRACT_EVM_MAINNET
5919
+ bridge: BRIDGE_CONTRACT_EVM_MAINNET,
5920
+ adapter: ADAPTER_CONTRACT_EVM_MAINNET
5866
5921
  }
5867
5922
  });
5868
5923
 
@@ -8165,8 +8220,8 @@ var Chains = {
8165
8220
  * Zod schema for validating swap-specific chain identifiers.
8166
8221
  *
8167
8222
  * Validates chains based on:
8168
- * - CCTPv2 support (adapter contract deployed)
8169
- * - Mainnet only (no testnets)
8223
+ * - Membership in the SwapChain enum
8224
+ * - Mainnet or explicitly allowlisted testnet
8170
8225
  * - At least one supported token available
8171
8226
  *
8172
8227
  */ zod.z.union([
@@ -10063,11 +10118,13 @@ function parseOrThrow(value, schema, context) {
10063
10118
  [Blockchain.Arbitrum]: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
10064
10119
  [Blockchain.Avalanche]: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7',
10065
10120
  [Blockchain.Celo]: '0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e',
10121
+ [Blockchain.Cronos]: '0x66e428c3f67a68878562e79A0234c1F83c208770',
10066
10122
  [Blockchain.Ethereum]: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
10067
10123
  [Blockchain.HyperEVM]: '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb',
10068
10124
  [Blockchain.Ink]: '0x0200C29006150606B650577BBE7B6248F58470c1',
10069
10125
  [Blockchain.Linea]: '0xA219439258ca9da29E9Cc4cE5596924745e12B93',
10070
10126
  [Blockchain.Monad]: '0xe7cd86e13AC4309349F30B3435a9d337750fC82D',
10127
+ [Blockchain.Morph]: '0xe7cd86e13AC4309349F30B3435a9d337750fC82D',
10071
10128
  [Blockchain.NEAR]: 'usdt.tether-token.near',
10072
10129
  [Blockchain.Optimism]: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
10073
10130
  [Blockchain.Polkadot_Asset_Hub]: '1984',
@@ -10126,6 +10183,7 @@ function parseOrThrow(value, schema, context) {
10126
10183
  [Blockchain.Arbitrum]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
10127
10184
  [Blockchain.Avalanche]: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70',
10128
10185
  [Blockchain.Base]: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
10186
+ [Blockchain.Cronos]: '0xF2001B145b43032AAF5Ee2884e456CCd805F677D',
10129
10187
  [Blockchain.Ethereum]: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
10130
10188
  [Blockchain.Linea]: '0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5',
10131
10189
  [Blockchain.Optimism]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
@@ -10188,7 +10246,9 @@ function parseOrThrow(value, schema, context) {
10188
10246
  [Blockchain.Arbitrum]: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
10189
10247
  [Blockchain.Avalanche]: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB',
10190
10248
  [Blockchain.Base]: '0x4200000000000000000000000000000000000006',
10249
+ [Blockchain.Cronos]: '0xe44Fd7fCb2b1581822D0c862B68222998a0c299a',
10191
10250
  [Blockchain.Ethereum]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
10251
+ [Blockchain.Morph]: '0x5300000000000000000000000000000000000011',
10192
10252
  [Blockchain.Optimism]: '0x4200000000000000000000000000000000000006',
10193
10253
  [Blockchain.Polygon]: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
10194
10254
  [Blockchain.Solana]: '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs'
@@ -10207,6 +10267,7 @@ function parseOrThrow(value, schema, context) {
10207
10267
  locators: {
10208
10268
  [Blockchain.Ethereum]: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599',
10209
10269
  [Blockchain.Arbitrum]: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
10270
+ [Blockchain.Cronos]: '0x062E66477Faf219F25D27dCED647BF57C3107d52',
10210
10271
  [Blockchain.Avalanche]: '0x50b7545627a5162F82A992c33b87aDc75187B218'
10211
10272
  }
10212
10273
  };
@@ -11897,7 +11958,7 @@ function resolveOptions(options) {
11897
11958
  }
11898
11959
 
11899
11960
  var name = "@circle-fin/unified-balance-kit";
11900
- var version$1 = "1.8.0";
11961
+ var version$1 = "1.8.1";
11901
11962
  var pkg$1 = {
11902
11963
  name: name,
11903
11964
  version: version$1};
@@ -29244,7 +29305,7 @@ const mockAttestationMessage = {
29244
29305
  return step;
29245
29306
  }
29246
29307
 
29247
- var version = "1.14.1";
29308
+ var version = "1.14.2";
29248
29309
  var pkg = {
29249
29310
  version: version};
29250
29311
 
@@ -2404,22 +2404,73 @@ let activeRedactor = defaultMessageRedactor;
2404
2404
  '0x9147d463': 'Final balance is less than the initial balance',
2405
2405
  '0xf4b3b1bc': 'Native token transfer to the beneficiary failed'
2406
2406
  };
2407
+ /**
2408
+ * Matches revert data: a 4-byte selector followed by whole ABI-encoded bytes.
2409
+ */ const REVERT_DATA_PATTERN = /^0x[0-9a-f]{8}(?:[0-9a-f]{2})*$/i;
2410
+ /**
2411
+ * Returns the revert data held by one error in a `cause` chain.
2412
+ *
2413
+ * Browser wallets (EIP-1193) wrap the node's error, so the revert data sits
2414
+ * one level down as `data.data`. viem's `getContractError` reads it the same
2415
+ * way, then keeps it on `ContractFunctionRevertedError.raw` and drops the
2416
+ * node's error from the chain.
2417
+ *
2418
+ * @param link - One error in the `cause` chain
2419
+ * @returns The `raw` or `data` string, or undefined if there is none
2420
+ */ function getRevertData(link) {
2421
+ if ('raw' in link && typeof link.raw === 'string' && REVERT_DATA_PATTERN.test(link.raw)) {
2422
+ return link.raw;
2423
+ }
2424
+ if (!('data' in link)) {
2425
+ return undefined;
2426
+ }
2427
+ const { data } = link;
2428
+ if (typeof data === 'string') {
2429
+ return data;
2430
+ }
2431
+ if (data !== null && typeof data === 'object' && 'data' in data && typeof data.data === 'string') {
2432
+ return data.data;
2433
+ }
2434
+ return undefined;
2435
+ }
2436
+ /**
2437
+ * Finds the first revert data on the error or in its `cause` chain that
2438
+ * `accept` takes.
2439
+ *
2440
+ * viem keeps the node's revert data on an inner `RpcRequestError`, not on
2441
+ * the error it throws. The `seen` set stops a self-referencing `cause` chain.
2442
+ *
2443
+ * @param error - The error object
2444
+ * @param accept - Returns true for the data shape the caller wants
2445
+ * @returns The data as written on the error, or undefined if not found
2446
+ */ function findRevertData(error, accept) {
2447
+ const seen = new Set();
2448
+ let current = error;
2449
+ while(current !== null && typeof current === 'object' && !seen.has(current)){
2450
+ seen.add(current);
2451
+ const data = getRevertData(current);
2452
+ if (data !== undefined && accept(data)) {
2453
+ return data;
2454
+ }
2455
+ current = 'cause' in current ? current.cause : undefined;
2456
+ }
2457
+ return undefined;
2458
+ }
2407
2459
  /**
2408
2460
  * Attempts to extract an error selector from an error object or message.
2409
2461
  *
2410
2462
  * Checks multiple sources in priority order:
2411
- * 1. `error.data` field
2463
+ * 1. `raw` or `data` field (or nested `data.data`) on the error or anywhere
2464
+ * in its `cause` chain
2412
2465
  * 2. Message pattern: "custom error 0x8baa579f"
2413
2466
  *
2414
2467
  * @param msg - The error message
2415
2468
  * @param error - The error object (optional)
2416
2469
  * @returns The 4 bytes selector , or undefined if not found
2417
2470
  */ function extractErrorSelector(msg, error) {
2418
- // Check error.data field
2419
- if (error !== null && typeof error === 'object' && 'data' in error) {
2420
- if (typeof error.data === 'string' && /^0x[0-9a-f]{8}$/i.test(error.data)) {
2421
- return error.data.toLowerCase();
2422
- }
2471
+ const data = findRevertData(error, (value)=>/^0x[0-9a-f]{8}$/i.test(value));
2472
+ if (data !== undefined) {
2473
+ return data.toLowerCase();
2423
2474
  }
2424
2475
  // Check for "custom error 0x8baa579f" in the message
2425
2476
  const match = /custom error (0x[0-9a-f]{8})\b/i.exec(msg);
@@ -3644,6 +3695,8 @@ var SwapChain;
3644
3695
  SwapChain["HyperEVM"] = "HyperEVM";
3645
3696
  SwapChain["Monad"] = "Monad";
3646
3697
  SwapChain["Arc"] = "Arc";
3698
+ SwapChain["Cronos"] = "Cronos";
3699
+ SwapChain["Morph"] = "Morph";
3647
3700
  // Testnet chains with swap support
3648
3701
  SwapChain["Arc_Testnet"] = "Arc_Testnet";
3649
3702
  })(SwapChain || (SwapChain = {}));
@@ -4986,7 +5039,8 @@ var BorrowChain;
4986
5039
  }
4987
5040
  },
4988
5041
  kitContracts: {
4989
- bridge: BRIDGE_CONTRACT_EVM_MAINNET
5042
+ bridge: BRIDGE_CONTRACT_EVM_MAINNET,
5043
+ adapter: ADAPTER_CONTRACT_EVM_MAINNET
4990
5044
  }
4991
5045
  });
4992
5046
 
@@ -5855,7 +5909,8 @@ var BorrowChain;
5855
5909
  }
5856
5910
  },
5857
5911
  kitContracts: {
5858
- bridge: BRIDGE_CONTRACT_EVM_MAINNET
5912
+ bridge: BRIDGE_CONTRACT_EVM_MAINNET,
5913
+ adapter: ADAPTER_CONTRACT_EVM_MAINNET
5859
5914
  }
5860
5915
  });
5861
5916
 
@@ -8158,8 +8213,8 @@ var Chains = /*#__PURE__*/Object.freeze({
8158
8213
  * Zod schema for validating swap-specific chain identifiers.
8159
8214
  *
8160
8215
  * Validates chains based on:
8161
- * - CCTPv2 support (adapter contract deployed)
8162
- * - Mainnet only (no testnets)
8216
+ * - Membership in the SwapChain enum
8217
+ * - Mainnet or explicitly allowlisted testnet
8163
8218
  * - At least one supported token available
8164
8219
  *
8165
8220
  */ z.union([
@@ -10056,11 +10111,13 @@ function parseOrThrow(value, schema, context) {
10056
10111
  [Blockchain.Arbitrum]: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
10057
10112
  [Blockchain.Avalanche]: '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7',
10058
10113
  [Blockchain.Celo]: '0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e',
10114
+ [Blockchain.Cronos]: '0x66e428c3f67a68878562e79A0234c1F83c208770',
10059
10115
  [Blockchain.Ethereum]: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
10060
10116
  [Blockchain.HyperEVM]: '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb',
10061
10117
  [Blockchain.Ink]: '0x0200C29006150606B650577BBE7B6248F58470c1',
10062
10118
  [Blockchain.Linea]: '0xA219439258ca9da29E9Cc4cE5596924745e12B93',
10063
10119
  [Blockchain.Monad]: '0xe7cd86e13AC4309349F30B3435a9d337750fC82D',
10120
+ [Blockchain.Morph]: '0xe7cd86e13AC4309349F30B3435a9d337750fC82D',
10064
10121
  [Blockchain.NEAR]: 'usdt.tether-token.near',
10065
10122
  [Blockchain.Optimism]: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
10066
10123
  [Blockchain.Polkadot_Asset_Hub]: '1984',
@@ -10119,6 +10176,7 @@ function parseOrThrow(value, schema, context) {
10119
10176
  [Blockchain.Arbitrum]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
10120
10177
  [Blockchain.Avalanche]: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70',
10121
10178
  [Blockchain.Base]: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
10179
+ [Blockchain.Cronos]: '0xF2001B145b43032AAF5Ee2884e456CCd805F677D',
10122
10180
  [Blockchain.Ethereum]: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
10123
10181
  [Blockchain.Linea]: '0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5',
10124
10182
  [Blockchain.Optimism]: '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
@@ -10181,7 +10239,9 @@ function parseOrThrow(value, schema, context) {
10181
10239
  [Blockchain.Arbitrum]: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
10182
10240
  [Blockchain.Avalanche]: '0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB',
10183
10241
  [Blockchain.Base]: '0x4200000000000000000000000000000000000006',
10242
+ [Blockchain.Cronos]: '0xe44Fd7fCb2b1581822D0c862B68222998a0c299a',
10184
10243
  [Blockchain.Ethereum]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
10244
+ [Blockchain.Morph]: '0x5300000000000000000000000000000000000011',
10185
10245
  [Blockchain.Optimism]: '0x4200000000000000000000000000000000000006',
10186
10246
  [Blockchain.Polygon]: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
10187
10247
  [Blockchain.Solana]: '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs'
@@ -10200,6 +10260,7 @@ function parseOrThrow(value, schema, context) {
10200
10260
  locators: {
10201
10261
  [Blockchain.Ethereum]: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599',
10202
10262
  [Blockchain.Arbitrum]: '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f',
10263
+ [Blockchain.Cronos]: '0x062E66477Faf219F25D27dCED647BF57C3107d52',
10203
10264
  [Blockchain.Avalanche]: '0x50b7545627a5162F82A992c33b87aDc75187B218'
10204
10265
  }
10205
10266
  };
@@ -11890,7 +11951,7 @@ function resolveOptions(options) {
11890
11951
  }
11891
11952
 
11892
11953
  var name = "@circle-fin/unified-balance-kit";
11893
- var version$1 = "1.8.0";
11954
+ var version$1 = "1.8.1";
11894
11955
  var pkg$1 = {
11895
11956
  name: name,
11896
11957
  version: version$1};
@@ -29237,7 +29298,7 @@ const mockAttestationMessage = {
29237
29298
  return step;
29238
29299
  }
29239
29300
 
29240
- var version = "1.14.1";
29301
+ var version = "1.14.2";
29241
29302
  var pkg = {
29242
29303
  version: version};
29243
29304