mirror of https://github.com/certusone/oyster.git
Merge pull request #27 from yamijuan/wallet-connect-2nd
Add metamask and walletconnect providers
This commit is contained in:
commit
a8a16c2543
|
@ -2,7 +2,6 @@
|
||||||
"name": "bridge",
|
"name": "bridge",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@solana/wallet-base": "0.0.1",
|
|
||||||
"@ant-design/icons": "^4.4.0",
|
"@ant-design/icons": "^4.4.0",
|
||||||
"@babel/preset-typescript": "^7.12.13",
|
"@babel/preset-typescript": "^7.12.13",
|
||||||
"@craco/craco": "^5.7.0",
|
"@craco/craco": "^5.7.0",
|
||||||
|
@ -13,6 +12,7 @@
|
||||||
"@solana/spl-token": "0.0.13",
|
"@solana/spl-token": "0.0.13",
|
||||||
"@solana/spl-token-registry": "^0.2.0",
|
"@solana/spl-token-registry": "^0.2.0",
|
||||||
"@solana/spl-token-swap": "0.1.0",
|
"@solana/spl-token-swap": "0.1.0",
|
||||||
|
"@solana/wallet-base": "0.0.1",
|
||||||
"@solana/web3.js": "^0.86.2",
|
"@solana/web3.js": "^0.86.2",
|
||||||
"@testing-library/jest-dom": "^4.2.4",
|
"@testing-library/jest-dom": "^4.2.4",
|
||||||
"@testing-library/react": "^9.5.0",
|
"@testing-library/react": "^9.5.0",
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"@uniswap/token-lists": "^1.0.0-beta.19",
|
"@uniswap/token-lists": "^1.0.0-beta.19",
|
||||||
"@walletconnect/client": "^1.3.6",
|
"@walletconnect/client": "^1.3.6",
|
||||||
"@walletconnect/qrcode-modal": "^1.3.6",
|
"@walletconnect/qrcode-modal": "^1.3.6",
|
||||||
"@walletconnect/web3-provider": "^1.3.6",
|
"@walletconnect/web3-provider": "^1.4.0",
|
||||||
"@web3-react/core": "^6.0.9",
|
"@web3-react/core": "^6.0.9",
|
||||||
"@web3-react/fortmatic-connector": "^6.0.9",
|
"@web3-react/fortmatic-connector": "^6.0.9",
|
||||||
"@web3-react/injected-connector": "^6.0.7",
|
"@web3-react/injected-connector": "^6.0.7",
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="300px" height="185px" viewBox="0 0 300 185" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>WalletConnect</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="walletconnect-logo-alt" fill="#3B99FC" fill-rule="nonzero">
|
||||||
|
<path d="M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z" id="WalletConnect"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="300px" height="185px" viewBox="0 0 300 185" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>WalletConnect</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<defs></defs>
|
||||||
|
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="walletconnect-logo-alt" fill="#3B99FC" fill-rule="nonzero">
|
||||||
|
<path d="M61.4385429,36.2562612 C110.349767,-11.6319051 189.65053,-11.6319051 238.561752,36.2562612 L244.448297,42.0196786 C246.893858,44.4140867 246.893858,48.2961898 244.448297,50.690599 L224.311602,70.406102 C223.088821,71.6033071 221.106302,71.6033071 219.883521,70.406102 L211.782937,62.4749541 C177.661245,29.0669724 122.339051,29.0669724 88.2173582,62.4749541 L79.542302,70.9685592 C78.3195204,72.1657633 76.337001,72.1657633 75.1142214,70.9685592 L54.9775265,51.2530561 C52.5319653,48.8586469 52.5319653,44.9765439 54.9775265,42.5821357 L61.4385429,36.2562612 Z M280.206339,77.0300061 L298.128036,94.5769031 C300.573585,96.9713 300.573599,100.85338 298.128067,103.247793 L217.317896,182.368927 C214.872352,184.763353 210.907314,184.76338 208.461736,182.368989 C208.461726,182.368979 208.461714,182.368967 208.461704,182.368957 L151.107561,126.214385 C150.496171,125.615783 149.504911,125.615783 148.893521,126.214385 C148.893517,126.214389 148.893514,126.214393 148.89351,126.214396 L91.5405888,182.368927 C89.095052,184.763359 85.1300133,184.763399 82.6844276,182.369014 C82.6844133,182.369 82.684398,182.368986 82.6843827,182.36897 L1.87196327,103.246785 C-0.573596939,100.852377 -0.573596939,96.9702735 1.87196327,94.5758653 L19.7936929,77.028998 C22.2392531,74.6345898 26.2042918,74.6345898 28.6498531,77.028998 L86.0048306,133.184355 C86.6162214,133.782957 87.6074796,133.782957 88.2188704,133.184355 C88.2188796,133.184346 88.2188878,133.184338 88.2188969,133.184331 L145.571,77.028998 C148.016505,74.6345347 151.981544,74.6344449 154.427161,77.028798 C154.427195,77.0288316 154.427229,77.0288653 154.427262,77.028899 L211.782164,133.184331 C212.393554,133.782932 213.384814,133.782932 213.996204,133.184331 L271.350179,77.0300061 C273.79574,74.6355969 277.760778,74.6355969 280.206339,77.0300061 Z" id="WalletConnect"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
|
@ -2,12 +2,11 @@ import React from 'react';
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
|
|
||||||
import { useCorrectNetwork } from '../../hooks/useCorrectNetwork';
|
import { useCorrectNetwork } from '../../hooks/useCorrectNetwork';
|
||||||
import metamaskIcon from '../../assets/metamask.svg';
|
|
||||||
import { shortenAddress } from '@oyster/common';
|
import { shortenAddress } from '@oyster/common';
|
||||||
import { useEthereum } from '../../contexts';
|
import { useEthereum } from '../../contexts';
|
||||||
|
|
||||||
export const EthereumConnect = () => {
|
export const EthereumConnect = () => {
|
||||||
const { accounts, onConnectEthereum, connected } = useEthereum();
|
const { accounts, onConnectEthereum, connected, walletProvider } = useEthereum();
|
||||||
const { hasCorrespondingNetworks } = useCorrectNetwork();
|
const { hasCorrespondingNetworks } = useCorrectNetwork();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -16,11 +15,11 @@ export const EthereumConnect = () => {
|
||||||
hasCorrespondingNetworks ? (
|
hasCorrespondingNetworks ? (
|
||||||
<>
|
<>
|
||||||
<img
|
<img
|
||||||
alt={'metamask-icon'}
|
alt={'ethereum-icon'}
|
||||||
width={20}
|
width={20}
|
||||||
height={20}
|
height={20}
|
||||||
style={{ marginRight: 5 }}
|
style={{ marginRight: 5 }}
|
||||||
src={metamaskIcon}
|
src={walletProvider.icon}
|
||||||
/>
|
/>
|
||||||
{shortenAddress(accounts[0], 4)}
|
{shortenAddress(accounts[0], 4)}
|
||||||
</>
|
</>
|
||||||
|
@ -31,14 +30,7 @@ export const EthereumConnect = () => {
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<Button onClick={() => onConnectEthereum && onConnectEthereum()}>
|
<Button onClick={() => onConnectEthereum && onConnectEthereum()}>
|
||||||
<img
|
Connect Ethereum
|
||||||
alt={'metamask-icon'}
|
|
||||||
width={20}
|
|
||||||
height={20}
|
|
||||||
style={{ marginRight: 5 }}
|
|
||||||
src={metamaskIcon}
|
|
||||||
/>
|
|
||||||
Connect Metamask
|
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -119,6 +119,7 @@ export const TokenSelectModal = (props: {
|
||||||
visible={isModalVisible}
|
visible={isModalVisible}
|
||||||
onCancel={() => hideModal()}
|
onCancel={() => hideModal()}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
className={"token-select-modal"}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
autoFocus
|
autoFocus
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
background-color: rgba(255, 255, 255, 0.08);
|
background-color: rgba(255, 255, 255, 0.08);
|
||||||
}
|
}
|
||||||
.ant-modal-body {
|
.ant-modal-body {
|
||||||
height: 80vh;
|
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
@ -26,6 +25,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.token-select-modal .ant-modal-body {
|
||||||
|
height: 80vh;
|
||||||
|
}
|
||||||
|
|
||||||
.ReactVirtualized__Grid.ReactVirtualized__List:focus {
|
.ReactVirtualized__Grid.ReactVirtualized__List:focus {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
|
@ -146,7 +146,7 @@ export const Transfer = () => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Asset: ', asset);
|
console.log('Asset: ', asset);
|
||||||
debugger;
|
//debugger;
|
||||||
|
|
||||||
// get user address from asset
|
// get user address from asset
|
||||||
//
|
//
|
||||||
|
|
|
@ -4,6 +4,7 @@ import React, {
|
||||||
useCallback,
|
useCallback,
|
||||||
useContext,
|
useContext,
|
||||||
useEffect,
|
useEffect,
|
||||||
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -13,9 +14,30 @@ import { useWallet as useEthereumWallet } from 'use-wallet';
|
||||||
import WalletConnectProvider from '@walletconnect/web3-provider';
|
import WalletConnectProvider from '@walletconnect/web3-provider';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Fortmatic from 'fortmatic';
|
import Fortmatic from 'fortmatic';
|
||||||
import { useConnectionConfig, useWallet, ENV } from '@oyster/common';
|
import { useWallet, useLocalStorageState} from '@oyster/common';
|
||||||
|
import { WalletAdapter } from '@solana/wallet-base'
|
||||||
import { TokenList, TokenInfo } from '@uniswap/token-lists';
|
import { TokenList, TokenInfo } from '@uniswap/token-lists';
|
||||||
import { ethers } from 'ethers';
|
import { ethers } from 'ethers';
|
||||||
|
import { MetamaskWalletAdapter } from '../wallet-adapters/metamask';
|
||||||
|
import { Button, Modal } from 'antd';
|
||||||
|
import {WalletConnectWalletAdapter} from "../wallet-adapters/wallet-connect";
|
||||||
|
|
||||||
|
const ASSETS_URL =
|
||||||
|
'https://raw.githubusercontent.com/solana-labs/oyster/main/assets/wallets/';
|
||||||
|
export const ETH_WALLET_PROVIDERS = [
|
||||||
|
{
|
||||||
|
name: 'Metamask',
|
||||||
|
url: 'https://www.metamask.com',
|
||||||
|
icon: `${ASSETS_URL}metamask.svg`,
|
||||||
|
adapter: MetamaskWalletAdapter,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Wallet Connect',
|
||||||
|
url: 'https://walletconnect.org',
|
||||||
|
icon: `/blockchains/walletconnect.svg`,
|
||||||
|
adapter: WalletConnectWalletAdapter,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export interface EthereumContextState {
|
export interface EthereumContextState {
|
||||||
provider?: ethers.providers.Web3Provider;
|
provider?: ethers.providers.Web3Provider;
|
||||||
|
@ -25,6 +47,7 @@ export interface EthereumContextState {
|
||||||
accounts: string[];
|
accounts: string[];
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
chainId: number;
|
chainId: number;
|
||||||
|
walletProvider: any;
|
||||||
onConnectEthereum?: () => void;
|
onConnectEthereum?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,16 +57,22 @@ export const EthereumContext = createContext<EthereumContextState>({
|
||||||
accounts: [''],
|
accounts: [''],
|
||||||
chainId: 0,
|
chainId: 0,
|
||||||
connected: false,
|
connected: false,
|
||||||
|
walletProvider: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const EthereumProvider: FunctionComponent = ({ children }) => {
|
export const EthereumProvider: FunctionComponent = ({ children }) => {
|
||||||
const [accounts, setAccounts] = useState<string[]>(['']);
|
const [accounts, setAccounts] = useState<string[]>(['']);
|
||||||
const [provider, setProvider] = useState<ethers.providers.Web3Provider>();
|
const [provider, setProvider] = useState<ethers.providers.Web3Provider>();
|
||||||
|
|
||||||
|
const [providerUrl, setProviderUrl] = useLocalStorageState(
|
||||||
|
'ethWalletProvider',
|
||||||
|
);
|
||||||
const [connected, setConnected] = useState<boolean>(false);
|
const [connected, setConnected] = useState<boolean>(false);
|
||||||
const [chainId, setChainId] = useState<number>(0);
|
const [chainId, setChainId] = useState<number>(0);
|
||||||
//const { env } = useConnectionConfig();
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
|
|
||||||
const { connected: walletConnected } = useWallet();
|
const { connected: walletConnected } = useWallet();
|
||||||
//const wallet = useEthereumWallet();
|
|
||||||
const [tokens, setTokens] = useState<{
|
const [tokens, setTokens] = useState<{
|
||||||
map: Map<string, TokenInfo>;
|
map: Map<string, TokenInfo>;
|
||||||
list: TokenInfo[];
|
list: TokenInfo[];
|
||||||
|
@ -51,6 +80,18 @@ export const EthereumProvider: FunctionComponent = ({ children }) => {
|
||||||
map: new Map<string, TokenInfo>(),
|
map: new Map<string, TokenInfo>(),
|
||||||
list: [],
|
list: [],
|
||||||
});
|
});
|
||||||
|
const walletProvider = useMemo(
|
||||||
|
() => ETH_WALLET_PROVIDERS.find(({ url }) => url === providerUrl),
|
||||||
|
[providerUrl],
|
||||||
|
);
|
||||||
|
const wallet = useMemo(
|
||||||
|
function () {
|
||||||
|
if (walletProvider) {
|
||||||
|
return new walletProvider.adapter() as WalletAdapter;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[walletProvider, providerUrl],
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
|
@ -100,47 +141,53 @@ export const EthereumProvider: FunctionComponent = ({ children }) => {
|
||||||
})();
|
})();
|
||||||
}, [setTokens]);
|
}, [setTokens]);
|
||||||
|
|
||||||
const onConnectEthereum = () => {
|
const onConnectEthereum = useCallback(() => {
|
||||||
(async () => {
|
if (wallet && providerUrl) {
|
||||||
// @ts-ignore
|
wallet.connect();
|
||||||
await window.ethereum.request({ method: 'eth_requestAccounts' });
|
} else {
|
||||||
|
select();
|
||||||
const provider = new ethers.providers.Web3Provider(
|
}
|
||||||
(window as any).ethereum,
|
}, [wallet, providerUrl]);
|
||||||
);
|
|
||||||
const signer = provider.getSigner();
|
|
||||||
const account = await signer.getAddress();
|
|
||||||
const network = await provider.getNetwork();
|
|
||||||
|
|
||||||
setChainId(network.chainId);
|
|
||||||
setProvider(provider);
|
|
||||||
setAccounts([account]);
|
|
||||||
setConnected(true);
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (connected) {
|
if (wallet) {
|
||||||
|
wallet.on('connect', () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.ethereum.on('disconnect', error => {
|
setAccounts(wallet.accounts);
|
||||||
|
// @ts-ignore
|
||||||
|
setChainId(wallet.chainID);
|
||||||
|
// @ts-ignore
|
||||||
|
setProvider(wallet.provider);
|
||||||
|
setConnected(true);
|
||||||
|
});
|
||||||
|
wallet.on('disconnect', error => {
|
||||||
setConnected(false);
|
setConnected(false);
|
||||||
});
|
});
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.ethereum.on('accountsChanged', accounts => {
|
wallet.on('accountsChanged', accounts => {
|
||||||
if (!accounts || !accounts[0]) setConnected(false);
|
if (!accounts || !accounts[0]) setConnected(false);
|
||||||
});
|
});
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.ethereum.on('chainChanged', (chainId: string) => {
|
wallet.on('chainChanged', (chainId: string) => {
|
||||||
setChainId(parseInt(chainId, 16));
|
setChainId(parseInt(chainId, 16));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [connected]);
|
return () => {
|
||||||
|
setConnected(false);
|
||||||
|
if (wallet) {
|
||||||
|
wallet.disconnect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, [wallet]);
|
||||||
|
|
||||||
|
const select = useCallback(() => setIsModalVisible(true), []);
|
||||||
|
const close = useCallback(() => setIsModalVisible(false), []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (walletConnected && !connected) {
|
if (walletConnected && !connected) {
|
||||||
onConnectEthereum();
|
onConnectEthereum();
|
||||||
}
|
}
|
||||||
}, [walletConnected]);
|
}, [walletConnected, connected, providerUrl]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EthereumContext.Provider
|
<EthereumContext.Provider
|
||||||
|
@ -151,10 +198,51 @@ export const EthereumProvider: FunctionComponent = ({ children }) => {
|
||||||
provider,
|
provider,
|
||||||
connected,
|
connected,
|
||||||
chainId,
|
chainId,
|
||||||
|
walletProvider,
|
||||||
onConnectEthereum: () => onConnectEthereum(),
|
onConnectEthereum: () => onConnectEthereum(),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
<Modal
|
||||||
|
title="Select Ethereum Wallet"
|
||||||
|
okText="Connect"
|
||||||
|
visible={isModalVisible}
|
||||||
|
okButtonProps={{ style: { display: 'none' } }}
|
||||||
|
onCancel={close}
|
||||||
|
width={400}
|
||||||
|
>
|
||||||
|
{ETH_WALLET_PROVIDERS.map(provider => {
|
||||||
|
const onClick = function () {
|
||||||
|
setProviderUrl(provider.url);
|
||||||
|
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>
|
||||||
</EthereumContext.Provider>
|
</EthereumContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
import EventEmitter from 'eventemitter3';
|
||||||
|
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||||
|
import { notify } from '@oyster/common';
|
||||||
|
import { WalletAdapter } from '@solana/wallet-base'
|
||||||
|
import { ethers } from 'ethers';
|
||||||
|
|
||||||
|
export class MetamaskWalletAdapter
|
||||||
|
extends EventEmitter
|
||||||
|
implements WalletAdapter {
|
||||||
|
_publicKey: PublicKey | null;
|
||||||
|
_onProcess: boolean;
|
||||||
|
_accounts: Array<any>;
|
||||||
|
_chainID: number;
|
||||||
|
_provider: any;
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this._publicKey = null;
|
||||||
|
this._provider = null;
|
||||||
|
this._accounts = [];
|
||||||
|
this._chainID = 0;
|
||||||
|
this._onProcess = false;
|
||||||
|
this.connect = this.connect.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
get publicKey() {
|
||||||
|
return this._publicKey;
|
||||||
|
}
|
||||||
|
get provider() {
|
||||||
|
return this._provider;
|
||||||
|
}
|
||||||
|
get accounts() {
|
||||||
|
return this._accounts;
|
||||||
|
}
|
||||||
|
get chainID() {
|
||||||
|
return this._chainID;
|
||||||
|
}
|
||||||
|
|
||||||
|
async signTransaction(transaction: Transaction) {
|
||||||
|
return (window as any).ethereum.signTransaction(transaction);
|
||||||
|
}
|
||||||
|
async signMultipleTransaction(transactions: Transaction[]) {
|
||||||
|
return transactions;
|
||||||
|
}
|
||||||
|
|
||||||
|
connect() {
|
||||||
|
if (this._onProcess) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((window as any).ethereum === undefined) {
|
||||||
|
notify({
|
||||||
|
message: 'Metamask Error',
|
||||||
|
description: 'Please install metamask wallet from Chrome ',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._onProcess = true;
|
||||||
|
// @ts-ignore
|
||||||
|
window.ethereum
|
||||||
|
.request({ method: 'eth_requestAccounts' })
|
||||||
|
.then(() => {
|
||||||
|
// @ts-ignore
|
||||||
|
const provider = new ethers.providers.Web3Provider(
|
||||||
|
(window as any).ethereum,
|
||||||
|
);
|
||||||
|
const signer = provider.getSigner();
|
||||||
|
signer.getAddress().then(account => {
|
||||||
|
this._accounts = [account];
|
||||||
|
provider.getNetwork().then(network => {
|
||||||
|
this._chainID = network.chainId;
|
||||||
|
this._provider = provider;
|
||||||
|
this.emit('connect');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
window.ethereum.on('disconnect', error => {
|
||||||
|
this.emit('disconnect', error);
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
window.ethereum.on('accountsChanged', accounts => {
|
||||||
|
this.emit('accountsChanged', accounts);
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
window.ethereum.on('chainChanged', (chainId: string) => {
|
||||||
|
this.emit('chainChanged', chainId);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.disconnect();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this._onProcess = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
if (this._publicKey) {
|
||||||
|
this._publicKey = null;
|
||||||
|
this.emit('disconnect');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,97 @@
|
||||||
|
import EventEmitter from 'eventemitter3';
|
||||||
|
import { PublicKey, Transaction } from '@solana/web3.js';
|
||||||
|
import { notify } from '@oyster/common';
|
||||||
|
import { WalletAdapter } from '@solana/wallet-base'
|
||||||
|
import { ethers } from 'ethers';
|
||||||
|
import WalletConnectProvider from "@walletconnect/web3-provider";
|
||||||
|
|
||||||
|
export class WalletConnectWalletAdapter
|
||||||
|
extends EventEmitter
|
||||||
|
implements WalletAdapter {
|
||||||
|
_publicKey: PublicKey | null;
|
||||||
|
_onProcess: boolean;
|
||||||
|
_accounts: Array<any>;
|
||||||
|
_chainID: number;
|
||||||
|
_provider: any;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this._publicKey = null;
|
||||||
|
this._provider = null;
|
||||||
|
this._accounts = [];
|
||||||
|
this._chainID = 0;
|
||||||
|
this._onProcess = false;
|
||||||
|
this.connect = this.connect.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
get publicKey() {
|
||||||
|
return this._publicKey;
|
||||||
|
}
|
||||||
|
get provider() {
|
||||||
|
return this._provider;
|
||||||
|
}
|
||||||
|
get accounts() {
|
||||||
|
return this._accounts;
|
||||||
|
}
|
||||||
|
get chainID() {
|
||||||
|
return this._chainID;
|
||||||
|
}
|
||||||
|
|
||||||
|
async signTransaction(transaction: Transaction) {
|
||||||
|
return this._provider.signTransaction(transaction);
|
||||||
|
}
|
||||||
|
async signMultipleTransaction(transactions: Transaction[]) {
|
||||||
|
return transactions;
|
||||||
|
}
|
||||||
|
|
||||||
|
connect() {
|
||||||
|
if (this._onProcess) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._onProcess = true;
|
||||||
|
|
||||||
|
// Create WalletConnect Provider
|
||||||
|
const walletConnectProvider = new WalletConnectProvider({
|
||||||
|
infuraId: "535ab8649e9f40cface13cbded7d647e",
|
||||||
|
});
|
||||||
|
walletConnectProvider.enable().then(()=>{
|
||||||
|
const provider = new ethers.providers.Web3Provider(walletConnectProvider);
|
||||||
|
const signer = provider.getSigner();
|
||||||
|
signer.getAddress().then(account => {
|
||||||
|
this._accounts = [account];
|
||||||
|
provider.getNetwork().then(network => {
|
||||||
|
this._chainID = network.chainId;
|
||||||
|
this._provider = provider;
|
||||||
|
this.emit('connect');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
walletConnectProvider.on('disconnect', (code: number, reason: string) => {
|
||||||
|
this.emit('disconnect', {code, reason});
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
walletConnectProvider.on('accountsChanged', (accounts: string[]) => {
|
||||||
|
this.emit('accountsChanged', accounts);
|
||||||
|
});
|
||||||
|
// @ts-ignore
|
||||||
|
walletConnectProvider.on('chainChanged', (chainId: number) => {
|
||||||
|
this.emit('chainChanged', chainId);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.disconnect();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this._onProcess = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
if (this._publicKey) {
|
||||||
|
this._publicKey = null;
|
||||||
|
this.emit('disconnect');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
109
yarn.lock
109
yarn.lock
|
@ -3781,6 +3781,17 @@
|
||||||
resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.19.tgz#5256db144fba721a6233f43b92ffb388cbd58327"
|
resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.19.tgz#5256db144fba721a6233f43b92ffb388cbd58327"
|
||||||
integrity sha512-19V3KM7DAe40blWW1ApiaSYwqbq0JTKMO3yChGBrXzQBl+BoQZRTNZ4waCyoZ5QM45Q0Mxd6bCn6jXcH9G1kjg==
|
integrity sha512-19V3KM7DAe40blWW1ApiaSYwqbq0JTKMO3yChGBrXzQBl+BoQZRTNZ4waCyoZ5QM45Q0Mxd6bCn6jXcH9G1kjg==
|
||||||
|
|
||||||
|
"@walletconnect/browser-utils@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.4.0.tgz#2998d0433086a0a4376d6c883b708a54ea18a3de"
|
||||||
|
integrity sha512-2oLQGaQ53bJvoToYG17XGf8palfbNF4ZdSvBKmEYX1ac9NnDetEPBfryz0Ij2s4f9o9XfVKFO7+HPLzm2ayMMw==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
detect-browser "5.2.0"
|
||||||
|
safe-json-utils "1.0.0"
|
||||||
|
window-getters "1.0.0"
|
||||||
|
window-metadata "1.0.0"
|
||||||
|
|
||||||
"@walletconnect/client@^1.3.6":
|
"@walletconnect/client@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.3.6.tgz#537b7af6bf87a906fcf171fd5bc4e56a2a3d1908"
|
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.3.6.tgz#537b7af6bf87a906fcf171fd5bc4e56a2a3d1908"
|
||||||
|
@ -3791,6 +3802,16 @@
|
||||||
"@walletconnect/types" "^1.3.6"
|
"@walletconnect/types" "^1.3.6"
|
||||||
"@walletconnect/utils" "^1.3.6"
|
"@walletconnect/utils" "^1.3.6"
|
||||||
|
|
||||||
|
"@walletconnect/client@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.4.0.tgz#b6dc28b7758370adadc9b8da372c626594cd30c0"
|
||||||
|
integrity sha512-lg3JFCuECCvZEl7BpOztNtnStOmOpGqXuSIhisnaEtqUgHdopH275Rz5jU736X5uS+7VExU6LOIWKNPPXlY2ZQ==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/core" "^1.4.0"
|
||||||
|
"@walletconnect/iso-crypto" "^1.4.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
|
||||||
"@walletconnect/core@^1.3.6":
|
"@walletconnect/core@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.3.6.tgz#1690081bc4666b6644ed6a1bed128509a5259e50"
|
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.3.6.tgz#1690081bc4666b6644ed6a1bed128509a5259e50"
|
||||||
|
@ -3800,6 +3821,15 @@
|
||||||
"@walletconnect/types" "^1.3.6"
|
"@walletconnect/types" "^1.3.6"
|
||||||
"@walletconnect/utils" "^1.3.6"
|
"@walletconnect/utils" "^1.3.6"
|
||||||
|
|
||||||
|
"@walletconnect/core@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.4.0.tgz#fbd4085f46a0765262b19570dd715b1fd5abc0b4"
|
||||||
|
integrity sha512-0rPfgSAcdCHG/JcEUgLAJ6wnQOsd7AiBEAUv7d71ViORu1gKrXm8mWKpWnPkPV53IH+oRVVP0pAGEpwo7f+Bdw==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/socket-transport" "^1.4.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
|
||||||
"@walletconnect/http-connection@^1.3.6":
|
"@walletconnect/http-connection@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.3.6.tgz#98be28c312cfcca86b962b5a3a2813ac7b3f4866"
|
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.3.6.tgz#98be28c312cfcca86b962b5a3a2813ac7b3f4866"
|
||||||
|
@ -3810,6 +3840,16 @@
|
||||||
eventemitter3 "4.0.7"
|
eventemitter3 "4.0.7"
|
||||||
xhr2-cookies "1.1.0"
|
xhr2-cookies "1.1.0"
|
||||||
|
|
||||||
|
"@walletconnect/http-connection@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.4.0.tgz#0643310af0023270f76ab663ba381f8deb3bedcb"
|
||||||
|
integrity sha512-HIYrgzz/Fagwoyco6RsnxAD9pFLdt0cp+g+Rhw770QIhax0PjzpiC+IcLcYqVDFcCJwss6pZFlyPu7AAK67VDw==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
eventemitter3 "4.0.7"
|
||||||
|
xhr2-cookies "1.1.0"
|
||||||
|
|
||||||
"@walletconnect/iso-crypto@^1.3.6":
|
"@walletconnect/iso-crypto@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.3.6.tgz#e6003d46fbc12b979e96269d94eebd8e801c0305"
|
resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.3.6.tgz#e6003d46fbc12b979e96269d94eebd8e801c0305"
|
||||||
|
@ -3819,11 +3859,25 @@
|
||||||
"@walletconnect/types" "^1.3.6"
|
"@walletconnect/types" "^1.3.6"
|
||||||
"@walletconnect/utils" "^1.3.6"
|
"@walletconnect/utils" "^1.3.6"
|
||||||
|
|
||||||
|
"@walletconnect/iso-crypto@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.4.0.tgz#e134faa46f14827383217277004aa69e76763ea7"
|
||||||
|
integrity sha512-pd5N6brECiRCp9A7skW1gL/fw24vjzy8zQJvn75GFRcuYcHNgpQwFOAq5OvaZt6/9wBIL1rVZ9QdBpyZ+EX85w==
|
||||||
|
dependencies:
|
||||||
|
"@pedrouid/iso-crypto" "^1.0.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
|
||||||
"@walletconnect/mobile-registry@^1.3.6":
|
"@walletconnect/mobile-registry@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/mobile-registry/-/mobile-registry-1.3.6.tgz#891d08b62c8e5c61f96203aad588c2c463c5d7f3"
|
resolved "https://registry.yarnpkg.com/@walletconnect/mobile-registry/-/mobile-registry-1.3.6.tgz#891d08b62c8e5c61f96203aad588c2c463c5d7f3"
|
||||||
integrity sha512-OhOCFJhUWKVbRzU9XcAcYIW9cC6gNb+kFttIAtjbaocRGgN+n5NDoUZsrrd6iurjvS6ToCWkalvlYbXDU5/xtw==
|
integrity sha512-OhOCFJhUWKVbRzU9XcAcYIW9cC6gNb+kFttIAtjbaocRGgN+n5NDoUZsrrd6iurjvS6ToCWkalvlYbXDU5/xtw==
|
||||||
|
|
||||||
|
"@walletconnect/mobile-registry@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/mobile-registry/-/mobile-registry-1.4.0.tgz#502cf8ab87330841d794819081e748ebdef7aee5"
|
||||||
|
integrity sha512-ZtKRio4uCZ1JUF7LIdecmZt7FOLnX72RPSY7aUVu7mj7CSfxDwUn6gBuK6WGtH+NZCldBqDl5DenI5fFSvkKYw==
|
||||||
|
|
||||||
"@walletconnect/qrcode-modal@^1.3.6":
|
"@walletconnect/qrcode-modal@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.3.6.tgz#4ab9562e19069d453e04a3376f485aadf5f91de3"
|
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.3.6.tgz#4ab9562e19069d453e04a3376f485aadf5f91de3"
|
||||||
|
@ -3835,6 +3889,17 @@
|
||||||
preact "10.4.1"
|
preact "10.4.1"
|
||||||
qrcode "1.4.4"
|
qrcode "1.4.4"
|
||||||
|
|
||||||
|
"@walletconnect/qrcode-modal@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.4.0.tgz#a502886b9ec044bf2d3c86018decacca810f1aba"
|
||||||
|
integrity sha512-FOov70va04sOReI9ijGPbYexXtNWS7VZPlSEv7vHLq5ufcghh0sPsl5MfO6wvyNqpSJERbGoTmaHLSMR7LjpFg==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/browser-utils" "^1.4.0"
|
||||||
|
"@walletconnect/mobile-registry" "^1.4.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
preact "10.4.1"
|
||||||
|
qrcode "1.4.4"
|
||||||
|
|
||||||
"@walletconnect/socket-transport@^1.3.6":
|
"@walletconnect/socket-transport@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.3.6.tgz#702951831ff17db8f4c337dcdcb107cce377dae4"
|
resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.3.6.tgz#702951831ff17db8f4c337dcdcb107cce377dae4"
|
||||||
|
@ -3844,11 +3909,25 @@
|
||||||
"@walletconnect/utils" "^1.3.6"
|
"@walletconnect/utils" "^1.3.6"
|
||||||
ws "7.3.0"
|
ws "7.3.0"
|
||||||
|
|
||||||
|
"@walletconnect/socket-transport@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.4.0.tgz#2b7f90cede720dbcf03a11f641b4e707a2c1580f"
|
||||||
|
integrity sha512-X/7Hm+4w0d9fn0xf8adXetlHxmvpyw1cvUPHSCPxEzC+xACdZE1Q/dveDfEb/RaWlv7Z3IQoagVSCN/3xzkyYQ==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
ws "7.3.0"
|
||||||
|
|
||||||
"@walletconnect/types@^1.3.6":
|
"@walletconnect/types@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.3.6.tgz#892da6fb4570d9bc5450dc1a5810d7b4d345dd08"
|
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.3.6.tgz#892da6fb4570d9bc5450dc1a5810d7b4d345dd08"
|
||||||
integrity sha512-fNir3Pi1ZpuVlgNr8qtP2LOSsV9rNgJGHmBnHHqKNmpuRpPxG1mhmKFdDHNGyVIP5bM5CWIXmlULDTax63UJbg==
|
integrity sha512-fNir3Pi1ZpuVlgNr8qtP2LOSsV9rNgJGHmBnHHqKNmpuRpPxG1mhmKFdDHNGyVIP5bM5CWIXmlULDTax63UJbg==
|
||||||
|
|
||||||
|
"@walletconnect/types@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.4.0.tgz#debd38ae72231b304f281cbd1e6758cb4a1b26a4"
|
||||||
|
integrity sha512-aCeuVzIos3VsRIK+/nnk8WHAftQNVOLUeWOTZoClOOGFJk5HpaPNfyIHJ+hjU4VXh/3YuN0yqnCeMWVjKlQ3nw==
|
||||||
|
|
||||||
"@walletconnect/utils@^1.3.6":
|
"@walletconnect/utils@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.3.6.tgz#e55cb5510eb41b4ae6be8e88c1de42abf309bdd3"
|
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.3.6.tgz#e55cb5510eb41b4ae6be8e88c1de42abf309bdd3"
|
||||||
|
@ -3865,6 +3944,19 @@
|
||||||
window-getters "1.0.0"
|
window-getters "1.0.0"
|
||||||
window-metadata "1.0.0"
|
window-metadata "1.0.0"
|
||||||
|
|
||||||
|
"@walletconnect/utils@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.4.0.tgz#2ab4889e92a84a8f28aa7134ed86df7fa035ed76"
|
||||||
|
integrity sha512-MFUKROV/TQKj6J95uNW0s04MU/yhl6wohZh5LwtKbFKIY2tsba+qM2miEXMo9fMOpxq/HnjBsVVVTZT9bSeIRw==
|
||||||
|
dependencies:
|
||||||
|
"@json-rpc-tools/utils" "1.6.1"
|
||||||
|
"@walletconnect/browser-utils" "^1.4.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
bn.js "4.11.8"
|
||||||
|
enc-utils "3.0.0"
|
||||||
|
js-sha3 "0.8.0"
|
||||||
|
query-string "6.13.5"
|
||||||
|
|
||||||
"@walletconnect/web3-provider@^1.3.6":
|
"@walletconnect/web3-provider@^1.3.6":
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.3.6.tgz#a09f0c08115475918ed4fe8d0503d28e29ac1877"
|
resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.3.6.tgz#a09f0c08115475918ed4fe8d0503d28e29ac1877"
|
||||||
|
@ -3877,6 +3969,18 @@
|
||||||
"@walletconnect/utils" "^1.3.6"
|
"@walletconnect/utils" "^1.3.6"
|
||||||
web3-provider-engine "16.0.1"
|
web3-provider-engine "16.0.1"
|
||||||
|
|
||||||
|
"@walletconnect/web3-provider@^1.4.0":
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.4.0.tgz#45530f8fb0f52e3dc38cc435f7a10c7e4b94bc7c"
|
||||||
|
integrity sha512-Z7t61acIeeNsPz/kK74tiHHK/sFv1j1YPZYaq2GpoKh1qBnHMWWenk8Q8PbGRGc0ouEExXxaqRGYb2/0IICaxA==
|
||||||
|
dependencies:
|
||||||
|
"@walletconnect/client" "^1.4.0"
|
||||||
|
"@walletconnect/http-connection" "^1.4.0"
|
||||||
|
"@walletconnect/qrcode-modal" "^1.4.0"
|
||||||
|
"@walletconnect/types" "^1.4.0"
|
||||||
|
"@walletconnect/utils" "^1.4.0"
|
||||||
|
web3-provider-engine "16.0.1"
|
||||||
|
|
||||||
"@web3-react/abstract-connector@^6.0.7":
|
"@web3-react/abstract-connector@^6.0.7":
|
||||||
version "6.0.7"
|
version "6.0.7"
|
||||||
resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6"
|
resolved "https://registry.yarnpkg.com/@web3-react/abstract-connector/-/abstract-connector-6.0.7.tgz#401b3c045f1e0fab04256311be49d5144e9badc6"
|
||||||
|
@ -7547,6 +7651,11 @@ detect-browser@5.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.1.0.tgz#0c51c66b747ad8f98a6832bf3026a5a23a7850ff"
|
resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.1.0.tgz#0c51c66b747ad8f98a6832bf3026a5a23a7850ff"
|
||||||
integrity sha512-WKa9p+/MNwmTiS+V2AS6eGxic+807qvnV3hC+4z2GTY+F42h1n8AynVTMMc4EJBC32qMs6yjOTpeDEQQt/AVqQ==
|
integrity sha512-WKa9p+/MNwmTiS+V2AS6eGxic+807qvnV3hC+4z2GTY+F42h1n8AynVTMMc4EJBC32qMs6yjOTpeDEQQt/AVqQ==
|
||||||
|
|
||||||
|
detect-browser@5.2.0:
|
||||||
|
version "5.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.2.0.tgz#c9cd5afa96a6a19fda0bbe9e9be48a6b6e1e9c97"
|
||||||
|
integrity sha512-tr7XntDAu50BVENgQfajMLzacmSe34D+qZc4zjnniz0ZVuw/TZcLcyxHQjYpJTM36sGEkZZlYLnIM1hH7alTMA==
|
||||||
|
|
||||||
detect-gpu@^3.0.0:
|
detect-gpu@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/detect-gpu/-/detect-gpu-3.0.0.tgz#d1ced721581c27fec29e24aee8c3eadf45450b5a"
|
resolved "https://registry.yarnpkg.com/detect-gpu/-/detect-gpu-3.0.0.tgz#d1ced721581c27fec29e24aee8c3eadf45450b5a"
|
||||||
|
|
Loading…
Reference in New Issue