@orderly.network/wallet-connector-privy 2.6.0 → 2.6.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.
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import * as viemExport from 'viem';
3
3
  import { defineChain } from 'viem';
4
4
  import { mainnet, abstract, abstractTestnet } from 'viem/chains';
5
5
  import { useWalletConnector, useAccount, useSWR, fetcher, WalletConnectorContext, useTrack, useStorageLedgerAddress, useLocalStorage, useStorageChain } from '@orderly.network/hooks';
6
- import { SOLANA_TESTNET_CHAINID, SOLANA_MAINNET_CHAINID, ChainNamespace, ABSTRACT_CHAIN_ID_MAP, AccountStatusEnum, ABSTRACT_TESTNET_CHAINID, ABSTRACT_MAINNET_CHAINID, SolanaChains as SolanaChains$1, AbstractChains, AbstractTestnetChainInfo, ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo, EMPTY_OBJECT, TrackerEventName, ConnectorKey } from '@orderly.network/types';
6
+ import { SOLANA_TESTNET_CHAINID, SOLANA_MAINNET_CHAINID, ChainNamespace, TesntTokenFallback, ArbitrumSepoliaTokenInfo, SolanaDevnetTokenInfo, ABSTRACT_CHAIN_ID_MAP, AccountStatusEnum, ABSTRACT_TESTNET_CHAINID, ABSTRACT_MAINNET_CHAINID, SolanaChains as SolanaChains$1, AbstractChains, ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo, AbstractTestnetChainInfo, EMPTY_OBJECT, TrackerEventName, ConnectorKey } from '@orderly.network/types';
7
7
  import { modal, useModal, SimpleSheet, SheetHeader, Text, Flex, Divider, cn, installExtension, ExtensionPositionEnum, useScreen, formatAddress, Button, SimpleDialog, TooltipProvider, CloseIcon, ScrollArea, ExclamationFillIcon, Tooltip, CopyIcon, Checkbox, toast, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, DropdownMenuItem, ChevronDownIcon, ChevronUpIcon, Grid, ChainIcon, Popover } from '@orderly.network/ui';
8
8
  import { useTranslation, Trans } from '@orderly.network/i18n';
9
9
  import { AbstractWalletProvider as AbstractWalletProvider$1, useLoginWithAbstract, useAbstractClient, useGlobalWalletSignerAccount } from '@abstract-foundation/agw-react';
@@ -3078,6 +3078,11 @@ var commonSwrOpts = {
3078
3078
  // don't duplicate a request with the same key for 1hr
3079
3079
  dedupingInterval: 36e5
3080
3080
  };
3081
+ var testnetTokenFallback = TesntTokenFallback([
3082
+ ArbitrumSepoliaTokenInfo,
3083
+ SolanaDevnetTokenInfo
3084
+ ]);
3085
+ var testnetChainFallback = [ArbitrumSepoliaChainInfo, SolanaDevnetChainInfo];
3081
3086
  var formatSwapChainInfo = (data = {}) => {
3082
3087
  return Object.keys(data).map((key) => {
3083
3088
  const chain = data[key];
@@ -3214,12 +3219,18 @@ function WalletConnectorPrivyProvider(props) {
3214
3219
  const { data: mainnetChainInfos } = useSWR(
3215
3220
  !props.customChains ? "https://api.orderly.org/v1/public/chain_info" : null,
3216
3221
  fetcher,
3217
- commonSwrOpts
3222
+ {
3223
+ ...commonSwrOpts,
3224
+ fallbackData: testnetTokenFallback
3225
+ }
3218
3226
  );
3219
3227
  const { data: testChainInfos } = useSWR(
3220
3228
  !props.customChains ? "https://testnet-api.orderly.org/v1/public/chain_info" : null,
3221
3229
  fetcher,
3222
- commonSwrOpts
3230
+ {
3231
+ ...commonSwrOpts,
3232
+ fallbackData: testnetChainFallback
3233
+ }
3223
3234
  );
3224
3235
  const handleCustomerChains = () => {
3225
3236
  const testChains = processChainInfo(