-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ditch support to mb wallet #541
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
"scripts": { | ||
"build": "tsc", | ||
"watch": "tsc && tsc --watch & jest --watch --coverage", | ||
"lint": "eslint . --fix --ext ts --ext tsx", | ||
"test": "jest --coverage" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why tho? |
||
"lint": "eslint . --fix --ext ts --ext tsx" | ||
}, | ||
"files": [ | ||
"lib" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ interface ContextProviderType { | |
additionalWallets?: Array<WalletModuleFactory>; | ||
successUrl?: string; | ||
failureUrl?: string; | ||
onlyBitteWallet?: boolean | ||
} | ||
|
||
|
||
|
@@ -52,7 +53,7 @@ export const BitteWalletContextProvider: React.FC<ContextProviderType> = ({ | |
network, | ||
contractAddress, | ||
additionalWallets, | ||
onlyMbWallet, | ||
onlyBitteWallet, | ||
callbackUrl, | ||
successUrl, | ||
failureUrl, | ||
|
@@ -73,21 +74,21 @@ export const BitteWalletContextProvider: React.FC<ContextProviderType> = ({ | |
|
||
const { setupBitteWalletSelector, registerWalletAccountsSubscriber, connectWalletSelector, pollForWalletConnection, disconnectFromWalletSelector, signMessage } = BitteWalletAuth; | ||
|
||
const setupMbWallet = async (): Promise<WalletSelectorComponents> => { | ||
const isOnlyMbWallet = !!onlyMbWallet || !!(additionalWallets && additionalWallets.length > 0); | ||
const setupBitteWallet = async (): Promise<WalletSelectorComponents> => { | ||
const isOnlyBitteWallet = !!onlyBitteWallet || !!(additionalWallets && additionalWallets.length > 0); | ||
|
||
return await setupBitteWalletSelector( | ||
callbackUrl, | ||
isOnlyMbWallet, | ||
isOnlyBitteWallet, | ||
selectedNetwork, | ||
selectedContract, | ||
isOnlyMbWallet ? { additionalWallets } : undefined, | ||
isOnlyBitteWallet ? { additionalWallets } : undefined, | ||
successUrl, failureUrl, | ||
); | ||
}; | ||
Comment on lines
+77
to
88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could live without having the wallet name everywhere. Like why not just |
||
|
||
const setup = useCallback(async () => { | ||
const components = await setupMbWallet(); | ||
const components = await setupBitteWallet(); | ||
|
||
setIsWalletSelectorSetup(true); | ||
setComponents(components); | ||
|
@@ -98,7 +99,7 @@ export const BitteWalletContextProvider: React.FC<ContextProviderType> = ({ | |
}; | ||
|
||
const setupWallet = async (): Promise<WalletSelectorComponents> => { | ||
const components = await setupMbWallet(); | ||
const components = await setupBitteWallet(); | ||
|
||
return components; | ||
}; | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this should just be called
WalletContextProvider
- independent of the name. If it were, then we wouldn't have had to change anything here.