Skip to content

Commit 9955d3a

Browse files
Adamj1232taylorjdawsonbrendanwwAdam Carpentercb-jake
authored
1.37.2 Release - Master (#802)
* update walletlink to 2.4.4 * 1.37.0-0.0.2 - Update yarn.lock deps to run in Node v12 container (#786) * update yarn.lock to run in Node v12 container * Update package.json ver Co-authored-by: Adam Carpenter <Adam@blocknative.com> * 1.37.0-0.0.3 - Update to PR checklist for fork merges to run yarn with nove v12 (#787) * Update to PR checklist for fork merges to run yarn with nove v12 * Ver inc Co-authored-by: Adam Carpenter <Adam@blocknative.com> * 1.37.0-0.0.4 : use window.ethereum provider if available (#777) * coinbase wallet use window.ethereum vs. web3 * bump minor version Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Release: 1.37.1 (#788) Co-authored-by: Adam Carpenter <Adam@blocknative.com> * 1inch wallet (#779) * 1inch wallet * Up version due to 1inch wallet integration * Fix lint Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> * Update version for release * 1.37.1-0.0.2 - Update Walletconnect dep to 1.7.1 (#775) * Update walletconnect to 1.7.1 * Update to latest develop version Co-authored-by: Adam Carpenter <adamcarpenter86@gmail.com> Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com> Co-authored-by: Brendan Weinstein <brendan.weinstein@coinbase.com> Co-authored-by: Adam Carpenter <Adam@blocknative.com> Co-authored-by: cb-jake <95890768+cb-jake@users.noreply.github.com> Co-authored-by: Alexandr Kazachenko <shoom3301@gmail.com> Co-authored-by: WC <677680+welps@users.noreply.github.com>
1 parent 00b65ea commit 9955d3a

File tree

7 files changed

+111
-66
lines changed

7 files changed

+111
-66
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.37.1",
3+
"version": "1.37.2",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",
@@ -68,7 +68,7 @@
6868
"@shapeshiftoss/hdwallet-keepkey": "^1.15.2",
6969
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
7070
"@toruslabs/torus-embed": "^1.10.11",
71-
"@walletconnect/web3-provider": "^1.6.2",
71+
"@walletconnect/web3-provider": "^1.7.1",
7272
"authereum": "^0.1.12",
7373
"bignumber.js": "^9.0.0",
7474
"bnc-sdk": "^3.4.1",

src/modules/select/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const desktopDefaultWalletNames = [
2121
]
2222

2323
const mobileDefaultWalletNames = [
24+
'1inch',
2425
'metamask',
2526
'coinbase',
2627
'trust',
@@ -229,6 +230,8 @@ function getModule(name: string): Promise<{
229230
// return import('./wallets/mewwallet')
230231
case 'mathwallet':
231232
return import('./wallets/mathwallet')
233+
case '1inch':
234+
return import('./wallets/1inch')
232235
case 'blankwallet':
233236
return import('./wallets/blankwallet')
234237
case 'ronin':
6.93 KB
Loading
10.3 KB
Loading

src/modules/select/wallets/1inch.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { mobileWalletInstallMessage } from '../content'
2+
import { WalletModule, Helpers, CommonWalletOptions } from '../../../interfaces'
3+
4+
import oneInchIcon from '../wallet-icons/1inch.png'
5+
import oneInchIcon2x from '../wallet-icons/1inch@2x.png'
6+
7+
function oneInchWallet(options: CommonWalletOptions): WalletModule {
8+
const { preferred, label, iconSrc, svg } = options
9+
10+
return {
11+
name: label || '1inch',
12+
iconSrc: iconSrc || oneInchIcon,
13+
iconSrcSet: iconSrc || oneInchIcon2x,
14+
svg,
15+
wallet: async (helpers: Helpers) => {
16+
const { createModernProviderInterface, getProviderName } = helpers
17+
const windowAsAny = window as any
18+
const provider =
19+
windowAsAny || (windowAsAny.web3 && windowAsAny.web3.currentProvider)
20+
21+
return {
22+
provider,
23+
interface:
24+
provider && getProviderName(provider) === '1inch'
25+
? createModernProviderInterface(provider)
26+
: null
27+
}
28+
},
29+
type: 'injected',
30+
link: `https://wallet.1inch.io?url=${window.location.host}`,
31+
installMessage: mobileWalletInstallMessage,
32+
mobile: true,
33+
preferred,
34+
osExclusions: ['Android']
35+
}
36+
}
37+
38+
export default oneInchWallet

src/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ export function getProviderName(provider: any): string | undefined {
357357
return 'BlankWallet'
358358
}
359359

360+
if (provider.isOneInchIOSWallet) {
361+
return '1inch'
362+
}
363+
360364
// =====================================
361365
// When adding new wallet place above this metamask check as some providers
362366
// have an isMetaMask property in addition to the wallet's own `is[WalletName]`

yarn.lock

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,35 +2604,35 @@
26042604
semver "^7.3.2"
26052605
tsutils "^3.17.1"
26062606

2607-
"@walletconnect/browser-utils@^1.6.5":
2608-
version "1.6.5"
2609-
resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.6.5.tgz#01180682e90b95384e820191a1c6ad4a78729439"
2610-
integrity sha512-HLTysmlCkc2HN2OS6ewMG0v8E9oY2h9zNaDHe0BLN3ZxnsoMCVzkJxy7ryaXCemVdapmr6HgHFexGJoMbWaC4w==
2607+
"@walletconnect/browser-utils@^1.7.1":
2608+
version "1.7.1"
2609+
resolved "https://registry.yarnpkg.com/@walletconnect/browser-utils/-/browser-utils-1.7.1.tgz#2a28846cd4d73166debbbf7d470e78ba25616f5e"
2610+
integrity sha512-y6KvxPhi52sWzS0/HtA3EhdgmtG8mXcxdc26YURDOVC/BJh3MxV8E16JFrT4InylOqYJs6dcSLWVfcnJaiPtZw==
26112611
dependencies:
26122612
"@walletconnect/safe-json" "1.0.0"
2613-
"@walletconnect/types" "^1.6.5"
2613+
"@walletconnect/types" "^1.7.1"
26142614
"@walletconnect/window-getters" "1.0.0"
26152615
"@walletconnect/window-metadata" "1.0.0"
26162616
detect-browser "5.2.0"
26172617

2618-
"@walletconnect/client@^1.6.5":
2619-
version "1.6.5"
2620-
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.6.5.tgz#6616ae926abc7c87c48a2d3693f2eb697858e685"
2621-
integrity sha512-dRq1D3NEGwM2I3CpiwFsWy1rrdMKCMSfDUu3rCCXUE4zInx+pyq7IEFjYiSjtOEZzjRlUTqYwhjnYIezQZgh4w==
2618+
"@walletconnect/client@^1.7.1":
2619+
version "1.7.1"
2620+
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.7.1.tgz#aaa74199bdc0605db9ac2ecdf8a463b271586d3b"
2621+
integrity sha512-xD8B8s1hL7Z5vJwb3L0u1bCVAk6cRQfIY9ycymf7KkmIhkAONQJNf2Y0C0xIpbPp2fdn9VwnSfLm5Ed/Ht/1IA==
26222622
dependencies:
2623-
"@walletconnect/core" "^1.6.5"
2624-
"@walletconnect/iso-crypto" "^1.6.5"
2625-
"@walletconnect/types" "^1.6.5"
2626-
"@walletconnect/utils" "^1.6.5"
2623+
"@walletconnect/core" "^1.7.1"
2624+
"@walletconnect/iso-crypto" "^1.7.1"
2625+
"@walletconnect/types" "^1.7.1"
2626+
"@walletconnect/utils" "^1.7.1"
26272627

2628-
"@walletconnect/core@^1.6.5":
2629-
version "1.6.5"
2630-
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.6.5.tgz#acb687fc7c2d71ce2adad6a921ec1b343c4b4dd7"
2631-
integrity sha512-mmMTP8nZunjSCAy0ckafvt/JcdzcuSZPaAybqgKwx2rC9cc/3XWrdNsfiKMt8AFoQF87jGHem3905eFZYTqLXw==
2628+
"@walletconnect/core@^1.7.1":
2629+
version "1.7.1"
2630+
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-1.7.1.tgz#321c14d63af81241658b028022e0e5fa6dc7f374"
2631+
integrity sha512-qO+4wykyRNiq3HEuaAA2pW2PDnMM4y7pyPAgiCwfHiqF4PpWvtcdB301hI0K5am9ghuqKZMy1HlE9LWNOEBvcw==
26322632
dependencies:
2633-
"@walletconnect/socket-transport" "^1.6.5"
2634-
"@walletconnect/types" "^1.6.5"
2635-
"@walletconnect/utils" "^1.6.5"
2633+
"@walletconnect/socket-transport" "^1.7.1"
2634+
"@walletconnect/types" "^1.7.1"
2635+
"@walletconnect/utils" "^1.7.1"
26362636

26372637
"@walletconnect/crypto@^1.0.1":
26382638
version "1.0.1"
@@ -2658,24 +2658,24 @@
26582658
resolved "https://registry.yarnpkg.com/@walletconnect/environment/-/environment-1.0.0.tgz#c4545869fa9c389ec88c364e1a5f8178e8ab5034"
26592659
integrity sha512-4BwqyWy6KpSvkocSaV7WR3BlZfrxLbJSLkg+j7Gl6pTDE+U55lLhJvQaMuDVazXYxcjBsG09k7UlH7cGiUI5vQ==
26602660

2661-
"@walletconnect/http-connection@^1.6.5":
2662-
version "1.6.5"
2663-
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.6.5.tgz#18529b7556bc09d7c794f4adc76ef0742cd500aa"
2664-
integrity sha512-5kr6wZ3DnqaBiwkeA9iKdawvIb3bIJNf8WA8X89YHE5KOzbkAsymjniZWs8asdl9Y9+8ZHJMPXtylyrkpT8wXA==
2661+
"@walletconnect/http-connection@^1.7.1":
2662+
version "1.7.1"
2663+
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.7.1.tgz#fddddccd70a5c659c6e6ac25ba5305290c158705"
2664+
integrity sha512-cz3pw2MsTyBT5hy8qhs67NFHTIFOzltdMx9Hy1ftkjXQYtenxIBzAQpZzF6l/lXC3GmMziueYnknZILo1+wgfg==
26652665
dependencies:
2666-
"@walletconnect/types" "^1.6.5"
2667-
"@walletconnect/utils" "^1.6.5"
2666+
"@walletconnect/types" "^1.7.1"
2667+
"@walletconnect/utils" "^1.7.1"
26682668
eventemitter3 "4.0.7"
26692669
xhr2-cookies "1.1.0"
26702670

2671-
"@walletconnect/iso-crypto@^1.6.5":
2672-
version "1.6.5"
2673-
resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.6.5.tgz#1c6471506283817e7e797c5e2e733f6c3d88f8dc"
2674-
integrity sha512-145VRX1+gudhHrnT2s81lLW/BEu3QgFMMRCrkxx9Tsl5JiLGcGbWkMxAl8zjGTMqnHeuQngyjvY1mO+3z27a7A==
2671+
"@walletconnect/iso-crypto@^1.7.1":
2672+
version "1.7.1"
2673+
resolved "https://registry.yarnpkg.com/@walletconnect/iso-crypto/-/iso-crypto-1.7.1.tgz#c463bb5874686c2f21344e2c7f3cf4d71c34ca70"
2674+
integrity sha512-qMiW0kLN6KCjnLMD50ijIj1lQqjNjGszGUwrSVUiS2/Dp4Ecx+4QEtHbmVwGEkfx4kelYPFpDJV3ZJpQ4Kqg/g==
26752675
dependencies:
26762676
"@walletconnect/crypto" "^1.0.1"
2677-
"@walletconnect/types" "^1.6.5"
2678-
"@walletconnect/utils" "^1.6.5"
2677+
"@walletconnect/types" "^1.7.1"
2678+
"@walletconnect/utils" "^1.7.1"
26792679

26802680
"@walletconnect/jsonrpc-types@^1.0.0":
26812681
version "1.0.0"
@@ -2697,14 +2697,14 @@
26972697
resolved "https://registry.yarnpkg.com/@walletconnect/mobile-registry/-/mobile-registry-1.4.0.tgz#502cf8ab87330841d794819081e748ebdef7aee5"
26982698
integrity sha512-ZtKRio4uCZ1JUF7LIdecmZt7FOLnX72RPSY7aUVu7mj7CSfxDwUn6gBuK6WGtH+NZCldBqDl5DenI5fFSvkKYw==
26992699

2700-
"@walletconnect/qrcode-modal@^1.6.5":
2701-
version "1.6.5"
2702-
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.6.5.tgz#58974ca8f826bd500121e85694dd342b3535cf2c"
2703-
integrity sha512-XII/Pm7zS5pRxrakURuhbWO+SfwgOuLuvOBk/hr1ATK/y7R5p19P62mCSUrvSxHXca27IX1tZJRe9D161R0WgQ==
2700+
"@walletconnect/qrcode-modal@^1.7.1":
2701+
version "1.7.1"
2702+
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.7.1.tgz#89b19c2eb6466ec237ccd597388d7a1b1b946067"
2703+
integrity sha512-m/4lSx3pgj8V2eHVJcGnxBKUSCNFtyVIcg5tqbSJHi9HjKIBxvRq4D5M4X4yEpgXYtRmTucihxNCrj2zQrmlSQ==
27042704
dependencies:
2705-
"@walletconnect/browser-utils" "^1.6.5"
2705+
"@walletconnect/browser-utils" "^1.7.1"
27062706
"@walletconnect/mobile-registry" "^1.4.0"
2707-
"@walletconnect/types" "^1.6.5"
2707+
"@walletconnect/types" "^1.7.1"
27082708
copy-to-clipboard "^3.3.1"
27092709
preact "10.4.1"
27102710
qrcode "1.4.4"
@@ -2723,43 +2723,43 @@
27232723
resolved "https://registry.yarnpkg.com/@walletconnect/safe-json/-/safe-json-1.0.0.tgz#12eeb11d43795199c045fafde97e3c91646683b2"
27242724
integrity sha512-QJzp/S/86sUAgWY6eh5MKYmSfZaRpIlmCJdi5uG4DJlKkZrHEF7ye7gA+VtbVzvTtpM/gRwO2plQuiooIeXjfg==
27252725

2726-
"@walletconnect/socket-transport@^1.6.5":
2727-
version "1.6.5"
2728-
resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.6.5.tgz#f190f2d994021287fdeaf071114a5415096b2535"
2729-
integrity sha512-FRlgBr3EIxD3du5l/tuK6jdiva85YeRG+iZmo/RPnlVw4opy74WXb5JdCK9jXLcBEoDiY9Hz4j69aqnht6gIDQ==
2726+
"@walletconnect/socket-transport@^1.7.1":
2727+
version "1.7.1"
2728+
resolved "https://registry.yarnpkg.com/@walletconnect/socket-transport/-/socket-transport-1.7.1.tgz#cc4c8dcf21c40b805812ecb066b2abb156fdb146"
2729+
integrity sha512-Gu1RPro0eLe+HHtLhq/1T5TNFfO/HW2z3BnWuUYuJ/F8w1U9iK7+4LMHe+LTgwgWy9Ybcb2k0tiO5e3LgjHBHQ==
27302730
dependencies:
2731-
"@walletconnect/types" "^1.6.5"
2732-
"@walletconnect/utils" "^1.6.5"
2731+
"@walletconnect/types" "^1.7.1"
2732+
"@walletconnect/utils" "^1.7.1"
27332733
ws "7.5.3"
27342734

2735-
"@walletconnect/types@^1.6.5":
2736-
version "1.6.5"
2737-
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.6.5.tgz#31ad1415fc6e1e89e25a10ad5fed6958f56cefa8"
2738-
integrity sha512-S9DsODI35PbIDuOSkIiF8SzTstqCqX/4+kV7n18vyukEFPlpSSHwZMwJUfzo9yJ0pqsqLNZta+jvb88gJRuAaA==
2735+
"@walletconnect/types@^1.7.1":
2736+
version "1.7.1"
2737+
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.7.1.tgz#86cc3832e02415dc9f518f3dcb5366722afbfc03"
2738+
integrity sha512-X0NunEUgq46ExDcKo7BnnFpFhuZ89bZ04/1FtohNziBWcP2Mblp2yf+FN7iwmZiuZ3bRTb8J1O4oJH2JGP9I7A==
27392739

2740-
"@walletconnect/utils@^1.6.5":
2741-
version "1.6.5"
2742-
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.6.5.tgz#6edd749cb52a363feda117121dc865d7cc6169f7"
2743-
integrity sha512-QB5rn/1s0PKVitAQ2/mgWbay2XfN21y3ob+5g6IhxtJRW31bbMoZw5YfO6s4ixLaZZez5LNQXstvQAclRzB7jQ==
2740+
"@walletconnect/utils@^1.7.1":
2741+
version "1.7.1"
2742+
resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-1.7.1.tgz#f858d5f22425a4c2da2a28ae493bde7f2eecf815"
2743+
integrity sha512-7Lig9rruqTMaFuwEhBrArq1QgzIf2NuzO6J3sCUYCZh60EQ7uIZjekaDonQjiQJAbfYcgWUBm8qa0PG1TzYN3Q==
27442744
dependencies:
2745-
"@walletconnect/browser-utils" "^1.6.5"
2745+
"@walletconnect/browser-utils" "^1.7.1"
27462746
"@walletconnect/encoding" "^1.0.0"
27472747
"@walletconnect/jsonrpc-utils" "^1.0.0"
2748-
"@walletconnect/types" "^1.6.5"
2748+
"@walletconnect/types" "^1.7.1"
27492749
bn.js "4.11.8"
27502750
js-sha3 "0.8.0"
27512751
query-string "6.13.5"
27522752

2753-
"@walletconnect/web3-provider@^1.6.2":
2754-
version "1.6.5"
2755-
resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.6.5.tgz#7c4ac2f89ddda1a4069d500ed29cc4396e7fdade"
2756-
integrity sha512-SeC7+1saHxvFn2wjt/3F0sTkDemHDNDbMkdZ3jtA7vjEw91Q0CmaYIuZk2UxyVM+tC1jL1l4yci/sgaFeAcXpQ==
2757-
dependencies:
2758-
"@walletconnect/client" "^1.6.5"
2759-
"@walletconnect/http-connection" "^1.6.5"
2760-
"@walletconnect/qrcode-modal" "^1.6.5"
2761-
"@walletconnect/types" "^1.6.5"
2762-
"@walletconnect/utils" "^1.6.5"
2753+
"@walletconnect/web3-provider@^1.7.1":
2754+
version "1.7.1"
2755+
resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.7.1.tgz#3b7bf41bfd0198b18f5cc5626e1ec28e931667c7"
2756+
integrity sha512-dhoYwQaBVbaKIiELNeCF4kW7Dslbf73wDIsxOF9gmjVch1Qi18kNlqbR03u56iBcAsXU0tAwfd9Z7cGHfUX1Fg==
2757+
dependencies:
2758+
"@walletconnect/client" "^1.7.1"
2759+
"@walletconnect/http-connection" "^1.7.1"
2760+
"@walletconnect/qrcode-modal" "^1.7.1"
2761+
"@walletconnect/types" "^1.7.1"
2762+
"@walletconnect/utils" "^1.7.1"
27632763
web3-provider-engine "16.0.1"
27642764

27652765
"@walletconnect/window-getters@1.0.0", "@walletconnect/window-getters@^1.0.0":

0 commit comments

Comments
 (0)