Skip to content

Commit eb2a6b0

Browse files
authored
Merge pull request #90 from blocknative/develop
Release 0.2.12
2 parents d69e9e5 + bbb43ec commit eb2a6b0

33 files changed

+551
-433
lines changed

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true
7+
}

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ JavaScript library to easily onboard users to ethereum apps by enabling wallet s
99
## Quick Start with Default Modules
1010

1111
```javascript
12-
import Onboard from "bnc-onboard"
12+
import Onboard from 'bnc-onboard'
1313

1414
// initialize onboard
1515
const onboard = Onboard.init({
16-
dappId: "Your apiKey here",
16+
dappId: 'Your apiKey here',
1717
networkId: 1,
1818
subscriptions: {
19-
address: address => console.log("user address has changed:", address),
20-
network: network => console.log("user network has changed:", network),
21-
balance: balance => console.log("user balance has changed:", balance),
19+
address: address => console.log('user address has changed:', address),
20+
network: network => console.log('user network has changed:', network),
21+
balance: balance => console.log('user balance has changed:', balance),
2222
wallet: wallet =>
2323
console.log(
24-
"a new wallet has been selected by user",
24+
'a new wallet has been selected by user',
2525
wallet.provider,
2626
wallet.name
2727
)
@@ -30,17 +30,17 @@ const onboard = Onboard.init({
3030
// default wallets that are included: MetaMask, Dapper, Coinbase, Trust, WalletConnect
3131
walletSelect: Onboard.modules.select.defaults({
3232
// if you want squarelink as a wallet option
33-
squarelinkInit: { apiKey: "Your squarelink key here" },
33+
squarelinkInit: { apiKey: 'Your squarelink key here' },
3434
// if you want fortmatic as a wallet option
35-
fortmaticInit: { apiKey: "Your fortmatic key here" },
35+
fortmaticInit: { apiKey: 'Your fortmatic key here' },
3636
// if you want portis as a wallet option
37-
portisInit: { apiKey: "Your portis key here" },
37+
portisInit: { apiKey: 'Your portis key here' },
3838
networkId: 4
3939
}),
4040
// default ready steps are: connect, network, balance
4141
walletReady: Onboard.modules.ready.defaults({
4242
networkId: 4,
43-
minimumBalance: "200000000000000000"
43+
minimumBalance: '200000000000000000'
4444
})
4545
}
4646
})
@@ -241,7 +241,7 @@ walletConnect({
241241
#### Example
242242

243243
```javascript
244-
import Onboard from "bnc-onboard"
244+
import Onboard from 'bnc-onboard'
245245

246246
// PICK AND CHOOSE MODULES
247247

@@ -257,17 +257,17 @@ const onboard = Onboard.init({
257257
// ...
258258
modules: {
259259
walletSelect: {
260-
heading: "Select a Wallet",
260+
heading: 'Select a Wallet',
261261
description:
262-
"Please select the wallet that you would like to use with this Dapp",
262+
'Please select the wallet that you would like to use with this Dapp',
263263
wallets: {
264264
desktop: [
265-
portis({ apiKey: "sdda-w2-ds3", networkId: 1 }),
266-
squarelink({ apiKey: "sdda-w2-ds3", networkId: 1 }),
265+
portis({ apiKey: 'sdda-w2-ds3', networkId: 1 }),
266+
squarelink({ apiKey: 'sdda-w2-ds3', networkId: 1 }),
267267
dapper(),
268268
metmask()
269269
],
270-
mobile: [fortmatic({ apiKey: "sd-3d3-d", networkId: 1 })]
270+
mobile: [fortmatic({ apiKey: 'sd-3d3-d', networkId: 1 })]
271271
}
272272
}
273273
//....
@@ -282,7 +282,7 @@ const onboard = Onboard.init({
282282
// ...
283283
modules: {
284284
walletSelect: Onboard.modules.select.defaults({
285-
portisInit: { apiKey: "Your portis key here" },
285+
portisInit: { apiKey: 'Your portis key here' },
286286
networkId: 4
287287
})
288288
// ...
@@ -323,7 +323,7 @@ balance(String) // the minimum balance in wei required to interact with your da
323323
#### Example
324324

325325
```javascript
326-
import Onboard from "bnc-onboard"
326+
import Onboard from 'bnc-onboard'
327327

328328
// PICK AND CHOOSE MODULES
329329

@@ -333,7 +333,7 @@ const onboard = Onboard.init({
333333
// ...
334334
modules: {
335335
//....
336-
walletReady: [connect(), network(1), balance("400000000000")]
336+
walletReady: [connect(), network(1), balance('400000000000')]
337337
}
338338
})
339339

@@ -347,7 +347,7 @@ const onboard = Onboard.init({
347347
// ...
348348
walletReady: Onboard.modules.ready.defaults({
349349
networkId: 1,
350-
minimumBalance: "400000000000"
350+
minimumBalance: '400000000000'
351351
})
352352
}
353353
})

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": "0.2.11",
3+
"version": "0.2.12",
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",

rollup.config.js

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import svelte from "rollup-plugin-svelte"
2-
import resolve from "rollup-plugin-node-resolve"
3-
import json from "@rollup/plugin-json"
4-
import image from "rollup-plugin-img"
5-
import commonjs from "rollup-plugin-commonjs"
6-
import globals from "rollup-plugin-node-globals"
7-
import builtins from "@joseph184/rollup-plugin-node-builtins"
8-
import typescript from "rollup-plugin-typescript2"
1+
import svelte from 'rollup-plugin-svelte'
2+
import resolve from 'rollup-plugin-node-resolve'
3+
import json from '@rollup/plugin-json'
4+
import image from 'rollup-plugin-img'
5+
import commonjs from 'rollup-plugin-commonjs'
6+
import globals from 'rollup-plugin-node-globals'
7+
import builtins from '@joseph184/rollup-plugin-node-builtins'
8+
import typescript from 'rollup-plugin-typescript2'
99

1010
import {
1111
preprocess,
1212
createEnv,
1313
readConfigFile
14-
} from "@pyoner/svelte-ts-preprocess"
14+
} from '@pyoner/svelte-ts-preprocess'
1515

1616
const env = createEnv()
1717
const compilerOptions = readConfigFile(env)
@@ -25,20 +25,20 @@ const opts = {
2525

2626
export default [
2727
{
28-
input: "src/onboard.ts",
28+
input: 'src/onboard.ts',
2929
output: {
30-
format: "umd",
31-
name: "onboard",
32-
file: "dist/onboard.umd.js"
30+
format: 'umd',
31+
name: 'onboard',
32+
file: 'dist/onboard.umd.js'
3333
},
3434
moduleContext: id => {
3535
const thisAsWindowForModules = [
36-
"node_modules/intl-messageformat/lib/core.js",
37-
"node_modules/intl-messageformat/lib/compiler.js"
36+
'node_modules/intl-messageformat/lib/core.js',
37+
'node_modules/intl-messageformat/lib/compiler.js'
3838
]
3939

4040
if (thisAsWindowForModules.some(id_ => id.trimRight().endsWith(id_))) {
41-
return "window"
41+
return 'window'
4242
}
4343
},
4444
plugins: [
@@ -51,7 +51,7 @@ export default [
5151
browser: true,
5252
preferBuiltins: true,
5353
dedupe: importee =>
54-
importee === "svelte" || importee.startsWith("svelte/")
54+
importee === 'svelte' || importee.startsWith('svelte/')
5555
}),
5656
commonjs(),
5757
globals(),
@@ -60,19 +60,19 @@ export default [
6060
]
6161
},
6262
{
63-
input: "src/onboard.ts",
63+
input: 'src/onboard.ts',
6464
output: {
65-
format: "es",
66-
file: "dist/onboard.esm.js"
65+
format: 'es',
66+
file: 'dist/onboard.esm.js'
6767
},
6868
moduleContext: id => {
6969
const thisAsWindowForModules = [
70-
"node_modules/intl-messageformat/lib/core.js",
71-
"node_modules/intl-messageformat/lib/compiler.js"
70+
'node_modules/intl-messageformat/lib/core.js',
71+
'node_modules/intl-messageformat/lib/compiler.js'
7272
]
7373

7474
if (thisAsWindowForModules.some(id_ => id.trimRight().endsWith(id_))) {
75-
return "window"
75+
return 'window'
7676
}
7777
},
7878
plugins: [
@@ -84,22 +84,22 @@ export default [
8484
resolve({
8585
browser: true,
8686
dedupe: importee =>
87-
importee === "svelte" || importee.startsWith("svelte/")
87+
importee === 'svelte' || importee.startsWith('svelte/')
8888
}),
8989
commonjs(),
9090
typescript()
9191
],
9292
external: [
93-
"bowser",
94-
"bnc-sdk",
95-
"bignumber.js",
96-
"promise-cancelable",
97-
"@portis/web3",
98-
"@walletconnect/web3-provider",
99-
"fortmatic",
100-
"squarelink",
101-
"authereum",
102-
"regenerator-runtime/runtime"
93+
'bowser',
94+
'bnc-sdk',
95+
'bignumber.js',
96+
'promise-cancelable',
97+
'@portis/web3',
98+
'@walletconnect/web3-provider',
99+
'fortmatic',
100+
'squarelink',
101+
'authereum',
102+
'regenerator-runtime/runtime'
103103
]
104104
}
105105
]

src/@types/images.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
declare module "*.png"
2-
declare module "*.svg"
1+
declare module '*.png'
2+
declare module '*.svg'

src/@types/libraries.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module "promise-cancelable" {
1+
declare module 'promise-cancelable' {
22
export default class Cancelable extends Promise<any> {
33
constructor(executor: any)
44
cancel(func: () => void): any
@@ -7,6 +7,6 @@ declare module "promise-cancelable" {
77
isRejected(): any
88
}
99
}
10-
declare module "@walletconnect/web3-provider"
11-
declare module "squarelink"
12-
declare module "fortmatic"
10+
declare module '@walletconnect/web3-provider'
11+
declare module 'squarelink'
12+
declare module 'fortmatic'

src/components/ModalHeader.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2-
import { app } from "../stores";
3-
export let heading: string;
4-
export let icon: string;
2+
import { app } from '../stores'
3+
export let heading: string
4+
export let icon: string
55
</script>
66

77
<style>

src/components/SelectedWallet.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script lang="ts">
2-
import Button from "../elements/Button.svelte";
3-
import IconDisplay from "../elements/IconDisplay.svelte";
4-
import { fade } from "svelte/transition";
5-
import { WalletModule } from "../interfaces";
6-
export let selectedWalletModule: WalletModule;
7-
export let onBack: () => void;
8-
export let installMessage: string;
2+
import Button from '../elements/Button.svelte'
3+
import IconDisplay from '../elements/IconDisplay.svelte'
4+
import { fade } from 'svelte/transition'
5+
import { WalletModule } from '../interfaces'
6+
export let selectedWalletModule: WalletModule
7+
export let onBack: () => void
8+
export let installMessage: string
99
</script>
1010

1111
<style>

src/components/Wallets.svelte

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<script lang="ts">
2-
import { fade } from "svelte/transition";
3-
import Button from "../elements/Button.svelte";
4-
import IconButton from "../elements/IconButton.svelte";
5-
import { SelectModalData, WalletModule } from "../interfaces";
6-
export let modalData: SelectModalData;
7-
export let handleWalletSelect: (wallet: WalletModule) => void;
2+
import { fade } from 'svelte/transition'
3+
import Button from '../elements/Button.svelte'
4+
import IconButton from '../elements/IconButton.svelte'
5+
import { SelectModalData, WalletModule } from '../interfaces'
6+
export let modalData: SelectModalData
7+
export let handleWalletSelect: (wallet: WalletModule) => void
88
9-
let showingAllWalletModules: boolean = false;
9+
let showingAllWalletModules: boolean = false
1010
</script>
1111

1212
<style>
@@ -21,7 +21,7 @@
2121
overflow-y: scroll;
2222
padding: 0;
2323
scrollbar-width: none;
24-
font-family: "Helvetica Neue";
24+
font-family: 'Helvetica Neue';
2525
font-size: inherit;
2626
line-height: 1.15;
2727
box-sizing: border-box;

src/elements/IconDisplay.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2-
export let iconSrc: string;
3-
export let iconSrcSet: string;
4-
export let text: string;
2+
export let iconSrc: string
3+
export let iconSrcSet: string
4+
export let text: string
55
</script>
66

77
<style>

0 commit comments

Comments
 (0)