@skip-go/widget 1.2.1-alpha.2 → 1.2.1-alpha.4

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/build/index.es.js CHANGED
@@ -1,11 +1,18 @@
1
- import { Buffer } from 'buffer';
2
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { Buffer } from 'buffer';
3
3
  import { ChainProvider, useManager, useWalletClient, useWallet as useWallet$1 } from '@cosmos-kit/react';
4
+ import { wallets as wallets$2 } from '@cosmos-kit/cosmostation-extension';
5
+ import { wallets as wallets$1 } from '@cosmos-kit/keplr-extension';
6
+ import { wallets as wallets$3 } from '@cosmos-kit/leap-extension';
7
+ import { wallets as wallets$4 } from '@cosmos-kit/okxwallet';
8
+ import { wallets as wallets$5 } from '@cosmos-kit/station';
9
+ import { wallets as wallets$6 } from '@cosmos-kit/vectis';
4
10
  import { createConfig, WagmiProvider, useAccount as useAccount$1, useDisconnect, useConnect, useSwitchChain } from 'wagmi';
5
11
  import { defineChain, http, createPublicClient, erc20Abi, formatUnits, isAddress } from 'viem';
6
12
  import { arbitrum, avalanche, base, bsc, celo, fantom, filecoin, kava, linea, mainnet, manta, moonbeam, optimism, polygon, polygonMumbai, sepolia, avalancheFuji, baseSepolia, optimismSepolia, arbitrumSepolia, blast, blastSepolia, opBNB } from 'wagmi/chains';
7
13
  import { QueryClient, QueryClientProvider, useQuery, useMutation } from '@tanstack/react-query';
8
14
  import { WalletProvider as WalletProvider$1, useWallet } from '@solana/wallet-adapter-react';
15
+ import { PhantomWalletAdapter, SolflareWalletAdapter, CoinbaseWalletAdapter, TrustWalletAdapter, LedgerWalletAdapter } from '@solana/wallet-adapter-wallets';
9
16
  import { SkipRouter } from '@skip-go/core';
10
17
  import { getWalletClient } from '@wagmi/core';
11
18
  import { createContext, useContext, useMemo, useCallback, useRef, useState, useEffect, forwardRef, Fragment as Fragment$1 } from 'react';
@@ -63,21 +70,17 @@ function getAssetLists() {
63
70
  }));
64
71
  }
65
72
 
66
- const { wallets: keplr } = await import('@cosmos-kit/keplr-extension');
67
- const { wallets: leap } = await import('@cosmos-kit/leap-extension');
68
- const { wallets: cosmostation } = await import('@cosmos-kit/cosmostation-extension');
69
- const { wallets: okxwallet } = await import('@cosmos-kit/okxwallet');
70
- const { wallets: station } = await import('@cosmos-kit/station');
71
- const { wallets: vectis } = await import('@cosmos-kit/vectis');
73
+ globalThis.Buffer = Buffer;
72
74
  const wallets = [
73
- ...keplr,
74
- ...cosmostation,
75
- ...leap,
76
- ...okxwallet,
77
- ...station,
78
- ...vectis,
75
+ ...wallets$1,
76
+ ...wallets$2,
77
+ ...wallets$3,
78
+ ...wallets$4,
79
+ ...wallets$5,
80
+ ...wallets$6,
79
81
  ];
80
82
 
83
+ globalThis.Buffer = Buffer;
81
84
  const CosmosProvider = ({ children }) => {
82
85
  const chains = getChains();
83
86
  const assets = getAssetLists();
@@ -198,7 +201,7 @@ const EVMProvider = ({ children }) => {
198
201
  return (jsx(WagmiProvider, { config: config, reconnectOnMount: true, children: jsx(QueryClientProvider, { client: queryClient, children: children }, 'skip-widget') }, 'skip-widget-wagmi-provider'));
199
202
  };
200
203
 
201
- const { CoinbaseWalletAdapter, LedgerWalletAdapter, PhantomWalletAdapter, SolflareWalletAdapter, TrustWalletAdapter, } = await import('@solana/wallet-adapter-wallets');
204
+ globalThis.Buffer = Buffer;
202
205
  const solanaWallets = [
203
206
  new PhantomWalletAdapter(),
204
207
  new SolflareWalletAdapter(),
@@ -308,6 +311,7 @@ function isReadyToCheckLedger(walletClient) {
308
311
  return false;
309
312
  }
310
313
 
314
+ globalThis.Buffer = Buffer;
311
315
  const SkipContext = createContext(undefined);
312
316
  function SkipProvider({ children, apiURL, endpointOptions, }) {
313
317
  const { getWalletRepo } = useManager();
@@ -728,6 +732,7 @@ function isMobile() {
728
732
  !!window.navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u));
729
733
  }
730
734
 
735
+ globalThis.Buffer = Buffer;
731
736
  const useStore = create(() => ({}));
732
737
  function useTotalWallets() {
733
738
  return useStore((state) => Object.keys(state).length);
@@ -781,6 +786,7 @@ const EvmWalletListItem = ({ children, walletName, ...props }) => {
781
786
  return jsx("div", { ...props, children: children });
782
787
  };
783
788
 
789
+ globalThis.Buffer = Buffer;
784
790
  const useMakeWallets = () => {
785
791
  const { data: chains } = useChains();
786
792
  const getChain = (_chainID) => chains === null || chains === void 0 ? void 0 : chains.find((chain) => chain.chainID === _chainID);
@@ -1161,6 +1167,7 @@ function useAnyDisclosureOpen() {
1161
1167
  return disclosureStore((state) => Object.values(state).some(Boolean));
1162
1168
  }
1163
1169
 
1170
+ globalThis.Buffer = Buffer;
1164
1171
  function useAccount(chainID) {
1165
1172
  const { data: chain } = useChainByID(chainID);
1166
1173
  const trackedWallet = useTrackWallet(chain === null || chain === void 0 ? void 0 : chain.chainType);
@@ -1866,6 +1873,7 @@ function parseAmountWei(amount, decimals = 6) {
1866
1873
  }
1867
1874
  }
1868
1875
 
1876
+ globalThis.Buffer = Buffer;
1869
1877
  const PRICE_IMPACT_THRESHOLD = 0.1;
1870
1878
  function useSwapWidget() {
1871
1879
  /**
@@ -5198,7 +5206,5 @@ const initializeSwapWidget = () => {
5198
5206
  }
5199
5207
  };
5200
5208
 
5201
- globalThis.Buffer = Buffer;
5202
-
5203
5209
  export { SwapWidget, SwapWidgetProvider, initializeSwapWidget, useAssets, useChainByID, useChains };
5204
5210
  //# sourceMappingURL=index.es.js.map