Skip to content

Commit bc25401

Browse files
authored
Merge pull request #254 from blocknative/fix/sdk-disconnect
Make sure SDK wallets disconnect correctly. Closes #253
2 parents 9a7317c + 7f93c56 commit bc25401

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/modules/select/wallets/fortmatic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function fortmatic(
2525
networkId === 1 ? undefined : networkName(networkId)
2626
)
2727
const provider = instance.getProvider()
28-
2928
const { BigNumber } = helpers
3029

3130
return {
@@ -34,6 +33,7 @@ function fortmatic(
3433
interface: {
3534
name: 'Fortmatic',
3635
connect: instance.user.login,
36+
disconnect: instance.user.logout,
3737
address: {
3838
get: () => Promise.resolve(provider.account)
3939
},

src/modules/select/wallets/portis.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function portis(options: SdkWalletOptions & CommonWalletOptions): WalletModule {
1919
const { default: Portis } = await import('@portis/web3')
2020
const instance = new Portis(apiKey, networkName(networkId))
2121
const provider = instance.provider
22-
2322
const { BigNumber } = helpers
2423

2524
return {
@@ -28,6 +27,10 @@ function portis(options: SdkWalletOptions & CommonWalletOptions): WalletModule {
2827
interface: {
2928
name: 'Portis',
3029
connect: provider.enable,
30+
disconnect: () => {
31+
instance.logout()
32+
provider.stop()
33+
},
3134
address: {
3235
onChange: func => {
3336
instance.onLogin((address: string) => {

src/modules/select/wallets/squarelink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function squarelink(
2525
})
2626

2727
const provider = instance.getProviderSync()
28-
2928
const { BigNumber } = helpers
3029

3130
return {
@@ -34,6 +33,7 @@ function squarelink(
3433
interface: {
3534
name: 'Squarelink',
3635
connect: provider.enable,
36+
disconnect: () => provider.stop(),
3737
address: {
3838
get: () => Promise.resolve(instance.accounts[0])
3939
},

0 commit comments

Comments
 (0)