Merge pull request #157 from steveluscher/use-solana-wallet-adapter
Use `@solana/wallet-adapter-react` for compatibility with Mobile Wallet Adapter and the Wallet Standard
This commit is contained in:
commit
46048aab7b
|
@ -1,6 +1,13 @@
|
|||
const CracoLessPlugin = require('craco-less');
|
||||
|
||||
module.exports = {
|
||||
babel: {
|
||||
plugins: [
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-transform-shorthand-properties',
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
plugin: CracoLessPlugin,
|
||||
|
|
15
package.json
15
package.json
|
@ -14,7 +14,14 @@
|
|||
"@project-serum/sol-wallet-adapter": "^0.2.0",
|
||||
"@solana/spl-name-service": "^0.1.2",
|
||||
"@solana/spl-token": "^0.1.6",
|
||||
"@solana/web3.js": "^1.22.0",
|
||||
"@solana/wallet-adapter-ledger": "^0.9.20",
|
||||
"@solana/wallet-adapter-mathwallet": "^0.9.13",
|
||||
"@solana/wallet-adapter-phantom": "^0.9.17",
|
||||
"@solana/wallet-adapter-react": "^0.15.21-rc.3",
|
||||
"@solana/wallet-adapter-solflare": "^0.6.18",
|
||||
"@solana/wallet-adapter-sollet": "^0.11.12",
|
||||
"@solana/wallet-adapter-solong": "^0.9.13",
|
||||
"@solana/web3.js": "^1.66.2",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
|
@ -83,8 +90,10 @@
|
|||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ledgerhq__hw-transport": "^4.21.3",
|
||||
"@types/ledgerhq__hw-transport-webusb": "^4.70.1",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
||||
"@babel/plugin-transform-shorthand-properties": "^7.18.6",
|
||||
"@solana/wallet-adapter-base": "^0.9.18",
|
||||
"gh-pages": "^3.1.0",
|
||||
"git-format-staged": "^2.1.0",
|
||||
"husky": "^4.2.5",
|
||||
|
|
52
src/App.tsx
52
src/App.tsx
|
@ -1,13 +1,49 @@
|
|||
import React, { Suspense } from 'react';
|
||||
import React, { Suspense, useMemo } from 'react';
|
||||
import './App.less';
|
||||
import { ConnectionProvider } from './utils/connection';
|
||||
import { WalletProvider } from './utils/wallet';
|
||||
import { ConnectionProvider, useConnectionConfig } from './utils/connection';
|
||||
import { WalletProvider } from '@solana/wallet-adapter-react';
|
||||
import { GlobalStyle } from './global_style';
|
||||
import { Spin } from 'antd';
|
||||
import ErrorBoundary from './components/ErrorBoundary';
|
||||
import { Routes } from './routes';
|
||||
import { PreferencesProvider } from './utils/preferences';
|
||||
import { ReferrerProvider } from './utils/referrer';
|
||||
import { PhantomWalletAdapter } from '@solana/wallet-adapter-phantom';
|
||||
import { LedgerWalletAdapter } from '@solana/wallet-adapter-ledger';
|
||||
import {
|
||||
SolletExtensionWalletAdapter,
|
||||
SolletWalletAdapter,
|
||||
} from '@solana/wallet-adapter-sollet';
|
||||
import { SolflareWalletAdapter } from '@solana/wallet-adapter-solflare';
|
||||
import { MathWalletAdapter } from '@solana/wallet-adapter-mathwallet';
|
||||
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
|
||||
|
||||
function AppImpl() {
|
||||
const { endpoint } = useConnectionConfig();
|
||||
const network = useMemo(() => endpoint as WalletAdapterNetwork, [endpoint]);
|
||||
const wallets = useMemo(
|
||||
() => [
|
||||
new SolletWalletAdapter({ network }),
|
||||
new SolletExtensionWalletAdapter({ network }),
|
||||
new LedgerWalletAdapter(),
|
||||
new SolflareWalletAdapter({ network }),
|
||||
new PhantomWalletAdapter(),
|
||||
new MathWalletAdapter(),
|
||||
],
|
||||
[network],
|
||||
);
|
||||
return (
|
||||
<ReferrerProvider>
|
||||
<WalletProvider autoConnect wallets={wallets}>
|
||||
<PreferencesProvider>
|
||||
<Suspense fallback={() => <Spin size="large" />}>
|
||||
<Routes />
|
||||
</Suspense>
|
||||
</PreferencesProvider>
|
||||
</WalletProvider>
|
||||
</ReferrerProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
|
@ -15,15 +51,7 @@ export default function App() {
|
|||
<GlobalStyle />
|
||||
<ErrorBoundary>
|
||||
<ConnectionProvider>
|
||||
<ReferrerProvider>
|
||||
<WalletProvider>
|
||||
<PreferencesProvider>
|
||||
<Suspense fallback={() => <Spin size="large" />}>
|
||||
<Routes />
|
||||
</Suspense>
|
||||
</PreferencesProvider>
|
||||
</WalletProvider>
|
||||
</ReferrerProvider>
|
||||
<AppImpl />
|
||||
</ConnectionProvider>
|
||||
</ErrorBoundary>
|
||||
</Suspense>
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
useTokenAccounts,
|
||||
} from '../utils/markets';
|
||||
import { notify } from '../utils/notifications';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet, Wallet } from '@solana/wallet-adapter-react';
|
||||
import { useConnection, useSendConnection } from '../utils/connection';
|
||||
import { placeOrder } from '../utils/send';
|
||||
import { floorToDecimal, getDecimalCount } from '../utils/utils';
|
||||
|
@ -24,7 +24,7 @@ import FloatingElement from './layout/FloatingElement';
|
|||
import WalletConnect from './WalletConnect';
|
||||
import { SwapOutlined } from '@ant-design/icons';
|
||||
import { CustomMarketInfo } from '../utils/types';
|
||||
import { WalletAdapter } from '../wallet-adapters';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
|
||||
const { Option } = Select;
|
||||
const { Title } = Typography;
|
||||
|
@ -103,7 +103,7 @@ export default function ConvertForm() {
|
|||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{tokenConvertMap && connected && (
|
||||
{tokenConvertMap && wallet && connected && (
|
||||
<>
|
||||
<Row style={{ marginBottom: 8 }}>
|
||||
<Col>
|
||||
|
@ -174,7 +174,7 @@ function ConvertFormSubmit({
|
|||
setSize: (newSize: number | undefined) => void;
|
||||
fromToken: string;
|
||||
toToken: string;
|
||||
wallet?: WalletAdapter;
|
||||
wallet?: Wallet;
|
||||
customMarkets: CustomMarketInfo[];
|
||||
}) {
|
||||
const { market } = useMarket();
|
||||
|
@ -283,7 +283,7 @@ function ConvertFormSubmit({
|
|||
orderType: 'ioc',
|
||||
market,
|
||||
connection: sendConnection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
baseCurrencyAccount: baseCurrencyAccount?.pubkey,
|
||||
quoteCurrencyAccount: quoteCurrencyAccount?.pubkey,
|
||||
feeDiscountPubkey: feeDiscountKey,
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
useMarket,
|
||||
useSelectedQuoteCurrencyAccount,
|
||||
} from '../utils/markets';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import Link from './Link';
|
||||
|
||||
export default function DepositDialog({ onClose, baseOrQuote }) {
|
||||
|
|
|
@ -33,9 +33,10 @@ export default function DeprecatedMarketsInstructions({ switchToLiveMarkets }) {
|
|||
Migrate new markets
|
||||
</Title>
|
||||
<Typography>
|
||||
Markets on older versions of the DEX or using Wrapped USDT are now deprecated. To migrate over
|
||||
to the new markets, please cancel your orders and settle your funds on old markets. To convert
|
||||
from Wrapped USDT to Native USDT use sollet.io.
|
||||
Markets on older versions of the DEX or using Wrapped USDT are now
|
||||
deprecated. To migrate over to the new markets, please cancel your
|
||||
orders and settle your funds on old markets. To convert from Wrapped
|
||||
USDT to Native USDT use sollet.io.
|
||||
</Typography>
|
||||
<div style={{ marginTop: 20, display: 'flex', justifyContent: 'center' }}>
|
||||
<Button onClick={() => refresh(true)}>
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
useTokenAccounts,
|
||||
} from '../utils/markets';
|
||||
import DepositDialog from './DepositDialog';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import Link from './Link';
|
||||
import { settleFunds } from '../utils/send';
|
||||
import { useSendConnection } from '../utils/connection';
|
||||
|
@ -24,6 +24,7 @@ import { useInterval } from '../utils/useInterval';
|
|||
import { useLocalStorageState } from '../utils/utils';
|
||||
import { AUTO_SETTLE_DISABLED_OVERRIDE } from '../utils/preferences';
|
||||
import { useReferrer } from '../utils/referrer';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
|
||||
const RowBox = styled(Row)`
|
||||
padding-bottom: 20px;
|
||||
|
@ -45,7 +46,7 @@ export default function StandaloneBalancesDisplay() {
|
|||
const balances = useBalances();
|
||||
const openOrdersAccount = useSelectedOpenOrdersAccount(true);
|
||||
const connection = useSendConnection();
|
||||
const { providerUrl, providerName, wallet, connected } = useWallet();
|
||||
const { wallet, connected } = useWallet();
|
||||
const [baseOrQuote, setBaseOrQuote] = useState('');
|
||||
const baseCurrencyAccount = useSelectedBaseCurrencyAccount();
|
||||
const quoteCurrencyAccount = useSelectedQuoteCurrencyAccount();
|
||||
|
@ -105,7 +106,7 @@ export default function StandaloneBalancesDisplay() {
|
|||
market,
|
||||
openOrders: openOrdersAccount,
|
||||
connection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
baseCurrencyAccount,
|
||||
quoteCurrencyAccount,
|
||||
usdcRef,
|
||||
|
@ -149,7 +150,7 @@ export default function StandaloneBalancesDisplay() {
|
|||
market,
|
||||
openOrders: openOrdersAccount,
|
||||
connection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
baseCurrencyAccount,
|
||||
quoteCurrencyAccount,
|
||||
usdcRef,
|
||||
|
@ -161,7 +162,10 @@ export default function StandaloneBalancesDisplay() {
|
|||
}
|
||||
console.log('Finished settling funds.');
|
||||
};
|
||||
connected && wallet?.autoApprove && autoSettleEnabled && autoSettle();
|
||||
connected &&
|
||||
(wallet?.adapter as any).autoApprove &&
|
||||
autoSettleEnabled &&
|
||||
autoSettle();
|
||||
}, 1000);
|
||||
|
||||
const formattedBalances: [
|
||||
|
@ -247,8 +251,8 @@ export default function StandaloneBalancesDisplay() {
|
|||
</RowBox>
|
||||
<Tip>
|
||||
All deposits go to your{' '}
|
||||
<Link external to={providerUrl}>
|
||||
{providerName}
|
||||
<Link external to={wallet?.adapter.url}>
|
||||
{wallet?.adapter.name}
|
||||
</Link>{' '}
|
||||
wallet
|
||||
</Tip>
|
||||
|
|
|
@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
import logo from '../assets/logo.svg';
|
||||
import styled from 'styled-components';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { ENDPOINTS, useConnectionConfig } from '../utils/connection';
|
||||
import Settings from './Settings';
|
||||
import CustomClusterEndpointDialog from './CustomClusterEndpointDialog';
|
||||
|
@ -40,7 +40,8 @@ const LogoWrapper = styled.div`
|
|||
`;
|
||||
|
||||
const EXTERNAL_LINKS = {
|
||||
'/learn': 'https://docs.projectserum.com/trade-on-serum-dex/trade-on-serum-dex-1',
|
||||
'/learn':
|
||||
'https://docs.projectserum.com/trade-on-serum-dex/trade-on-serum-dex-1',
|
||||
'/add-market': 'https://serum-academy.com/en/add-market/',
|
||||
'/wallet-support': 'https://serum-academy.com/en/wallet-support',
|
||||
'/dex-list': 'https://serum-academy.com/en/dex-list/',
|
||||
|
@ -309,7 +310,9 @@ export default function TopBar() {
|
|||
{connected && (
|
||||
<div>
|
||||
<Popover
|
||||
content={<Settings autoApprove={wallet?.autoApprove} />}
|
||||
content={
|
||||
<Settings autoApprove={(wallet?.adapter as any).autoApprove} />
|
||||
}
|
||||
placement="bottomRight"
|
||||
title="Settings"
|
||||
trigger="click"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Button, Input, Radio, Slider, Switch} from 'antd';
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import { Button, Input, Radio, Slider, Switch } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import {
|
||||
useFeeDiscountKeys,
|
||||
|
@ -12,14 +12,19 @@ import {
|
|||
useSelectedQuoteCurrencyAccount,
|
||||
useSelectedQuoteCurrencyBalances,
|
||||
} from '../utils/markets';
|
||||
import {useWallet} from '../utils/wallet';
|
||||
import {notify} from '../utils/notifications';
|
||||
import {floorToDecimal, getDecimalCount, roundToDecimal,} from '../utils/utils';
|
||||
import {useSendConnection} from '../utils/connection';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { notify } from '../utils/notifications';
|
||||
import {
|
||||
floorToDecimal,
|
||||
getDecimalCount,
|
||||
roundToDecimal,
|
||||
} from '../utils/utils';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
import { useSendConnection } from '../utils/connection';
|
||||
import FloatingElement from './layout/FloatingElement';
|
||||
import {getUnixTs, placeOrder} from '../utils/send';
|
||||
import {SwitchChangeEventHandler} from 'antd/es/switch';
|
||||
import {refreshCache} from '../utils/fetch-loop';
|
||||
import { getUnixTs, placeOrder } from '../utils/send';
|
||||
import { SwitchChangeEventHandler } from 'antd/es/switch';
|
||||
import { refreshCache } from '../utils/fetch-loop';
|
||||
import tuple from 'immutable-tuple';
|
||||
|
||||
const SellButton = styled(Button)`
|
||||
|
@ -58,7 +63,7 @@ export default function TradeForm({
|
|||
const baseCurrencyAccount = useSelectedBaseCurrencyAccount();
|
||||
const quoteCurrencyAccount = useSelectedQuoteCurrencyAccount();
|
||||
const openOrdersAccount = useSelectedOpenOrdersAccount(true);
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const sendConnection = useSendConnection();
|
||||
const markPrice = useMarkPrice();
|
||||
useFeeDiscountKeys();
|
||||
|
@ -85,8 +90,6 @@ export default function TradeForm({
|
|||
market?.minOrderSize && getDecimalCount(market.minOrderSize);
|
||||
let priceDecimalCount = market?.tickSize && getDecimalCount(market.tickSize);
|
||||
|
||||
const publicKey = wallet?.publicKey;
|
||||
|
||||
useEffect(() => {
|
||||
setChangeOrderRef && setChangeOrderRef(doChangeOrder);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
@ -105,7 +108,7 @@ export default function TradeForm({
|
|||
useEffect(() => {
|
||||
const warmUpCache = async () => {
|
||||
try {
|
||||
if (!wallet || !publicKey || !market) {
|
||||
if (!publicKey || !market) {
|
||||
console.log(`Skipping refreshing accounts`);
|
||||
return;
|
||||
}
|
||||
|
@ -126,7 +129,7 @@ export default function TradeForm({
|
|||
warmUpCache();
|
||||
const id = setInterval(warmUpCache, 30_000);
|
||||
return () => clearInterval(id);
|
||||
}, [market, sendConnection, wallet, publicKey]);
|
||||
}, [market, sendConnection, publicKey]);
|
||||
|
||||
const onSetBaseSize = (baseSize: number | undefined) => {
|
||||
setBaseSize(baseSize);
|
||||
|
@ -252,7 +255,7 @@ export default function TradeForm({
|
|||
orderType: ioc ? 'ioc' : postOnly ? 'postOnly' : 'limit',
|
||||
market,
|
||||
connection: sendConnection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
baseCurrencyAccount: baseCurrencyAccount?.pubkey,
|
||||
quoteCurrencyAccount: quoteCurrencyAccount?.pubkey,
|
||||
feeDiscountPubkey: feeDiscountKey,
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
} from '../../utils/markets';
|
||||
import DataTable from '../layout/DataTable';
|
||||
import { useSendConnection } from '../../utils/connection';
|
||||
import { useWallet } from '../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { settleFunds } from '../../utils/send';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { useReferrer } from '../../utils/referrer';
|
||||
|
|
|
@ -4,11 +4,12 @@ import DataTable from '../layout/DataTable';
|
|||
import styled from 'styled-components';
|
||||
import { Button, Col, Row, Tag } from 'antd';
|
||||
import { cancelOrder } from '../../utils/send';
|
||||
import { useWallet } from '../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { useSendConnection } from '../../utils/connection';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { DeleteOutlined } from '@ant-design/icons';
|
||||
import { OrderWithMarketAndMarketName } from '../../utils/types';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
|
||||
const CancelButton = styled(Button)`
|
||||
color: #f23b69;
|
||||
|
@ -44,7 +45,7 @@ export default function OpenOrderTable({
|
|||
order,
|
||||
market: order.market,
|
||||
connection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
});
|
||||
} catch (e) {
|
||||
notify({
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Button, Row } from 'antd';
|
|||
import { settleAllFunds } from '../../utils/send';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { useConnection } from '../../utils/connection';
|
||||
import { useWallet } from '../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import {
|
||||
useAllMarkets,
|
||||
useSelectedTokenAccounts,
|
||||
|
@ -13,6 +13,7 @@ import {
|
|||
import StandaloneTokenAccountsSelect from '../StandaloneTokenAccountSelect';
|
||||
import { abbreviateAddress } from '../../utils/utils';
|
||||
import { PublicKey } from '@solana/web3.js';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
|
||||
export default function WalletBalancesTable({
|
||||
walletBalances,
|
||||
|
@ -64,7 +65,7 @@ export default function WalletBalancesTable({
|
|||
connection,
|
||||
tokenAccounts,
|
||||
selectedTokenAccounts,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
markets: allMarkets.map((marketInfo) => marketInfo.market),
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
|
@ -1,24 +1,94 @@
|
|||
import React from 'react';
|
||||
import { Dropdown, Menu } from 'antd';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { Button, Dropdown, Menu, Modal } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import LinkAddress from './LinkAddress';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
|
||||
export default function WalletConnect() {
|
||||
const { connected, wallet, select, connect, disconnect } = useWallet();
|
||||
const publicKey = (connected && wallet?.publicKey?.toBase58()) || '';
|
||||
const {
|
||||
connected,
|
||||
publicKey,
|
||||
connect,
|
||||
disconnect,
|
||||
select,
|
||||
wallet,
|
||||
wallets,
|
||||
} = useWallet();
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
const publicKeyString = publicKey?.toBase58() || '';
|
||||
|
||||
const menu = (
|
||||
<Menu>
|
||||
{connected && <LinkAddress shorten={true} address={publicKey} />}
|
||||
<Menu.Item key="3" onClick={select}>
|
||||
{connected && <LinkAddress shorten={true} address={publicKeyString} />}
|
||||
<Menu.Item
|
||||
key="3"
|
||||
onClick={() => {
|
||||
setIsModalVisible((v) => !v);
|
||||
}}
|
||||
>
|
||||
Change Wallet
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
return (
|
||||
<Dropdown.Button onClick={connected ? disconnect : connect} overlay={menu}>
|
||||
{connected ? 'Disconnect' : 'Connect'}
|
||||
</Dropdown.Button>
|
||||
<>
|
||||
<Dropdown.Button
|
||||
onClick={
|
||||
wallet
|
||||
? connected
|
||||
? disconnect
|
||||
: connect
|
||||
: () => {
|
||||
setIsModalVisible(true);
|
||||
}
|
||||
}
|
||||
overlay={menu}
|
||||
>
|
||||
{connected ? 'Disconnect' : 'Connect'}
|
||||
</Dropdown.Button>
|
||||
<Modal
|
||||
title="Select Wallet"
|
||||
okText="Connect"
|
||||
visible={isModalVisible}
|
||||
okButtonProps={{ style: { display: 'none' } }}
|
||||
onCancel={() => {
|
||||
setIsModalVisible(false);
|
||||
}}
|
||||
width={400}
|
||||
>
|
||||
{wallets.map(({ adapter }) => {
|
||||
const onClick = function () {
|
||||
select(adapter.name);
|
||||
setIsModalVisible(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Button
|
||||
size="large"
|
||||
type={adapter.name === wallet?.adapter.name ? 'primary' : 'ghost'}
|
||||
onClick={onClick}
|
||||
icon={
|
||||
<img
|
||||
alt={`${adapter.name}`}
|
||||
width={20}
|
||||
height={20}
|
||||
src={adapter.icon}
|
||||
style={{ marginRight: 8 }}
|
||||
/>
|
||||
}
|
||||
style={{
|
||||
display: 'block',
|
||||
width: '100%',
|
||||
textAlign: 'left',
|
||||
marginBottom: 8,
|
||||
}}
|
||||
>
|
||||
{adapter.name}
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { MARKETS } from '@project-serum/serum';
|
|||
import { useConnection } from '../utils/connection';
|
||||
import FloatingElement from '../components/layout/FloatingElement';
|
||||
import styled from 'styled-components';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { listMarket } from '../utils/send';
|
||||
import { useMintInput } from '../components/useMintInput';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
import OpenOrderTable from '../components/UserInfoTable/OpenOrderTable';
|
||||
import { Button, Row } from 'antd';
|
||||
import { OrderWithMarketAndMarketName } from '../utils/types';
|
||||
import { useWallet } from '../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import WalletConnect from '../components/WalletConnect';
|
||||
|
||||
export default function OpenOrdersPage() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import { nanoid } from 'nanoid';
|
|||
import { TVChartContainer } from '../components/TradingView';
|
||||
// Use following stub for quick setup without the TradingView private dependency
|
||||
// function TVChartContainer() {
|
||||
// return <></>
|
||||
// return <></>;
|
||||
// }
|
||||
|
||||
const { Option, OptGroup } = Select;
|
||||
|
|
|
@ -12,7 +12,8 @@ import { PublicKey } from '@solana/web3.js';
|
|||
import { useConnection } from '../../utils/connection';
|
||||
import FloatingElement from '../../components/layout/FloatingElement';
|
||||
import styled from 'styled-components';
|
||||
import { useWallet } from '../../utils/wallet';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { sendSignedTransaction, signTransactions } from '../../utils/send';
|
||||
import { useMintInput } from '../../components/useMintInput';
|
||||
import { PoolTransactions } from '@project-serum/pool';
|
||||
|
@ -53,7 +54,7 @@ const PROGRAM_ID_OPTIONS = [
|
|||
|
||||
export default function NewPoolPage() {
|
||||
const connection = useConnection();
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const [poolName, setPoolName] = useState('');
|
||||
const [programId, setProgramId] = useState(DEFAULT_PROGRAM_ID);
|
||||
const [initialSupply, setInitialSupply] = useState('1');
|
||||
|
@ -76,10 +77,10 @@ export default function NewPoolPage() {
|
|||
}, [programId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (connected && wallet) {
|
||||
setAdminAddress(wallet.publicKey.toBase58());
|
||||
if (connected && publicKey) {
|
||||
setAdminAddress(publicKey.toBase58());
|
||||
}
|
||||
}, [wallet, connected]);
|
||||
}, [publicKey, connected]);
|
||||
|
||||
const canSubmit =
|
||||
connected &&
|
||||
|
@ -91,7 +92,7 @@ export default function NewPoolPage() {
|
|||
(adminAddress || !adminControlled);
|
||||
|
||||
async function onSubmit() {
|
||||
if (!canSubmit || !wallet) {
|
||||
if (!canSubmit || !publicKey || !wallet) {
|
||||
return;
|
||||
}
|
||||
setSubmitting(true);
|
||||
|
@ -111,7 +112,7 @@ export default function NewPoolPage() {
|
|||
),
|
||||
assetMints: assets.map((asset) => asset.mint),
|
||||
initialAssetQuantities: assets.map((asset) => new BN(asset.quantity)),
|
||||
creator: wallet.publicKey,
|
||||
creator: publicKey,
|
||||
creatorAssets: assets.map((asset) => {
|
||||
const found = tokenAccounts?.find((tokenAccount) =>
|
||||
tokenAccount.effectiveMint.equals(asset.mint),
|
||||
|
@ -133,7 +134,7 @@ export default function NewPoolPage() {
|
|||
});
|
||||
const signed = await signTransactions({
|
||||
transactionsAndSigners,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
connection,
|
||||
});
|
||||
for (let signedTransaction of signed) {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AdminControlledPoolInstructions, PoolInfo } from '@project-serum/pool';
|
|||
import { TokenInstructions } from '@project-serum/serum';
|
||||
import FloatingElement from '../../../components/layout/FloatingElement';
|
||||
import { useConnection } from '../../../utils/connection';
|
||||
import { useWallet } from '../../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import {
|
||||
getSelectedTokenAccountForMint,
|
||||
useTokenAccounts,
|
||||
|
@ -22,6 +22,7 @@ import {
|
|||
getAssociatedTokenAddress,
|
||||
} from '@project-serum/associated-token';
|
||||
import { parseTokenMintData, useMintToTickers } from '../../../utils/tokens';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
import BN from 'bn.js';
|
||||
import { refreshAllCaches } from '../../../utils/fetch-loop';
|
||||
|
||||
|
@ -72,7 +73,11 @@ function PauseUnpauseTab({ poolInfo }: TabParams) {
|
|||
try {
|
||||
const transaction = new Transaction();
|
||||
transaction.add(AdminControlledPoolInstructions.pause(poolInfo));
|
||||
await sendTransaction({ connection, wallet, transaction });
|
||||
await sendTransaction({
|
||||
connection,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
transaction,
|
||||
});
|
||||
} catch (e) {
|
||||
notify({
|
||||
message: 'Error pausing pool',
|
||||
|
@ -92,7 +97,11 @@ function PauseUnpauseTab({ poolInfo }: TabParams) {
|
|||
try {
|
||||
const transaction = new Transaction();
|
||||
transaction.add(AdminControlledPoolInstructions.unpause(poolInfo));
|
||||
await sendTransaction({ connection, wallet, transaction });
|
||||
await sendTransaction({
|
||||
connection,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
transaction,
|
||||
});
|
||||
} catch (e) {
|
||||
notify({
|
||||
message: 'Error unpausing pool',
|
||||
|
@ -119,7 +128,7 @@ function PauseUnpauseTab({ poolInfo }: TabParams) {
|
|||
function AddAssetTab({ poolInfo }: TabParams) {
|
||||
const connection = useConnection();
|
||||
const [address, setAddress] = useState('');
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey } = useWallet();
|
||||
const canSubmit = connected && address;
|
||||
const [onSubmit, submitting] = useOnSubmitHandler(
|
||||
'adding asset to pool',
|
||||
|
@ -130,10 +139,10 @@ function AddAssetTab({ poolInfo }: TabParams) {
|
|||
mintAddress,
|
||||
);
|
||||
const transaction = new Transaction();
|
||||
if (!(await connection.getAccountInfo(vaultAddress)) && wallet) {
|
||||
if (!(await connection.getAccountInfo(vaultAddress)) && publicKey) {
|
||||
transaction.add(
|
||||
await createAssociatedTokenAccount(
|
||||
wallet.publicKey,
|
||||
publicKey,
|
||||
poolInfo.state.vaultSigner,
|
||||
mintAddress,
|
||||
),
|
||||
|
@ -200,7 +209,7 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
const [quantity, setQuantity] = useState('');
|
||||
|
||||
const connection = useConnection();
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey } = useWallet();
|
||||
const [tokenAccounts] = useTokenAccounts();
|
||||
const canSubmit =
|
||||
connected && address && tokenAccounts && parseFloat(quantity);
|
||||
|
@ -208,7 +217,7 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
const [onSubmit, submitting] = useOnSubmitHandler(
|
||||
'depositing to pool',
|
||||
async () => {
|
||||
if (!wallet) {
|
||||
if (!publicKey) {
|
||||
throw new Error('Wallet is not connected');
|
||||
}
|
||||
|
||||
|
@ -239,7 +248,7 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
|
||||
const wrappedSolAccount =
|
||||
mintAddress.equals(TokenInstructions.WRAPPED_SOL_MINT) &&
|
||||
walletTokenAccount.pubkey.equals(wallet.publicKey)
|
||||
walletTokenAccount.pubkey.equals(publicKey)
|
||||
? new Account()
|
||||
: null;
|
||||
|
||||
|
@ -248,7 +257,7 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
if (wrappedSolAccount) {
|
||||
transaction.add(
|
||||
SystemProgram.createAccount({
|
||||
fromPubkey: wallet.publicKey,
|
||||
fromPubkey: publicKey,
|
||||
lamports: parsedQuantity + 2.04e6,
|
||||
newAccountPubkey: wrappedSolAccount.publicKey,
|
||||
programId: TokenInstructions.TOKEN_PROGRAM_ID,
|
||||
|
@ -257,18 +266,18 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
TokenInstructions.initializeAccount({
|
||||
account: wrappedSolAccount.publicKey,
|
||||
mint: TokenInstructions.WRAPPED_SOL_MINT,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
TokenInstructions.transfer({
|
||||
source: wrappedSolAccount.publicKey,
|
||||
destination: vaultAddress,
|
||||
amount: parsedQuantity,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
TokenInstructions.closeAccount({
|
||||
source: wrappedSolAccount.publicKey,
|
||||
destination: walletTokenAccount.pubkey,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
);
|
||||
signers.push(wrappedSolAccount);
|
||||
|
@ -278,7 +287,7 @@ function DepositTab({ poolInfo }: TabParams) {
|
|||
source: walletTokenAccount.pubkey,
|
||||
destination: vaultAddress,
|
||||
amount: parsedQuantity,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
@ -312,7 +321,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
const [quantity, setQuantity] = useState('');
|
||||
|
||||
const connection = useConnection();
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey } = useWallet();
|
||||
const [tokenAccounts] = useTokenAccounts();
|
||||
const canSubmit =
|
||||
connected && address && tokenAccounts && parseFloat(quantity);
|
||||
|
@ -320,7 +329,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
const [onSubmit, submitting] = useOnSubmitHandler(
|
||||
'withdrawing from pool',
|
||||
async () => {
|
||||
if (!wallet) {
|
||||
if (!publicKey) {
|
||||
throw new Error('Wallet is not connected');
|
||||
}
|
||||
|
||||
|
@ -351,7 +360,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
|
||||
const wrappedSolAccount =
|
||||
mintAddress.equals(TokenInstructions.WRAPPED_SOL_MINT) &&
|
||||
walletTokenAccount.pubkey.equals(wallet.publicKey)
|
||||
walletTokenAccount.pubkey.equals(publicKey)
|
||||
? new Account()
|
||||
: null;
|
||||
|
||||
|
@ -360,7 +369,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
if (wrappedSolAccount) {
|
||||
transaction.add(
|
||||
SystemProgram.createAccount({
|
||||
fromPubkey: wallet.publicKey,
|
||||
fromPubkey: publicKey,
|
||||
lamports: 2.04e6,
|
||||
newAccountPubkey: wrappedSolAccount.publicKey,
|
||||
programId: TokenInstructions.TOKEN_PROGRAM_ID,
|
||||
|
@ -369,7 +378,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
TokenInstructions.initializeAccount({
|
||||
account: wrappedSolAccount.publicKey,
|
||||
mint: TokenInstructions.WRAPPED_SOL_MINT,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
);
|
||||
signers.push(wrappedSolAccount);
|
||||
|
@ -378,7 +387,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
AdminControlledPoolInstructions.approveDelegate(
|
||||
poolInfo,
|
||||
vaultAddress,
|
||||
wallet.publicKey,
|
||||
publicKey,
|
||||
new BN(parsedQuantity),
|
||||
),
|
||||
);
|
||||
|
@ -388,12 +397,12 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
source: vaultAddress,
|
||||
destination: wrappedSolAccount.publicKey,
|
||||
amount: parsedQuantity,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
TokenInstructions.closeAccount({
|
||||
source: wrappedSolAccount.publicKey,
|
||||
destination: walletTokenAccount.pubkey,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
|
@ -402,7 +411,7 @@ function WithdrawTab({ poolInfo }: TabParams) {
|
|||
source: vaultAddress,
|
||||
destination: walletTokenAccount.pubkey,
|
||||
amount: parsedQuantity,
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
@ -470,7 +479,7 @@ function useOnSubmitHandler(
|
|||
refresh = false,
|
||||
): [(FormEvent) => void, boolean] {
|
||||
const connection = useConnection();
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, wallet } = useWallet();
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
async function onSubmit(e: FormEvent) {
|
||||
|
@ -484,7 +493,12 @@ function useOnSubmitHandler(
|
|||
throw new Error('Wallet not connected');
|
||||
}
|
||||
const [transaction, signers] = await makeTransaction();
|
||||
await sendTransaction({ connection, wallet, transaction, signers });
|
||||
await sendTransaction({
|
||||
connection,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
transaction,
|
||||
signers,
|
||||
});
|
||||
if (refresh) {
|
||||
refreshAllCaches();
|
||||
}
|
||||
|
|
|
@ -10,9 +10,11 @@ import tuple from 'immutable-tuple';
|
|||
import PoolBasketDisplay from './PoolBasketDisplay';
|
||||
import BN from 'bn.js';
|
||||
import { notify } from '../../../utils/notifications';
|
||||
import { useWallet } from '../../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { useTokenAccounts } from '../../../utils/markets';
|
||||
import { sendTransaction } from '../../../utils/send';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
import assert from 'assert';
|
||||
|
||||
const { Text } = Typography;
|
||||
const { TabPane } = Tabs;
|
||||
|
@ -56,7 +58,7 @@ interface CreateRedeemInnerPanel {
|
|||
|
||||
function CreateRedeemTab({ poolInfo, mintInfo, tab }: CreateRedeemInnerPanel) {
|
||||
const connection = useConnection();
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const [quantity, setQuantity] = useState('');
|
||||
const [tokenAccounts] = useTokenAccounts();
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
@ -100,11 +102,12 @@ function CreateRedeemTab({ poolInfo, mintInfo, tab }: CreateRedeemInnerPanel) {
|
|||
}
|
||||
setSubmitting(true);
|
||||
try {
|
||||
assert(publicKey, 'Expected `publicKey` to be non-null');
|
||||
const { transaction, signers } = PoolTransactions.execute(
|
||||
poolInfo,
|
||||
action,
|
||||
{
|
||||
owner: wallet.publicKey,
|
||||
owner: publicKey,
|
||||
poolTokenAccount: findTokenAccount(poolInfo.state.poolTokenMint),
|
||||
assetAccounts: poolInfo.state.assets.map((asset) =>
|
||||
findTokenAccount(asset.mint),
|
||||
|
@ -112,7 +115,12 @@ function CreateRedeemTab({ poolInfo, mintInfo, tab }: CreateRedeemInnerPanel) {
|
|||
},
|
||||
basket,
|
||||
);
|
||||
await sendTransaction({ connection, wallet, transaction, signers });
|
||||
await sendTransaction({
|
||||
connection,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
transaction,
|
||||
signers,
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
notify({
|
||||
|
|
|
@ -15,7 +15,7 @@ import PoolCreateRedeemPanel from './PoolCreateRedeemPanel';
|
|||
import PoolBalancesPanel from './PoolBalancesPanel';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { PoolAdminPanel } from './PoolAdminPanel';
|
||||
import { useWallet } from '../../../utils/wallet';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
|
@ -47,9 +47,9 @@ export default function PoolPage() {
|
|||
() => (mintAccountInfo ? parseTokenMintData(mintAccountInfo.data) : null),
|
||||
[mintAccountInfo],
|
||||
);
|
||||
const { wallet } = useWallet();
|
||||
const { publicKey } = useWallet();
|
||||
|
||||
if (poolInfo && mintInfo && wallet) {
|
||||
if (poolInfo && mintInfo && publicKey) {
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
|
@ -67,8 +67,7 @@ export default function PoolPage() {
|
|||
<Col xs={24}>
|
||||
<PoolBalancesPanel poolInfo={poolInfo} />
|
||||
</Col>
|
||||
{wallet.connected &&
|
||||
poolInfo.state.adminKey?.equals(wallet.publicKey) &&
|
||||
{poolInfo.state.adminKey?.equals(publicKey) &&
|
||||
isAdminControlledPool(poolInfo) ? (
|
||||
<Col xs={24}>
|
||||
<PoolAdminPanel poolInfo={poolInfo} />
|
||||
|
|
|
@ -262,8 +262,6 @@ export function setCache(
|
|||
}
|
||||
}
|
||||
|
||||
export function getCache(
|
||||
cacheKey: any
|
||||
) {
|
||||
export function getCache(cacheKey: any) {
|
||||
return globalCache.get(cacheKey);
|
||||
}
|
||||
|
|
|
@ -1,14 +1,31 @@
|
|||
import {Market, MARKETS, OpenOrders, Orderbook, TOKEN_MINTS, TokenInstructions,} from '@project-serum/serum';
|
||||
import {PublicKey} from '@solana/web3.js';
|
||||
import React, {useContext, useEffect, useState} from 'react';
|
||||
import {divideBnToNumber, floorToDecimal, getTokenMultiplierFromDecimals, sleep, useLocalStorageState,} from './utils';
|
||||
import {refreshCache, useAsyncData} from './fetch-loop';
|
||||
import {useAccountData, useAccountInfo, useConnection} from './connection';
|
||||
import {useWallet} from './wallet';
|
||||
import {
|
||||
Market,
|
||||
MARKETS,
|
||||
OpenOrders,
|
||||
Orderbook,
|
||||
TOKEN_MINTS,
|
||||
TokenInstructions,
|
||||
} from '@project-serum/serum';
|
||||
import { PublicKey } from '@solana/web3.js';
|
||||
import React, { useContext, useEffect, useState } from 'react';
|
||||
import {
|
||||
divideBnToNumber,
|
||||
floorToDecimal,
|
||||
getTokenMultiplierFromDecimals,
|
||||
sleep,
|
||||
useLocalStorageState,
|
||||
} from './utils';
|
||||
import { refreshCache, useAsyncData } from './fetch-loop';
|
||||
import { useAccountData, useAccountInfo, useConnection } from './connection';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import tuple from 'immutable-tuple';
|
||||
import {notify} from './notifications';
|
||||
import { notify } from './notifications';
|
||||
import BN from 'bn.js';
|
||||
import {getTokenAccountInfo, parseTokenAccountData, useMintInfos,} from './tokens';
|
||||
import {
|
||||
getTokenAccountInfo,
|
||||
parseTokenAccountData,
|
||||
useMintInfos,
|
||||
} from './tokens';
|
||||
import {
|
||||
Balances,
|
||||
CustomMarketInfo,
|
||||
|
@ -20,8 +37,8 @@ import {
|
|||
SelectedTokenAccounts,
|
||||
TokenAccount,
|
||||
} from './types';
|
||||
import {WRAPPED_SOL_MINT} from '@project-serum/serum/lib/token-instructions';
|
||||
import {Order} from '@project-serum/serum/lib/market';
|
||||
import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions';
|
||||
import { Order } from '@project-serum/serum/lib/market';
|
||||
import BonfidaApi from './bonfidaConnector';
|
||||
|
||||
// Used in debugging, should be false in production
|
||||
|
@ -32,7 +49,10 @@ export const USE_MARKETS: MarketInfo[] = _IGNORE_DEPRECATED
|
|||
: MARKETS;
|
||||
|
||||
export function useMarketsList() {
|
||||
return USE_MARKETS.filter(({ name, deprecated }) => !deprecated && !process.env.REACT_APP_EXCLUDE_MARKETS?.includes(name));
|
||||
return USE_MARKETS.filter(
|
||||
({ name, deprecated }) =>
|
||||
!deprecated && !process.env.REACT_APP_EXCLUDE_MARKETS?.includes(name),
|
||||
);
|
||||
}
|
||||
|
||||
export function useAllMarkets() {
|
||||
|
@ -82,10 +102,10 @@ export function useAllMarkets() {
|
|||
|
||||
export function useUnmigratedOpenOrdersAccounts() {
|
||||
const connection = useConnection();
|
||||
const { wallet } = useWallet();
|
||||
const { publicKey } = useWallet();
|
||||
|
||||
async function getUnmigratedOpenOrdersAccounts(): Promise<OpenOrders[]> {
|
||||
if (!wallet || !connection || !wallet.publicKey) {
|
||||
if (!connection || !publicKey) {
|
||||
return [];
|
||||
}
|
||||
console.log('refreshing useUnmigratedOpenOrdersAccounts');
|
||||
|
@ -102,7 +122,7 @@ export function useUnmigratedOpenOrdersAccounts() {
|
|||
try {
|
||||
const openOrdersAccounts = await OpenOrders.findForOwner(
|
||||
connection,
|
||||
wallet.publicKey,
|
||||
publicKey,
|
||||
programId,
|
||||
);
|
||||
deprecatedOpenOrdersAccounts = deprecatedOpenOrdersAccounts.concat(
|
||||
|
@ -134,7 +154,7 @@ export function useUnmigratedOpenOrdersAccounts() {
|
|||
const cacheKey = tuple(
|
||||
'getUnmigratedOpenOrdersAccounts',
|
||||
connection,
|
||||
wallet?.publicKey?.toBase58(),
|
||||
publicKey?.toBase58(),
|
||||
);
|
||||
const [accounts] = useAsyncData(getUnmigratedOpenOrdersAccounts, cacheKey, {
|
||||
refreshInterval: _VERY_SLOW_REFRESH_INTERVAL,
|
||||
|
@ -401,19 +421,16 @@ export function useOrderbook(
|
|||
// TODO: Update to use websocket
|
||||
export function useOpenOrdersAccounts(fast = false) {
|
||||
const { market } = useMarket();
|
||||
const { connected, wallet } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const connection = useConnection();
|
||||
async function getOpenOrdersAccounts() {
|
||||
if (!connected || !wallet) {
|
||||
if (!connected || !publicKey || !wallet) {
|
||||
return null;
|
||||
}
|
||||
if (!market) {
|
||||
return null;
|
||||
}
|
||||
return await market.findOpenOrdersAccountsForOwner(
|
||||
connection,
|
||||
wallet.publicKey,
|
||||
);
|
||||
return await market.findOpenOrdersAccountsForOwner(connection, publicKey);
|
||||
}
|
||||
return useAsyncData<OpenOrders[] | null>(
|
||||
getOpenOrdersAccounts,
|
||||
|
@ -434,13 +451,13 @@ export function useTokenAccounts(): [
|
|||
TokenAccount[] | null | undefined,
|
||||
boolean,
|
||||
] {
|
||||
const { connected, wallet } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const connection = useConnection();
|
||||
async function getTokenAccounts() {
|
||||
if (!connected || !wallet) {
|
||||
if (!connected || !publicKey || !wallet) {
|
||||
return null;
|
||||
}
|
||||
return await getTokenAccountInfo(connection, wallet.publicKey);
|
||||
return await getTokenAccountInfo(connection, publicKey);
|
||||
}
|
||||
return useAsyncData(
|
||||
getTokenAccounts,
|
||||
|
@ -580,11 +597,11 @@ export function useFeeDiscountKeys(): [
|
|||
boolean,
|
||||
] {
|
||||
const { market } = useMarket();
|
||||
const { connected, wallet } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const connection = useConnection();
|
||||
const { setStoredFeeDiscountKey } = useLocallyStoredFeeDiscountKey();
|
||||
let getFeeDiscountKeys = async () => {
|
||||
if (!connected || !wallet) {
|
||||
if (!connected || !publicKey || !wallet) {
|
||||
return null;
|
||||
}
|
||||
if (!market) {
|
||||
|
@ -592,7 +609,7 @@ export function useFeeDiscountKeys(): [
|
|||
}
|
||||
const feeDiscountKey = await market.findFeeDiscountKeys(
|
||||
connection,
|
||||
wallet.publicKey,
|
||||
publicKey,
|
||||
);
|
||||
if (feeDiscountKey) {
|
||||
setStoredFeeDiscountKey(feeDiscountKey[0].pubkey.toBase58());
|
||||
|
@ -626,7 +643,7 @@ export function useFills(limit = 100) {
|
|||
}
|
||||
|
||||
export function useAllOpenOrdersAccounts() {
|
||||
const { wallet, connected } = useWallet();
|
||||
const { connected, publicKey } = useWallet();
|
||||
const connection = useConnection();
|
||||
const marketInfos = useMarketInfos();
|
||||
const programIds = [
|
||||
|
@ -634,13 +651,13 @@ export function useAllOpenOrdersAccounts() {
|
|||
].map((stringProgramId) => new PublicKey(stringProgramId));
|
||||
|
||||
const getAllOpenOrdersAccounts = async () => {
|
||||
if (!connected || !wallet) {
|
||||
if (!connected || !publicKey) {
|
||||
return [];
|
||||
}
|
||||
return (
|
||||
await Promise.all(
|
||||
programIds.map((programId) =>
|
||||
OpenOrders.findForOwner(connection, wallet.publicKey, programId),
|
||||
OpenOrders.findForOwner(connection, publicKey, programId),
|
||||
),
|
||||
)
|
||||
).flat();
|
||||
|
@ -651,7 +668,7 @@ export function useAllOpenOrdersAccounts() {
|
|||
'getAllOpenOrdersAccounts',
|
||||
connection,
|
||||
connected,
|
||||
wallet?.publicKey?.toBase58(),
|
||||
publicKey?.toBase58(),
|
||||
marketInfos.length,
|
||||
(programIds || []).length,
|
||||
),
|
||||
|
@ -726,7 +743,7 @@ export const useAllOpenOrders = (): {
|
|||
refreshOpenOrders: () => void;
|
||||
} => {
|
||||
const connection = useConnection();
|
||||
const { connected, wallet } = useWallet();
|
||||
const { connected, publicKey } = useWallet();
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [refresh, setRefresh] = useState(0);
|
||||
const [openOrders, setOpenOrders] = useState<
|
||||
|
@ -743,7 +760,7 @@ export const useAllOpenOrders = (): {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (connected && wallet) {
|
||||
if (connected && publicKey) {
|
||||
const getAllOpenOrders = async () => {
|
||||
setLoaded(false);
|
||||
const _openOrders: { orders: Order[]; marketAddress: string }[] = [];
|
||||
|
@ -758,7 +775,7 @@ export const useAllOpenOrders = (): {
|
|||
);
|
||||
const orders = await market.loadOrdersForOwner(
|
||||
connection,
|
||||
wallet?.publicKey,
|
||||
publicKey,
|
||||
30000,
|
||||
);
|
||||
_openOrders.push({
|
||||
|
@ -776,7 +793,7 @@ export const useAllOpenOrders = (): {
|
|||
};
|
||||
getAllOpenOrders();
|
||||
}
|
||||
}, [connection, connected, wallet, refresh]);
|
||||
}, [connection, connected, refresh, publicKey]);
|
||||
return {
|
||||
openOrders: openOrders,
|
||||
loaded: loaded,
|
||||
|
@ -951,7 +968,7 @@ export function useGetOpenOrdersForDeprecatedMarkets(): {
|
|||
loaded: boolean;
|
||||
refreshOpenOrders: () => void;
|
||||
} {
|
||||
const { connected, wallet } = useWallet();
|
||||
const { connected, publicKey, wallet } = useWallet();
|
||||
const { customMarkets } = useCustomMarkets();
|
||||
const connection = useConnection();
|
||||
const marketsAndOrders = useUnmigratedDeprecatedMarkets();
|
||||
|
@ -966,7 +983,7 @@ export function useGetOpenOrdersForDeprecatedMarkets(): {
|
|||
.map((market) => market.address.toBase58());
|
||||
|
||||
async function getOpenOrdersForDeprecatedMarkets() {
|
||||
if (!connected || !wallet) {
|
||||
if (!connected || !publicKey) {
|
||||
return null;
|
||||
}
|
||||
if (!marketsList) {
|
||||
|
@ -982,7 +999,7 @@ export function useGetOpenOrdersForDeprecatedMarkets(): {
|
|||
console.log('Fetching open orders for', marketName);
|
||||
// Can do better than this, we have the open orders accounts already
|
||||
return (
|
||||
await market.loadOrdersForOwner(connection, wallet.publicKey)
|
||||
await market.loadOrdersForOwner(connection, publicKey)
|
||||
).map((order) => ({ marketName, market, ...order }));
|
||||
} catch (e) {
|
||||
console.log('Failed loading open orders', market.address.toBase58(), e);
|
||||
|
@ -1167,7 +1184,12 @@ export function getExpectedFillPrice(
|
|||
return formattedPrice;
|
||||
}
|
||||
|
||||
export function useCurrentlyAutoSettling(): [boolean, (currentlyAutoSettling: boolean) => void] {
|
||||
const [currentlyAutoSettling, setCurrentlyAutosettling] = useState<boolean>(false);
|
||||
export function useCurrentlyAutoSettling(): [
|
||||
boolean,
|
||||
(currentlyAutoSettling: boolean) => void,
|
||||
] {
|
||||
const [currentlyAutoSettling, setCurrentlyAutosettling] = useState<boolean>(
|
||||
false,
|
||||
);
|
||||
return [currentlyAutoSettling, setCurrentlyAutosettling];
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import React, {useContext, useState} from 'react';
|
||||
import {sleep, useLocalStorageState} from './utils';
|
||||
import {useInterval} from './useInterval';
|
||||
import {useConnection} from './connection';
|
||||
import {useWallet} from './wallet';
|
||||
import {
|
||||
useMarketInfos,
|
||||
useTokenAccounts,
|
||||
} from './markets';
|
||||
import {settleAllFunds} from './send';
|
||||
import {PreferencesContextValues} from './types';
|
||||
import {Market} from "@project-serum/serum";
|
||||
import React, { useContext, useState } from 'react';
|
||||
import { sleep, useLocalStorageState } from './utils';
|
||||
import { useInterval } from './useInterval';
|
||||
import { useConnection } from './connection';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { useMarketInfos, useTokenAccounts } from './markets';
|
||||
import { settleAllFunds } from './send';
|
||||
import { PreferencesContextValues } from './types';
|
||||
import { Market } from '@project-serum/serum';
|
||||
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
||||
|
||||
export const AUTO_SETTLE_DISABLED_OVERRIDE = true;
|
||||
|
||||
|
@ -26,18 +24,21 @@ export function PreferencesProvider({ children }) {
|
|||
const [tokenAccounts] = useTokenAccounts();
|
||||
const { connected, wallet } = useWallet();
|
||||
const marketInfoList = useMarketInfos();
|
||||
const [currentlyFetchingMarkets, setCurrentlyFetchingMarkets] = useState<boolean>(false);
|
||||
const [markets, setMarkets] = useState<Map<string, Market>>(new Map())
|
||||
const [
|
||||
currentlyFetchingMarkets,
|
||||
setCurrentlyFetchingMarkets,
|
||||
] = useState<boolean>(false);
|
||||
const [markets, setMarkets] = useState<Map<string, Market>>(new Map());
|
||||
const addToMarketsMap = (marketId, market) => {
|
||||
setMarkets(prev => new Map(prev).set(marketId, market));
|
||||
}
|
||||
setMarkets((prev) => new Map(prev).set(marketId, market));
|
||||
};
|
||||
const connection = useConnection();
|
||||
|
||||
useInterval(() => {
|
||||
const autoSettle = async () => {
|
||||
if (AUTO_SETTLE_DISABLED_OVERRIDE) {
|
||||
return;
|
||||
}
|
||||
if (AUTO_SETTLE_DISABLED_OVERRIDE) {
|
||||
return;
|
||||
}
|
||||
if (!wallet) {
|
||||
return;
|
||||
}
|
||||
|
@ -45,7 +46,7 @@ export function PreferencesProvider({ children }) {
|
|||
console.log('Settling funds...');
|
||||
await settleAllFunds({
|
||||
connection,
|
||||
wallet,
|
||||
wallet: wallet.adapter as BaseSignerWalletAdapter,
|
||||
tokenAccounts: tokenAccounts || [],
|
||||
markets: [...markets.values()],
|
||||
});
|
||||
|
@ -55,12 +56,10 @@ export function PreferencesProvider({ children }) {
|
|||
}
|
||||
console.log('Finished settling funds.');
|
||||
};
|
||||
(
|
||||
connected &&
|
||||
wallet?.autoApprove &&
|
||||
connected &&
|
||||
(wallet?.adapter as any).autoApprove &&
|
||||
autoSettleEnabled &&
|
||||
autoSettle()
|
||||
);
|
||||
autoSettle();
|
||||
}, 20000);
|
||||
|
||||
// warms up the market and open orders cache for auto-settlement
|
||||
|
@ -76,7 +75,12 @@ export function PreferencesProvider({ children }) {
|
|||
continue;
|
||||
}
|
||||
try {
|
||||
const market = await Market.load(connection, marketInfo.address, {}, marketInfo.programId)
|
||||
const market = await Market.load(
|
||||
connection,
|
||||
marketInfo.address,
|
||||
{},
|
||||
marketInfo.programId,
|
||||
);
|
||||
addToMarketsMap(marketInfo.address.toString(), market);
|
||||
await sleep(1000);
|
||||
} catch (e) {
|
||||
|
@ -84,15 +88,13 @@ export function PreferencesProvider({ children }) {
|
|||
}
|
||||
}
|
||||
setCurrentlyFetchingMarkets(false);
|
||||
}
|
||||
(
|
||||
connected &&
|
||||
wallet?.autoApprove &&
|
||||
};
|
||||
connected &&
|
||||
(wallet?.adapter as any).autoApprove &&
|
||||
autoSettleEnabled &&
|
||||
!currentlyFetchingMarkets &&
|
||||
fetchMarkets()
|
||||
);
|
||||
}, 60000)
|
||||
fetchMarkets();
|
||||
}, 60000);
|
||||
|
||||
return (
|
||||
<PreferencesContext.Provider
|
||||
|
|
|
@ -32,7 +32,10 @@ import { Order } from '@project-serum/serum/lib/market';
|
|||
import { Buffer } from 'buffer';
|
||||
import assert from 'assert';
|
||||
import { struct } from 'superstruct';
|
||||
import { WalletAdapter } from '../wallet-adapters';
|
||||
import {
|
||||
BaseSignerWalletAdapter,
|
||||
WalletAdapter,
|
||||
} from '@solana/wallet-adapter-base';
|
||||
|
||||
export async function createTokenAccountTransaction({
|
||||
connection,
|
||||
|
@ -46,6 +49,7 @@ export async function createTokenAccountTransaction({
|
|||
transaction: Transaction;
|
||||
newAccountPubkey: PublicKey;
|
||||
}> {
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
const ata = await Token.getAssociatedTokenAddress(
|
||||
ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
TOKEN_PROGRAM_ID,
|
||||
|
@ -83,7 +87,7 @@ export async function settleFunds({
|
|||
market: Market;
|
||||
openOrders: OpenOrders;
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
baseCurrencyAccount: TokenAccount;
|
||||
quoteCurrencyAccount: TokenAccount;
|
||||
sendNotification?: boolean;
|
||||
|
@ -173,7 +177,7 @@ export async function settleAllFunds({
|
|||
selectedTokenAccounts,
|
||||
}: {
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
tokenAccounts: TokenAccount[];
|
||||
markets: Market[];
|
||||
selectedTokenAccounts?: SelectedTokenAccounts;
|
||||
|
@ -196,6 +200,7 @@ export async function settleAllFunds({
|
|||
});
|
||||
|
||||
const getOpenOrdersAccountsForProgramId = async (programId) => {
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
const openOrdersAccounts = await OpenOrders.findForOwner(
|
||||
connection,
|
||||
wallet.publicKey,
|
||||
|
@ -237,15 +242,15 @@ export async function settleAllFunds({
|
|||
tokenAccounts,
|
||||
baseMint,
|
||||
baseMint &&
|
||||
selectedTokenAccounts &&
|
||||
selectedTokenAccounts[baseMint.toBase58()],
|
||||
selectedTokenAccounts &&
|
||||
selectedTokenAccounts[baseMint.toBase58()],
|
||||
)?.pubkey;
|
||||
const selectedQuoteTokenAccount = getSelectedTokenAccountForMint(
|
||||
tokenAccounts,
|
||||
quoteMint,
|
||||
quoteMint &&
|
||||
selectedTokenAccounts &&
|
||||
selectedTokenAccounts[quoteMint.toBase58()],
|
||||
selectedTokenAccounts &&
|
||||
selectedTokenAccounts[quoteMint.toBase58()],
|
||||
)?.pubkey;
|
||||
if (!selectedBaseTokenAccount || !selectedQuoteTokenAccount) {
|
||||
return null;
|
||||
|
@ -295,7 +300,7 @@ export async function settleAllFunds({
|
|||
export async function cancelOrder(params: {
|
||||
market: Market;
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
order: Order;
|
||||
}) {
|
||||
return cancelOrders({ ...params, orders: [params.order] });
|
||||
|
@ -308,14 +313,16 @@ export async function cancelOrders({
|
|||
orders,
|
||||
}: {
|
||||
market: Market;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
connection: Connection;
|
||||
orders: Order[];
|
||||
}) {
|
||||
const transaction = market.makeMatchOrdersTransaction(5);
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
const publicKey = wallet.publicKey;
|
||||
orders.forEach((order) => {
|
||||
transaction.add(
|
||||
market.makeCancelOrderInstruction(connection, wallet.publicKey, order),
|
||||
market.makeCancelOrderInstruction(connection, publicKey, order),
|
||||
);
|
||||
});
|
||||
transaction.add(market.makeMatchOrdersTransaction(5));
|
||||
|
@ -345,7 +352,7 @@ export async function placeOrder({
|
|||
orderType: 'ioc' | 'postOnly' | 'limit';
|
||||
market: Market | undefined | null;
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
baseCurrencyAccount: PublicKey | undefined;
|
||||
quoteCurrencyAccount: PublicKey | undefined;
|
||||
feeDiscountPubkey: PublicKey | undefined;
|
||||
|
@ -482,13 +489,15 @@ export async function listMarket({
|
|||
dexProgramId,
|
||||
}: {
|
||||
connection: Connection;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
baseMint: PublicKey;
|
||||
quoteMint: PublicKey;
|
||||
baseLotSize: number;
|
||||
quoteLotSize: number;
|
||||
dexProgramId: PublicKey;
|
||||
}) {
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
|
||||
const market = new Account();
|
||||
const requestQueue = new Account();
|
||||
const eventQueue = new Account();
|
||||
|
@ -641,7 +650,7 @@ export async function sendTransaction({
|
|||
sendNotification = true,
|
||||
}: {
|
||||
transaction: Transaction;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
signers?: Array<Account>;
|
||||
connection: Connection;
|
||||
sendingMessage?: string;
|
||||
|
@ -674,10 +683,11 @@ export async function signTransaction({
|
|||
connection,
|
||||
}: {
|
||||
transaction: Transaction;
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
signers?: Array<Account>;
|
||||
connection: Connection;
|
||||
}) {
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
transaction.recentBlockhash = (
|
||||
await connection.getRecentBlockhash('max')
|
||||
).blockhash;
|
||||
|
@ -697,16 +707,15 @@ export async function signTransactions({
|
|||
transaction: Transaction;
|
||||
signers?: Array<Account>;
|
||||
}[];
|
||||
wallet: WalletAdapter;
|
||||
wallet: BaseSignerWalletAdapter;
|
||||
connection: Connection;
|
||||
}) {
|
||||
assert(wallet.publicKey, 'Expected `publicKey` to be non-null');
|
||||
const publicKey = wallet.publicKey;
|
||||
const blockhash = (await connection.getRecentBlockhash('max')).blockhash;
|
||||
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
|
||||
transaction.recentBlockhash = blockhash;
|
||||
transaction.setSigners(
|
||||
wallet.publicKey,
|
||||
...signers.map((s) => s.publicKey),
|
||||
);
|
||||
transaction.setSigners(publicKey, ...signers.map((s) => s.publicKey));
|
||||
if (signers?.length > 0) {
|
||||
transaction.partialSign(...signers);
|
||||
}
|
||||
|
@ -770,7 +779,7 @@ export async function sendSignedTransaction({
|
|||
simulateResult = (
|
||||
await simulateTransaction(connection, signedTransaction, 'single')
|
||||
).value;
|
||||
} catch (e) { }
|
||||
} catch (e) {}
|
||||
if (simulateResult && simulateResult.err) {
|
||||
if (simulateResult.logs) {
|
||||
for (let i = simulateResult.logs.length - 1; i >= 0; --i) {
|
||||
|
@ -942,9 +951,9 @@ export async function getMultipleSolanaAccounts(
|
|||
if (res.error) {
|
||||
throw new Error(
|
||||
'failed to get info about accounts ' +
|
||||
publicKeys.map((k) => k.toBase58()).join(', ') +
|
||||
': ' +
|
||||
res.error.message,
|
||||
publicKeys.map((k) => k.toBase58()).join(', ') +
|
||||
': ' +
|
||||
res.error.message,
|
||||
);
|
||||
}
|
||||
assert(typeof res.result !== 'undefined');
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import * as BufferLayout from 'buffer-layout';
|
||||
import {AccountInfo, Connection, PublicKey} from '@solana/web3.js';
|
||||
import {WRAPPED_SOL_MINT} from '@project-serum/serum/lib/token-instructions';
|
||||
import {TokenAccount} from './types';
|
||||
import {TOKEN_MINTS} from '@project-serum/serum';
|
||||
import {useAllMarkets, useCustomMarkets, useTokenAccounts} from './markets';
|
||||
import {getMultipleSolanaAccounts} from './send';
|
||||
import {useConnection} from './connection';
|
||||
import {useAsyncData} from './fetch-loop';
|
||||
import { AccountInfo, Connection, PublicKey } from '@solana/web3.js';
|
||||
import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions';
|
||||
import { TokenAccount } from './types';
|
||||
import { TOKEN_MINTS } from '@project-serum/serum';
|
||||
import { useAllMarkets, useCustomMarkets, useTokenAccounts } from './markets';
|
||||
import { getMultipleSolanaAccounts } from './send';
|
||||
import { useConnection } from './connection';
|
||||
import { useAsyncData } from './fetch-loop';
|
||||
import tuple from 'immutable-tuple';
|
||||
import BN from 'bn.js';
|
||||
import {useMemo} from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export const ACCOUNT_LAYOUT = BufferLayout.struct([
|
||||
BufferLayout.blob(32, 'mint'),
|
||||
|
@ -75,14 +75,11 @@ export async function getOwnedTokenAccounts(
|
|||
publicKey: PublicKey,
|
||||
): Promise<Array<{ publicKey: PublicKey; accountInfo: AccountInfo<Buffer> }>> {
|
||||
let filters = getOwnedAccountsFilters(publicKey);
|
||||
let resp = await connection.getProgramAccounts(
|
||||
TOKEN_PROGRAM_ID,
|
||||
{
|
||||
filters,
|
||||
},
|
||||
);
|
||||
return resp
|
||||
.map(({ pubkey, account: { data, executable, owner, lamports } }) => ({
|
||||
let resp = await connection.getProgramAccounts(TOKEN_PROGRAM_ID, {
|
||||
filters,
|
||||
});
|
||||
return resp.map(
|
||||
({ pubkey, account: { data, executable, owner, lamports } }) => ({
|
||||
publicKey: new PublicKey(pubkey),
|
||||
accountInfo: {
|
||||
data,
|
||||
|
@ -90,7 +87,8 @@ export async function getOwnedTokenAccounts(
|
|||
owner: new PublicKey(owner),
|
||||
lamports,
|
||||
},
|
||||
}))
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function getTokenAccountInfo(
|
||||
|
|
|
@ -2,7 +2,6 @@ import { AccountInfo, Connection, PublicKey } from '@solana/web3.js';
|
|||
import { Market, OpenOrders } from '@project-serum/serum';
|
||||
import { Event } from '@project-serum/serum/lib/queue';
|
||||
import { Order } from '@project-serum/serum/lib/market';
|
||||
import { WalletAdapter } from '../wallet-adapters';
|
||||
|
||||
export interface ConnectionContextValues {
|
||||
endpoint: string;
|
||||
|
@ -13,15 +12,6 @@ export interface ConnectionContextValues {
|
|||
setCustomEndpoints: (newCustomEndpoints: EndpointInfo[]) => void;
|
||||
}
|
||||
|
||||
export interface WalletContextValues {
|
||||
wallet: WalletAdapter | undefined;
|
||||
connected: boolean;
|
||||
providerUrl: string;
|
||||
setProviderUrl: (newProviderUrl: string) => void;
|
||||
providerName: string;
|
||||
select: () => void;
|
||||
}
|
||||
|
||||
export interface MarketInfo {
|
||||
address: PublicKey;
|
||||
name: string;
|
||||
|
|
|
@ -1,250 +0,0 @@
|
|||
import React, {
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import Wallet from '@project-serum/sol-wallet-adapter';
|
||||
import { notify } from './notifications';
|
||||
import { useConnectionConfig } from './connection';
|
||||
import { useLocalStorageState } from './utils';
|
||||
import { WalletContextValues } from './types';
|
||||
import { Button, Modal } from 'antd';
|
||||
import {
|
||||
WalletAdapter,
|
||||
LedgerWalletAdapter,
|
||||
PhantomWalletAdapter,
|
||||
SolletExtensionAdapter,
|
||||
MathWalletAdapter,
|
||||
SolflareExtensionWalletAdapter,
|
||||
} from '../wallet-adapters';
|
||||
|
||||
const ASSET_URL =
|
||||
'https://cdn.jsdelivr.net/gh/solana-labs/oyster@main/assets/wallets';
|
||||
export const WALLET_PROVIDERS = [
|
||||
{
|
||||
name: 'sollet.io',
|
||||
url: 'https://www.sollet.io',
|
||||
icon: `${ASSET_URL}/sollet.svg`,
|
||||
},
|
||||
{
|
||||
name: 'Sollet Extension',
|
||||
url: 'https://www.sollet.io/extension',
|
||||
icon: `${ASSET_URL}/sollet.svg`,
|
||||
adapter: SolletExtensionAdapter as any,
|
||||
},
|
||||
{
|
||||
name: 'Ledger',
|
||||
url: 'https://www.ledger.com',
|
||||
icon: `${ASSET_URL}/ledger.svg`,
|
||||
adapter: LedgerWalletAdapter,
|
||||
},
|
||||
{
|
||||
name: 'Solflare',
|
||||
url: 'https://solflare.com/access-wallet',
|
||||
icon: `${ASSET_URL}/solflare.svg`,
|
||||
},
|
||||
{
|
||||
name: 'Solflare Extension',
|
||||
url: 'https://solflare.com',
|
||||
icon: `${ASSET_URL}/solflare.svg`,
|
||||
adapter: SolflareExtensionWalletAdapter,
|
||||
},
|
||||
{
|
||||
name: 'Phantom',
|
||||
url: 'https://www.phantom.app',
|
||||
icon: `https://www.phantom.app/img/logo.png`,
|
||||
adapter: PhantomWalletAdapter,
|
||||
},
|
||||
{
|
||||
name: 'MathWallet',
|
||||
url: 'https://www.mathwallet.org',
|
||||
icon: `${ASSET_URL}/mathwallet.svg`,
|
||||
adapter: MathWalletAdapter,
|
||||
},
|
||||
];
|
||||
|
||||
const WalletContext = React.createContext<null | WalletContextValues>(null);
|
||||
|
||||
export function WalletProvider({ children }) {
|
||||
const { endpoint } = useConnectionConfig();
|
||||
|
||||
const [autoConnect, setAutoConnect] = useState(false);
|
||||
const [providerUrl, setProviderUrl] = useLocalStorageState('walletProvider');
|
||||
|
||||
const provider = useMemo(
|
||||
() => WALLET_PROVIDERS.find(({ url }) => url === providerUrl),
|
||||
[providerUrl],
|
||||
);
|
||||
|
||||
let [wallet, setWallet] = useState<WalletAdapter | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (provider) {
|
||||
const updateWallet = () => {
|
||||
// hack to also update wallet synchronously in case it disconnects
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
wallet = new (provider.adapter || Wallet)(
|
||||
providerUrl,
|
||||
endpoint,
|
||||
) as WalletAdapter;
|
||||
setWallet(wallet);
|
||||
};
|
||||
|
||||
if (document.readyState !== 'complete') {
|
||||
// wait to ensure that browser extensions are loaded
|
||||
const listener = () => {
|
||||
updateWallet();
|
||||
window.removeEventListener('load', listener);
|
||||
};
|
||||
window.addEventListener('load', listener);
|
||||
return () => window.removeEventListener('load', listener);
|
||||
} else {
|
||||
updateWallet();
|
||||
}
|
||||
}
|
||||
}, [provider, providerUrl, endpoint]);
|
||||
|
||||
const [connected, setConnected] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (wallet) {
|
||||
wallet.on('connect', () => {
|
||||
if (wallet?.publicKey) {
|
||||
console.log('connected');
|
||||
localStorage.removeItem('feeDiscountKey');
|
||||
setConnected(true);
|
||||
const walletPublicKey = wallet.publicKey.toBase58();
|
||||
const keyToDisplay =
|
||||
walletPublicKey.length > 20
|
||||
? `${walletPublicKey.substring(
|
||||
0,
|
||||
7,
|
||||
)}.....${walletPublicKey.substring(
|
||||
walletPublicKey.length - 7,
|
||||
walletPublicKey.length,
|
||||
)}`
|
||||
: walletPublicKey;
|
||||
|
||||
notify({
|
||||
message: 'Wallet update',
|
||||
description: 'Connected to wallet ' + keyToDisplay,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
wallet.on('disconnect', () => {
|
||||
setConnected(false);
|
||||
notify({
|
||||
message: 'Wallet update',
|
||||
description: 'Disconnected from wallet',
|
||||
});
|
||||
localStorage.removeItem('feeDiscountKey');
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
setConnected(false);
|
||||
if (wallet && wallet.connected) {
|
||||
wallet.disconnect();
|
||||
setConnected(false);
|
||||
}
|
||||
};
|
||||
}, [wallet]);
|
||||
|
||||
useEffect(() => {
|
||||
if (wallet && autoConnect) {
|
||||
wallet.connect();
|
||||
setAutoConnect(false);
|
||||
}
|
||||
|
||||
return () => {};
|
||||
}, [wallet, autoConnect]);
|
||||
|
||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||
|
||||
const select = useCallback(() => setIsModalVisible(true), []);
|
||||
const close = useCallback(() => setIsModalVisible(false), []);
|
||||
|
||||
return (
|
||||
<WalletContext.Provider
|
||||
value={{
|
||||
wallet,
|
||||
connected,
|
||||
select,
|
||||
providerUrl,
|
||||
setProviderUrl,
|
||||
providerName:
|
||||
WALLET_PROVIDERS.find(({ url }) => url === providerUrl)?.name ??
|
||||
providerUrl,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
<Modal
|
||||
title="Select Wallet"
|
||||
okText="Connect"
|
||||
visible={isModalVisible}
|
||||
okButtonProps={{ style: { display: 'none' } }}
|
||||
onCancel={close}
|
||||
width={400}
|
||||
>
|
||||
{WALLET_PROVIDERS.map((provider) => {
|
||||
const onClick = function () {
|
||||
setProviderUrl(provider.url);
|
||||
setAutoConnect(true);
|
||||
close();
|
||||
};
|
||||
|
||||
return (
|
||||
<Button
|
||||
size="large"
|
||||
type={providerUrl === provider.url ? 'primary' : 'ghost'}
|
||||
onClick={onClick}
|
||||
icon={
|
||||
<img
|
||||
alt={`${provider.name}`}
|
||||
width={20}
|
||||
height={20}
|
||||
src={provider.icon}
|
||||
style={{ marginRight: 8 }}
|
||||
/>
|
||||
}
|
||||
style={{
|
||||
display: 'block',
|
||||
width: '100%',
|
||||
textAlign: 'left',
|
||||
marginBottom: 8,
|
||||
}}
|
||||
>
|
||||
{provider.name}
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</Modal>
|
||||
</WalletContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useWallet() {
|
||||
const context = useContext(WalletContext);
|
||||
if (!context) {
|
||||
throw new Error('Missing wallet context');
|
||||
}
|
||||
|
||||
const wallet = context.wallet;
|
||||
return {
|
||||
connected: context.connected,
|
||||
wallet: wallet,
|
||||
providerUrl: context.providerUrl,
|
||||
setProvider: context.setProviderUrl,
|
||||
providerName: context.providerName,
|
||||
select: context.select,
|
||||
connect() {
|
||||
wallet ? wallet.connect() : context.select();
|
||||
},
|
||||
disconnect() {
|
||||
wallet?.disconnect();
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
export * from './ledger';
|
||||
export * from './phantom';
|
||||
export * from './sollet-extension';
|
||||
export * from './math';
|
||||
export * from './types';
|
||||
export * from './solflare-extension';
|
|
@ -1,133 +0,0 @@
|
|||
import type Transport from '@ledgerhq/hw-transport';
|
||||
import type { Transaction } from '@solana/web3.js';
|
||||
|
||||
import { PublicKey } from '@solana/web3.js';
|
||||
|
||||
const INS_GET_PUBKEY = 0x05;
|
||||
const INS_SIGN_MESSAGE = 0x06;
|
||||
|
||||
const P1_NON_CONFIRM = 0x00;
|
||||
const P1_CONFIRM = 0x01;
|
||||
|
||||
const P2_EXTEND = 0x01;
|
||||
const P2_MORE = 0x02;
|
||||
|
||||
const MAX_PAYLOAD = 255;
|
||||
|
||||
const LEDGER_CLA = 0xe0;
|
||||
|
||||
/*
|
||||
* Helper for chunked send of large payloads
|
||||
*/
|
||||
async function ledgerSend(
|
||||
transport: Transport,
|
||||
instruction: number,
|
||||
p1: number,
|
||||
payload: Buffer,
|
||||
) {
|
||||
let p2 = 0;
|
||||
let payloadOffset = 0;
|
||||
|
||||
if (payload.length > MAX_PAYLOAD) {
|
||||
while (payload.length - payloadOffset > MAX_PAYLOAD) {
|
||||
const chunk = payload.slice(payloadOffset, payloadOffset + MAX_PAYLOAD);
|
||||
payloadOffset += MAX_PAYLOAD;
|
||||
console.log(
|
||||
'send',
|
||||
(p2 | P2_MORE).toString(16),
|
||||
chunk.length.toString(16),
|
||||
chunk,
|
||||
);
|
||||
const reply = await transport.send(
|
||||
LEDGER_CLA,
|
||||
instruction,
|
||||
p1,
|
||||
p2 | P2_MORE,
|
||||
chunk,
|
||||
);
|
||||
if (reply.length !== 2) {
|
||||
throw new Error('Received unexpected reply payload');
|
||||
}
|
||||
p2 |= P2_EXTEND;
|
||||
}
|
||||
}
|
||||
|
||||
const chunk = payload.slice(payloadOffset);
|
||||
console.log('send', p2.toString(16), chunk.length.toString(16), chunk);
|
||||
const reply = await transport.send(LEDGER_CLA, instruction, p1, p2, chunk);
|
||||
|
||||
return reply.slice(0, reply.length - 2);
|
||||
}
|
||||
|
||||
const BIP32_HARDENED_BIT = (1 << 31) >>> 0;
|
||||
function harden(n: number = 0) {
|
||||
return (n | BIP32_HARDENED_BIT) >>> 0;
|
||||
}
|
||||
|
||||
export function getSolanaDerivationPath(account?: number, change?: number) {
|
||||
var length;
|
||||
if (account !== undefined) {
|
||||
if (change !== undefined) {
|
||||
length = 4;
|
||||
} else {
|
||||
length = 3;
|
||||
}
|
||||
} else {
|
||||
length = 2;
|
||||
}
|
||||
|
||||
var derivationPath = Buffer.alloc(1 + length * 4);
|
||||
// eslint-disable-next-line
|
||||
var offset = 0;
|
||||
offset = derivationPath.writeUInt8(length, offset);
|
||||
offset = derivationPath.writeUInt32BE(harden(44), offset); // Using BIP44
|
||||
offset = derivationPath.writeUInt32BE(harden(501), offset); // Solana's BIP44 path
|
||||
|
||||
if (length > 2) {
|
||||
offset = derivationPath.writeUInt32BE(harden(account), offset);
|
||||
if (length === 4) {
|
||||
// @FIXME: https://github.com/project-serum/spl-token-wallet/issues/59
|
||||
offset = derivationPath.writeUInt32BE(harden(change), offset);
|
||||
}
|
||||
}
|
||||
|
||||
return derivationPath;
|
||||
}
|
||||
|
||||
export async function signTransaction(
|
||||
transport: Transport,
|
||||
transaction: Transaction,
|
||||
derivationPath: Buffer = getSolanaDerivationPath(),
|
||||
) {
|
||||
const messageBytes = transaction.serializeMessage();
|
||||
return signBytes(transport, messageBytes, derivationPath);
|
||||
}
|
||||
|
||||
export async function signBytes(
|
||||
transport: Transport,
|
||||
bytes: Buffer,
|
||||
derivationPath: Buffer = getSolanaDerivationPath(),
|
||||
) {
|
||||
const numPaths = Buffer.alloc(1);
|
||||
numPaths.writeUInt8(1, 0);
|
||||
|
||||
const payload = Buffer.concat([numPaths, derivationPath, bytes]);
|
||||
|
||||
// @FIXME: must enable blind signing in Solana Ledger App per https://github.com/project-serum/spl-token-wallet/issues/71
|
||||
// See also https://github.com/project-serum/spl-token-wallet/pull/23#issuecomment-712317053
|
||||
return ledgerSend(transport, INS_SIGN_MESSAGE, P1_CONFIRM, payload);
|
||||
}
|
||||
|
||||
export async function getPublicKey(
|
||||
transport: Transport,
|
||||
derivationPath: Buffer = getSolanaDerivationPath(),
|
||||
) {
|
||||
const publicKeyBytes = await ledgerSend(
|
||||
transport,
|
||||
INS_GET_PUBKEY,
|
||||
P1_NON_CONFIRM,
|
||||
derivationPath,
|
||||
);
|
||||
|
||||
return new PublicKey(publicKeyBytes);
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
import type Transport from '@ledgerhq/hw-transport';
|
||||
import type { Transaction } from '@solana/web3.js';
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
import { PublicKey } from '@solana/web3.js';
|
||||
import TransportWebUSB from '@ledgerhq/hw-transport-webusb';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { getPublicKey, signTransaction } from './core';
|
||||
import { DEFAULT_PUBLIC_KEY, WalletAdapter } from '../types';
|
||||
|
||||
export class LedgerWalletAdapter extends EventEmitter implements WalletAdapter {
|
||||
_connecting: boolean;
|
||||
_publicKey: PublicKey | null;
|
||||
_transport: Transport | null;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._connecting = false;
|
||||
this._publicKey = null;
|
||||
this._transport = null;
|
||||
}
|
||||
|
||||
get publicKey() {
|
||||
return this._publicKey || DEFAULT_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return this._publicKey !== null;
|
||||
}
|
||||
|
||||
get autoApprove() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async signAllTransactions(
|
||||
transactions: Transaction[],
|
||||
): Promise<Transaction[]> {
|
||||
const result: Transaction[] = [];
|
||||
for (let i = 0; i < transactions.length; i++) {
|
||||
const transaction = transactions[i];
|
||||
const signed = await this.signTransaction(transaction);
|
||||
result.push(signed);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async signTransaction(transaction: Transaction) {
|
||||
if (!this._transport || !this._publicKey) {
|
||||
throw new Error('Not connected to Ledger');
|
||||
}
|
||||
|
||||
// @TODO: account selection (derivation path changes with account)
|
||||
const signature = await signTransaction(this._transport, transaction);
|
||||
|
||||
transaction.addSignature(this._publicKey, signature);
|
||||
|
||||
return transaction;
|
||||
}
|
||||
|
||||
async connect() {
|
||||
if (this._connecting) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._connecting = true;
|
||||
|
||||
try {
|
||||
// @TODO: transport selection (WebUSB, WebHID, bluetooth, ...)
|
||||
this._transport = await TransportWebUSB.create();
|
||||
// @TODO: account selection
|
||||
this._publicKey = await getPublicKey(this._transport);
|
||||
this.emit('connect', this._publicKey);
|
||||
} catch (error) {
|
||||
notify({
|
||||
message: 'Ledger Error',
|
||||
description: error.message,
|
||||
});
|
||||
await this.disconnect();
|
||||
} finally {
|
||||
this._connecting = false;
|
||||
}
|
||||
}
|
||||
|
||||
async disconnect() {
|
||||
let emit = false;
|
||||
if (this._transport) {
|
||||
await this._transport.close();
|
||||
this._transport = null;
|
||||
emit = true;
|
||||
}
|
||||
|
||||
this._connecting = false;
|
||||
this._publicKey = null;
|
||||
|
||||
if (emit) {
|
||||
this.emit('disconnect');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
import EventEmitter from 'eventemitter3';
|
||||
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { DEFAULT_PUBLIC_KEY, WalletAdapter } from '../types';
|
||||
|
||||
export class MathWalletAdapter extends EventEmitter implements WalletAdapter {
|
||||
_publicKey?: PublicKey;
|
||||
_onProcess: boolean;
|
||||
_connected: boolean;
|
||||
constructor() {
|
||||
super();
|
||||
this._onProcess = false;
|
||||
this._connected = false;
|
||||
this.connect = this.connect.bind(this);
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return this._connected;
|
||||
}
|
||||
|
||||
get autoApprove() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async signAllTransactions(
|
||||
transactions: Transaction[],
|
||||
): Promise<Transaction[]> {
|
||||
if (!this._provider) {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
return this._provider.signAllTransactions(transactions);
|
||||
}
|
||||
|
||||
private get _provider() {
|
||||
if ((window as any)?.solana?.isMathWallet) {
|
||||
return (window as any).solana;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
get publicKey() {
|
||||
return this._publicKey || DEFAULT_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
async signTransaction(transaction: Transaction) {
|
||||
if (!this._provider) {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
return this._provider.signTransaction(transaction);
|
||||
}
|
||||
|
||||
connect() {
|
||||
if (this._onProcess) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._provider) {
|
||||
window.open('https://mathwallet.org/', '_blank');
|
||||
notify({
|
||||
message: 'Math Wallet Error',
|
||||
description: 'Please install mathwallet',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this._onProcess = true;
|
||||
this._provider
|
||||
.getAccount()
|
||||
.then((account: any) => {
|
||||
this._publicKey = new PublicKey(account);
|
||||
this._connected = true;
|
||||
this.emit('connect', this._publicKey);
|
||||
})
|
||||
.catch(() => {
|
||||
this.disconnect();
|
||||
})
|
||||
.finally(() => {
|
||||
this._onProcess = false;
|
||||
});
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this._publicKey) {
|
||||
this._publicKey = undefined;
|
||||
this._connected = false;
|
||||
this.emit('disconnect');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
import EventEmitter from 'eventemitter3';
|
||||
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { DEFAULT_PUBLIC_KEY, WalletAdapter } from '../types';
|
||||
|
||||
type PhantomEvent = 'disconnect' | 'connect';
|
||||
type PhantomRequestMethod =
|
||||
| 'connect'
|
||||
| 'disconnect'
|
||||
| 'signTransaction'
|
||||
| 'signAllTransactions';
|
||||
|
||||
interface PhantomProvider {
|
||||
publicKey?: PublicKey;
|
||||
isConnected?: boolean;
|
||||
autoApprove?: boolean;
|
||||
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
||||
signAllTransactions: (transactions: Transaction[]) => Promise<Transaction[]>;
|
||||
connect: () => Promise<void>;
|
||||
disconnect: () => Promise<void>;
|
||||
on: (event: PhantomEvent, handler: (args: any) => void) => void;
|
||||
request: (method: PhantomRequestMethod, params: any) => Promise<any>;
|
||||
listeners: (event: PhantomEvent) => (() => void)[];
|
||||
}
|
||||
|
||||
export class PhantomWalletAdapter
|
||||
extends EventEmitter
|
||||
implements WalletAdapter {
|
||||
constructor() {
|
||||
super();
|
||||
this.connect = this.connect.bind(this);
|
||||
}
|
||||
|
||||
private get _provider(): PhantomProvider | undefined {
|
||||
if ((window as any)?.solana?.isPhantom) {
|
||||
return (window as any).solana;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private _handleConnect = (...args) => {
|
||||
this.emit('connect', ...args);
|
||||
}
|
||||
|
||||
private _handleDisconnect = (...args) => {
|
||||
this.emit('disconnect', ...args);
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return this._provider?.isConnected || false;
|
||||
}
|
||||
|
||||
get autoApprove() {
|
||||
return this._provider?.autoApprove || false;
|
||||
}
|
||||
|
||||
async signAllTransactions(
|
||||
transactions: Transaction[],
|
||||
): Promise<Transaction[]> {
|
||||
if (!this._provider) {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
return this._provider.signAllTransactions(transactions);
|
||||
}
|
||||
|
||||
get publicKey() {
|
||||
return this._provider?.publicKey || DEFAULT_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
async signTransaction(transaction: Transaction) {
|
||||
if (!this._provider) {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
return this._provider.signTransaction(transaction);
|
||||
}
|
||||
|
||||
connect() {
|
||||
if (!this._provider) {
|
||||
window.open('https://phantom.app/', '_blank');
|
||||
notify({
|
||||
message: 'Connection Error',
|
||||
description: 'Please install Phantom wallet',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this._provider.listeners('connect').length) {
|
||||
this._provider?.on('connect', this._handleConnect);
|
||||
}
|
||||
if (!this._provider.listeners('disconnect').length) {
|
||||
this._provider?.on('disconnect', this._handleDisconnect);
|
||||
}
|
||||
return this._provider?.connect();
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this._provider) {
|
||||
this._provider.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
import EventEmitter from 'eventemitter3';
|
||||
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { DEFAULT_PUBLIC_KEY, WalletAdapter } from '../types';
|
||||
|
||||
type SolflareExtensionEvent = 'disconnect' | 'connect';
|
||||
type SolflareExtensionRequestMethod =
|
||||
| 'connect'
|
||||
| 'disconnect'
|
||||
| 'signTransaction'
|
||||
| 'signAllTransactions';
|
||||
|
||||
interface SolflareExtensionProvider {
|
||||
publicKey?: PublicKey;
|
||||
isConnected?: boolean;
|
||||
autoApprove?: boolean;
|
||||
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
||||
signAllTransactions: (transactions: Transaction[]) => Promise<Transaction[]>;
|
||||
connect: () => Promise<void>;
|
||||
disconnect: () => Promise<void>;
|
||||
on: (event: SolflareExtensionEvent, handler: (args: any) => void) => void;
|
||||
off: (event: SolflareExtensionEvent, handler: (args: any) => void) => void;
|
||||
request: (method: SolflareExtensionRequestMethod, params: any) => Promise<any>;
|
||||
}
|
||||
|
||||
export class SolflareExtensionWalletAdapter
|
||||
extends EventEmitter
|
||||
implements WalletAdapter {
|
||||
constructor() {
|
||||
super();
|
||||
this.connect = this.connect.bind(this);
|
||||
}
|
||||
|
||||
private get _provider(): SolflareExtensionProvider | undefined {
|
||||
if ((window as any)?.solflare?.isSolflare) {
|
||||
return (window as any).solflare;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private _handleConnect = (...args) => {
|
||||
this.emit('connect', ...args);
|
||||
}
|
||||
|
||||
private _handleDisconnect = (...args) => {
|
||||
this._provider?.off('connect', this._handleConnect);
|
||||
this._provider?.off('disconnect', this._handleDisconnect);
|
||||
this.emit('disconnect', ...args);
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return this._provider?.isConnected || false;
|
||||
}
|
||||
|
||||
get autoApprove() {
|
||||
return this._provider?.autoApprove || false;
|
||||
}
|
||||
|
||||
async signAllTransactions(
|
||||
transactions: Transaction[],
|
||||
): Promise<Transaction[]> {
|
||||
if (!this._provider) {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
return this._provider.signAllTransactions(transactions);
|
||||
}
|
||||
|
||||
get publicKey() {
|
||||
return this._provider?.publicKey || DEFAULT_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
async signTransaction(transaction: Transaction) {
|
||||
if (!this._provider) {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
return this._provider.signTransaction(transaction);
|
||||
}
|
||||
|
||||
async connect() {
|
||||
if (!this._provider) {
|
||||
window.open('https://solflare.com/', '_blank');
|
||||
notify({
|
||||
message: 'Connection Error',
|
||||
description: 'Please install Solflare extension',
|
||||
});
|
||||
return;
|
||||
}
|
||||
this._provider?.on('connect', this._handleConnect);
|
||||
this._provider?.on('disconnect', this._handleDisconnect);
|
||||
return this._provider?.connect();
|
||||
}
|
||||
|
||||
async disconnect() {
|
||||
if (this._provider) {
|
||||
this._provider.disconnect();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
import Wallet from '@project-serum/sol-wallet-adapter';
|
||||
import { notify } from '../../utils/notifications';
|
||||
|
||||
export function SolletExtensionAdapter(_, network) {
|
||||
const sollet = (window as any).sollet;
|
||||
if (sollet) {
|
||||
return new Wallet(sollet, network);
|
||||
}
|
||||
|
||||
return {
|
||||
on: () => {},
|
||||
connect: () => {
|
||||
notify({
|
||||
message: 'Sollet Extension Error',
|
||||
description: 'Please install the Sollet Extension for Chrome',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
import EventEmitter from 'eventemitter3';
|
||||
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||
import { notify } from '../../utils/notifications';
|
||||
import { DEFAULT_PUBLIC_KEY, WalletAdapter } from '../types';
|
||||
|
||||
export class SolongWalletAdapter extends EventEmitter implements WalletAdapter {
|
||||
_publicKey?: PublicKey;
|
||||
_onProcess: boolean;
|
||||
_connected: boolean;
|
||||
constructor() {
|
||||
super();
|
||||
this._onProcess = false;
|
||||
this._connected = false;
|
||||
this.connect = this.connect.bind(this);
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return this._connected;
|
||||
}
|
||||
|
||||
get autoApprove() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async signAllTransactions(
|
||||
transactions: Transaction[],
|
||||
): Promise<Transaction[]> {
|
||||
const solong = (window as any).solong;
|
||||
if (solong.signAllTransactions) {
|
||||
return solong.signAllTransactions(transactions);
|
||||
} else {
|
||||
const result: Transaction[] = [];
|
||||
for (let i = 0; i < transactions.length; i++) {
|
||||
const transaction = transactions[i];
|
||||
const signed = await solong.signTransaction(transaction);
|
||||
result.push(signed);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
get publicKey() {
|
||||
return this._publicKey || DEFAULT_PUBLIC_KEY;
|
||||
}
|
||||
|
||||
async signTransaction(transaction: Transaction) {
|
||||
return (window as any).solong.signTransaction(transaction);
|
||||
}
|
||||
|
||||
connect() {
|
||||
if (this._onProcess) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((window as any).solong === undefined) {
|
||||
notify({
|
||||
message: 'Solong Error',
|
||||
description: 'Please install solong wallet from Chrome ',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this._onProcess = true;
|
||||
(window as any).solong
|
||||
.selectAccount()
|
||||
.then((account: any) => {
|
||||
this._publicKey = new PublicKey(account);
|
||||
this._connected = true;
|
||||
this.emit('connect', this._publicKey);
|
||||
})
|
||||
.catch(() => {
|
||||
this.disconnect();
|
||||
})
|
||||
.finally(() => {
|
||||
this._onProcess = false;
|
||||
});
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this._publicKey) {
|
||||
this._publicKey = undefined;
|
||||
this._connected = false;
|
||||
this.emit('disconnect');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||
|
||||
export const DEFAULT_PUBLIC_KEY = new PublicKey(
|
||||
'11111111111111111111111111111111',
|
||||
);
|
||||
|
||||
export interface WalletAdapter {
|
||||
publicKey: PublicKey;
|
||||
autoApprove: boolean;
|
||||
connected: boolean;
|
||||
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
||||
signAllTransactions: (transaction: Transaction[]) => Promise<Transaction[]>;
|
||||
connect: () => any;
|
||||
disconnect: () => any;
|
||||
on<T>(event: string, fn: () => void): this;
|
||||
}
|
|
@ -17,9 +17,15 @@
|
|||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react",
|
||||
"lib": ["dom", "esnext"]
|
||||
"lib": [
|
||||
"dom",
|
||||
"esnext"
|
||||
],
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["./src/"],
|
||||
"include": [
|
||||
"./src/"
|
||||
],
|
||||
"exclude": [
|
||||
"./src/**/*.test.js",
|
||||
"node_modules",
|
||||
|
|
500
yarn.lock
500
yarn.lock
|
@ -248,6 +248,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af"
|
||||
integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==
|
||||
|
||||
"@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9":
|
||||
version "7.19.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf"
|
||||
integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==
|
||||
|
||||
"@babel/helper-remap-async-to-generator@^7.13.0":
|
||||
version "7.13.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz#376a760d9f7b4b2077a9dd05aa9c3927cadb2209"
|
||||
|
@ -281,6 +286,13 @@
|
|||
dependencies:
|
||||
"@babel/types" "^7.12.1"
|
||||
|
||||
"@babel/helper-skip-transparent-expression-wrappers@^7.18.9":
|
||||
version "7.18.9"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818"
|
||||
integrity sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw==
|
||||
dependencies:
|
||||
"@babel/types" "^7.18.9"
|
||||
|
||||
"@babel/helper-split-export-declaration@^7.12.13":
|
||||
version "7.12.13"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05"
|
||||
|
@ -288,11 +300,21 @@
|
|||
dependencies:
|
||||
"@babel/types" "^7.12.13"
|
||||
|
||||
"@babel/helper-string-parser@^7.19.4":
|
||||
version "7.19.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
|
||||
integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==
|
||||
|
||||
"@babel/helper-validator-identifier@^7.12.11":
|
||||
version "7.12.11"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed"
|
||||
integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==
|
||||
|
||||
"@babel/helper-validator-identifier@^7.19.1":
|
||||
version "7.19.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
|
||||
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==
|
||||
|
||||
"@babel/helper-validator-option@^7.12.17":
|
||||
version "7.12.17"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831"
|
||||
|
@ -413,6 +435,14 @@
|
|||
"@babel/helper-plugin-utils" "^7.13.0"
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0"
|
||||
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6":
|
||||
version "7.18.6"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1"
|
||||
integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.18.6"
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
|
||||
|
||||
"@babel/plugin-proposal-numeric-separator@7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz#5d6769409699ec9b3b68684cd8116cedff93bad8"
|
||||
|
@ -463,6 +493,15 @@
|
|||
"@babel/helper-skip-transparent-expression-wrappers" "^7.12.1"
|
||||
"@babel/plugin-syntax-optional-chaining" "^7.8.0"
|
||||
|
||||
"@babel/plugin-proposal-optional-chaining@^7.18.9":
|
||||
version "7.18.9"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz#e8e8fe0723f2563960e4bf5e9690933691915993"
|
||||
integrity sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.18.9"
|
||||
"@babel/helper-skip-transparent-expression-wrappers" "^7.18.9"
|
||||
"@babel/plugin-syntax-optional-chaining" "^7.8.3"
|
||||
|
||||
"@babel/plugin-proposal-private-methods@^7.13.0":
|
||||
version "7.13.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787"
|
||||
|
@ -542,7 +581,7 @@
|
|||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.10.4"
|
||||
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0":
|
||||
"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0", "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
|
||||
integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==
|
||||
|
@ -570,7 +609,7 @@
|
|||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.8.0"
|
||||
|
||||
"@babel/plugin-syntax-optional-chaining@^7.8.0":
|
||||
"@babel/plugin-syntax-optional-chaining@^7.8.0", "@babel/plugin-syntax-optional-chaining@^7.8.3":
|
||||
version "7.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
|
||||
integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==
|
||||
|
@ -874,6 +913,13 @@
|
|||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.12.13"
|
||||
|
||||
"@babel/plugin-transform-shorthand-properties@^7.18.6":
|
||||
version "7.18.6"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9"
|
||||
integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.18.6"
|
||||
|
||||
"@babel/plugin-transform-spread@^7.13.0", "@babel/plugin-transform-spread@^7.8.3":
|
||||
version "7.13.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz#84887710e273c1815ace7ae459f6f42a5d31d5fd"
|
||||
|
@ -1145,6 +1191,13 @@
|
|||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/runtime@^7.17.2":
|
||||
version "7.19.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.4.tgz#a42f814502ee467d55b38dd1c256f53a7b885c78"
|
||||
integrity sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/template@^7.12.13", "@babel/template@^7.4.0", "@babel/template@^7.8.6":
|
||||
version "7.12.13"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327"
|
||||
|
@ -1178,6 +1231,15 @@
|
|||
lodash "^4.17.19"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@babel/types@^7.18.9":
|
||||
version "7.19.4"
|
||||
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7"
|
||||
integrity sha512-M5LK7nAeS6+9j7hAq+b3fQs+pNfUtTGq+yFFfHnauFA8zQtLRfmuipmsKDKKLuyG+wC8ABW43A153YNawNTEtw==
|
||||
dependencies:
|
||||
"@babel/helper-string-parser" "^7.19.4"
|
||||
"@babel/helper-validator-identifier" "^7.19.1"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@cnakazawa/watch@^1.0.3":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a"
|
||||
|
@ -1433,6 +1495,16 @@
|
|||
"@types/yargs" "^15.0.0"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@ledgerhq/devices@6.27.1", "@ledgerhq/devices@^6.27.1":
|
||||
version "6.27.1"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.27.1.tgz#3b13ab1d1ba8201e9e74a08f390560483978c962"
|
||||
integrity sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ==
|
||||
dependencies:
|
||||
"@ledgerhq/errors" "^6.10.0"
|
||||
"@ledgerhq/logs" "^6.10.0"
|
||||
rxjs "6"
|
||||
semver "^7.3.5"
|
||||
|
||||
"@ledgerhq/devices@^5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.43.0.tgz#9b8ca838a7f8ece74098dc84aa6468eb7651972d"
|
||||
|
@ -1443,11 +1515,36 @@
|
|||
rxjs "^6.6.3"
|
||||
semver "^7.3.4"
|
||||
|
||||
"@ledgerhq/devices@^7.0.3":
|
||||
version "7.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-7.0.3.tgz#bdd7e8ce078399fe644067a7e1ca9a9d2e249c02"
|
||||
integrity sha512-URlcgq6yKklWxj35nIu/eTF0UpGLGUOp69xp8uHeyoMK2wqVC0GNGeD2MvKyJ+ul83edqMEI98GycA98Y7trsg==
|
||||
dependencies:
|
||||
"@ledgerhq/errors" "^6.11.1"
|
||||
"@ledgerhq/logs" "^6.10.1"
|
||||
rxjs "6"
|
||||
semver "^7.3.5"
|
||||
|
||||
"@ledgerhq/errors@^5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.43.0.tgz#6bec77ebc31c4333a7f8d13b1f3f4d739b859b75"
|
||||
integrity sha512-ZjKlUQbIn/DHXAefW3Y1VyDrlVhVqqGnXzrqbOXuDbZ2OAIfSe/A1mrlCbWt98jP/8EJQBuCzBOtnmpXIL/nYg==
|
||||
|
||||
"@ledgerhq/errors@^6.10.0", "@ledgerhq/errors@^6.11.1":
|
||||
version "6.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.11.1.tgz#a8a81bda6d28ac43c757e109b1ff079ddeec54a6"
|
||||
integrity sha512-HT1PFvNrejcN5z3ba6xikacIdHWMkjBeE9U5FFoGHhaKBKGjC74mnCeEo0/oJunyuVId+9mhGnv6lrBl6Mkqdg==
|
||||
|
||||
"@ledgerhq/hw-transport-webhid@6.27.1":
|
||||
version "6.27.1"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.27.1.tgz#8fd1710d23b6bd7cbe2382dd02054dfabe788447"
|
||||
integrity sha512-u74rBYlibpbyGblSn74fRs2pMM19gEAkYhfVibq0RE1GNFjxDMFC1n7Sb+93Jqmz8flyfB4UFJsxs8/l1tm2Kw==
|
||||
dependencies:
|
||||
"@ledgerhq/devices" "^6.27.1"
|
||||
"@ledgerhq/errors" "^6.10.0"
|
||||
"@ledgerhq/hw-transport" "^6.27.1"
|
||||
"@ledgerhq/logs" "^6.10.0"
|
||||
|
||||
"@ledgerhq/hw-transport-webusb@^5.41.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-5.43.0.tgz#02fa4a51dd93efae73e2caa1005be9782c381066"
|
||||
|
@ -1458,6 +1555,15 @@
|
|||
"@ledgerhq/hw-transport" "^5.43.0"
|
||||
"@ledgerhq/logs" "^5.43.0"
|
||||
|
||||
"@ledgerhq/hw-transport@6.27.1":
|
||||
version "6.27.1"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.1.tgz#88072278f69c279cb6569352acd4ae2fec33ace3"
|
||||
integrity sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ==
|
||||
dependencies:
|
||||
"@ledgerhq/devices" "^6.27.1"
|
||||
"@ledgerhq/errors" "^6.10.0"
|
||||
events "^3.3.0"
|
||||
|
||||
"@ledgerhq/hw-transport@^5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.43.0.tgz#dc9863706d31bae96aed66f193b8922a876cbf82"
|
||||
|
@ -1467,11 +1573,25 @@
|
|||
"@ledgerhq/errors" "^5.43.0"
|
||||
events "^3.2.0"
|
||||
|
||||
"@ledgerhq/hw-transport@^6.27.1":
|
||||
version "6.27.6"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.6.tgz#87f886591bad047c18e76920519aceb9d844667b"
|
||||
integrity sha512-DRGUsB8WfbeEPuU42nAtwYpA5D6Bq3q1CvC2VjDinkukLcf6XMc22YUJl9mxt+h+/cLTU1Ff/pz+fqYqeELLEA==
|
||||
dependencies:
|
||||
"@ledgerhq/devices" "^7.0.3"
|
||||
"@ledgerhq/errors" "^6.11.1"
|
||||
events "^3.3.0"
|
||||
|
||||
"@ledgerhq/logs@^5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.43.0.tgz#031bad4b8a3525c5e14210afde0bc09c79564026"
|
||||
integrity sha512-QWfQjea3ekh9ZU+JeL2tJC9cTKLZ/JrcS0JGatLejpRYxQajvnHvHfh0dbHOKXEaXfCskEPTZ3f1kzuts742GA==
|
||||
|
||||
"@ledgerhq/logs@^6.10.0", "@ledgerhq/logs@^6.10.1":
|
||||
version "6.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.1.tgz#5bd16082261d7364eabb511c788f00937dac588d"
|
||||
integrity sha512-z+ILK8Q3y+nfUl43ctCPuR4Y2bIxk/ooCQFwZxhtci1EhAtMDzMAx2W25qx8G1PPL9UUOdnUax19+F0OjXoj4w==
|
||||
|
||||
"@mrmlnc/readdir-enhanced@^2.2.1":
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
|
||||
|
@ -1480,6 +1600,21 @@
|
|||
call-me-maybe "^1.0.1"
|
||||
glob-to-regexp "^0.3.0"
|
||||
|
||||
"@noble/ed25519@^1.7.0":
|
||||
version "1.7.1"
|
||||
resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.1.tgz#6899660f6fbb97798a6fbd227227c4589a454724"
|
||||
integrity sha512-Rk4SkJFaXZiznFyC/t77Q0NKS4FL7TLJJsVG2V2oiEq3kJVeTdxysEe/yRWSpnWMe808XRDJ+VFh5pt/FN5plw==
|
||||
|
||||
"@noble/hashes@^1.1.2":
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111"
|
||||
integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==
|
||||
|
||||
"@noble/secp256k1@^1.6.3":
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1"
|
||||
integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw==
|
||||
|
||||
"@nodelib/fs.stat@^1.1.2":
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
|
||||
|
@ -1548,9 +1683,9 @@
|
|||
buffer-layout "^1.2.0"
|
||||
|
||||
"@project-serum/serum@^0.13.58":
|
||||
version "0.13.58"
|
||||
resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.58.tgz#0f4aaa98f28c1220f8131052cd33b36d43430266"
|
||||
integrity sha512-g8PNsFiJ3qTGu5B1qHdGIfmXovka3DpC9cMhyYzdKKX3WqdpzHrwKYO/ZuqH+JBp+dGfjYTxRLQ3dNTxYWohHA==
|
||||
version "0.13.65"
|
||||
resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.65.tgz#6d3cf07912f13985765237f053cca716fe84b0b0"
|
||||
integrity sha512-BHRqsTqPSfFB5p+MgI2pjvMBAQtO8ibTK2fYY96boIFkCI3TTwXDt2gUmspeChKO2pqHr5aKevmexzAcXxrSRA==
|
||||
dependencies:
|
||||
"@project-serum/anchor" "^0.11.1"
|
||||
"@solana/spl-token" "^0.1.6"
|
||||
|
@ -1567,7 +1702,7 @@
|
|||
bn.js "^5.1.2"
|
||||
buffer-layout "^1.2.0"
|
||||
|
||||
"@project-serum/sol-wallet-adapter@^0.2.0":
|
||||
"@project-serum/sol-wallet-adapter@0.2.0":
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@project-serum/sol-wallet-adapter/-/sol-wallet-adapter-0.2.0.tgz#e1fa5508bf13110429bf26e10b818182015f2161"
|
||||
integrity sha512-ed7wZwlDqjF88VCq7eHVO8njHqdUkBxBL8WEVOnB47ooLO4btOJt6GBdkKpKqKX86c86LiEROJclcdW8e7kIjg==
|
||||
|
@ -1575,11 +1710,50 @@
|
|||
bs58 "^4.0.1"
|
||||
eventemitter3 "^4.0.4"
|
||||
|
||||
"@project-serum/sol-wallet-adapter@^0.2.0", "@project-serum/sol-wallet-adapter@^0.2.6":
|
||||
version "0.2.6"
|
||||
resolved "https://registry.yarnpkg.com/@project-serum/sol-wallet-adapter/-/sol-wallet-adapter-0.2.6.tgz#b4cd25a566294354427c97c26d716112b91a0107"
|
||||
integrity sha512-cpIb13aWPW8y4KzkZAPDgw+Kb+DXjCC6rZoH74MGm3I/6e/zKyGnfAuW5olb2zxonFqsYgnv7ev8MQnvSgJ3/g==
|
||||
dependencies:
|
||||
bs58 "^4.0.1"
|
||||
eventemitter3 "^4.0.7"
|
||||
|
||||
"@react-native-async-storage/async-storage@^1.17.7":
|
||||
version "1.17.10"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.10.tgz#8d6a4771912be8454a9e215eebd469b1b8e2e638"
|
||||
integrity sha512-KrR021BmBLsA0TT1AAsfH16bHYy0MSbhdAeBAqpriak3GS1T2alFcdTUvn13p0ZW6FKRD6Bd3ryU2zhU/IYYJQ==
|
||||
dependencies:
|
||||
merge-options "^3.0.4"
|
||||
|
||||
"@sheerun/mutationobserver-shim@^0.3.2":
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25"
|
||||
integrity sha512-DetpxZw1fzPD5xUBrIAoplLChO2VB8DlL5Gg+I1IR9b2wPqYIca2WSUxL5g1vLeR4MsQq1NeWriXAVffV+U1Fw==
|
||||
|
||||
"@solana-mobile/mobile-wallet-adapter-protocol-web3js@^0.9.7":
|
||||
version "0.9.7"
|
||||
resolved "https://registry.yarnpkg.com/@solana-mobile/mobile-wallet-adapter-protocol-web3js/-/mobile-wallet-adapter-protocol-web3js-0.9.7.tgz#0c9824a5528e14b96d35b80904d8d19245e81bf5"
|
||||
integrity sha512-2VP1zzEip9C7BtIa+FU6sVOWEgd5x5FvBBzeUCL6gGIAmxD0d6nr9J8REzcx371eA7CPaFur+eVakdpRKzzP0A==
|
||||
dependencies:
|
||||
"@solana-mobile/mobile-wallet-adapter-protocol" "^0.9.7"
|
||||
bs58 "^5.0.0"
|
||||
js-base64 "^3.7.2"
|
||||
|
||||
"@solana-mobile/mobile-wallet-adapter-protocol@^0.9.7":
|
||||
version "0.9.7"
|
||||
resolved "https://registry.yarnpkg.com/@solana-mobile/mobile-wallet-adapter-protocol/-/mobile-wallet-adapter-protocol-0.9.7.tgz#121ce0f5119dc3bc7ebf5eb8ba50b88826a6f22c"
|
||||
integrity sha512-fbxFm4I/27tRih8W2Ej9h8LHWJTOrVwAFfPBilxhsUSbx8+or/jMr1KHPcXlBe4WUZW8pSx5C3ymIOMqbV+r+g==
|
||||
|
||||
"@solana-mobile/wallet-adapter-mobile@^0.9.6":
|
||||
version "0.9.7"
|
||||
resolved "https://registry.yarnpkg.com/@solana-mobile/wallet-adapter-mobile/-/wallet-adapter-mobile-0.9.7.tgz#39136c2ce7691ce0e5ab9a9add32c87488626d6a"
|
||||
integrity sha512-1xOZ2pbro9i5vAaqKtbbE489QP3JMTBniifoYcOYbbEgIoj/FAqDO/VFnVx6K6zC6IyBSICc/lV0Dnjpo9O5KA==
|
||||
dependencies:
|
||||
"@react-native-async-storage/async-storage" "^1.17.7"
|
||||
"@solana-mobile/mobile-wallet-adapter-protocol-web3js" "^0.9.7"
|
||||
"@solana/wallet-adapter-base" "^0.9.17"
|
||||
js-base64 "^3.7.2"
|
||||
|
||||
"@solana/buffer-layout@^3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326"
|
||||
|
@ -1587,6 +1761,13 @@
|
|||
dependencies:
|
||||
buffer "~6.0.3"
|
||||
|
||||
"@solana/buffer-layout@^4.0.0":
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.0.tgz#75b1b11adc487234821c81dfae3119b73a5fd734"
|
||||
integrity sha512-lR0EMP2HC3+Mxwd4YcnZb0smnaDw7Bl2IQWZiTevRH5ZZBZn6VRWn3/92E3qdU4SSImJkA6IDHawOHAnx/qUvQ==
|
||||
dependencies:
|
||||
buffer "~6.0.3"
|
||||
|
||||
"@solana/spl-name-service@^0.1.2":
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@solana/spl-name-service/-/spl-name-service-0.1.2.tgz#d49240a692bbf05ef56d79db0916b17a4829b99d"
|
||||
|
@ -1629,6 +1810,116 @@
|
|||
buffer-layout "^1.2.0"
|
||||
dotenv "10.0.0"
|
||||
|
||||
"@solana/wallet-adapter-base@^0.9.17", "@solana/wallet-adapter-base@^0.9.18":
|
||||
version "0.9.18"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-base/-/wallet-adapter-base-0.9.18.tgz#9365304a76977b4446a1167b240d588f2c5448d5"
|
||||
integrity sha512-5HQFytLmb64j1Nzc6dwddZx+IUePN/PYqVMyf/ok7fN3z8Vw3EIFS8b+RFfBpj4HWbc2kqv5fpnLlaAH7q67pA==
|
||||
dependencies:
|
||||
eventemitter3 "^4.0.0"
|
||||
|
||||
"@solana/wallet-adapter-ledger@^0.9.20":
|
||||
version "0.9.20"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-ledger/-/wallet-adapter-ledger-0.9.20.tgz#717642d72b731239d37cb191ee36d34217d98a47"
|
||||
integrity sha512-puPGyVxf1z0oPxCdXhifzKhIiHUCwnUGC8rrQhoUGnyIDWN8lu/vuKA/m39z0kvA1Jw9NUcksVSTfAImUqUTiA==
|
||||
dependencies:
|
||||
"@ledgerhq/devices" "6.27.1"
|
||||
"@ledgerhq/hw-transport" "6.27.1"
|
||||
"@ledgerhq/hw-transport-webhid" "6.27.1"
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
buffer "^6.0.3"
|
||||
|
||||
"@solana/wallet-adapter-mathwallet@^0.9.13":
|
||||
version "0.9.13"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-mathwallet/-/wallet-adapter-mathwallet-0.9.13.tgz#f7e25f830a3f4d053d10fde48d90521ceafc1804"
|
||||
integrity sha512-3l6OXeESBbqC2HvUm21Ep7TcQppALhEVo0mDo5JzGC93r5u61hkQgmlO6Z/hOJHAWgMNlXLa9+9kPAHSieOUNg==
|
||||
dependencies:
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
|
||||
"@solana/wallet-adapter-phantom@^0.9.17":
|
||||
version "0.9.17"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-phantom/-/wallet-adapter-phantom-0.9.17.tgz#d042f5d94fdbe5493f78717b6f3419941574ae2e"
|
||||
integrity sha512-NgqObD9G2SojkKaLEz7RPC0izS0qPzHa94Da4le3xMErW7SKIEKjVfQ3fP/rIcD2jEwGW5qf9YqYPsPw8jaJ0Q==
|
||||
dependencies:
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
|
||||
"@solana/wallet-adapter-react@^0.15.21-rc.3":
|
||||
version "0.15.21-rc.3"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-react/-/wallet-adapter-react-0.15.21-rc.3.tgz#3fc011af811c482340d3f07639a8dbc72755b2fd"
|
||||
integrity sha512-AfDm6UM3lqzkIFmaeR2Bl0DQHBC2x8MVTwuktu2VZUVZQQHhgFVGhFw5esTw0W83w2Ny5Ujnaqc1ucC4My2Y5Q==
|
||||
dependencies:
|
||||
"@solana-mobile/wallet-adapter-mobile" "^0.9.6"
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
"@solana/wallet-standard-wallet-adapter-react" "^1.0.0-rc.2"
|
||||
|
||||
"@solana/wallet-adapter-solflare@^0.6.18":
|
||||
version "0.6.18"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-solflare/-/wallet-adapter-solflare-0.6.18.tgz#0095e95d1f096a26074efeb66c14c557c8071aac"
|
||||
integrity sha512-LF6V2MgM5+d3zuVioG4ZkpPIVXRHXXysjWfIhqpRW3n0lPFLQMk7agTnEgQU9tHy0WZiLvN6SYZamPK9dGfT0A==
|
||||
dependencies:
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
"@solflare-wallet/sdk" "^1.1.0"
|
||||
|
||||
"@solana/wallet-adapter-sollet@^0.11.12":
|
||||
version "0.11.12"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-sollet/-/wallet-adapter-sollet-0.11.12.tgz#95dfa09d87e1f9636c0530908cd3e0cd250bc897"
|
||||
integrity sha512-rXTPS28ZRHdErcWiNhadoumcQb3H544wmmWccsARgO4PW1eG/37hp9LIQjFT3c7uBjWPM3rVFfklbmlHQOrVmA==
|
||||
dependencies:
|
||||
"@project-serum/sol-wallet-adapter" "^0.2.6"
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
|
||||
"@solana/wallet-adapter-solong@^0.9.13":
|
||||
version "0.9.13"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-solong/-/wallet-adapter-solong-0.9.13.tgz#a5a27fcb0edc96d09b269b478baa69897da02dd9"
|
||||
integrity sha512-zOwv6+bnKbyUB9TAgtq826WX4XtxTYq5ak83X2GboAuDsPlyYhGhQKiq7ZndKq5Wqd7cCwLRNV95n6YaAfavWw==
|
||||
dependencies:
|
||||
"@solana/wallet-adapter-base" "^0.9.18"
|
||||
|
||||
"@solana/wallet-standard-chains@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-standard-chains/-/wallet-standard-chains-1.0.0-rc.0.tgz#d6c59c47a3b3bd5c62196da6809949aae21ea041"
|
||||
integrity sha512-KBYLaTF/wjW36VTUb4JTrr30S6DP7x2TzyNkzLl3DNASSENhxWtug6xWy90fuC5EJj+TtRuzJYx90/csJTx1yw==
|
||||
dependencies:
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
|
||||
"@solana/wallet-standard-features@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-standard-features/-/wallet-standard-features-1.0.0-rc.0.tgz#5927d3826e8497615aec7030a249742bebf9050d"
|
||||
integrity sha512-BPxu50kzCDSxogQFp8wUQAhPDHNyyzetf4iBiae23iT1TnVQNSoS0e+f+AAqK/GMwfCoEcubhzNNuLpRIHI1qA==
|
||||
dependencies:
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
"@wallet-standard/features" "^1.0.0-rc.0"
|
||||
|
||||
"@solana/wallet-standard-util@^1.0.0-rc.1":
|
||||
version "1.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-standard-util/-/wallet-standard-util-1.0.0-rc.1.tgz#3ab760439dcdc01a75fa87d8e4b36482a0a67a53"
|
||||
integrity sha512-rcPQ0dg84AHmzE0E0N0VVEWoi9T2ZlEF7pU14bTnvjUgDfjPum+hNic2EMo7J7eQQXtUGctzMLWGlLdMfgC/Xg==
|
||||
dependencies:
|
||||
"@solana/wallet-standard-chains" "^1.0.0-rc.0"
|
||||
"@solana/wallet-standard-features" "^1.0.0-rc.0"
|
||||
|
||||
"@solana/wallet-standard-wallet-adapter-base@^1.0.0-rc.1":
|
||||
version "1.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-standard-wallet-adapter-base/-/wallet-standard-wallet-adapter-base-1.0.0-rc.1.tgz#4e1cc231e343cbda225c2e170a7b9f635de8c844"
|
||||
integrity sha512-sJwg3UcWx497ZFPqH0nXiJvhJEVrkXszCDfdr0lv5GrfV7iQtIfZi2UD2lOnr1CF8H0jBw/EgfyunDX2t+l7iw==
|
||||
dependencies:
|
||||
"@solana/wallet-adapter-base" "^0.9.17"
|
||||
"@solana/wallet-standard-chains" "^1.0.0-rc.0"
|
||||
"@solana/wallet-standard-features" "^1.0.0-rc.0"
|
||||
"@solana/wallet-standard-util" "^1.0.0-rc.1"
|
||||
"@wallet-standard/app" "^1.0.0-rc.0"
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
"@wallet-standard/features" "^1.0.0-rc.0"
|
||||
"@wallet-standard/util" "^1.0.0-rc.0"
|
||||
|
||||
"@solana/wallet-standard-wallet-adapter-react@^1.0.0-rc.2":
|
||||
version "1.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@solana/wallet-standard-wallet-adapter-react/-/wallet-standard-wallet-adapter-react-1.0.0-rc.2.tgz#490df711728c496595ba51608184b69cc537c768"
|
||||
integrity sha512-p7vF1LbZtsd0F3t7wUmwCqaL7MbddSRo7YJL1D2iRadhmfS3edVmF9PGAij+eO2HuKkcgx7UXiDKxy+BJ7qN+g==
|
||||
dependencies:
|
||||
"@solana/wallet-standard-wallet-adapter-base" "^1.0.0-rc.1"
|
||||
"@wallet-standard/app" "^1.0.0-rc.0"
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
|
||||
"@solana/web3.js@^0.90.0":
|
||||
version "0.90.5"
|
||||
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-0.90.5.tgz#5be7d78a19f0b5e01bf82c52e3cbf0bb72a38cfd"
|
||||
|
@ -1692,25 +1983,36 @@
|
|||
superstruct "^0.14.2"
|
||||
tweetnacl "^1.0.0"
|
||||
|
||||
"@solana/web3.js@^1.22.0":
|
||||
version "1.22.0"
|
||||
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.22.0.tgz#ded439eb903aff4269a16a7fdfacc6866c6f0c13"
|
||||
integrity sha512-7BQUiR1AIj2L8KJ8LYsI31iPRLytgF8T4hz7xLlvvBfalpUK7qD2om7frlNpXl8ROUpvruNf83QaectJdZJW1w==
|
||||
"@solana/web3.js@^1.66.2":
|
||||
version "1.66.2"
|
||||
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.66.2.tgz#80b43c5868b846124fe3ebac7d3943930c3fa60c"
|
||||
integrity sha512-RyaHMR2jGmaesnYP045VLeBGfR/gAW3cvZHzMFGg7bkO+WOYOYp1nEllf0/la4U4qsYGKCsO9eEevR5fhHiVHg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
"@solana/buffer-layout" "^3.0.0"
|
||||
"@noble/ed25519" "^1.7.0"
|
||||
"@noble/hashes" "^1.1.2"
|
||||
"@noble/secp256k1" "^1.6.3"
|
||||
"@solana/buffer-layout" "^4.0.0"
|
||||
bigint-buffer "^1.1.5"
|
||||
bn.js "^5.0.0"
|
||||
borsh "^0.4.0"
|
||||
borsh "^0.7.0"
|
||||
bs58 "^4.0.1"
|
||||
buffer "6.0.1"
|
||||
crypto-hash "^1.2.2"
|
||||
fast-stable-stringify "^1.0.0"
|
||||
jayson "^3.4.4"
|
||||
js-sha3 "^0.8.0"
|
||||
node-fetch "^2.6.1"
|
||||
rpc-websockets "^7.4.2"
|
||||
secp256k1 "^4.0.2"
|
||||
node-fetch "2"
|
||||
rpc-websockets "^7.5.0"
|
||||
superstruct "^0.14.2"
|
||||
tweetnacl "^1.0.0"
|
||||
|
||||
"@solflare-wallet/sdk@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@solflare-wallet/sdk/-/sdk-1.1.0.tgz#300e2784720e11bef8910b54057bb1c1c8c284a0"
|
||||
integrity sha512-h/OmjgRMDC6CkPHlkUQgOIRv1QXEZp+kQg132zU1KAcikZvc25xf0yMMRU0APUypQ6EJEz6bgQR6BRvvVA9/ZA==
|
||||
dependencies:
|
||||
"@project-serum/sol-wallet-adapter" "0.2.0"
|
||||
bs58 "^4.0.1"
|
||||
eventemitter3 "^4.0.7"
|
||||
uuid "^8.3.2"
|
||||
|
||||
"@svgr/babel-plugin-add-jsx-attribute@^4.2.0":
|
||||
version "4.2.0"
|
||||
|
@ -1990,21 +2292,6 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
|
||||
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
|
||||
|
||||
"@types/ledgerhq__hw-transport-webusb@^4.70.1":
|
||||
version "4.70.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/ledgerhq__hw-transport-webusb/-/ledgerhq__hw-transport-webusb-4.70.1.tgz#ea80859607a46030f001bce462e1e7443b27ec43"
|
||||
integrity sha512-s+bt/fU5cH7etjLrNRn2LebZZqUL+YHIWciC1T6SUw2kyFpSqQQmjcM81ZrMR/tccQGfYTy3ebrJx9ZK3Mn+HA==
|
||||
dependencies:
|
||||
"@types/ledgerhq__hw-transport" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/ledgerhq__hw-transport@*", "@types/ledgerhq__hw-transport@^4.21.3":
|
||||
version "4.21.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/ledgerhq__hw-transport/-/ledgerhq__hw-transport-4.21.3.tgz#1e658da6b5d01ffab92f9660cf57121aecfa7e2c"
|
||||
integrity sha512-6QveiZLsFLq9WZDk8HWAZhivoGzyz5S8WV36hpUe7KrVDaTR1fDdB+syorrNRhYbyjraAuUJrIdJR5p/7doq8g==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/lodash@^4.14.159":
|
||||
version "4.14.170"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6"
|
||||
|
@ -2187,6 +2474,32 @@
|
|||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@wallet-standard/app@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@wallet-standard/app/-/app-1.0.0-rc.0.tgz#e38bb5d3ac7798a3efa1cbdf8fa3b34a05e34e47"
|
||||
integrity sha512-dSn8qF9xj8oRz/8Q3+OmiVZx3Y/wtl8taaqn3dkiRY1Q6ueQaia0+cvnvl4cdE23vSgvNtc6IMbvFkRw4vJYbA==
|
||||
dependencies:
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
|
||||
"@wallet-standard/base@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@wallet-standard/base/-/base-1.0.0-rc.0.tgz#f12e7f0903a6340b1e7c38d42a8e1ee98f116294"
|
||||
integrity sha512-yfQ5Ho61eKXRT6b81ezwGQ6DflKjI7hmkVRGVPAHno5gPK8TvFuiDmQJid1Y+c0v8huGGc/XFvw3451JJgb1fg==
|
||||
|
||||
"@wallet-standard/features@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@wallet-standard/features/-/features-1.0.0-rc.0.tgz#08dfc7e5f559709b982e3318a81299f47989e523"
|
||||
integrity sha512-4Jo/IPvsLFGnRqTF1P1Tukbae/xiiiV5Gqpf3hxjXhX7wK1hflU2aLMoU2le4P3FRY7Tphj4pkoVcrl/jBm7Xg==
|
||||
dependencies:
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
|
||||
"@wallet-standard/util@^1.0.0-rc.0":
|
||||
version "1.0.0-rc.0"
|
||||
resolved "https://registry.yarnpkg.com/@wallet-standard/util/-/util-1.0.0-rc.0.tgz#0caf9351680f0a9c724e28a1e6ee9b2da4256734"
|
||||
integrity sha512-P5OJ0sf/dSgoC0aClmCHObzNdlFgtQSdJZWXH5GUEfkhVrUACkqdYOgHom7hnBzh+R0TMZjKWXnHPt2exe5wpw==
|
||||
dependencies:
|
||||
"@wallet-standard/base" "^1.0.0-rc.0"
|
||||
|
||||
"@webassemblyjs/ast@1.8.5":
|
||||
version "1.8.5"
|
||||
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359"
|
||||
|
@ -3026,6 +3339,11 @@ base-x@^3.0.2:
|
|||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
base-x@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a"
|
||||
integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==
|
||||
|
||||
base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||
|
@ -3061,6 +3379,13 @@ big.js@^5.2.2:
|
|||
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
|
||||
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
|
||||
|
||||
bigint-buffer@^1.1.5:
|
||||
version "1.1.5"
|
||||
resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442"
|
||||
integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==
|
||||
dependencies:
|
||||
bindings "^1.3.0"
|
||||
|
||||
binary-extensions@^1.0.0:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
|
||||
|
@ -3106,6 +3431,11 @@ bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.1.3:
|
|||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
|
||||
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==
|
||||
|
||||
bn.js@^5.2.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70"
|
||||
integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==
|
||||
|
||||
body-parser@1.19.0:
|
||||
version "1.19.0"
|
||||
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a"
|
||||
|
@ -3149,6 +3479,15 @@ borsh@^0.4.0:
|
|||
bs58 "^4.0.0"
|
||||
text-encoding-utf-8 "^1.0.2"
|
||||
|
||||
borsh@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a"
|
||||
integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==
|
||||
dependencies:
|
||||
bn.js "^5.2.0"
|
||||
bs58 "^4.0.0"
|
||||
text-encoding-utf-8 "^1.0.2"
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
|
@ -3286,6 +3625,13 @@ bs58@4.0.1, bs58@^4.0.0, bs58@^4.0.1:
|
|||
dependencies:
|
||||
base-x "^3.0.2"
|
||||
|
||||
bs58@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279"
|
||||
integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==
|
||||
dependencies:
|
||||
base-x "^4.0.0"
|
||||
|
||||
bs58check@<3.0.0, bs58check@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc"
|
||||
|
@ -3330,7 +3676,7 @@ buffer@6.0.1:
|
|||
base64-js "^1.3.1"
|
||||
ieee754 "^1.2.1"
|
||||
|
||||
buffer@6.0.3, buffer@^6.0.1, buffer@~6.0.3:
|
||||
buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3:
|
||||
version "6.0.3"
|
||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
|
||||
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
|
||||
|
@ -5271,6 +5617,11 @@ events@^3.0.0, events@^3.2.0:
|
|||
resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379"
|
||||
integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==
|
||||
|
||||
events@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
|
||||
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
|
||||
|
||||
eventsource@^1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0"
|
||||
|
@ -5477,6 +5828,11 @@ fast-levenshtein@~2.0.6:
|
|||
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
|
||||
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
|
||||
|
||||
fast-stable-stringify@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313"
|
||||
integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==
|
||||
|
||||
faye-websocket@^0.10.0:
|
||||
version "0.10.0"
|
||||
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4"
|
||||
|
@ -6870,6 +7226,11 @@ is-plain-obj@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
|
||||
integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4=
|
||||
|
||||
is-plain-obj@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
|
||||
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
|
||||
|
||||
is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
|
||||
|
@ -7486,6 +7847,11 @@ jest@24.9.0:
|
|||
import-local "^2.0.0"
|
||||
jest-cli "^24.9.0"
|
||||
|
||||
js-base64@^3.7.2:
|
||||
version "3.7.2"
|
||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745"
|
||||
integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==
|
||||
|
||||
js-sha256@^0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
|
||||
|
@ -8219,6 +8585,13 @@ merge-descriptors@1.0.1:
|
|||
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
|
||||
integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
|
||||
|
||||
merge-options@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7"
|
||||
integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==
|
||||
dependencies:
|
||||
is-plain-obj "^2.1.0"
|
||||
|
||||
merge-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
|
||||
|
@ -8555,6 +8928,13 @@ node-addon-api@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
|
||||
integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==
|
||||
|
||||
node-fetch@2:
|
||||
version "2.6.7"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
|
||||
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
|
||||
dependencies:
|
||||
whatwg-url "^5.0.0"
|
||||
|
||||
node-fetch@^2.2.0, node-fetch@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
|
@ -11195,6 +11575,19 @@ rpc-websockets@^7.4.2:
|
|||
bufferutil "^4.0.1"
|
||||
utf-8-validate "^5.0.2"
|
||||
|
||||
rpc-websockets@^7.5.0:
|
||||
version "7.5.0"
|
||||
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748"
|
||||
integrity sha512-9tIRi1uZGy7YmDjErf1Ax3wtqdSSLIlnmL5OtOzgd5eqPKbsPpwDP5whUDO2LQay3Xp0CcHlcNSGzacNRluBaQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.17.2"
|
||||
eventemitter3 "^4.0.7"
|
||||
uuid "^8.3.2"
|
||||
ws "^8.5.0"
|
||||
optionalDependencies:
|
||||
bufferutil "^4.0.1"
|
||||
utf-8-validate "^5.0.2"
|
||||
|
||||
rsvp@^4.8.4:
|
||||
version "4.8.5"
|
||||
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
|
||||
|
@ -11212,6 +11605,13 @@ run-queue@^1.0.0, run-queue@^1.0.3:
|
|||
dependencies:
|
||||
aproba "^1.1.1"
|
||||
|
||||
rxjs@6:
|
||||
version "6.6.7"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
|
||||
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
rxjs@^6.5.3, rxjs@^6.6.0, rxjs@^6.6.3:
|
||||
version "6.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552"
|
||||
|
@ -11377,6 +11777,13 @@ semver@^7.3.2, semver@^7.3.4:
|
|||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
semver@^7.3.5:
|
||||
version "7.3.8"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
|
||||
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
send@0.17.1:
|
||||
version "0.17.1"
|
||||
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
|
||||
|
@ -12399,6 +12806,11 @@ tr46@^1.0.1:
|
|||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
tr46@~0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
|
||||
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
|
||||
|
||||
traverse-chain@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1"
|
||||
|
@ -12722,7 +13134,7 @@ uuid@^3.3.2, uuid@^3.4.0:
|
|||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
||||
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
||||
|
||||
uuid@^8.3.0:
|
||||
uuid@^8.3.0, uuid@^8.3.2:
|
||||
version "8.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
||||
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
||||
|
@ -12829,6 +13241,11 @@ wbuf@^1.1.0, wbuf@^1.7.3:
|
|||
dependencies:
|
||||
minimalistic-assert "^1.0.0"
|
||||
|
||||
webidl-conversions@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
|
||||
|
||||
webidl-conversions@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
|
||||
|
@ -13023,6 +13440,14 @@ whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0:
|
|||
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
|
||||
integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==
|
||||
|
||||
whatwg-url@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
|
||||
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
|
||||
dependencies:
|
||||
tr46 "~0.0.3"
|
||||
webidl-conversions "^3.0.0"
|
||||
|
||||
whatwg-url@^6.4.1:
|
||||
version "6.5.0"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8"
|
||||
|
@ -13304,6 +13729,11 @@ ws@^7.0.0, ws@^7.4.5:
|
|||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1"
|
||||
integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g==
|
||||
|
||||
ws@^8.5.0:
|
||||
version "8.9.0"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.9.0.tgz#2a994bb67144be1b53fe2d23c53c028adeb7f45e"
|
||||
integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==
|
||||
|
||||
xml-name-validator@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
|
||||
|
|
Loading…
Reference in New Issue