Skip to content

Commit 68a1b07

Browse files
authored
Merge pull request #407 from blocknative/enhancement/update-dependencies
Enhancement: Update dependencies Closes #407
2 parents 30c45d1 + 2c4ee94 commit 68a1b07

File tree

4 files changed

+707
-591
lines changed

4 files changed

+707
-591
lines changed

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,24 @@
4545
"typescript": "^3.6.4"
4646
},
4747
"dependencies": {
48-
"@ledgerhq/hw-app-eth": "^5.19.0",
49-
"@ledgerhq/hw-transport-u2f": "^5.19.0",
50-
"@portis/web3": "^2.0.0-beta.55",
51-
"@toruslabs/torus-embed": "^1.8.1",
52-
"@unilogin/provider": "^0.5.21",
53-
"@walletconnect/web3-provider": "^1.0.13",
48+
"@ledgerhq/hw-app-eth": "^5.21.0",
49+
"@ledgerhq/hw-transport-u2f": "^5.21.0",
50+
"@portis/web3": "^2.0.0-beta.57",
51+
"@toruslabs/torus-embed": "^1.8.2",
52+
"@unilogin/provider": "^0.6.1",
53+
"@walletconnect/web3-provider": "^1.1.0",
5454
"authereum": "^0.0.4-beta.157",
5555
"bignumber.js": "^9.0.0",
5656
"bnc-sdk": "^2.1.4",
57-
"bowser": "^2.5.2",
57+
"bowser": "^2.10.0",
5858
"ethereumjs-tx": "^2.1.2",
59-
"ethereumjs-util": "^6.2.0",
60-
"ethereumjs-wallet": "^0.6.3",
61-
"fortmatic": "^0.8.2",
62-
"hdkey": "^1.1.1",
63-
"regenerator-runtime": "^0.13.3",
59+
"ethereumjs-util": "^7.0.3",
60+
"ethereumjs-wallet": "^1.0.0",
61+
"fortmatic": "^2.2.1",
62+
"hdkey": "^2.0.1",
63+
"regenerator-runtime": "^0.13.7",
6464
"squarelink": "^1.1.4",
65-
"trezor-connect": "^8.1.2",
65+
"trezor-connect": "^8.1.9",
6666
"walletlink": "^2.0.2",
6767
"web3-provider-engine": "^15.0.4"
6868
},

src/@types/index.d.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,3 @@ declare module '@ledgerhq/hw-transport-u2f'
1515

1616
declare module '*.png'
1717
declare module '*.svg'
18-
19-
declare module 'svelte-i18n' {
20-
interface Options {
21-
fallback: string
22-
navigator: boolean
23-
}
24-
export function getClientLocale(options: Options): string
25-
26-
export namespace _ {
27-
export function subscribe(dictionary: any): void
28-
}
29-
30-
export namespace dictionary {
31-
export function set(dictionary: any): void
32-
}
33-
34-
export namespace locale {
35-
export function set(locale: string): void
36-
}
37-
}

src/modules/select/wallets/fortmatic.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,44 @@ function fortmatic(
1919
apiKey,
2020
networkId === 1 ? undefined : networkName(networkId)
2121
)
22+
2223
const provider = instance.getProvider()
23-
const { BigNumber } = helpers
24+
const { BigNumber, getAddress } = helpers
25+
26+
let enabled: boolean
2427

2528
return {
2629
provider,
2730
instance,
2831
interface: {
2932
name: 'Fortmatic',
30-
connect: instance.user.login,
31-
disconnect: instance.user.logout,
33+
connect: () =>
34+
instance.user.login().then((res: any) => {
35+
enabled = true
36+
return res
37+
}),
38+
disconnect: () => instance.user.logout(),
3239
address: {
33-
get: () => Promise.resolve(provider.account)
40+
get: () => (enabled ? getAddress(provider) : Promise.resolve())
3441
},
3542
network: {
3643
get: () => Promise.resolve(networkId)
3744
},
3845
balance: {
39-
get: () =>
40-
provider.account &&
41-
instance.user
42-
.getBalances()
43-
.then((res: any) =>
44-
res[0]
45-
? BigNumber(res[0].crypto_amount)
46-
.times(BigNumber('1000000000000000000'))
47-
.toString(10)
48-
: null
49-
)
46+
get: async () => {
47+
return (
48+
enabled &&
49+
instance.user
50+
.getBalances()
51+
.then((res: any) =>
52+
res[0]
53+
? BigNumber(res[0].crypto_amount)
54+
.times(BigNumber('1000000000000000000'))
55+
.toString(10)
56+
: null
57+
)
58+
)
59+
}
5060
},
5161
dashboard: () => instance.user.settings()
5262
}

0 commit comments

Comments
 (0)