Skip to content

Commit 4d43f7b

Browse files
authored
Merge pull request #110 from blocknative/develop
Release 1.0.3
2 parents 2742870 + 50ce94b commit 4d43f7b

File tree

5 files changed

+10
-31
lines changed

5 files changed

+10
-31
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.0.2",
3+
"version": "1.0.3",
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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ export interface WalletCheckModule {
3333
}
3434

3535
export interface WalletCheckModal {
36-
img?: string
3736
heading: string
3837
description: string
3938
button?: {
4039
onclick: () => void
4140
text: string
4241
}
43-
invalidMsg?: string
4442
eventCode: string
4543
action?: () => Promise<{ message: string } | undefined>
46-
loading?: () => Promise<undefined>
44+
loading?: Promise<undefined>
4745
icon?: string
4846
}
4947

@@ -104,7 +102,7 @@ export interface WalletInterface {
104102
name: string
105103
connect?: () => Promise<{ message: string } | undefined>
106104
disconnect?: () => void
107-
loading?: () => Promise<undefined>
105+
loading?: Promise<undefined>
108106
address: StateSyncer
109107
network: StateSyncer
110108
balance: StateSyncer
@@ -120,7 +118,7 @@ export interface Wallet {
120118
provider: any
121119
instance?: any
122120
connect?: () => Promise<{ message: string } | undefined>
123-
loading?: () => Promise<undefined>
121+
loading?: Promise<undefined>
124122
}
125123

126124
export interface SdkWalletOptions {

src/modules/select/wallets/authereum.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ function authereum(options: {
3737
name: 'Authereum',
3838
connect: () => provider.enable(),
3939
disconnect: () => authereum.logout(),
40-
loading: () =>
41-
new Promise((resolve: () => void) => {
42-
authereum.on('openPopup', resolve)
43-
}),
40+
loading: new Promise((resolve: () => void) => {
41+
authereum.on('openPopup', resolve)
42+
}),
4443
address: {
4544
get: () => authereum.getAccountAddress()
4645
},

src/validation.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,9 @@ export function validateModal(modal: WalletCheckModal): never | void {
259259
validateType({ name: 'modal', value: modal, type: 'object' })
260260

261261
const {
262-
img,
263262
heading,
264263
description,
265264
button,
266-
invalidMsg,
267265
eventCode,
268266
action,
269267
icon,
@@ -273,28 +271,12 @@ export function validateModal(modal: WalletCheckModal): never | void {
273271

274272
invalidParams(
275273
otherParams,
276-
[
277-
'img',
278-
'heading',
279-
'description',
280-
'button',
281-
'invalidMsg',
282-
'eventCode',
283-
'action',
284-
'icon'
285-
],
274+
['heading', 'description', 'button', 'eventCode', 'action', 'icon'],
286275
'modal'
287276
)
288277

289-
validateType({ name: 'img', value: img, type: 'string', optional: true })
290278
validateType({ name: 'heading', value: heading, type: 'string' })
291279
validateType({ name: 'description', value: description, type: 'string' })
292-
validateType({
293-
name: 'invalidMsg',
294-
value: invalidMsg,
295-
type: 'string',
296-
optional: true
297-
})
298280
validateType({ name: 'eventCode', value: eventCode, type: 'string' })
299281
validateType({
300282
name: 'action',
@@ -306,7 +288,7 @@ export function validateModal(modal: WalletCheckModal): never | void {
306288
validateType({
307289
name: 'loading',
308290
value: loading,
309-
type: 'function',
291+
type: 'object',
310292
optional: true
311293
})
312294

src/views/WalletCheck.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
8888
if (activeModal.loading) {
8989
loading = true
90-
activeModal.loading().then(() => (loading = false))
90+
activeModal.loading.then(() => (loading = false))
9191
}
9292
9393
// poll to automatically to check if condition has been met

0 commit comments

Comments
 (0)