Skip to content

Commit

Permalink
v17.2.1: fix phantom provider
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Aug 20, 2024
1 parent 896ca51 commit 6aae078
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 32 deletions.
4 changes: 4 additions & 0 deletions dist/esm/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@ class PhantomEVM extends WindowEthereum {
! _optionalChain$a([window, 'optionalAccess', _6 => _6.okxwallet])
)
};}

getProvider() {
return _optionalChain$a([window, 'optionalAccess', _7 => _7.phantom, 'optionalAccess', _8 => _8.ethereum]) || window.ethereum
}
} PhantomEVM.__initStatic(); PhantomEVM.__initStatic2();

function _optionalChain$9(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
8 changes: 8 additions & 0 deletions dist/esm/index.js

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

4 changes: 4 additions & 0 deletions dist/esm/index.solana.js

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

4 changes: 4 additions & 0 deletions dist/umd/index.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@
! _optionalChain$a([window, 'optionalAccess', _6 => _6.okxwallet])
)
};}

getProvider() {
return _optionalChain$a([window, 'optionalAccess', _7 => _7.phantom, 'optionalAccess', _8 => _8.ethereum]) || window.ethereum
}
} PhantomEVM.__initStatic(); PhantomEVM.__initStatic2();

function _optionalChain$9(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
Expand Down
8 changes: 8 additions & 0 deletions dist/umd/index.js

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

4 changes: 4 additions & 0 deletions dist/umd/index.solana.js

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

6 changes: 3 additions & 3 deletions 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": "17.2.0",
"version": "17.2.1",
"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 All @@ -26,8 +26,8 @@
"peerDependencies": {
"@depay/coinbase-wallet-sdk": "^3.8.4",
"@depay/walletconnect-v2": "^2.12.2",
"@depay/web3-blockchains": "^9.1.4",
"@depay/web3-client-evm": "^10.18.5",
"@depay/web3-blockchains": "^9.4.4",
"@depay/web3-client-evm": "^10.18.10",
"ethers": "^5.7.1"
},
"engines": {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-wallets",
"moduleName": "Web3Wallets",
"version": "17.2.0",
"version": "17.2.1",
"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 Expand Up @@ -35,8 +35,8 @@
"@depay/coinbase-wallet-sdk": "^3.8.4",
"@depay/solana-web3.js": "^1.26.0",
"@depay/walletconnect-v2": "^2.12.2",
"@depay/web3-blockchains": "^9.2.5",
"@depay/web3-client": "^10.18.5",
"@depay/web3-blockchains": "^9.4.4",
"@depay/web3-client": "^10.18.10",
"ethers": "^5.7.1"
},
"engines": {
Expand All @@ -48,10 +48,10 @@
"@depay/coinbase-wallet-sdk": "^3.8.4",
"@depay/solana-web3.js": "^1.26.0",
"@depay/walletconnect-v2": "^2.11.3",
"@depay/web3-blockchains": "^9.2.5",
"@depay/web3-client": "^10.18.4",
"@depay/web3-client-evm": "^10.18.4",
"@depay/web3-client-solana": "^10.18.4",
"@depay/web3-blockchains": "^9.4.4",
"@depay/web3-client": "^10.18.10",
"@depay/web3-client-evm": "^10.18.10",
"@depay/web3-client-solana": "^10.18.10",
"@depay/web3-mock": "^14.17.0",
"@depay/web3-mock-evm": "^14.17.0",
"@depay/web3-mock-solana": "^14.17.0",
Expand Down
6 changes: 3 additions & 3 deletions 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": "17.2.0",
"version": "17.2.1",
"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 All @@ -27,8 +27,8 @@
"@depay/coinbase-wallet-sdk": "^3.8.4",
"@depay/solana-web3.js": "^1.26.0",
"@depay/walletconnect-v2": "^2.12.2",
"@depay/web3-blockchains": "^9.1.4",
"@depay/web3-client-solana": "^10.18.5",
"@depay/web3-blockchains": "^9.4.4",
"@depay/web3-client-solana": "^10.18.10",
"ethers": "^5.7.1"
},
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions src/wallets/Phantom.evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ export default class PhantomEVM extends WindowEthereum {
! window?.okxwallet
)
}

getProvider() {
return window?.phantom?.ethereum || window.ethereum
}
}
4 changes: 4 additions & 0 deletions src/wallets/Phantom.svm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ export default class PhantomSVM extends WindowSolana {
!['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])
)
}

getProvider() {
return window?.phantom?.solana || window.solana
}
}
38 changes: 19 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1043,25 +1043,25 @@
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.1.4.tgz#f006c29c887c433e1824e2bfabf8f39ad13da907"
integrity sha512-CQnXCNAt3sA1MphZDMPbrhAPtemzeQ/NKeHcd2aBF61nTjJCRUmSh1Ox8Z6rlSjgDP66842iy6JAoRiFDtlmFw==

"@depay/web3-blockchains@^9.2.5":
version "9.2.5"
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.2.5.tgz#a428f898dfa04aa7b6b4ccfe20c68807c7326077"
integrity sha512-4AxGC1vyEydvk4WF1cxInY51JrTg8qND8mdZCJAZzKSNZI/d1+aRczzCn/yYXSwEHdPQCKUmXKzybQp1k/m7pw==

"@depay/web3-client-evm@^10.18.4":
version "10.18.4"
resolved "https://registry.yarnpkg.com/@depay/web3-client-evm/-/web3-client-evm-10.18.4.tgz#568dd937a49a09e03eb335ad3eadc2154542db57"
integrity sha512-ZPl8TPFvvtmkUh45A2MDba7DlQoaqOrX7VDsgSWla8uwyzEbMfXJMCafDogAYeaZZaYCU8hTrgA4Tj7wZGKmMg==

"@depay/web3-client-solana@^10.18.4":
version "10.18.4"
resolved "https://registry.yarnpkg.com/@depay/web3-client-solana/-/web3-client-solana-10.18.4.tgz#c4f862656e90895136586e48b79ba58c10f70da8"
integrity sha512-Mw4RZM/e6pMniE/adz/bcdsyv9FTNZhSbMARJizX5gFEshlJ0P5Bq2U8IxZ/IB+JFk9JRXCBs8dms7plHxo7YQ==

"@depay/web3-client@^10.18.4":
version "10.18.4"
resolved "https://registry.yarnpkg.com/@depay/web3-client/-/web3-client-10.18.4.tgz#94a3b07c6fa837ca414e6ac7f0adb30ceba43e91"
integrity sha512-MkxXkHZpfnMXeXvON+Biz+ZwoQYFd/ZA+wvLK2f2YejNLrjWk8dBryBBULkSeNpJKiLi7awkAD2nBp5sK4WQjQ==
"@depay/web3-blockchains@^9.4.4":
version "9.4.4"
resolved "https://registry.yarnpkg.com/@depay/web3-blockchains/-/web3-blockchains-9.4.4.tgz#0dcc1a04099df5f2d2ed8e22da421965c66a62be"
integrity sha512-z/L7QjtGCavkNOt+gzZbg44aILazzjQKK+ZAniNCy+DeT1HRNbBC3HXAfprb6GNiBaZBk6rmsLf8o1GsYQMa8g==

"@depay/web3-client-evm@^10.18.10":
version "10.18.10"
resolved "https://registry.yarnpkg.com/@depay/web3-client-evm/-/web3-client-evm-10.18.10.tgz#16334af49a99ff3fabbc364308c2350c407c99e4"
integrity sha512-dXwCgw54JT1DkEI+D275kKtjAq4Ft+1v03kJlhYJX9sOvlbSaSozSRdwYRMN/OSzZFvYnNqLRibQBaBbxg8dzw==

"@depay/web3-client-solana@^10.18.10":
version "10.18.10"
resolved "https://registry.yarnpkg.com/@depay/web3-client-solana/-/web3-client-solana-10.18.10.tgz#609bd285fc1d2f3898aa8fdfc707011383d8fad1"
integrity sha512-uG8PJEkcRdNEDfJReVinmRyBQTnAhOGO3Ro3N0DY48Z84AXQVVsosfmZLbPKm7qoPHj9OYt0Wn6gEf1AsJPyGA==

"@depay/web3-client@^10.18.10":
version "10.18.10"
resolved "https://registry.yarnpkg.com/@depay/web3-client/-/web3-client-10.18.10.tgz#d1c958546e0eb37a1d889aea1158984f2b5e776d"
integrity sha512-S9XhZ6NfalRx3fI++R9RhQpQWLWnWRzvPyFC347xZuJgpR0c8p//o/rn1KDpw3+hyPQNJuLdlrCZQXUJgZu7DA==

"@depay/web3-mock-evm@^14.17.0":
version "14.17.0"
Expand Down

0 comments on commit 6aae078

Please sign in to comment.