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

Refactor/remove unsupported operators #1082

Merged
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.3.0-alpha.3",
"version": "2.3.0-alpha.4",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/icons/checkmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export default `
<svg width="14" height="11" viewBox="0 0 14 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.48076 8.10881L1.33076 4.95881L0.280762 6.00881L4.48076 10.2088L13.4808 1.20881L12.4308 0.158813L4.48076 8.10881Z" fill="#A4F4C6"/>
</svg>
`
`
2 changes: 1 addition & 1 deletion packages/core/src/icons/close-circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export default `
<svg width="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>
</svg>
`
`
2 changes: 1 addition & 1 deletion packages/core/src/icons/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.666992 13.0002H15.3337L8.00033 0.333496L0.666992 13.0002ZM8.66699 11.0002H7.33366V9.66683H8.66699V11.0002ZM8.66699 8.3335H7.33366V5.66683H8.66699V8.3335Z" fill="#FFB3B3"/>
</svg>
`
`
2 changes: 1 addition & 1 deletion packages/core/src/icons/hourglass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export default `
<svg width="100%" height="100%" viewBox="0 0 12 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0L0.0100002 6L4 10L0.0100002 14.01L0 20H12V14L8 10L12 6.01V0H0ZM10 14.5V18H2V14.5L6 10.5L10 14.5Z" fill="#929BED"/>
</svg>
`
`
1 change: 0 additions & 1 deletion packages/core/src/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,3 @@ export function typeToDismissTimeout(type: string): number {
return 0
}
}

10 changes: 6 additions & 4 deletions packages/core/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function getProvider(chain: Chain): providers.StaticJsonRpcProvider {

if (!ethersProviders[chain.rpcUrl]) {
ethersProviders[chain.rpcUrl] = new providers.StaticJsonRpcProvider(
chain.providerConnectionInfo?.url
chain.providerConnectionInfo && chain.providerConnectionInfo.url
? chain.providerConnectionInfo
: chain.rpcUrl
)
Expand Down Expand Up @@ -300,7 +300,7 @@ export async function getEns(
// chain we don't recognize and don't have a rpcUrl for requests
if (!chain) return null

const provider = getProvider(chain);
const provider = getProvider(chain)

try {
const name = await provider.lookupAddress(address)
Expand Down Expand Up @@ -340,7 +340,7 @@ export async function getBalance(
// chain we don't recognize and don't have a rpcUrl for requests
if (!chain) return null

const provider = getProvider(chain);
const provider = getProvider(chain)

try {
const balanceWei = await provider.getBalance(address)
Expand Down Expand Up @@ -380,7 +380,9 @@ export function addNewChain(
decimals: 18
},
rpcUrls: [chain.publicRpcUrl || chain.rpcUrl],
blockExplorerUrls: chain.blockExplorerUrl ? [chain.blockExplorerUrl] : undefined
blockExplorerUrls: chain.blockExplorerUrl
? [chain.blockExplorerUrl]
: undefined
}
]
})
Expand Down
41 changes: 20 additions & 21 deletions packages/core/src/updateBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,31 @@ import { state } from './store'
import { getBalance } from './provider'
import { updateAllWallets } from './store/actions'

async function updateBalances(addresses?: string[]): Promise<void> {
const { wallets, chains } = state.get()
async function updateBalances(addresses?: string[]): Promise<void> {
const { wallets, chains } = state.get()

const updatedWallets = await Promise.all(
wallets.map(async wallet => {
const chain = chains.find(({ id }) => id === wallet.chains[0].id)
const updatedWallets = await Promise.all(
wallets.map(async wallet => {
const chain = chains.find(({ id }) => id === wallet.chains[0].id)

const updatedAccounts = await Promise.all(
wallet.accounts.map(async account => {
// if no provided addresses, we want to update all balances
// otherwise check if address is in addresses array
if (!addresses || addresses.includes(account.address)) {
const updatedAccounts = await Promise.all(
wallet.accounts.map(async account => {
// if no provided addresses, we want to update all balances
// otherwise check if address is in addresses array
if (!addresses || addresses.includes(account.address)) {
const updatedBalance = await getBalance(account.address, chain)

const updatedBalance = await getBalance(account.address, chain)
return { ...account, balance: updatedBalance }
}

return { ...account, balance: updatedBalance }
}

return account
})
)
return { ...wallet, accounts: updatedAccounts }
return account
})
)

updateAllWallets(updatedWallets)
return { ...wallet, accounts: updatedAccounts }
})
)

updateAllWallets(updatedWallets)
}

export default updateBalances
export default updateBalances
7 changes: 6 additions & 1 deletion packages/core/src/validation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import Joi, { ObjectSchema, Schema } from 'joi'
import type { Chain, ChainId, WalletInit, WalletModule } from '@web3-onboard/common'
import type {
Chain,
ChainId,
WalletInit,
WalletModule
} from '@web3-onboard/common'

import type {
InitOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/dcent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { providers } from 'ethers'
interface CustomWindow extends Window {
ethereum: EIP1193Provider
}

declare const window: CustomWindow

const DEFAULT_BASE_PATH = "m/44'/60'/0'/0/0"
Expand Down
6 changes: 3 additions & 3 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
},
"dependencies": {
"@web3-onboard/coinbase": "^2.0.5-alpha.1",
"@web3-onboard/core": "^2.3.0-alpha.2",
"@web3-onboard/core": "^2.3.0-alpha.4",
"@web3-onboard/dcent": "^2.0.2-alpha.1",
"@web3-onboard/fortmatic": "^2.0.4-alpha.1",
"@web3-onboard/gnosis": "^2.0.3-alpha.1",
"@web3-onboard/injected-wallets": "^2.0.10-alpha.1",
"@web3-onboard/keepkey": "^2.1.2-alpha.1",
"@web3-onboard/keystone": "^2.1.3-alpha.1",
"@web3-onboard/keepkey": "^2.1.2-alpha.2",
"@web3-onboard/keystone": "^2.1.3-alpha.2",
"@web3-onboard/ledger": "^2.1.2-alpha.1",
"@web3-onboard/magic": "^2.0.5-alpha.1",
"@web3-onboard/portis": "^2.0.2-alpha.1",
Expand Down
27 changes: 14 additions & 13 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
})

const web3auth = web3authModule({
clientId: 'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo'
clientId:
'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo'
})

const torus = torusModule()
Expand Down Expand Up @@ -167,7 +168,7 @@
desktop: {
position: 'topRight',
enabled: true,
minimal: true
minimal: false
}
},
// example customizing copy
Expand All @@ -190,18 +191,19 @@
// message: 'Your in the pool, hope you brought a towel!',
// autoDismiss: 0,
// id: '123',
// key: '321'
// key: '321',
// onClick: () =>
// window.open(`https://rinkeby.etherscan.io/tx/${transaction.hash}`)
// }
// }
// if (transaction.eventCode === 'txPool') {
// return {
// type: 'hint',
// message: 'Your in the pool, hope you brought a towel!',
// autoDismiss: 0,
// id: '1232',
// key: '3212'
// }
// if (transaction.eventCode === 'txPool') {
// return {
// type: 'hint',
// message: 'Your in the pool, hope you brought a towel!',
// autoDismiss: 0,
// link: `https://ropsten.etherscan.io/tx/${transaction.hash}`
// }
// }
}
},
// Sign up for your free api key at www.Blocknative.com
Expand Down Expand Up @@ -320,8 +322,7 @@
on:click={() =>
onboard.state.actions.customNotification({
type: 'hint',
message:
'This is a custom DApp hint',
message: 'This is a custom DApp hint',
autoDismiss: 0
})}>Send Hint Notification</button
>
Expand Down
2 changes: 1 addition & 1 deletion packages/injected/src/icons/exodus.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIyIiBoZWlnaHQ9IjEyNCIgdmlld0JveD0iMCAwIDEyMiAxMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxtYXNrIGlkPSJtYXNrMF8zMF8xMTAiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjIiIGhlaWdodD0iMTI0Ij4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0iIzFEMUQxQiIvPgo8cGF0aCBkPSJNMjMuNzk5MyA2OS45NThINTMuMzQ5M1Y1NC4wNDJIMjMuNjg5NEwxOS44NDQ2IDQxLjUyODhMNTMuMzQ5MyAxOS42ODU1VjAuNDc2NTYyTDAuOTUwMTk1IDM0LjgzMzFMOS41MTg2IDYyLjA1NDlMMC45NTAxOTUg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C1jb2xvcj0iIzg5NTJGRiIgc3RvcC1vcGFjaXR5PSIwLjg3Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RBQkRGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg=='
2 changes: 1 addition & 1 deletion packages/injected/src/icons/opera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export default `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<path d="M85.9,200.1 C71.7,183.4 62.6,158.7 62,131 L62,125 C62.6,97.3 71.8,72.6 85.9,55.9 C104.3,32.1 131.3,21.4 161.8,21.4 C180.6,21.4 198.3,22.7 213.3,32.7 C190.8,12.4 161.1,0.1 128.5,0 L128,0 C57.3,0 0,57.3 0,128 C0,196.6 54,252.7 121.9,255.9 C123.9,256 126,256 128,256 C160.8,256 190.7,243.7 213.3,223.4 C198.3,233.4 181.6,233.8 162.8,233.8 C132.4,233.9 104.2,224 85.9,200.1 L85.9,200.1 Z" fill="url(#linearGradient-1)"></path>
<path d="M85.9,55.9 C97.6,42 112.8,33.7 129.4,33.7 C166.7,33.7 196.9,75.9 196.9,128.1 C196.9,180.3 166.7,222.5 129.4,222.5 C112.8,222.5 97.7,214.1 85.9,200.3 C104.3,224.1 131.6,239.3 162,239.3 C180.7,239.3 198.3,233.6 213.3,223.6 C239.5,200 256,165.9 256,128 C256,90.1 239.5,56 213.3,32.6 C198.3,22.6 180.8,16.9 162,16.9 C131.5,16.9 104.2,32 85.9,55.9 L85.9,55.9 Z" fill="url(#linearGradient-2)"></path>
</g>
</svg>`
</svg>`
2 changes: 1 addition & 1 deletion packages/injected/src/icons/tallywallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default `
fill="#002522"
/>
</svg>
`
`
2 changes: 1 addition & 1 deletion packages/injected/src/icons/tp.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/injected/src/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const exodus: InjectedWalletModule = {
label: ProviderLabel.Exodus,
injectedNamespace: InjectedNameSpace.Ethereum,
checkProviderIdentity: ({ provider }) =>
!!provider && !!provider[ProviderIdentityFlag.Exodus],
!!provider && !!provider[ProviderIdentityFlag.Exodus],
getIcon: async () => (await import('./icons/exodus.js')).default,
getInterface: getInjectedInterface(ProviderIdentityFlag.Exodus),
platforms: ['all']
Expand Down
2 changes: 1 addition & 1 deletion packages/keepkey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keepkey",
"version": "2.1.2-alpha.1",
"version": "2.1.2-alpha.2",
"description": "KeepKey module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/keepkey/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function keepkey(): WalletInit {
value: value || '',
nonce: utils.hexValue(nonce),
gasLimit: gasLimit || '0x0',
data: data?.toString() || '',
data: (data || '').toString(),
...gasData
}

Expand Down
2 changes: 1 addition & 1 deletion packages/keystone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/keystone",
"version": "2.1.3-alpha.1",
"version": "2.1.3-alpha.2",
"description": "Keystone module for web3-onboard",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
8 changes: 6 additions & 2 deletions packages/keystone/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ function keystone({
'@keystonehq/eth-keyring'
)

// @ts-ignore super weird esm issue where the default export is an object with a property default on it
// Super weird esm issue where the default export is an object with a property default on it
// if that is the case then we just grab the default value
AirGappedKeyring = AirGappedKeyring?.default || AirGappedKeyring
AirGappedKeyring =
'default' in AirGappedKeyring
? // @ts-ignore
AirGappedKeyring.default
: AirGappedKeyring

const { TransactionFactory: Transaction } = await import(
'@ethereumjs/tx'
Expand Down
8 changes: 4 additions & 4 deletions packages/magic/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export type LoginOptions = {
walletName: string,
brandingHTMLString: string,
walletName: string
brandingHTMLString: string
emailLoginFunction: EmailLoginFunction
}

export type MagicInitOptions = {
apiKey: string,
userEmail?: string,
apiKey: string
userEmail?: string
}

export type EmailLoginFunction = (emailAddress: string) => Promise<boolean>
2 changes: 1 addition & 1 deletion packages/mew/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module '@myetherwallet/mewconnect-web-client'
declare module '@myetherwallet/mewconnect-web-client'
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/react",
"version": "2.2.0-alpha.4",
"version": "2.2.0-alpha.5",
"description": "Collection of React Hooks for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -23,7 +23,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/core": "^2.3.0-alpha.3",
"@web3-onboard/core": "^2.3.0-alpha.4",
"@web3-onboard/common": "^2.1.2-alpha.2",
"use-sync-external-store": "1.0.0"
},
Expand Down
9 changes: 6 additions & 3 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ export const useSetChain = (

const { wallets, chains } = useAppState()

const connectedChain =
(walletLabel
const getChain = () => {
const wallet = walletLabel
? wallets.find(({ label }) => label === walletLabel)
: wallets[0]
)?.chains[0] || null
return wallet && wallet.chains ? wallet.chains[0] : null
}

const connectedChain = getChain()

const [settingChain, setInProgress] = useState<boolean>(false)

Expand Down
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/vue",
"version": "2.1.0-alpha.3",
"version": "2.1.0-alpha.4",
"description": "Vue Composable for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -24,7 +24,7 @@
"@vueuse/core": "^8.4.2",
"@vueuse/rxjs": "^8.2.0",
"@web3-onboard/common": "^2.1.2-alpha.2",
"@web3-onboard/core": "^2.3.0-alpha.3",
"@web3-onboard/core": "^2.3.0-alpha.4",
"vue-demi": "^0.12.4"
},
"peerDependencies": {
Expand Down
Loading