viem 2.55.10 → 2.55.11

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/_cjs/chains/definitions/story.js +7 -7
  3. package/_cjs/chains/definitions/story.js.map +1 -1
  4. package/_cjs/chains/definitions/storyAeneid.js +8 -8
  5. package/_cjs/chains/definitions/storyAeneid.js.map +1 -1
  6. package/_cjs/errors/typedData.js +11 -1
  7. package/_cjs/errors/typedData.js.map +1 -1
  8. package/_cjs/errors/version.js +1 -1
  9. package/_cjs/index.js +5 -4
  10. package/_cjs/index.js.map +1 -1
  11. package/_cjs/tempo/Abis.js +642 -253
  12. package/_cjs/tempo/Abis.js.map +1 -1
  13. package/_cjs/tempo/actions/earn.js +45 -17
  14. package/_cjs/tempo/actions/earn.js.map +1 -1
  15. package/_cjs/tempo/actions/token.js +18 -6
  16. package/_cjs/tempo/actions/token.js.map +1 -1
  17. package/_cjs/tokens/definitions/usdc.js +7 -0
  18. package/_cjs/tokens/definitions/usdc.js.map +1 -1
  19. package/_cjs/utils/promise/withRetry.js +2 -2
  20. package/_cjs/utils/promise/withRetry.js.map +1 -1
  21. package/_cjs/utils/typedData.js +3 -0
  22. package/_cjs/utils/typedData.js.map +1 -1
  23. package/_esm/chains/definitions/story.js +7 -7
  24. package/_esm/chains/definitions/story.js.map +1 -1
  25. package/_esm/chains/definitions/storyAeneid.js +8 -8
  26. package/_esm/chains/definitions/storyAeneid.js.map +1 -1
  27. package/_esm/errors/typedData.js +9 -0
  28. package/_esm/errors/typedData.js.map +1 -1
  29. package/_esm/errors/version.js +1 -1
  30. package/_esm/index.js +1 -1
  31. package/_esm/index.js.map +1 -1
  32. package/_esm/tempo/Abis.js +643 -254
  33. package/_esm/tempo/Abis.js.map +1 -1
  34. package/_esm/tempo/actions/earn.js +45 -17
  35. package/_esm/tempo/actions/earn.js.map +1 -1
  36. package/_esm/tempo/actions/token.js +21 -8
  37. package/_esm/tempo/actions/token.js.map +1 -1
  38. package/_esm/tokens/definitions/usdc.js +7 -0
  39. package/_esm/tokens/definitions/usdc.js.map +1 -1
  40. package/_esm/utils/promise/withRetry.js +2 -2
  41. package/_esm/utils/promise/withRetry.js.map +1 -1
  42. package/_esm/utils/typedData.js +4 -1
  43. package/_esm/utils/typedData.js.map +1 -1
  44. package/_types/chains/definitions/story.d.ts +7 -7
  45. package/_types/chains/definitions/storyAeneid.d.ts +8 -8
  46. package/_types/errors/typedData.d.ts +8 -0
  47. package/_types/errors/typedData.d.ts.map +1 -1
  48. package/_types/errors/version.d.ts +1 -1
  49. package/_types/index.d.ts +1 -1
  50. package/_types/index.d.ts.map +1 -1
  51. package/_types/tempo/Abis.d.ts +945 -388
  52. package/_types/tempo/Abis.d.ts.map +1 -1
  53. package/_types/tempo/actions/earn.d.ts +1141 -534
  54. package/_types/tempo/actions/earn.d.ts.map +1 -1
  55. package/_types/tempo/actions/token.d.ts +1 -1
  56. package/_types/tempo/actions/token.d.ts.map +1 -1
  57. package/_types/tokens/definitions/usdc.d.ts +7 -0
  58. package/_types/tokens/definitions/usdc.d.ts.map +1 -1
  59. package/_types/tokens/sets.d.ts +14 -0
  60. package/_types/tokens/sets.d.ts.map +1 -1
  61. package/_types/utils/typedData.d.ts.map +1 -1
  62. package/chains/definitions/story.ts +7 -7
  63. package/chains/definitions/storyAeneid.ts +8 -8
  64. package/errors/typedData.ts +13 -0
  65. package/errors/version.ts +1 -1
  66. package/index.ts +2 -0
  67. package/package.json +1 -1
  68. package/tempo/Abis.ts +644 -254
  69. package/tempo/actions/earn.ts +80 -63
  70. package/tempo/actions/token.ts +60 -9
  71. package/tokens/definitions/usdc.ts +7 -0
  72. package/utils/promise/withRetry.ts +4 -4
  73. package/utils/typedData.ts +5 -0
@@ -923,7 +923,7 @@ export async function depositSharesSync<
923
923
  caller: args.caller,
924
924
  earnShareAmount: args.earnShares,
925
925
  receipt,
926
- receivedVenueShareAmount: args.receivedVenueShares,
926
+ receivedVenueShareAmount: args.receivedEngineShares,
927
927
  recipient: args.receiver,
928
928
  venueShareAmount: args.requestedVenueShares,
929
929
  }
@@ -1039,7 +1039,9 @@ export namespace privateDeposit {
1039
1039
  zonePortal: portalAddress,
1040
1040
  }),
1041
1041
  ])
1042
- const assetToken = parameters.assetToken ?? config.vaultAsset
1042
+ const assetToken = parameters.assetToken ?? config.privateAsset
1043
+ if (!isAddressEqual(assetToken, config.privateAsset))
1044
+ throw new Error('`assetToken` must match the Zone gateway private asset.')
1043
1045
  const { encrypted, keyIndex } =
1044
1046
  await zoneActions.encryptedDeposit.prepareRecipient(client, {
1045
1047
  ...readParameters,
@@ -1049,18 +1051,13 @@ export namespace privateDeposit {
1049
1051
  zoneId: config.zoneId,
1050
1052
  })
1051
1053
  const shareAmountMin = resolveMinimumShareAmount(parameters)
1052
- const direct = isAddressEqual(assetToken, config.vaultAsset)
1053
1054
  const data = encodeAbiParameters(Abis.earnRouterCallbackData, [
1054
1055
  {
1055
1056
  actionId,
1056
- earnVault: config.vault,
1057
1057
  flow: 0,
1058
1058
  minEarnShares: shareAmountMin,
1059
1059
  minOutputAmount: 0n,
1060
- minVaultAssets: direct
1061
- ? assetAmount
1062
- : (parameters.vaultAssetAmountMin ?? 0n),
1063
- outputToken: config.shareToken,
1060
+ minVaultAssets: parameters.vaultAssetAmountMin ?? assetAmount,
1064
1061
  zoneReturn: { encrypted, keyIndex, refundRecipient: recoveryRecipient },
1065
1062
  },
1066
1063
  ])
@@ -1084,9 +1081,9 @@ export namespace privateDeposit {
1084
1081
  export type Args = PrivatePreparationParameters & {
1085
1082
  /** Assets withdrawn from the Zone, base units. */
1086
1083
  assetAmount: bigint
1087
- /** Asset token withdrawn from the Zone. @default vault asset */
1084
+ /** Private asset withdrawn from the Zone. @default gateway private asset */
1088
1085
  assetToken?: Address | undefined
1089
- /** Minimum vault assets accepted after swapping `assetToken`. @default `0n` */
1086
+ /** Minimum vault assets accepted after conversion. @default `assetAmount` */
1090
1087
  vaultAssetAmountMin?: bigint | undefined
1091
1088
  } & MinimumShareAmountParameters
1092
1089
  export type ReturnValue = PreparedZoneRequest
@@ -1429,15 +1426,15 @@ export type FeeConfig = {
1429
1426
  excess: {
1430
1427
  /** Excess fee recipient. */
1431
1428
  account: Address
1432
- /** Annual target growth rate, scaled to 18 decimals. */
1433
- annualTargetRate: bigint
1429
+ /** Annual target growth rate in basis points. */
1430
+ annualTargetRateBps: number
1434
1431
  /** Whether the excess fee is active. */
1435
1432
  enabled: boolean
1436
- /** Rate applied above the target, scaled to 18 decimals. */
1437
- excessFeeRate: bigint
1433
+ /** Rate applied above the target in basis points. */
1434
+ excessFeeRateBps: number
1438
1435
  }
1439
- /** Fixed fee recipients and their 18-decimal rates. */
1440
- fixedFees: readonly { account: Address; rate: bigint }[]
1436
+ /** Fixed fee recipients and their rates in basis points. */
1437
+ fixedFees: readonly { account: Address; rateBps: number }[]
1441
1438
  }
1442
1439
 
1443
1440
  /** Pending vault fee amounts. */
@@ -2419,9 +2416,9 @@ export namespace privateRedeem {
2419
2416
  zonePortal: portalAddress,
2420
2417
  }),
2421
2418
  ])
2422
- const assetToken = parameters.assetToken ?? config.vaultAsset
2423
- if (isAddressEqual(assetToken, config.shareToken))
2424
- throw new Error('`assetToken` cannot be the Earn share token.')
2419
+ const assetToken = parameters.assetToken ?? config.privateAsset
2420
+ if (!isAddressEqual(assetToken, config.privateAsset))
2421
+ throw new Error('`assetToken` must match the Zone gateway private asset.')
2425
2422
 
2426
2423
  const [{ encrypted, keyIndex }, assetAmountMin] = await Promise.all([
2427
2424
  zoneActions.encryptedDeposit.prepareRecipient(client, {
@@ -2447,16 +2444,13 @@ export namespace privateRedeem {
2447
2444
  return EarnShares.minimumOutput(assetAmount, parameters.slippageBps)
2448
2445
  })(),
2449
2446
  ])
2450
- const direct = isAddressEqual(assetToken, config.vaultAsset)
2451
2447
  const data = encodeAbiParameters(Abis.earnRouterCallbackData, [
2452
2448
  {
2453
2449
  actionId,
2454
- earnVault: config.vault,
2455
2450
  flow: 1,
2456
2451
  minEarnShares: 0n,
2457
- minOutputAmount: direct ? 0n : assetAmountMin,
2458
- minVaultAssets: direct ? assetAmountMin : 1n,
2459
- outputToken: assetToken,
2452
+ minOutputAmount: assetAmountMin,
2453
+ minVaultAssets: assetAmountMin,
2460
2454
  zoneReturn: { encrypted, keyIndex, refundRecipient: recoveryRecipient },
2461
2455
  },
2462
2456
  ])
@@ -2480,31 +2474,24 @@ export namespace privateRedeem {
2480
2474
  PrivatePreparationParameters & {
2481
2475
  /** Earn shares withdrawn from the Zone, base units. */
2482
2476
  shareAmount: bigint
2483
- } & (
2484
- | ({
2485
- /** Asset token returned to the Zone. @default vault asset */
2486
- assetToken?: undefined
2487
- } & OneOf<
2488
- | {
2489
- /** Minimum assets returned to the Zone. */
2490
- assetAmountMin: bigint
2491
- }
2492
- | {
2493
- /** Quoted assets returned to the Zone. */
2494
- assetAmount: bigint
2495
- /** Slippage tolerance under `assetAmount` (50 = 0.5%). */
2496
- slippageBps: number
2497
- }
2498
- | {
2499
- /** Slippage tolerance under a live vault quote (50 = 0.5%). */
2500
- slippageBps: number
2501
- }
2502
- >)
2503
- | ({
2504
- /** Asset token returned to the Zone after a swap. */
2505
- assetToken: Address
2506
- } & MinimumAssetAmountParameters)
2507
- )
2477
+ /** Private asset returned to the Zone. Must match the gateway. @default gateway private asset */
2478
+ assetToken?: Address | undefined
2479
+ } & OneOf<
2480
+ | {
2481
+ /** Minimum assets returned to the Zone. */
2482
+ assetAmountMin: bigint
2483
+ }
2484
+ | {
2485
+ /** Quoted assets returned to the Zone. */
2486
+ assetAmount: bigint
2487
+ /** Slippage tolerance under `assetAmount` (50 = 0.5%). */
2488
+ slippageBps: number
2489
+ }
2490
+ | {
2491
+ /** Slippage tolerance under a live vault quote (50 = 0.5%). */
2492
+ slippageBps: number
2493
+ }
2494
+ >
2508
2495
  export type ReturnValue = PreparedZoneRequest
2509
2496
  export type ErrorType = BaseErrorType
2510
2497
  }
@@ -3006,19 +2993,6 @@ export namespace withdrawExactSync {
3006
2993
  export type ErrorType = BaseErrorType
3007
2994
  }
3008
2995
 
3009
- type MinimumAssetAmountParameters = OneOf<
3010
- | {
3011
- /** Minimum assets returned to the Zone. */
3012
- assetAmountMin: bigint
3013
- }
3014
- | {
3015
- /** Quoted assets returned to the Zone. */
3016
- assetAmount: bigint
3017
- /** Slippage tolerance under `assetAmount` (50 = 0.5%). */
3018
- slippageBps: number
3019
- }
3020
- >
3021
-
3022
2996
  type MinimumShareAmountParameters = OneOf<
3023
2997
  | {
3024
2998
  /** Minimum Earn shares returned to the Zone. */
@@ -3132,7 +3106,16 @@ async function getZoneGatewayConfig<chain extends Chain | undefined>(
3132
3106
  },
3133
3107
  ) {
3134
3108
  const { flow, gateway, vault, zoneId, zonePortal, ...rest } = parameters
3135
- const [vaultAsset, shareToken, supportsFlow] = await multicall(client, {
3109
+ const [
3110
+ vaultAsset,
3111
+ shareToken,
3112
+ allowedZoneId,
3113
+ routerVault,
3114
+ privateAsset,
3115
+ routerVaultAsset,
3116
+ routerShareToken,
3117
+ supportsFlow,
3118
+ ] = await multicall(client, {
3136
3119
  ...rest,
3137
3120
  allowFailure: false,
3138
3121
  contracts: [
@@ -3146,6 +3129,31 @@ async function getZoneGatewayConfig<chain extends Chain | undefined>(
3146
3129
  address: vault,
3147
3130
  functionName: 'earnShare',
3148
3131
  },
3132
+ {
3133
+ abi: Abis.earnRouter,
3134
+ address: gateway,
3135
+ functionName: 'allowedZoneId',
3136
+ },
3137
+ {
3138
+ abi: Abis.earnRouter,
3139
+ address: gateway,
3140
+ functionName: 'earnVault',
3141
+ },
3142
+ {
3143
+ abi: Abis.earnRouter,
3144
+ address: gateway,
3145
+ functionName: 'privateAsset',
3146
+ },
3147
+ {
3148
+ abi: Abis.earnRouter,
3149
+ address: gateway,
3150
+ functionName: 'vaultAsset',
3151
+ },
3152
+ {
3153
+ abi: Abis.earnRouter,
3154
+ address: gateway,
3155
+ functionName: 'earnShare',
3156
+ },
3149
3157
  {
3150
3158
  abi: Abis.earnRouter,
3151
3159
  address: gateway,
@@ -3156,7 +3164,16 @@ async function getZoneGatewayConfig<chain extends Chain | undefined>(
3156
3164
  deployless: true,
3157
3165
  })
3158
3166
  if (!supportsFlow) throw new Error('Zone gateway flow is not supported.')
3167
+ if (allowedZoneId !== zoneId)
3168
+ throw new Error('Zone gateway is configured for a different Zone.')
3169
+ if (!isAddressEqual(routerVault, vault))
3170
+ throw new Error('Zone gateway is configured for a different Earn vault.')
3171
+ if (!isAddressEqual(routerVaultAsset, vaultAsset))
3172
+ throw new Error('Zone gateway vault asset does not match the Earn vault.')
3173
+ if (!isAddressEqual(routerShareToken, shareToken))
3174
+ throw new Error('Zone gateway share token does not match the Earn vault.')
3159
3175
  return {
3176
+ privateAsset,
3160
3177
  shareToken,
3161
3178
  vault,
3162
3179
  vaultAsset,
@@ -4,9 +4,15 @@ import { TokenId, TokenRole } from 'ox/tempo'
4
4
  import type { Account } from '../../accounts/types.js'
5
5
  import { parseAccount } from '../../accounts/utils/parseAccount.js'
6
6
  import { estimateContractGas } from '../../actions/public/estimateContractGas.js'
7
- import { multicall } from '../../actions/public/multicall.js'
8
- import type { ReadContractReturnType } from '../../actions/public/readContract.js'
9
- import { readContract } from '../../actions/public/readContract.js'
7
+ import {
8
+ type MulticallParameters,
9
+ type MulticallReturnType,
10
+ multicall,
11
+ } from '../../actions/public/multicall.js'
12
+ import {
13
+ type ReadContractReturnType,
14
+ readContract,
15
+ } from '../../actions/public/readContract.js'
10
16
  import {
11
17
  type SimulateContractReturnType,
12
18
  simulateContract,
@@ -1399,7 +1405,7 @@ export async function getMetadata<chain extends Chain | undefined>(
1399
1405
  }
1400
1406
 
1401
1407
  if (TokenId.fromAddress(address) === TokenId.fromAddress(Addresses.pathUsd))
1402
- return multicall(client, {
1408
+ return readMetadataContracts(client, {
1403
1409
  ...rest,
1404
1410
  contracts: [
1405
1411
  {
@@ -1433,8 +1439,6 @@ export async function getMetadata<chain extends Chain | undefined>(
1433
1439
  functionName: 'totalSupply',
1434
1440
  },
1435
1441
  ] as const,
1436
- allowFailure: true,
1437
- deployless: true,
1438
1442
  }).then(([currency, decimals, logoURI, name, symbol, totalSupply]) => ({
1439
1443
  name: unwrapMulticallResult(name),
1440
1444
  symbol: unwrapMulticallResult(symbol),
@@ -1445,7 +1449,7 @@ export async function getMetadata<chain extends Chain | undefined>(
1445
1449
  ...overrides,
1446
1450
  }))
1447
1451
 
1448
- return multicall(client, {
1452
+ return readMetadataContracts(client, {
1449
1453
  ...rest,
1450
1454
  contracts: [
1451
1455
  {
@@ -1499,8 +1503,6 @@ export async function getMetadata<chain extends Chain | undefined>(
1499
1503
  functionName: 'transferPolicyId',
1500
1504
  },
1501
1505
  ] as const,
1502
- allowFailure: true,
1503
- deployless: true,
1504
1506
  }).then(
1505
1507
  ([
1506
1508
  currency,
@@ -1529,6 +1531,55 @@ export async function getMetadata<chain extends Chain | undefined>(
1529
1531
  )
1530
1532
  }
1531
1533
 
1534
+ async function readMetadataContracts<
1535
+ chain extends Chain | undefined,
1536
+ const contracts extends readonly unknown[],
1537
+ >(
1538
+ client: Client<Transport, chain>,
1539
+ parameters: Pick<
1540
+ MulticallParameters<contracts>,
1541
+ | 'blockNumber'
1542
+ | 'blockOverrides'
1543
+ | 'blockTag'
1544
+ | 'contracts'
1545
+ | 'stateOverride'
1546
+ >,
1547
+ ): Promise<MulticallReturnType<contracts>>
1548
+ async function readMetadataContracts<chain extends Chain | undefined>(
1549
+ client: Client<Transport, chain>,
1550
+ parameters: Pick<
1551
+ MulticallParameters,
1552
+ | 'blockNumber'
1553
+ | 'blockOverrides'
1554
+ | 'blockTag'
1555
+ | 'contracts'
1556
+ | 'stateOverride'
1557
+ >,
1558
+ ): Promise<MulticallReturnType> {
1559
+ // Preserve the action's deployless default unless the client overrides it.
1560
+ if (client.batch?.multicall === undefined)
1561
+ return multicall(client, {
1562
+ ...parameters,
1563
+ allowFailure: true,
1564
+ deployless: true,
1565
+ })
1566
+
1567
+ const { contracts, ...rest } = parameters
1568
+ const results = await Promise.allSettled(
1569
+ contracts.map((contract) =>
1570
+ readContract(client, {
1571
+ ...rest,
1572
+ ...contract,
1573
+ }),
1574
+ ),
1575
+ )
1576
+ return results.map((result) =>
1577
+ result.status === 'fulfilled'
1578
+ ? { result: result.value, status: 'success' }
1579
+ : { error: result.reason, status: 'failure' },
1580
+ )
1581
+ }
1582
+
1532
1583
  function unwrapMulticallResult<result>(
1533
1584
  response:
1534
1585
  | { result: result; status: 'success' }
@@ -40,6 +40,7 @@ export const usdc = /*#__PURE__*/ defineToken({
40
40
  137: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', // polygon
41
41
  143: '0x754704Bc059F8C67012fEd69BC8A327a5aafb603', // monad
42
42
  146: '0x29219dd400f2Bf60E5a23d13Be72B486D4038894', // sonic
43
+ 196: '0xB6CEceAB302E2E4948951eE7843FC24E92933061', // xLayer
43
44
  300: '0xAe045DE5638162fa134807Cb558E15A3F5A7F853', // zksyncSepoliaTestnet
44
45
  324: '0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4', // zksync
45
46
  338: '0xEb33dc5fac03833e132593659e1dE7256aB59794', // cronosTestnet
@@ -50,11 +51,16 @@ export const usdc = /*#__PURE__*/ defineToken({
50
51
  1328: '0x4fCF1784B31630811181f670Aea7A7bEF803eaED', // seiTestnet
51
52
  1329: '0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392', // sei
52
53
  1439: '0x0C382e685bbeeFE5d3d9C29e29E341fEE8E84C5d', // injectiveTestnet
54
+ 1672: '0xC879C018dB60520F4355C26eD1a6D572cdAC1815', // pharos
53
55
  1776: '0xa00C59fF5a080D2b954d0c75e46E22a0c371235a', // injective
56
+ 1952: '0xDec90b78111Ba2fc6FC6d84d8B9ec159A2d4b9B3', // xLayerTestnet
54
57
  2818: '0xCfb1186F4e93D60E60a8bDd997427D1F33bc372B', // morph
58
+ 2910: '0x7433b41C6c5e1d58D4Da99483609520255ab661B', // morphHoodi
59
+ 3343: '0x98d2919b9A214E6Fa5384AC81E6864bA686Ad74c', // edge
55
60
  4801: '0x66145f38cBAC35Ca6F1Dfb4914dF98F1614aeA88', // worldchainSepolia
56
61
  8453: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // base
57
62
  10143: '0x534b2f3A21130d7a60830c2Df862319e593943A3', // monadTestnet
63
+ 33431: '0x2d9F7CAD728051AA35Ecdc472a14cf8cDF5CFD6B', // edgeTestnet
58
64
  42161: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // arbitrum
59
65
  42220: '0xcebA9300f2b948710d2653dD7B07f33A8B32118C', // celo
60
66
  43113: '0x5425890298aed601595a70AB815c96711a31Bc65', // avalancheFuji
@@ -70,6 +76,7 @@ export const usdc = /*#__PURE__*/ defineToken({
70
76
  98866: '0x222365EF19F7947e5484218551B56bb3965Aa7aF', // plumeMainnet
71
77
  98867: '0xcB5f30e335672893c7eb944B374c196392C19D18', // plumeSepolia
72
78
  421614: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // arbitrumSepolia
79
+ 688689: '0xcfC8330f4BCAB529c625D12781b1C19466A9Fc8B', // pharosTestnet
73
80
  763373: '0xFabab97dCE620294D2B0b0e46C68964e326300Ac', // inkSepolia
74
81
  812242: '0x6d7f141b6819C2c9CC2f818e6ad549E7Ca090F8f', // codexTestnet
75
82
  5042002: '0x3600000000000000000000000000000000000000', // arcTestnet
@@ -39,13 +39,13 @@ export function withRetry<data>(
39
39
  }: WithRetryParameters = {},
40
40
  ) {
41
41
  return new Promise<data>((resolve, reject) => {
42
- const attemptRetry = async ({ count = 0 } = {}) => {
42
+ const attemptRetry = async ({ count = 0 } = {}): Promise<void> => {
43
43
  if (signal?.aborted) {
44
44
  reject(getAbortError(signal))
45
45
  return
46
46
  }
47
47
 
48
- const retry = async ({ error }: { error: Error }) => {
48
+ const retry = async ({ error }: { error: Error }): Promise<void> => {
49
49
  const delay =
50
50
  typeof delay_ === 'function' ? delay_({ count, error }) : delay_
51
51
  if (delay) {
@@ -56,7 +56,7 @@ export function withRetry<data>(
56
56
  return
57
57
  }
58
58
  }
59
- attemptRetry({ count: count + 1 })
59
+ return attemptRetry({ count: count + 1 })
60
60
  }
61
61
 
62
62
  try {
@@ -79,6 +79,6 @@ export function withRetry<data>(
79
79
  reject(err)
80
80
  }
81
81
  }
82
- attemptRetry()
82
+ void attemptRetry().catch(reject)
83
83
  })
84
84
  }
@@ -6,6 +6,7 @@ import {
6
6
  InvalidDomainError,
7
7
  InvalidPrimaryTypeError,
8
8
  InvalidStructTypeError,
9
+ InvalidTypedDataTypeError,
9
10
  } from '../errors/typedData.js'
10
11
  import type { ErrorType } from '../errors/utils.js'
11
12
  import type { Hex } from '../types/misc.js'
@@ -86,6 +87,10 @@ export function validateTypedData<
86
87
  const { name, type } = param
87
88
  const value = data[name]
88
89
 
90
+ const baseType = type.replace(/(\[[0-9]*\])+$/, '')
91
+ if (baseType === 'int' || baseType === 'uint')
92
+ throw new InvalidTypedDataTypeError({ type })
93
+
89
94
  const integerMatch = type.match(integerRegex)
90
95
  if (
91
96
  integerMatch &&