Skip to content

Commit dedb0fb

Browse files
authored
Merge pull request #573 from blocknative/release/1.27.0
Release 1.27.0
2 parents fa88d41 + 02cd668 commit dedb0fb

File tree

6 files changed

+61
-29
lines changed

6 files changed

+61
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.26.1",
3+
"version": "1.27.0",
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",

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export interface Wallet {
173173
instance?: any | null
174174
connect?: Connect | null
175175
dashboard?: () => void | null
176+
icons: Pick<WalletModule, 'svg' | 'iconSrc' | 'iconSrcSet'>
176177
}
177178

178179
export interface CommonWalletOptions {

src/onboard.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,27 @@ import initializeModules from './modules'
3636
let onboard: any
3737

3838
function init(initialization: Initialization): API {
39+
if (typeof window === 'undefined') {
40+
console.warn(
41+
'Onboard.js must be run in a browser environment. If you are utilizing server side rendering you can ignore this warning.'
42+
)
43+
44+
const stubbedAPI = {
45+
walletSelect: () => Promise.resolve(false),
46+
walletCheck: () => Promise.resolve(false),
47+
walletReset: () => {},
48+
config: () => {},
49+
getState: () => get(state),
50+
accountSelect: () => Promise.resolve(false)
51+
}
52+
53+
return stubbedAPI
54+
}
55+
3956
if (onboard) {
40-
console.warn('onboard has already been initialized')
57+
console.warn(
58+
'Initializing Onboard and destroying previously initialized instance.'
59+
)
4160
onboard.$destroy()
4261
}
4362

src/stores.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export function initializeStores() {
8888
connect: null,
8989
instance: null,
9090
dashboard: null,
91-
type: null
91+
type: null,
92+
icons: null
9293
})
9394

9495
state = derived(

src/views/WalletSelect.svelte

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,19 @@
223223
224224
return selectedWalletInterface
225225
})
226-
226+
const { name, type, svg, iconSrc, iconSrcSet } = module
227227
wallet.set({
228228
provider,
229229
instance,
230230
dashboard: selectedWalletInterface.dashboard,
231-
name: module.name,
231+
name,
232232
connect: selectedWalletInterface.connect,
233-
type: module.type
233+
type,
234+
icons: {
235+
svg,
236+
iconSrc,
237+
iconSrcSet
238+
}
234239
})
235240
236241
finish({ completed: true })

yarn.lock

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,14 +2129,15 @@ browserify-aes@^1.0.6, browserify-aes@^1.2.0:
21292129
safe-buffer "^5.0.1"
21302130

21312131
browserslist@^4.12.0, browserslist@^4.8.5:
2132-
version "4.13.0"
2133-
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.13.0.tgz#42556cba011e1b0a2775b611cba6a8eca18e940d"
2134-
integrity sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==
2132+
version "4.16.6"
2133+
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2"
2134+
integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==
21352135
dependencies:
2136-
caniuse-lite "^1.0.30001093"
2137-
electron-to-chromium "^1.3.488"
2138-
escalade "^3.0.1"
2139-
node-releases "^1.1.58"
2136+
caniuse-lite "^1.0.30001219"
2137+
colorette "^1.2.2"
2138+
electron-to-chromium "^1.3.723"
2139+
escalade "^3.1.1"
2140+
node-releases "^1.1.71"
21402141

21412142
bs58@^4.0.0, bs58@^4.0.1:
21422143
version "4.0.1"
@@ -2259,10 +2260,10 @@ camelcase@^5.0.0:
22592260
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
22602261
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
22612262

2262-
caniuse-lite@^1.0.30001093:
2263-
version "1.0.30001110"
2264-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001110.tgz#9003e3c7f5a43ea6f1193d4d5acba0bfb152c71a"
2265-
integrity sha512-KqJWeat4rhSHF0ito4yz9q/JuZHkvn71SsBnxge4azjPDbowIjOUnS8i1xpKGxZxU6BFiPqO2hSV2eiCpFQVRw==
2263+
caniuse-lite@^1.0.30001219:
2264+
version "1.0.30001230"
2265+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71"
2266+
integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==
22662267

22672268
caseless@~0.12.0:
22682269
version "0.12.0"
@@ -2398,6 +2399,11 @@ color-name@~1.1.4:
23982399
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
23992400
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
24002401

2402+
colorette@^1.2.2:
2403+
version "1.2.2"
2404+
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
2405+
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
2406+
24012407
combined-stream@^1.0.6, combined-stream@~1.0.6:
24022408
version "1.0.8"
24032409
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@@ -2673,10 +2679,10 @@ ecc-jsbn@~0.1.1:
26732679
jsbn "~0.1.0"
26742680
safer-buffer "^2.1.0"
26752681

2676-
electron-to-chromium@^1.3.488:
2677-
version "1.3.519"
2678-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.519.tgz#d1da9c8a8a96ee7f60c32b2ca2593533a970c210"
2679-
integrity sha512-2r/p/9YOjIpX10KxcH1HcAGz1oadSD9Cwwotoek8wNJx/SRpklea14qdAMzCTTZlIezvsJ8sNsBQN05bJ/ZjhA==
2682+
electron-to-chromium@^1.3.723:
2683+
version "1.3.742"
2684+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.742.tgz#7223215acbbd3a5284962ebcb6df85d88b95f200"
2685+
integrity sha512-ihL14knI9FikJmH2XUIDdZFWJxvr14rPSdOhJ7PpS27xbz8qmaRwCwyg/bmFwjWKmWK9QyamiCZVCvXm5CH//Q==
26802686

26812687
elliptic@6.5.2, elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3:
26822688
version "6.5.3"
@@ -2825,10 +2831,10 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3:
28252831
d "^1.0.1"
28262832
ext "^1.1.2"
28272833

2828-
escalade@^3.0.1:
2829-
version "3.0.2"
2830-
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.0.2.tgz#6a580d70edb87880f22b4c91d0d56078df6962c4"
2831-
integrity sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==
2834+
escalade@^3.1.1:
2835+
version "3.1.1"
2836+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
2837+
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
28322838

28332839
escape-string-regexp@^1.0.5:
28342840
version "1.0.5"
@@ -4935,10 +4941,10 @@ node-gyp-build@^4.2.0:
49354941
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739"
49364942
integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==
49374943

4938-
node-releases@^1.1.58:
4939-
version "1.1.60"
4940-
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.60.tgz#6948bdfce8286f0b5d0e5a88e8384e954dfe7084"
4941-
integrity sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==
4944+
node-releases@^1.1.71:
4945+
version "1.1.72"
4946+
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe"
4947+
integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==
49424948

49434949
normalize-hex@0.0.2:
49444950
version "0.0.2"

0 commit comments

Comments
 (0)