Skip to content
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

Add/blockwallet #63

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sample-app/src/elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ view { connectedEthWalletModel, userLanguage } =
Just ConnectedEthWallet.WalletConnect ->
"Wallet Connect"

Just ConnectedEthWallet.BlockWallet ->
"BlockWallet"

_ ->
"None"

Expand Down
6 changes: 6 additions & 0 deletions sample-app/src/elm/Strings/Translations.elm
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ wallet_connect lang =
En ->
"Wallet Connect"

blockWallet : Lang -> String
blockWallet lang =
case lang of
En ->
"BlockWallet"


get_started : Lang -> String
get_started lang =
Expand Down
16 changes: 16 additions & 0 deletions src/elm/CompoundComponents/Eth/ConnectedEthWallet.elm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type WalletProviderType
| Ledger
| OtherWeb3Browser
| WalletConnect
| BlockWallet
| None


Expand Down Expand Up @@ -521,6 +522,11 @@ connectItemView userLanguage isCompoundChain providerType =
, Translations.tally userLanguage
)

BlockWallet ->
( " connect-wallet-icon--blockwallet"
, Translations.blockWallet userLanguage
)

_ ->
( " connect-wallet-icon--metamask"
, Translations.metamask userLanguage
Expand Down Expand Up @@ -575,6 +581,15 @@ chooseWalletView userLanguage isCompoundChain ({ chooseWalletState } as model) =
[ div [ class "line" ] []
, connectItemView userLanguage isCompoundChain WalletLink
]

blockWalletItem =
if isCompoundChain then
[]

else
[ div [ class "line" ] []
, connectItemView userLanguage isCompoundChain BlockWallet
]
in
div [ class "connect-wallet-copy connect-wallet-copy--small-top" ]
([ markSpan isCompoundChain
Expand All @@ -589,6 +604,7 @@ chooseWalletView userLanguage isCompoundChain ({ chooseWalletState } as model) =
++ coinbaseWalletItem
++ lineDivider
++ [ connectItemView userLanguage isCompoundChain Tally ]
++ blockWalletItem
)
]
++ [ termsView userLanguage isCompoundChain ]
Expand Down
4 changes: 4 additions & 0 deletions src/elm/CompoundComponents/Eth/ProviderInfo.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type ProviderType
| MetaMask
| MetaMaskMobile
| ImToken
| BlockWallet
| Unknown


Expand All @@ -32,6 +33,9 @@ detectProvider providerType =
"im_token" ->
ImToken

"blockwallet" ->
BlockWallet

_ ->
Unknown

Expand Down
4 changes: 2 additions & 2 deletions src/js/sharedEth/connectedWalletPorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async function connectToTrxProvider(
({ networkId, account, ethereum } = await connectWeb3(eth, globEthereum, disallowAuthDialog));
break;
case PROVIDER_TYPE_TALLY:
({ networkId, account, ethereum } = await connectTally(eth, globEthereum, disallowAuthDialog));
break;
({ networkId, account, ethereum } = await connectTally(eth, globEthereum, disallowAuthDialog));
break;
case PROVIDER_TYPE_SHOW_ACCOUNT:
({ networkId, account, ethereum } = await connectShowAccount(eth, showAccount));
break;
Expand Down
6 changes: 5 additions & 1 deletion src/js/sharedEth/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const PROVIDER_TYPE_IM_TOKEN = 'im_token';
const PROVIDER_TYPE_TALLY = 'tally';
const PROVIDER_TYPE_META_MASK = 'meta_mask';
const PROVIDER_TYPE_META_MASK_MOBILE = 'meta_mask_mobile';
const PROVIDER_TYPE_BLOCKWALLET = 'blockwallet';
const PROVIDER_TYPE_OTHER = 'other';

const NON_AUTOCONNECT_PROVIDERS = [PROVIDER_TYPE_NONE, PROVIDER_TYPE_META_MASK];
Expand Down Expand Up @@ -48,8 +49,10 @@ function providerType(provider) {
return PROVIDER_TYPE_COINBASE_WALLET;
} else if (provider.isImToken) {
return PROVIDER_TYPE_IM_TOKEN;
}else if (provider.isTally) {
} else if (provider.isTally) {
return PROVIDER_TYPE_TALLY;
} else if (provider.isBlockWallet) {
return PROVIDER_TYPE_BLOCKWALLET;
} else if (provider.isMetaMask) {
if (provider.constructor.name === 'InpageBridge') {
return PROVIDER_TYPE_META_MASK_MOBILE;
Expand Down Expand Up @@ -149,6 +152,7 @@ export {
PROVIDER_TYPE_TALLY,
PROVIDER_TYPE_META_MASK,
PROVIDER_TYPE_META_MASK_MOBILE,
PROVIDER_TYPE_BLOCKWALLET,
shouldAutoConnect,
supportFromEntries,
langFromURL,
Expand Down
3 changes: 3 additions & 0 deletions src/public/assets/icn-blockwallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/scss/components/_connect-wallet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
background-image: url(/compound-components/assets/icn-wallet-connect.svg);
margin: 0;
}

&--blockwallet {
background-image: url(/compound-components/assets/icn-blockwallet.svg);
margin: 0;
}
}

.connect-choices {
Expand Down
6 changes: 5 additions & 1 deletion src/scss/components/_icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}

&--FEI {
background-image: url('/compound-components/assets/asset_FEI.svg') ;
background-image: url('/compound-components/assets/asset_FEI.svg');
}

&--AAVE {
Expand Down Expand Up @@ -126,4 +126,8 @@
&--metamask {
background-image: url('/compound-components/assets/icn-metamask.svg');
}

&--blockwallet {
background-image: url('/compound-components/assets/icn-blockwallet.svg');
}
}