Skip to content

Commit c469cfc

Browse files
authored
Merge pull request #196 from TomAFrench/authereum-notifications
Made disabling Authereum notifications optional
2 parents 5c2fb68 + 184f0f1 commit c469cfc

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/interfaces.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,16 @@ export interface TorusOptions {
147147
enableLogging?: boolean
148148
}
149149

150+
export interface AuthereumOptions {
151+
disableNotifications?: boolean
152+
}
153+
150154
export interface WalletInitOptions
151155
extends CommonWalletOptions,
152-
SdkWalletOptions,
153-
WalletConnectOptions,
154-
TorusOptions {
156+
SdkWalletOptions,
157+
WalletConnectOptions,
158+
TorusOptions,
159+
AuthereumOptions {
155160
walletName: string
156161
}
157162

src/modules/select/wallets/authereum.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import authereumIcon from '../wallet-icons/icon-authereum.png'
22
import { networkName } from '../../../utilities'
3-
import { WalletModule, CommonWalletOptions } from '../../../interfaces'
3+
import { WalletModule, AuthereumOptions, CommonWalletOptions } from '../../../interfaces'
44

5-
function authereum(options: CommonWalletOptions): WalletModule {
6-
const { networkId, preferred, label, iconSrc, svg } = options
5+
function authereum(options: AuthereumOptions & CommonWalletOptions): WalletModule {
6+
const { networkId, preferred, label, iconSrc, svg, disableNotifications } = options
77

88
return {
99
name: label || 'Authereum',
@@ -13,7 +13,7 @@ function authereum(options: CommonWalletOptions): WalletModule {
1313
const { default: Authereum } = await import('authereum')
1414
const instance = new Authereum({
1515
networkName: networkName(networkId),
16-
disableNotifications: true
16+
disableNotifications: disableNotifications // default: false
1717
})
1818

1919
const provider = instance.getProvider()

src/validation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ export function validateWalletInit(
529529
enableLogging,
530530
loginMethod,
531531
showTorusButton,
532+
disableNotifications,
532533
...otherParams
533534
} = walletInit
534535

@@ -634,4 +635,10 @@ export function validateWalletInit(
634635
type: 'boolean',
635636
optional: true
636637
})
638+
validateType({
639+
name: 'walletInit.disableNotifications',
640+
value: disableNotifications,
641+
type: 'boolean',
642+
optional: true
643+
})
637644
}

0 commit comments

Comments
 (0)