@berachain/berajs 0.2.9 → 0.2.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 (182) hide show
  1. package/dist/{HoneyConfigProvider-Dkj-_a5x.d.ts → HoneyConfigProvider-COOuDNra.d.ts} +1 -1
  2. package/dist/actions/clients/exports.d.ts +77 -1
  3. package/dist/actions/clients/exports.mjs +13 -4
  4. package/dist/actions/exports.d.ts +121 -39
  5. package/dist/actions/exports.mjs +75 -34
  6. package/dist/actions/governance/exports.d.ts +3 -11
  7. package/dist/actions/governance/exports.mjs +3 -3
  8. package/dist/actions/server/exports.mjs +4 -4
  9. package/dist/{chunk-4Z4AK6SH.mjs → chunk-3JJLQ2JX.mjs} +3 -3
  10. package/dist/{chunk-EXIUPSFN.mjs → chunk-7YVNSDXG.mjs} +2 -2
  11. package/dist/{chunk-WXXOISTU.mjs → chunk-AUOPN6NK.mjs} +1 -1
  12. package/dist/{chunk-75M6TF7M.mjs → chunk-DQRH5VE3.mjs} +1 -1
  13. package/dist/{chunk-CDFWPU2R.mjs → chunk-E7YFXBBQ.mjs} +0 -124
  14. package/dist/{chunk-AFN4CVD3.mjs → chunk-GUURQAME.mjs} +1 -1
  15. package/dist/{chunk-KQUMKB66.mjs → chunk-GY6B3PD5.mjs} +1 -1
  16. package/dist/{chunk-HSSJKHZ4.mjs → chunk-HYDP32P6.mjs} +3 -3
  17. package/dist/{chunk-NPBQLVL3.mjs → chunk-IXIBY5FP.mjs} +2 -2
  18. package/dist/{chunk-J5I45WGQ.mjs → chunk-KHXJDYA4.mjs} +7 -0
  19. package/dist/chunk-MRQGHXAN.mjs +54 -0
  20. package/dist/{chunk-FFB5LFDW.mjs → chunk-QVHEM4BG.mjs} +2 -2
  21. package/dist/{chunk-3EARVV7K.mjs → chunk-SXUNCX5E.mjs} +22 -9
  22. package/dist/chunk-UD5IUNCW.mjs +34 -0
  23. package/dist/{chunk-QJIXTYTZ.mjs → chunk-VAA2FVPP.mjs} +162 -41
  24. package/dist/chunk-Y6THHG77.mjs +126 -0
  25. package/dist/{chunk-XIYN6AL6.mjs → chunk-ZLTMIFCZ.mjs} +10 -5
  26. package/dist/contexts/exports.d.ts +2 -2
  27. package/dist/contexts/exports.mjs +11 -9
  28. package/dist/enum/exports.d.ts +8 -2
  29. package/dist/errors/exports.mjs +5 -5
  30. package/dist/getProposalVotes-DAUrdX2n.d.ts +12 -0
  31. package/dist/{getValidatorQueuedOperatorAddress-Dw5KN5sh.d.ts → getValidatorQueuedOperatorAddress-Cxt-DlL_.d.ts} +2 -2
  32. package/dist/{global.d-BuGDKh4k.d.ts → global.d-q_LQWQqs.d.ts} +2 -4
  33. package/dist/hooks/exports.d.ts +114 -164
  34. package/dist/hooks/exports.mjs +535 -522
  35. package/dist/hooks/governance/exports.d.ts +20 -15
  36. package/dist/hooks/governance/exports.mjs +43 -41
  37. package/dist/{pol.d-CqPA9K6m.d.ts → pol.d-CeRgXBL8.d.ts} +33 -8
  38. package/dist/types/exports.d.ts +5 -5
  39. package/dist/{useHoneySwapState-vFmuFF0g.d.ts → useHoneySwapState-twi7NTaO.d.ts} +1 -1
  40. package/dist/utils/exports.d.ts +2 -2
  41. package/dist/utils/exports.mjs +15 -9
  42. package/package.json +9 -8
  43. package/src/actions/bend/getMaxDeposit.ts +28 -2
  44. package/src/actions/clients/exports.ts +3 -0
  45. package/src/actions/clients/fetchBeep.ts +34 -0
  46. package/src/actions/clients/fetchOpenApi.ts +97 -0
  47. package/src/actions/clients/fetchOpenApi.unit.test.ts +245 -0
  48. package/src/actions/clients/fetchRailwayBackend.ts +34 -0
  49. package/src/actions/enso/getEnsoUserTokensWithBalances.ts +18 -0
  50. package/src/actions/exports.ts +2 -0
  51. package/src/actions/honey/getChartData.ts +53 -12
  52. package/src/actions/honey/getHoney24hVolume.ts +34 -6
  53. package/src/actions/honey/getHoneyTxns.ts +93 -0
  54. package/src/actions/honey/getPythLatestPrices.ts +7 -0
  55. package/src/actions/pol/__tests__/rewardVaults.integration.test.ts +1 -1
  56. package/src/actions/pol/getAutoclaimedIncentives.ts +21 -10
  57. package/src/actions/pol/getAutoclaimedIncentivesTxHash.ts +41 -0
  58. package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +5 -12
  59. package/src/actions/pol/getEarnedStakedBeraVault.ts +20 -16
  60. package/src/actions/pol/getRewardVaults.ts +4 -4
  61. package/src/actions/pol/getStakingDailyAssets.ts +18 -14
  62. package/src/actions/validators/getValidatorIncentiveDistribution.ts +64 -12
  63. package/src/actions/validators/utils/getValidatorBoostApy.ts +1 -1
  64. package/src/contexts/SwrFallback.tsx +2 -1
  65. package/src/data/contracts.ts +4 -0
  66. package/src/errors/RequestError.ts +12 -3
  67. package/src/errors/RequestError.unit.test.ts +55 -0
  68. package/src/errors/errorMap.ts +8 -0
  69. package/src/errors/getRevertReason.integration.test.ts +5 -1
  70. package/src/hooks/bend/useGetConvertToAssets.ts +2 -3
  71. package/src/hooks/dex/useAggregatorsQuotes.ts +10 -10
  72. package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +1 -1
  73. package/src/hooks/dex/useAllUserPools.ts +7 -5
  74. package/src/hooks/dex/useApiPool.ts +1 -1
  75. package/src/hooks/dex/useGlobalLiquidityAndSwapVolume.ts +1 -1
  76. package/src/hooks/dex/useOnChainPoolData.ts +1 -1
  77. package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +2 -2
  78. package/src/hooks/dex/usePoolEvents.ts +1 -2
  79. package/src/hooks/dex/usePoolHistoricalData.ts +2 -3
  80. package/src/hooks/dex/usePools.ts +4 -2
  81. package/src/hooks/dex/useSingleAggregatorQuote.ts +6 -18
  82. package/src/hooks/enso/useBendDemultiply.ts +3 -4
  83. package/src/hooks/enso/useBendMultiply.ts +3 -4
  84. package/src/hooks/enso/useBendZapSupply.ts +3 -4
  85. package/src/hooks/enso/useEnsoSwapBundle.ts +1 -1
  86. package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +3 -5
  87. package/src/hooks/enso/useEnsoWalletV2Address.ts +1 -1
  88. package/src/hooks/enso/useIsBendAuthorized.ts +1 -1
  89. package/src/hooks/enso/useZapStakeBera.ts +2 -2
  90. package/src/hooks/exports.ts +2 -0
  91. package/src/hooks/governance/useGetPastVotes.ts +1 -1
  92. package/src/hooks/governance/useHasVoted.ts +1 -1
  93. package/src/hooks/governance/useIsCanceller.ts +1 -1
  94. package/src/hooks/governance/usePollAllProposals.ts +13 -12
  95. package/src/hooks/governance/usePollProposal.ts +3 -3
  96. package/src/hooks/governance/usePollProposalThreshold.ts +1 -1
  97. package/src/hooks/governance/usePollProposalVotes.ts +23 -5
  98. package/src/hooks/governance/usePollUserDelegates.ts +3 -3
  99. package/src/hooks/governance/useProposalFromTx.ts +2 -1
  100. package/src/hooks/governance/useProposalSnapshot.ts +2 -3
  101. package/src/hooks/governance/useProposalState.ts +2 -2
  102. package/src/hooks/governance/useProposalTimelockState.ts +2 -1
  103. package/src/hooks/governance/useQuorum.ts +1 -2
  104. package/src/hooks/honey/useCappedGlobally.ts +3 -6
  105. package/src/hooks/honey/useCappedRelatively.ts +2 -2
  106. package/src/hooks/honey/useCollateralWeights.ts +3 -3
  107. package/src/hooks/honey/useHoney24hVolume.ts +1 -1
  108. package/src/hooks/honey/useHoneyBalances.ts +1 -1
  109. package/src/hooks/honey/useHoneyChartData.ts +1 -1
  110. package/src/hooks/honey/useHoneyVaultsBalance.ts +2 -3
  111. package/src/hooks/honey/useIsBadCollateralAsset.ts +4 -7
  112. package/src/hooks/honey/useIsBasketModeEnabled.ts +4 -7
  113. package/src/hooks/honey/usePythLatestPrices.ts +13 -9
  114. package/src/hooks/perps/usePythUpdateFee.ts +13 -11
  115. package/src/hooks/pol/useAutoclaimedIncentives.ts +2 -12
  116. package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +44 -0
  117. package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +39 -0
  118. package/src/hooks/pol/useBgtUnstakedBalance.ts +2 -2
  119. package/src/hooks/pol/useClaimableFees.ts +1 -1
  120. package/src/hooks/pol/useHighestVaultsAPR.ts +4 -6
  121. package/src/hooks/pol/useOnChainRewardVault.ts +77 -72
  122. package/src/hooks/pol/usePollGlobalData.ts +2 -3
  123. package/src/hooks/pol/usePollMarkets.ts +2 -2
  124. package/src/hooks/pol/useQueuedBeraUnlock.ts +2 -2
  125. package/src/hooks/pol/useRewardTokenToBeraRate.ts +2 -2
  126. package/src/hooks/pol/useRewardVault.ts +7 -6
  127. package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +4 -4
  128. package/src/hooks/pol/useRewardVaultFromToken.ts +1 -1
  129. package/src/hooks/pol/useRewardVaultIncentives.ts +1 -1
  130. package/src/hooks/pol/useRewardVaultRewards.ts +2 -2
  131. package/src/hooks/pol/useRewardVaults.ts +3 -6
  132. package/src/hooks/pol/useStakedAPR.ts +1 -2
  133. package/src/hooks/pol/useStakedData.ts +90 -41
  134. package/src/hooks/pol/useStakedSnapshots.ts +1 -1
  135. package/src/hooks/pol/useStakingVaultsMetadata.ts +1 -1
  136. package/src/hooks/pol/useTotalStakedAmount.ts +1 -2
  137. package/src/hooks/pol/useUserVaultInfo.ts +2 -2
  138. package/src/hooks/pol/useUserVaults.ts +2 -3
  139. package/src/hooks/pol/useVaultAddress.ts +1 -1
  140. package/src/hooks/pol/useVaultHistory.ts +1 -2
  141. package/src/hooks/pol/useVaultValidators.ts +2 -2
  142. package/src/hooks/tokens/useMultipleTokenInformation.ts +2 -2
  143. package/src/hooks/tokens/usePollAllowances.ts +3 -4
  144. package/src/hooks/tokens/usePollBalance.ts +2 -2
  145. package/src/hooks/tokens/usePollWalletBalances.ts +2 -2
  146. package/src/hooks/tokens/useStakingTokenInformation.ts +2 -2
  147. package/src/hooks/tokens/useTokenCurrentPrices.ts +11 -13
  148. package/src/hooks/tokens/useTokenInformation.ts +2 -2
  149. package/src/hooks/tokens/useTokenPrice.ts +2 -1
  150. package/src/hooks/tokens/useTokenPrices.ts +3 -4
  151. package/src/hooks/tokens/useTotalSupply.ts +1 -1
  152. package/src/hooks/tokens/useUnderlyingAsset.ts +1 -2
  153. package/src/hooks/useBlockToTimestamp.ts +1 -2
  154. package/src/hooks/useGetVerifiedAbi.ts +2 -1
  155. package/src/hooks/validators/useAllValidators.ts +2 -3
  156. package/src/hooks/validators/useApiEnrichedAllocation.ts +1 -1
  157. package/src/hooks/validators/useApiValidator.ts +3 -6
  158. package/src/hooks/validators/useBaselineRewardAllocation.ts +1 -2
  159. package/src/hooks/validators/useDailyValidatorBlockStats.ts +1 -1
  160. package/src/hooks/validators/useDefaultRewardAllocation.ts +2 -3
  161. package/src/hooks/validators/useManagedValidatorRole.ts +2 -2
  162. package/src/hooks/validators/useOnChainValidator.ts +3 -3
  163. package/src/hooks/validators/useStakingPoolBatch.ts +3 -4
  164. package/src/hooks/validators/useUserActiveValidators.ts +2 -3
  165. package/src/hooks/validators/useUserBoostsOnValidator.ts +1 -1
  166. package/src/hooks/validators/useUserClaimableIncentives.ts +1 -1
  167. package/src/hooks/validators/useUserStakingPositions.ts +2 -1
  168. package/src/hooks/validators/useValidator.ts +4 -8
  169. package/src/hooks/validators/useValidatorAnalytics.ts +1 -1
  170. package/src/hooks/validators/useValidatorCommission.ts +2 -2
  171. package/src/hooks/validators/useValidatorIncentiveDistribution.ts +3 -3
  172. package/src/hooks/validators/useValidatorQueuedCommission.ts +2 -2
  173. package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +2 -2
  174. package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +2 -2
  175. package/src/hooks/validators/useValidatorRewardAllocation.ts +2 -2
  176. package/src/types/bribe-boost.d.ts +14 -3
  177. package/src/types/global.d.ts +3 -4
  178. package/src/types/pol.d.ts +17 -3
  179. package/src/utils/polyfillAbortSignalAny.ts +53 -0
  180. package/src/utils/polyfillAbortSignalAny.unit.test.ts +81 -0
  181. package/dist/polling-BKnyavLI.d.ts +0 -8
  182. /package/dist/{exports-BcUTGFUb.d.ts → getApolloClient-BcUTGFUb.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import useSWR from "swr";
2
1
  import type { Address, PublicClient } from "viem";
3
2
 
4
3
  import { usePublicClient } from "@berachain/wagmi/hooks";
4
+ import { useSWR } from "@berachain/utils/pkg/swr";
5
5
 
6
6
  import { getValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
7
7
  import type { DefaultHookOptions } from "../../types/global";
@@ -25,7 +25,7 @@ export function useValidatorRewardAllocation(
25
25
  });
26
26
  },
27
27
  {
28
- ...options?.opts,
28
+ ...options,
29
29
  },
30
30
  );
31
31
 
@@ -33,11 +33,22 @@ export interface BribeBoostRewardProof {
33
33
  }
34
34
 
35
35
  // Response shape of GET /api/v1/wallets/:wallet/autoclaimed:
36
- // { [wallet]: { [validatorPubkey]: { [tokenAddress]: rawAmount (stringified bigint) } } }
37
- // Top-level wallet key is the lowercase wallet address that was queried.
36
+ // { [wallet]: { [validatorPubkey]: { [tokenAddress]: { amount } } } }
37
+ // `amount` is a stringified bigint in token base units. The backend now
38
+ // aggregates across validators under a single fake pubkey (`0x000…000`),
39
+ // so consumers can collapse the validator dimension blindly.
38
40
  export type AutoclaimedIncentivesResponse = Record<
39
41
  Address,
40
- Record<Address, Record<Address, string>>
42
+ Record<Address, Record<Address, { amount: string }>>
43
+ >;
44
+
45
+ // Response shape of GET /api/v1/wallets/:wallet/autoclaimed/txhash: same
46
+ // nesting, but each token leaf is `{ txhash }`. Tokens still pending are
47
+ // simply absent — when a token from `/autoclaimed` has no entry here, the
48
+ // bot hasn't distributed it yet.
49
+ export type AutoclaimedIncentivesTxHashResponse = Record<
50
+ Address,
51
+ Record<Address, Record<Address, { txhash: string }>>
41
52
  >;
42
53
 
43
54
  export interface BribeBoostValidatorApr {
@@ -1,5 +1,4 @@
1
1
  import type { Config, GetWalletClientReturnType } from "@wagmi/core";
2
- import type { SWRConfiguration, SWRResponse } from "swr";
3
2
  import type {
4
3
  Abi,
5
4
  Account,
@@ -13,6 +12,8 @@ import type {
13
12
 
14
13
  import type { BeraConfig, ChainId } from "@berachain/config";
15
14
 
15
+ import type { SWRConfiguration, SWRResponse } from "@berachain/utils/pkg/swr";
16
+
16
17
  import type { ContractName } from "../enum/contracts";
17
18
  import type { TransactionActionType } from "../enum/txnEnum";
18
19
  import type {
@@ -20,9 +21,7 @@ import type {
20
21
  TxnEventKeys,
21
22
  } from "../hooks/useContractWrite/types";
22
23
 
23
- export type DefaultHookOptions = {
24
- opts?: SWRConfiguration & { isEnabled?: boolean };
25
- };
24
+ export type DefaultHookOptions = SWRConfiguration & { isEnabled?: boolean };
26
25
 
27
26
  export type DefaultHookReturnType<T = any> = Omit<
28
27
  SWRResponse<T, any, any>,
@@ -55,10 +55,24 @@ export interface UserVaultInfo {
55
55
 
56
56
  export type StakedBeraAsset = {
57
57
  token: TokenWithMetadata;
58
- apr: number;
58
+ /**
59
+ * Staking APR, or `undefined` when unavailable (e.g. the APR backend is
60
+ * down). `undefined` lets the UI render a "—" placeholder instead of a
61
+ * misleading "0%".
62
+ */
63
+ apr: number | undefined;
59
64
  stakedAmount: number;
60
- stakedAmountUsd: number;
65
+ /**
66
+ * USD value of the staked amount, or `undefined` when the token price is
67
+ * unavailable (e.g. the price backend is down). `undefined` lets the UI
68
+ * render a "—" placeholder instead of a misleading "$0.00".
69
+ */
70
+ stakedAmountUsd: number | undefined;
61
71
  earnedAmount: number;
62
- earnedAmountUsd: number;
72
+ /**
73
+ * USD value of the earned amount, or `undefined` when the token price is
74
+ * unavailable. See {@link stakedAmountUsd}.
75
+ */
76
+ earnedAmountUsd: number | undefined;
63
77
  isLoadingEarnings?: boolean;
64
78
  };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Polyfill for `AbortSignal.any`.
3
+ *
4
+ * `AbortSignal.any` ships in Chrome 116+, Safari 17.4+, Firefox 124+. Older
5
+ * environments — notably Android WebViews bundled with old Chromium (e.g.
6
+ * Chrome Mobile WebView 114) — lack it, and third-party libraries that call it
7
+ * (e.g. @pythnetwork/hermes-client) throw "AbortSignal.any is not a function".
8
+ *
9
+ * This installs a spec-compatible-enough fallback: it returns a controller's
10
+ * signal that aborts as soon as any of the input signals abort (propagating the
11
+ * abort reason). It is idempotent and a no-op when the native API exists.
12
+ */
13
+ export function polyfillAbortSignalAny(): void {
14
+ if (typeof AbortSignal === "undefined") return;
15
+ if (typeof (AbortSignal as { any?: unknown }).any === "function") return;
16
+
17
+ (
18
+ AbortSignal as unknown as { any: (signals: AbortSignal[]) => AbortSignal }
19
+ ).any = (signals: AbortSignal[]): AbortSignal => {
20
+ const controller = new AbortController();
21
+
22
+ // Phase 1: if any signal is already aborted, short-circuit before attaching
23
+ // any listeners (attaching to the others would leave dangling listeners
24
+ // that never fire — the leak the WeakRef/FinalizationRegistry versions guard
25
+ // against; checking first avoids it without that machinery).
26
+ for (const signal of signals) {
27
+ if (signal.aborted) {
28
+ controller.abort(signal.reason);
29
+ return controller.signal;
30
+ }
31
+ }
32
+
33
+ // Phase 2: forward the first abort, then detach every listener so none
34
+ // outlive the combined signal. Safe for our short-lived usage (per-request
35
+ // fetch signals that settle and are collected together).
36
+ const listeners: Array<() => void> = [];
37
+ const cleanup = () => {
38
+ for (let i = 0; i < signals.length; i++) {
39
+ signals[i].removeEventListener("abort", listeners[i]);
40
+ }
41
+ };
42
+ for (const signal of signals) {
43
+ const onAbort = () => {
44
+ if (!controller.signal.aborted) controller.abort(signal.reason);
45
+ cleanup();
46
+ };
47
+ listeners.push(onAbort);
48
+ signal.addEventListener("abort", onAbort);
49
+ }
50
+
51
+ return controller.signal;
52
+ };
53
+ }
@@ -0,0 +1,81 @@
1
+ import { afterEach, describe, expect, it } from "vitest";
2
+
3
+ import { polyfillAbortSignalAny } from "./polyfillAbortSignalAny.js";
4
+
5
+ describe("polyfillAbortSignalAny", () => {
6
+ const original = (AbortSignal as { any?: unknown }).any;
7
+
8
+ afterEach(() => {
9
+ // restore whatever the runtime had (native or undefined)
10
+ (AbortSignal as { any?: unknown }).any = original;
11
+ });
12
+
13
+ it("does not overwrite a native AbortSignal.any", () => {
14
+ const native = () => new AbortController().signal;
15
+ (AbortSignal as { any?: unknown }).any = native;
16
+ polyfillAbortSignalAny();
17
+ expect((AbortSignal as { any?: unknown }).any).toBe(native);
18
+ });
19
+
20
+ it("installs a fallback when AbortSignal.any is missing", () => {
21
+ (AbortSignal as { any?: unknown }).any = undefined;
22
+ polyfillAbortSignalAny();
23
+ expect(typeof (AbortSignal as { any?: unknown }).any).toBe("function");
24
+ });
25
+
26
+ it("aborts the combined signal when one input aborts", () => {
27
+ (AbortSignal as { any?: unknown }).any = undefined;
28
+ polyfillAbortSignalAny();
29
+
30
+ const a = new AbortController();
31
+ const b = new AbortController();
32
+ const combined = (
33
+ AbortSignal as unknown as { any: (s: AbortSignal[]) => AbortSignal }
34
+ ).any([a.signal, b.signal]);
35
+
36
+ expect(combined.aborted).toBe(false);
37
+ b.abort("boom");
38
+ expect(combined.aborted).toBe(true);
39
+ expect(combined.reason).toBe("boom");
40
+ });
41
+
42
+ it("removes listeners from all inputs once the combined signal aborts", () => {
43
+ (AbortSignal as { any?: unknown }).any = undefined;
44
+ polyfillAbortSignalAny();
45
+
46
+ const a = new AbortController();
47
+ const b = new AbortController();
48
+ const removed: AbortSignal[] = [];
49
+ for (const c of [a, b]) {
50
+ const orig = c.signal.removeEventListener.bind(c.signal);
51
+ c.signal.removeEventListener = ((...args: Parameters<typeof orig>) => {
52
+ removed.push(c.signal);
53
+ return orig(...args);
54
+ }) as typeof orig;
55
+ }
56
+
57
+ (AbortSignal as unknown as { any: (s: AbortSignal[]) => AbortSignal }).any([
58
+ a.signal,
59
+ b.signal,
60
+ ]);
61
+
62
+ a.abort("x");
63
+ // both inputs should have had their abort listener detached, not just the firing one
64
+ expect(removed).toContain(a.signal);
65
+ expect(removed).toContain(b.signal);
66
+ });
67
+
68
+ it("is already aborted if an input is already aborted", () => {
69
+ (AbortSignal as { any?: unknown }).any = undefined;
70
+ polyfillAbortSignalAny();
71
+
72
+ const a = new AbortController();
73
+ a.abort("early");
74
+ const combined = (
75
+ AbortSignal as unknown as { any: (s: AbortSignal[]) => AbortSignal }
76
+ ).any([a.signal]);
77
+
78
+ expect(combined.aborted).toBe(true);
79
+ expect(combined.reason).toBe("early");
80
+ });
81
+ });
@@ -1,8 +0,0 @@
1
- declare enum POLLING {
2
- FAST = 10000,// 10 sec
3
- NORMAL = 100000,// 100 sec
4
- SLOW = 180000,// 3 min
5
- REFRESH_BLOCK_INTERVAL = 10000
6
- }
7
-
8
- export { POLLING as P };