Skip to content

Commit

Permalink
Merge pull request #13 from 0xsequence/2014-metamask
Browse files Browse the repository at this point in the history
metamask improvement
  • Loading branch information
SamueleA authored Mar 27, 2024
2 parents 78093ac + 531069d commit f33e369
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-checkout",
"version": "2.0.7",
"version": "2.0.8",
"description": "Checkout UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/checkout",
"main": "dist/0xsequence-kit-checkout.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/connectors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-connectors",
"version": "2.0.7",
"version": "2.0.8",
"description": "Wallets for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/connectors",
"main": "dist/0xsequence-kit-connectors.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit",
"version": "2.0.7",
"version": "2.0.8",
"description": "Core package for Sequence Kit",
"keywords": [
"sequence",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ export const ConnectWalletContent = (props: ConnectWalletContentProps) => {
const email = prompt('Auto-email login, please specify the email address:')
localStorage.setItem(EMAIL_CONNECTOR_LOCAL_STORAGE_KEY, email || '')
}

if (connector._wallet.id === 'metamask' && typeof window !== 'undefined') {
const isMetamaskFound = !!window?.ethereum?._metamask
if (!isMetamaskFound) {
window.open('https://metamask.io/download/')
return
}
}

connect({ connector })
}

Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-wallet",
"version": "2.0.7",
"version": "2.0.8",
"description": "Wallet UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/wallet",
"main": "dist/0xsequence-kit-wallet.cjs.js",
Expand Down
6 changes: 4 additions & 2 deletions packages/wallet/src/views/SendCoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ export const SendCoin = ({
analytics?.track({
event: 'SEND_TRANSACTION_REQUEST',
props: {
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown'
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown',
source: 'sequence-kit/wallet'
}
})
walletClient?.sendTransaction({
Expand All @@ -166,7 +167,8 @@ export const SendCoin = ({
analytics?.track({
event: 'SEND_TRANSACTION_REQUEST',
props: {
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown'
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown',
source: 'sequence-kit/wallet'
}
})
walletClient?.sendTransaction({
Expand Down
6 changes: 4 additions & 2 deletions packages/wallet/src/views/SendCollectible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ export const SendCollectible = ({
analytics?.track({
event: 'SEND_TRANSACTION_REQUEST',
props: {
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown'
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown',
source: 'sequence-kit/wallet'
}
})
// _from, _to, _id
Expand All @@ -160,7 +161,8 @@ export const SendCollectible = ({
analytics?.track({
event: 'SEND_TRANSACTION_REQUEST',
props: {
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown'
'walletClient': (connector as ExtendedConnector | undefined)?._wallet?.id || 'unknown',
source: 'sequence-kit/wallet'
}
})
// _from, _to, _ids, _amounts, _data
Expand Down
158 changes: 150 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f33e369

Please sign in to comment.