From c5167d064f745cdbf01ef07582d76c70f5e9a068 Mon Sep 17 00:00:00 2001 From: Taylor Dawson Date: Mon, 20 Jun 2022 13:00:40 -0700 Subject: [PATCH 1/6] refactor/remove-unsupported-operators --- packages/core/src/provider.ts | 10 +-- packages/keepkey/src/index.ts | 2 +- packages/keystone/src/index.ts | 8 ++- packages/react/src/index.ts | 9 ++- packages/vue/src/index.ts | 107 +++++++++++++++++---------------- 5 files changed, 75 insertions(+), 61 deletions(-) diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts index 42a593d04..02f5c48f2 100644 --- a/packages/core/src/provider.ts +++ b/packages/core/src/provider.ts @@ -30,7 +30,7 @@ export function getProvider(chain: Chain): providers.StaticJsonRpcProvider { if (!ethersProviders[chain.rpcUrl]) { ethersProviders[chain.rpcUrl] = new providers.StaticJsonRpcProvider( - chain.providerConnectionInfo?.url + 'url' in chain.providerConnectionInfo && chain.providerConnectionInfo.url ? chain.providerConnectionInfo : chain.rpcUrl ) @@ -245,7 +245,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) @@ -285,7 +285,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) @@ -325,7 +325,9 @@ export function addNewChain( decimals: 18 }, rpcUrls: [chain.publicRpcUrl || chain.rpcUrl], - blockExplorerUrls: chain.blockExplorerUrl ? [chain.blockExplorerUrl] : undefined + blockExplorerUrls: chain.blockExplorerUrl + ? [chain.blockExplorerUrl] + : undefined } ] }) diff --git a/packages/keepkey/src/index.ts b/packages/keepkey/src/index.ts index 39aac0e2f..bcb9139d2 100644 --- a/packages/keepkey/src/index.ts +++ b/packages/keepkey/src/index.ts @@ -430,7 +430,7 @@ function keepkey(): WalletInit { value: value || '', nonce: utils.hexValue(nonce), gasLimit: gasLimit || '0x0', - data: data?.toString() || '', + data: (data || '').toString(), ...gasData } diff --git a/packages/keystone/src/index.ts b/packages/keystone/src/index.ts index a515c7947..0cff20d25 100644 --- a/packages/keystone/src/index.ts +++ b/packages/keystone/src/index.ts @@ -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' diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 9d83b45bf..639f2adfb 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -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(false) diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index 7c132d54e..d0bf19b81 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -5,114 +5,119 @@ import type { ConnectOptions, DisconnectOptions, WalletState, - ConnectedChain, + ConnectedChain } from '@web3-onboard/core' // Not sure why it can't be imported directly without passing for dist -import type { AppState } from "@web3-onboard/core/dist/types"; +import type { AppState } from '@web3-onboard/core/dist/types' // We use vue-demi to automatically use the correct reactivity API for both Vue 2 and Vue 3 import { ref, computed, readonly, shallowRef } from 'vue-demi' import type { SetChainOptions, OnboardComposable } from './types' // Vueuse helper to use the localstorage as a reactive variable -import { useStorage } from "@vueuse/core"; +import { useStorage } from '@vueuse/core' // Vueuse helper to streamline the use of rxjs observables as vue refs -import { useSubscription } from "@vueuse/rxjs"; - +import { useSubscription } from '@vueuse/rxjs' // Onboard will be kept here to be reused every time that we access the composable -let web3Onboard: OnboardAPI | null = null; +let web3Onboard: OnboardAPI | null = null // Useful data about the previously connected wallets that will synced with the localstorage const alreadyConnectedWallets = useStorage( - "alreadyConnectedWallets", + 'alreadyConnectedWallets', [] -); +) const lastConnectionTimestamp = useStorage( - "lastWalletConnectionTimestamp", + 'lastWalletConnectionTimestamp', 0 -); +) // We store the internal onboard state as a shallowRef to have reactivity but with a smaller computational cost compared to a full ref // Because it is shallow, we must update it every time replacing the entire object -const onboardState = shallowRef({} as AppState); +const onboardState = shallowRef({} as AppState) const updateAlreadyConnectedWallets = () => { alreadyConnectedWallets.value = onboardState.value.wallets.map( (w: WalletState) => w.label - ); -}; + ) +} const init = (options: InitOptions): OnboardAPI => { - web3Onboard = Web3Onboard(options); - onboardState.value = web3Onboard.state.get(); + web3Onboard = Web3Onboard(options) + onboardState.value = web3Onboard.state.get() // To avoid memory leaks, we use only one rxjs subscription to update the internal onboard state // This subscription will be automatically destroyed when the context is destroyed useSubscription( - web3Onboard.state.select().subscribe((update) => { - onboardState.value = update; - updateAlreadyConnectedWallets(); + web3Onboard.state.select().subscribe(update => { + onboardState.value = update + updateAlreadyConnectedWallets() }) - ); - return web3Onboard; -}; + ) + return web3Onboard +} const useOnboard = (): OnboardComposable => { // Raise an error if init() wasn't called if (!web3Onboard) { - throw new Error("web3Onboard is not initialized"); + throw new Error('web3Onboard is not initialized') } // Wallet related functions and variables - const connectingWallet = ref(false); - const wallets = computed(() => onboardState.value.wallets); + const connectingWallet = ref(false) + const wallets = computed(() => onboardState.value.wallets) - const connectedWallet = computed(() => wallets.value.length > 0 ? wallets.value[0] : null); + const connectedWallet = computed(() => + wallets.value.length > 0 ? wallets.value[0] : null + ) const connectWallet = async (options?: ConnectOptions) => { - connectingWallet.value = true; - await (web3Onboard as OnboardAPI).connectWallet(options); - lastConnectionTimestamp.value = Date.now(); - connectingWallet.value = false; - }; + connectingWallet.value = true + await (web3Onboard as OnboardAPI).connectWallet(options) + lastConnectionTimestamp.value = Date.now() + connectingWallet.value = false + } const disconnectWallet = async (wallet: DisconnectOptions) => { - connectingWallet.value = true; - await (web3Onboard as OnboardAPI).disconnectWallet(wallet); - updateAlreadyConnectedWallets(); - connectingWallet.value = false; - }; + connectingWallet.value = true + await (web3Onboard as OnboardAPI).disconnectWallet(wallet) + updateAlreadyConnectedWallets() + connectingWallet.value = false + } const disconnectConnectedWallet = async () => { if (connectedWallet.value) { - await disconnectWallet({ label: connectedWallet.value.label }); + await disconnectWallet({ label: connectedWallet.value.label }) } - }; + } // Chain related functions and variables - const settingChain = ref(false); + const settingChain = ref(false) const connectedChain = computed( - () => connectedWallet?.value?.chains[0] ?? null - ); + () => + (connectedWallet && + connectedWallet.value && + connectedWallet.value.chains[0]) || + null + ) const getChain = (walletLabel: string) => { const wallet = onboardState.value.wallets.find( (w: WalletState) => w.label === walletLabel - ); - return wallet?.chains[0] ?? null; - }; + ) + return (wallet && wallet.chains[0]) || null + } const setChain = async (options: SetChainOptions) => { - settingChain.value = true; - await (web3Onboard as OnboardAPI).setChain(options); - settingChain.value = false; - }; + settingChain.value = true + await (web3Onboard as OnboardAPI).setChain(options) + settingChain.value = false + } return { alreadyConnectedWallets, @@ -126,8 +131,8 @@ const useOnboard = (): OnboardComposable => { lastConnectionTimestamp, setChain, settingChain: readonly(settingChain), - wallets, - }; -}; + wallets + } +} -export { init, useOnboard }; +export { init, useOnboard } From fd7e367380549e14dc1a54552ec9226ece543649 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 20 Jun 2022 15:02:07 -0600 Subject: [PATCH 2/6] Update react package version --- packages/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/package.json b/packages/react/package.json index e5ca4fb03..570ecba0d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.2.0-alpha.2", + "version": "2.2.0-alpha.3", "description": "Collection of React Hooks for web3-onboard", "module": "dist/index.js", "browser": "dist/index.js", From 959eccea6241b41adfa3727f95a7470ad1597bc5 Mon Sep 17 00:00:00 2001 From: Taylor Dawson Date: Mon, 20 Jun 2022 15:31:06 -0700 Subject: [PATCH 3/6] version bump + formatting --- packages/core/README.md | 2 +- packages/core/package.json | 2 +- packages/core/src/icons/checkmark.ts | 2 +- packages/core/src/icons/close-circle.ts | 2 +- packages/core/src/icons/error.ts | 2 +- packages/core/src/icons/hourglass.ts | 2 +- packages/core/src/notify.ts | 1 - packages/core/src/updateBalances.ts | 41 +++++++++++----------- packages/core/src/validation.ts | 7 +++- packages/dcent/src/index.ts | 2 +- packages/demo/package.json | 6 ++-- packages/injected/src/icons/exodus.ts | 2 +- packages/injected/src/icons/opera.ts | 2 +- packages/injected/src/icons/tallywallet.ts | 2 +- packages/injected/src/icons/tp.ts | 2 +- packages/injected/src/wallets.ts | 2 +- packages/keepkey/package.json | 2 +- packages/keystone/package.json | 2 +- packages/magic/src/types.ts | 8 ++--- packages/mew/src/types.d.ts | 2 +- packages/react/package.json | 4 +-- packages/vue/package.json | 4 +-- packages/vue/src/types.ts | 6 +--- 23 files changed, 53 insertions(+), 54 deletions(-) diff --git a/packages/core/README.md b/packages/core/README.md index f2352894a..303f0822c 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -172,7 +172,7 @@ export type Notification = { message: string autoDismiss: number link?: string - onclick?: (event: Event) => void + onClick?: (event: Event) => void } export type NotificationType = 'pending' | 'success' | 'error' | 'hint' diff --git a/packages/core/package.json b/packages/core/package.json index ab4f274c2..dc267b349 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/core", - "version": "2.3.0-alpha.1", + "version": "2.3.0-alpha.2", "scripts": { "build": "rollup -c", "dev": "rollup -c -w", diff --git a/packages/core/src/icons/checkmark.ts b/packages/core/src/icons/checkmark.ts index 3f0fbf735..9bcddb267 100644 --- a/packages/core/src/icons/checkmark.ts +++ b/packages/core/src/icons/checkmark.ts @@ -2,4 +2,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/core/src/icons/close-circle.ts b/packages/core/src/icons/close-circle.ts index 6f1e414fb..99288ef30 100644 --- a/packages/core/src/icons/close-circle.ts +++ b/packages/core/src/icons/close-circle.ts @@ -2,4 +2,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/core/src/icons/error.ts b/packages/core/src/icons/error.ts index f7f8b89ec..7b6a96ad8 100644 --- a/packages/core/src/icons/error.ts +++ b/packages/core/src/icons/error.ts @@ -1,4 +1,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/core/src/icons/hourglass.ts b/packages/core/src/icons/hourglass.ts index c05b1d50e..3dcee91f0 100644 --- a/packages/core/src/icons/hourglass.ts +++ b/packages/core/src/icons/hourglass.ts @@ -2,4 +2,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/core/src/notify.ts b/packages/core/src/notify.ts index 22446bde2..c2500d2e7 100644 --- a/packages/core/src/notify.ts +++ b/packages/core/src/notify.ts @@ -161,4 +161,3 @@ export function typeToDismissTimeout(type: string): number { return 0 } } - diff --git a/packages/core/src/updateBalances.ts b/packages/core/src/updateBalances.ts index b2a82ec14..59aa8c584 100644 --- a/packages/core/src/updateBalances.ts +++ b/packages/core/src/updateBalances.ts @@ -2,32 +2,31 @@ import { state } from './store' import { getBalance } from './provider' import { updateAllWallets } from './store/actions' -async function updateBalances(addresses?: string[]): Promise { - const { wallets, chains } = state.get() +async function updateBalances(addresses?: string[]): Promise { + 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 \ No newline at end of file +export default updateBalances diff --git a/packages/core/src/validation.ts b/packages/core/src/validation.ts index 322af9760..1739fdb52 100644 --- a/packages/core/src/validation.ts +++ b/packages/core/src/validation.ts @@ -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, diff --git a/packages/dcent/src/index.ts b/packages/dcent/src/index.ts index 51a2ba4bb..f373e6d88 100644 --- a/packages/dcent/src/index.ts +++ b/packages/dcent/src/index.ts @@ -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" diff --git a/packages/demo/package.json b/packages/demo/package.json index 61c909b39..f2c2fb3e7 100644 --- a/packages/demo/package.json +++ b/packages/demo/package.json @@ -23,13 +23,13 @@ }, "dependencies": { "@web3-onboard/coinbase": "^2.0.5-alpha.1", - "@web3-onboard/core": "^2.3.0-alpha.1", + "@web3-onboard/core": "^2.3.0-alpha.2", "@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", diff --git a/packages/injected/src/icons/exodus.ts b/packages/injected/src/icons/exodus.ts index 0c58fc20b..2bdeb4398 100644 --- a/packages/injected/src/icons/exodus.ts +++ b/packages/injected/src/icons/exodus.ts @@ -1 +1 @@ -export default 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIyIiBoZWlnaHQ9IjEyNCIgdmlld0JveD0iMCAwIDEyMiAxMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxtYXNrIGlkPSJtYXNrMF8zMF8xMTAiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjIiIGhlaWdodD0iMTI0Ij4KPHBhdGggZD0iTTEyMS43ODcgMzQuODMzMUw2OS4zODc2IDAuNDc2NTYyVjE5LjY4NTVMMTAzLjAwMiA0MS41Mjg4TDk5LjA0NzQgNTQuMDQySDY5LjM4NzZWNjkuOTU4SDk5LjA0NzRMMTAzLjAwMiA4Mi40NzEyTDY5LjM4NzYgMTA0LjMxNFYxMjMuNTIzTDEyMS43ODcgODkuMjc2N0wxMTMuMjE4IDYyLjA1NDlMMTIxLjc4NyAzNC44MzMxWiIgZmlsbD0iIzFEMUQxQiIvPgo8cGF0aCBkPSJNMjMuNzk5MyA2OS45NThINTMuMzQ5M1Y1NC4wNDJIMjMuNjg5NEwxOS44NDQ2IDQxLjUyODhMNTMuMzQ5MyAxOS42ODU1VjAuNDc2NTYyTDAuOTUwMTk1IDM0LjgzMzFMOS41MTg2IDYyLjA1NDlMMC45NTAxOTUgODkuMjc2N0w1My40NT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5NTJGRiIgc3RvcC1vcGFjaXR5PSIwLjg3Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0RBQkRGRiIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg==' diff --git a/packages/injected/src/icons/opera.ts b/packages/injected/src/icons/opera.ts index 5984b8f4a..a3b22e955 100644 --- a/packages/injected/src/icons/opera.ts +++ b/packages/injected/src/icons/opera.ts @@ -18,4 +18,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/injected/src/icons/tallywallet.ts b/packages/injected/src/icons/tallywallet.ts index baf9b28b3..3097b585a 100644 --- a/packages/injected/src/icons/tallywallet.ts +++ b/packages/injected/src/icons/tallywallet.ts @@ -10,4 +10,4 @@ export default ` fill="#002522" /> -` \ No newline at end of file +` diff --git a/packages/injected/src/icons/tp.ts b/packages/injected/src/icons/tp.ts index f80bf3ce6..893a5f240 100644 --- a/packages/injected/src/icons/tp.ts +++ b/packages/injected/src/icons/tp.ts @@ -7,4 +7,4 @@ export default ` -` \ No newline at end of file +` diff --git a/packages/injected/src/wallets.ts b/packages/injected/src/wallets.ts index db2a122cb..da4f25a89 100644 --- a/packages/injected/src/wallets.ts +++ b/packages/injected/src/wallets.ts @@ -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'] diff --git a/packages/keepkey/package.json b/packages/keepkey/package.json index d6c01a242..5e08c3d5b 100644 --- a/packages/keepkey/package.json +++ b/packages/keepkey/package.json @@ -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", diff --git a/packages/keystone/package.json b/packages/keystone/package.json index 7a52ea323..3f6e16ae7 100644 --- a/packages/keystone/package.json +++ b/packages/keystone/package.json @@ -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", diff --git a/packages/magic/src/types.ts b/packages/magic/src/types.ts index 02c681990..77a70108d 100644 --- a/packages/magic/src/types.ts +++ b/packages/magic/src/types.ts @@ -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 diff --git a/packages/mew/src/types.d.ts b/packages/mew/src/types.d.ts index 93a3bbd67..79c1b1cd5 100644 --- a/packages/mew/src/types.d.ts +++ b/packages/mew/src/types.d.ts @@ -1 +1 @@ -declare module '@myetherwallet/mewconnect-web-client' \ No newline at end of file +declare module '@myetherwallet/mewconnect-web-client' diff --git a/packages/react/package.json b/packages/react/package.json index 5cc5c5764..3eae29a6d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/react", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "description": "Collection of React Hooks for web3-onboard", "module": "dist/index.js", "browser": "dist/index.js", @@ -23,7 +23,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@web3-onboard/core": "^2.3.0-alpha.1", + "@web3-onboard/core": "^2.3.0-alpha.2", "@web3-onboard/common": "^2.1.2-alpha.2", "use-sync-external-store": "1.0.0" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index e56fbed16..8f6f6b4ce 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/vue", - "version": "2.1.0-alpha.1", + "version": "2.1.0-alpha.2", "description": "Vue Composable for web3-onboard", "module": "dist/index.js", "browser": "dist/index.js", @@ -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.1", + "@web3-onboard/core": "^2.3.0-alpha.2", "vue-demi": "^0.12.4" }, "peerDependencies": { diff --git a/packages/vue/src/types.ts b/packages/vue/src/types.ts index 22fd273ce..670bc30a5 100644 --- a/packages/vue/src/types.ts +++ b/packages/vue/src/types.ts @@ -30,8 +30,4 @@ interface OnboardComposable { wallets: ReadonlyRef } -export { - ReadonlyRef, - SetChainOptions, - OnboardComposable -} +export { ReadonlyRef, SetChainOptions, OnboardComposable } From b901d6a198731ed21c824782ab049221ea4250d5 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 21 Jun 2022 10:24:38 -0600 Subject: [PATCH 4/6] Remove in opperator in an instance it may be undefined --- packages/core/src/provider.ts | 2 +- packages/demo/src/App.svelte | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/core/src/provider.ts b/packages/core/src/provider.ts index 1348483e6..b3e3bc313 100644 --- a/packages/core/src/provider.ts +++ b/packages/core/src/provider.ts @@ -31,7 +31,7 @@ export function getProvider(chain: Chain): providers.StaticJsonRpcProvider { if (!ethersProviders[chain.rpcUrl]) { ethersProviders[chain.rpcUrl] = new providers.StaticJsonRpcProvider( - 'url' in chain.providerConnectionInfo && chain.providerConnectionInfo.url + chain.providerConnectionInfo && chain.providerConnectionInfo.url ? chain.providerConnectionInfo : chain.rpcUrl ) diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 38623dcfd..aeee80c7e 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -72,7 +72,8 @@ }) const web3auth = web3authModule({ - clientId: 'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo' + clientId: + 'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo' }) const torus = torusModule() @@ -167,7 +168,7 @@ desktop: { position: 'topRight', enabled: true, - minimal: true + minimal: false } }, // example customizing copy @@ -190,22 +191,23 @@ // message: 'Your in the pool, hope you brought a towel!', // autoDismiss: 0, // id: '123', - // key: '321' - // } - // } - // if (transaction.eventCode === 'txPool') { - // return { - // type: 'hint', - // message: 'Your in the pool, hope you brought a towel!', - // autoDismiss: 0, - // id: '1232', - // key: '3212' + // 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, + link: `https://ropsten.etherscan.io/tx/${transaction.hash}` + } + } } }, // Sign up for your free api key at www.Blocknative.com - apiKey: 'xxxxxx-bf21-42ec-a093-9d37e426xxxx' + apiKey: '1730eff0-9d50-4382-a3fe-89f0d34a2070' }) // Subscribe to wallet updates @@ -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 From b5ebe83aa26145b1b16e08acf10f8f649a1dbe01 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 21 Jun 2022 10:26:52 -0600 Subject: [PATCH 5/6] Remove dappId --- packages/demo/src/App.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index aeee80c7e..00d75b3fe 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -192,8 +192,8 @@ // autoDismiss: 0, // id: '123', // key: '321', - // onClick: () => - // window.open(`https://rinkeby.etherscan.io/tx/${transaction.hash}`) + // onClick: () => + // window.open(`https://rinkeby.etherscan.io/tx/${transaction.hash}`) // } // } if (transaction.eventCode === 'txPool') { @@ -207,7 +207,7 @@ } }, // Sign up for your free api key at www.Blocknative.com - apiKey: '1730eff0-9d50-4382-a3fe-89f0d34a2070' + apiKey: 'xxxxxx-bf21-42ec-a093-9d37e426xxxx' }) // Subscribe to wallet updates From 09954e663c0a05322956c81da74290ab25e2a223 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 21 Jun 2022 10:27:17 -0600 Subject: [PATCH 6/6] Comment out test code --- packages/demo/src/App.svelte | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/demo/src/App.svelte b/packages/demo/src/App.svelte index 00d75b3fe..272f1e4f1 100644 --- a/packages/demo/src/App.svelte +++ b/packages/demo/src/App.svelte @@ -196,14 +196,14 @@ // 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, - link: `https://ropsten.etherscan.io/tx/${transaction.hash}` - } - } + // 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