Skip to content

Commit

Permalink
try deployed (#24)
Browse files Browse the repository at this point in the history
* try deployed

* fix test
  • Loading branch information
10xSebastian authored Oct 9, 2023
1 parent fdedeae commit 50aa344
Show file tree
Hide file tree
Showing 31 changed files with 1,143 additions and 439 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ await wallet.account() // '0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'
await wallet.connect() // '0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'
```

### Platform

`platform:string`: Platform of the identified wallet. If a wallet has multiplatform support (e.g. EVM + SVM), it will provide 1 wallet instance per platform (e.g. Phantom, Exodus, etc.)

```javascript
wallet.platform // 'evm'
```

### Supported Blockchains

`blockchains:Array`: Array containing the names of supported blockchains
Expand Down
151 changes: 102 additions & 49 deletions dist/esm/index.evm.js

Large diffs are not rendered by default.

300 changes: 213 additions & 87 deletions dist/esm/index.js

Large diffs are not rendered by default.

137 changes: 111 additions & 26 deletions dist/esm/index.solana.js

Large diffs are not rendered by default.

151 changes: 102 additions & 49 deletions dist/umd/index.evm.js

Large diffs are not rendered by default.

300 changes: 213 additions & 87 deletions dist/umd/index.js

Large diffs are not rendered by default.

137 changes: 111 additions & 26 deletions dist/umd/index.solana.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.evm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-wallets-evm",
"moduleName": "Web3Wallets",
"version": "16.2.16",
"version": "16.3.0",
"description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
"main": "dist/umd/index.evm.js",
"module": "dist/esm/index.evm.js",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-wallets",
"moduleName": "Web3Wallets",
"version": "16.2.16",
"version": "16.3.0",
"description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
"main": "dist/umd/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion package.solana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-wallets-solana",
"moduleName": "Web3Wallets",
"version": "16.2.16",
"version": "16.3.0",
"description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
"main": "dist/umd/index.solana.js",
"module": "dist/esm/index.solana.js",
Expand Down
28 changes: 22 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import wallets from './wallets'
const supported = [
wallets.MetaMask,
wallets.Coinbase,
wallets.CoinbaseEVM,
wallets.Binance,
wallets.Trust,
wallets.TrustEVM,
wallets.Rabby,
wallets.PhantomEVM,
wallets.Brave,
wallets.Opera,
wallets.Coin98,
wallets.CryptoCom,
wallets.HyperPay,
wallets.TokenPocket,
wallets.ExodusEVM,
// standards (not concrete wallets)
wallets.WalletConnectV1,
wallets.WalletConnectV2,
wallets.WalletLink,
Expand All @@ -24,10 +28,15 @@ const supported = [
/*#elif _SOLANA
const supported = [
wallets.Phantom,
wallets.PhantomSVM,
wallets.Backpack,
wallets.Glow,
wallets.Solflare,
wallets.CoinbaseSVM,
wallets.TrustSVM,
wallets.ExodusSVM,
// standards (not concrete wallets)
wallets.WalletConnectV1,
wallets.WalletConnectV2,
wallets.SolanaMobileWalletAdapter,
Expand All @@ -38,10 +47,13 @@ const supported = [

const supported = [
wallets.MetaMask,
wallets.Phantom,
wallets.Coinbase,
wallets.PhantomEVM,
wallets.PhantomSVM,
wallets.CoinbaseEVM,
wallets.CoinbaseSVM,
wallets.Binance,
wallets.Trust,
wallets.TrustEVM,
wallets.TrustSVM,
wallets.Backpack,
wallets.Glow,
wallets.Solflare,
Expand All @@ -52,6 +64,10 @@ const supported = [
wallets.CryptoCom,
wallets.HyperPay,
wallets.TokenPocket,
wallets.ExodusEVM,
wallets.ExodusSVM,

// standards (not concrete wallets)
wallets.WalletConnectV1,
wallets.WalletConnectV2,
wallets.SolanaMobileWalletAdapter,
Expand Down
7 changes: 7 additions & 0 deletions src/logos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 46 additions & 16 deletions src/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,38 @@
import Binance from './wallets/Binance'
import Brave from './wallets/Brave'
import Coin98 from './wallets/Coin98'
import Coinbase from './wallets/Coinbase'
import Coin98EVM from './wallets/Coin98.evm'
import CoinbaseEVM from './wallets/Coinbase.evm'
import CryptoCom from './wallets/CryptoCom'
import ExodusEVM from './wallets/Exodus.evm'
import HyperPay from './wallets/HyperPay'
import MetaMask from './wallets/MetaMask'
import Opera from './wallets/Opera'
import PhantomEVM from './wallets/Phantom.evm'
import Rabby from './wallets/Rabby'
import TokenPocket from './wallets/TokenPocket'
import Trust from './wallets/Trust'
import TrustEVM from './wallets/Trust.evm'
import WalletConnectV1 from './wallets/WalletConnectV1'
import WalletConnectV2 from './wallets/WalletConnectV2'
import WalletLink from './wallets/WalletLink'
import WindowEthereum from './wallets/WindowEthereum'
export default {
MetaMask,
Coinbase,
CoinbaseEVM,
Binance,
Trust,
TrustEVM,
Rabby,
Brave,
Opera,
Coin98,
Coin98EVM,
CryptoCom,
HyperPay,
TokenPocket,
ExodusEVM,
PhantomEVM,
// standards (not concrete wallets)
WindowEthereum,
WalletConnectV1,
WalletConnectV2,
Expand All @@ -37,17 +43,27 @@ export default {
/*#elif _SOLANA
import Backpack from './wallets/Backpack'
import Coin98SVM from './wallets/Coin98.svm'
import CoinbaseSVM from './wallets/Coinbase.svm'
import ExodusSVM from './wallets/Exodus.svm'
import Glow from './wallets/Glow'
import Phantom from './wallets/Phantom'
import PhantomSVM from './wallets/Phantom.svm'
import SolanaMobileWalletAdapter from './wallets/SolanaMobileWalletAdapter'
import Solflare from './wallets/Solflare'
import TrustSVM from './wallets/Trust.svm'
import WindowSolana from './wallets/WindowSolana'
export default {
Phantom,
PhantomSVM,
Backpack,
Glow,
Solflare,
CoinbaseSVM,
TrustSVM,
ExodusSVM,
Coin98SVM,
// standards (not concrete wallets)
WindowSolana,
SolanaMobileWalletAdapter,
}
Expand All @@ -57,19 +73,25 @@ export default {
import Backpack from './wallets/Backpack'
import Binance from './wallets/Binance'
import Brave from './wallets/Brave'
import Coin98 from './wallets/Coin98'
import Coinbase from './wallets/Coinbase'
import Coin98EVM from './wallets/Coin98.evm'
import Coin98SVM from './wallets/Coin98.svm'
import CoinbaseEVM from './wallets/Coinbase.evm'
import CoinbaseSVM from './wallets/Coinbase.svm'
import CryptoCom from './wallets/CryptoCom'
import ExodusEVM from './wallets/Exodus.evm'
import ExodusSVM from './wallets/Exodus.svm'
import Glow from './wallets/Glow'
import HyperPay from './wallets/HyperPay'
import MetaMask from './wallets/MetaMask'
import Opera from './wallets/Opera'
import Phantom from './wallets/Phantom'
import PhantomEVM from './wallets/Phantom.evm'
import PhantomSVM from './wallets/Phantom.svm'
import Rabby from './wallets/Rabby'
import SolanaMobileWalletAdapter from './wallets/SolanaMobileWalletAdapter'
import Solflare from './wallets/Solflare'
import TokenPocket from './wallets/TokenPocket'
import Trust from './wallets/Trust'
import TrustEVM from './wallets/Trust.evm'
import TrustSVM from './wallets/Trust.svm'
import WalletConnectV1 from './wallets/WalletConnectV1'
import WalletConnectV2 from './wallets/WalletConnectV2'
import WalletLink from './wallets/WalletLink'
Expand All @@ -78,20 +100,28 @@ import WindowSolana from './wallets/WindowSolana'

export default {
MetaMask,
Phantom,
Coinbase,
PhantomEVM,
PhantomSVM,
CoinbaseEVM,
CoinbaseSVM,
Binance,
Trust,
TrustEVM,
TrustSVM,
Backpack,
Glow,
Solflare,
Rabby,
Brave,
Opera,
Coin98,
Coin98EVM,
Coin98SVM,
CryptoCom,
HyperPay,
TokenPocket,
ExodusEVM,
ExodusSVM,

// standards (not concrete wallets)
WindowEthereum,
WindowSolana,
SolanaMobileWalletAdapter,
Expand Down
3 changes: 2 additions & 1 deletion src/wallets/Binance.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default class Binance extends WindowEthereum {

static isAvailable = async()=>{
return window?.BinanceChain &&
!window.coin98
!window.coin98 &&
!window.trustwallet
}

getProvider() { return window.BinanceChain }
Expand Down
18 changes: 18 additions & 0 deletions src/wallets/Coin98.evm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import logos from '../logos'
import WindowEthereum from './WindowEthereum'
import { supported } from '../blockchains'

export default class Coin98EVM extends WindowEthereum {

static info = {
name: 'Coin98',
logo: logos.coin98,
blockchains: supported.evm,
platform: 'evm',
}

static isAvailable = async()=>{ return window?.coin98 }

getProvider() { return window.coin98.provider }

}
13 changes: 0 additions & 13 deletions src/wallets/Coin98.js

This file was deleted.

18 changes: 18 additions & 0 deletions src/wallets/Coin98.svm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import logos from '../logos'
import WindowSolana from './WindowSolana'
import { supported } from '../blockchains'

export default class Coin98SVM extends WindowSolana {

static info = {
name: 'Coin98',
logo: logos.coin98,
blockchains: supported.solana,
platform: 'svm',
}

static isAvailable = async()=>{ return window?.coin98?.sol }

getProvider() { return window.coin98.sol }

}
31 changes: 31 additions & 0 deletions src/wallets/Coinbase.evm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import logos from '../logos'
import { supported } from '../blockchains'
import WindowEthereum from './WindowEthereum'

export default class CoinbaseEVM extends WindowEthereum {

static info = {
name: 'Coinbase',
logo: logos.coinbase,
blockchains: supported.evm,
platform: 'evm',
}

getProvider() {
if(window?.ethereum?.providerMap?.has('CoinbaseWallet')) {
return window?.ethereum?.providerMap?.get('CoinbaseWallet')
} else {
return window.ethereum
}
}

static isAvailable = async()=>{
return(
(
window?.ethereum?.isCoinbaseWallet || window?.ethereum?.isWalletLink
) || (
window?.ethereum?.providerMap?.has('CoinbaseWallet')
)
)
}
}
Loading

0 comments on commit 50aa344

Please sign in to comment.