Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7fb6c25
Merge pull request #1147 from blocknative/release/2.5.0
Adamj1232 Jul 15, 2022
c5d81ad
[common-v2.1.5-alpha.1, core-v2.4.0-alpha.7, react-v2.2.3-alpha.5, vu…
mahmud-bn Jul 19, 2022
183ce59
[core: 2.6.0-alpha.2] - [fix] - Autoselect with disabled modals reso…
lnbc1QWFyb24 Jul 20, 2022
180d03a
[common-v2.1.7-alpha.2, core-v2.6.0-alpha.3, react-v2.2.5-alpha.3, vu…
mahmud-bn Jul 25, 2022
e71f10f
fix: typo in WalletConnect sdk readme example (#1162)
itsmnthn Jul 25, 2022
fb81fbb
[core-v2.6.0-alpha.4, react-v2.2.5-alpha.4, vue-v2.1.5-alpha.4] : Fix…
Adamj1232 Jul 25, 2022
c1bcc7d
Fix trezor nonce (#1165)
0xjocke Jul 26, 2022
db4672d
[core:2.6.0-alpha.3] [common:2.1.7-alpha.2] - [feature] : Gas Module…
lnbc1QWFyb24 Jul 26, 2022
bf08241
common-v2.1.7-alpha.2, core-v2.6.0-alpha.3, react-v2.2.5-alpha.2, vue…
mahmud-bn Jul 26, 2022
a538d6b
Fix: add "main" to Keystone's package.json (#1164)
katspaugh Jul 26, 2022
6813beb
gas-v2.0.0-alpha.1, core-v2.6.0-alpha.6]: Fix: Trigger Gas Module Pu…
mahmud-bn Jul 26, 2022
1b3fc9e
Updated Binance Wallet provider patch and version bump (#1174)
Adamj1232 Jul 27, 2022
5f8c085
Updated versions for release
Adamj1232 Jul 27, 2022
9b285dc
[gas:2.0.0-alpha.2] [core:2.6.0-alpha.7] - [enhancement] - Modify Gas…
lnbc1QWFyb24 Jul 27, 2022
a6927ee
Merge in changes to gas module
Adamj1232 Jul 27, 2022
af5a09f
[common-v2.1.7-alpha.1, core-v2.6.0-alpha.1, react-v2.2.5-alpha.1, vu…
mahmud-bn Jul 28, 2022
d7a98de
Merge in latest develop
Adamj1232 Jul 28, 2022
7b1eb11
Fix validation for HD wallets ID
Adamj1232 Jul 28, 2022
31a107f
feat: add BitKeep (#1177)
0xfaihai Jul 28, 2022
0d05ed5
Merge in develop
Adamj1232 Jul 28, 2022
c7fed22
Remove force ID to string as it will always be string/hex internally
Adamj1232 Aug 1, 2022
f980452
Tokenary support on all platforms (#1185)
grachyov Aug 1, 2022
ab48620
Merge branch 'v2-web3-onboard-develop' into release/2.6.0
Adamj1232 Aug 1, 2022
5fecc21
bundler-minify-version (#1186)
mahmud-bn Aug 1, 2022
9288af0
Merge in latest develop branch changes
Adamj1232 Aug 1, 2022
9e01c83
[common-v2.1.7-alpha.5, core-v2.6.0-alpha.8, react-v2.2.5-alpha.7]fix…
mahmud-bn Aug 1, 2022
78b317b
Merge in develop
Adamj1232 Aug 1, 2022
3a199e6
Remove unneeded log
Adamj1232 Aug 1, 2022
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
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/vue
steps:
- node-build-steps
build-gas:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/gas
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -407,6 +413,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/vue
steps:
- node-staging-build-steps
build-staging-gas:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/gas
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -531,3 +543,9 @@ workflows:
<<: *deploy_production_filters
- build-staging-vue:
<<: *deploy_staging_filters
gas:
jobs:
- build-gas:
<<: *deploy_production_filters
- build-staging-gas:
<<: *deploy_staging_filters
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-onboard-monorepo",
"version": "2.5.0",
"version": "2.6.0",
"private": true,
"workspaces": [
"./packages/*"
Expand Down
4 changes: 2 additions & 2 deletions packages/coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/coinbase",
"version": "2.0.9",
"version": "2.0.10",
"description": "Coinbase SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -59,6 +59,6 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.0.5",
"@web3-onboard/common": "^2.1.6"
"@web3-onboard/common": "^2.1.7"
}
}
4 changes: 3 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/common",
"version": "2.1.6",
"version": "2.1.7",
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -73,6 +73,7 @@
"prettier-plugin-svelte": "^2.4.0",
"rollup": "^2.3.4",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.42.5",
"svelte-check": "^2.2.6",
"svelte-preprocess": "^4.9.4",
Expand All @@ -81,6 +82,7 @@
},
"dependencies": {
"@ethereumjs/common": "2.6.2",
"bignumber.js": "^9.0.0",
"ethers": "5.5.4",
"joi": "^17.4.2",
"rxjs": "^7.5.2"
Expand Down
18 changes: 16 additions & 2 deletions packages/common/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import replace from '@rollup/plugin-replace'
import json from '@rollup/plugin-json'
import sveltePreprocess from 'svelte-preprocess'
import typescript from '@rollup/plugin-typescript'
import { terser } from 'rollup-plugin-terser'

const production = !process.env.ROLLUP_WATCH

export default {
input: 'src/index.ts',
output: {
format: 'esm',
dir: 'dist/'
dir: 'dist/',
sourcemap: true,
},
plugins: [
json(),
Expand All @@ -33,7 +35,19 @@ export default {
typescript({
sourceMap: !production,
inlineSources: !production
}),
production && terser({
ecma: 2017,
mangle: { toplevel: true },
compress: {
module: true,
toplevel: true,
unsafe_arrows: true,
drop_console: production,
drop_debugger: production
},
output: { quote_style: 1 }
})
],
external: ['joi', 'rxjs', 'ethers', '@ethereumjs/common']
external: ['joi', 'rxjs', 'ethers', '@ethereumjs/common', 'bignumber.js']
}
4 changes: 2 additions & 2 deletions packages/common/src/elements/AddressTable.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { Account, AccountsList } from '../types'
import { utils } from 'ethers'
import { weiToEth } from '../utils'

export let accountsListObject: AccountsList | undefined
export let accountSelected: Account | undefined = undefined
Expand Down Expand Up @@ -120,7 +120,7 @@
>
<td>{account.derivationPath}</td>
<td class="asset-td"
>{utils.formatEther(account.balance.value)}
>{weiToEth(account.balance.value.toString())}
{account.balance.asset}</td
>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/hdwallets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Common from '@ethereumjs/common'
import type { BigNumber } from 'ethers'
import type { CustomNetwork, EIP1193Provider, RPCResponse } from './types'
import type { TransactionRequest } from '@ethersproject/providers'
import type { BigNumber } from 'ethers'

/**
* Creates the common instance used for signing
Expand Down
119 changes: 2 additions & 117 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,3 @@
import type {
RequestPatch,
AccountSelectAPI,
SelectAccountOptions,
BasePath,
DerivationPath,
Asset,
ScanAccounts,
ScanAccountsOptions,
AccountAddress,
Account,
AccountsList,
AppMetadata,
RecommendedInjectedWallets,
WalletInit,
WalletHelpers,
APIKey,
Device,
WalletModule,
GetInterfaceHelpers,
Platform,
DeviceOS,
DeviceBrowser,
DeviceOSName,
DeviceBrowserName,
DeviceType,
ChainId,
RpcUrl,
WalletInterface,
ProviderMessage,
ProviderInfo,
ProviderAccounts,
ProviderEvent,
SimpleEventEmitter,
ConnectListener,
DisconnectListener,
MessageListener,
ChainListener,
AccountsListener,
Balance,
EthAccountsRequest,
EthBalanceRequest,
EIP1102Request,
SelectAccountsRequest,
EIP3326Request,
EIP3085Request,
EthChainIdRequest,
EthSignTransactionRequest,
EthSignMessageRequest,
EIP712Request,
AddChainParams,
EIP1193Provider,
Chain,
TokenSymbol,
CustomNetwork,
TransactionObject,
RPCResponse
} from './types'

export { ProviderRpcErrorCode } from './types'
export { ProviderRpcError } from './errors'
export { createEIP1193Provider } from './eip-1193'
Expand All @@ -68,62 +9,6 @@ export {
bigNumberFieldsToStrings,
getHardwareWalletProvider
} from './hdwallets'
export { weiToEth } from './utils'

export type {
RequestPatch,
AccountSelectAPI,
SelectAccountOptions,
BasePath,
DerivationPath,
Asset,
ScanAccounts,
ScanAccountsOptions,
AccountAddress,
Account,
AccountsList,
AppMetadata,
RecommendedInjectedWallets,
WalletInit,
WalletHelpers,
APIKey,
Device,
WalletModule,
GetInterfaceHelpers,
Platform,
DeviceOS,
DeviceBrowser,
DeviceOSName,
DeviceBrowserName,
DeviceType,
ChainId,
RpcUrl,
WalletInterface,
ProviderMessage,
ProviderInfo,
ProviderAccounts,
ProviderEvent,
SimpleEventEmitter,
ConnectListener,
DisconnectListener,
MessageListener,
ChainListener,
AccountsListener,
Balance,
EthAccountsRequest,
EthBalanceRequest,
EIP1102Request,
SelectAccountsRequest,
EIP3326Request,
EIP3085Request,
EthChainIdRequest,
EthSignTransactionRequest,
EthSignMessageRequest,
EIP712Request,
AddChainParams,
EIP1193Provider,
Chain,
TokenSymbol,
CustomNetwork,
TransactionObject,
RPCResponse
}
export * from './types'
8 changes: 6 additions & 2 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ethers, BigNumber } from 'ethers'
import type { ConnectionInfo } from 'ethers/lib/utils'
import type EventEmitter from 'eventemitter3'
import type { TypedData as EIP712TypedData } from 'eip-712'
import type { ethers } from 'ethers'
export type { TypedData as EIP712TypedData } from 'eip-712'

/**
Expand Down Expand Up @@ -116,7 +116,7 @@ export type Account = {
derivationPath: DerivationPath
balance: {
asset: Asset['label']
value: BigNumber
value: ethers.BigNumber
}
}

Expand Down Expand Up @@ -238,6 +238,8 @@ export type GetInterfaceHelpers = {

export type ChainId = string

export type DecimalChainId = number

export type RpcUrl = string

export type WalletInterface = {
Expand Down Expand Up @@ -434,6 +436,8 @@ export interface Chain {
blockExplorerUrl?: string
}

export type ChainWithDecimalId = Omit<Chain, 'id'> & { id: DecimalChainId }

export type TokenSymbol = string // eg ETH

export interface CustomNetwork {
Expand Down
5 changes: 5 additions & 0 deletions packages/common/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import BigNumber from 'bignumber.js'

export function weiToEth(wei: string): string {
return new BigNumber(wei).div(1e18).toString(10)
}
4 changes: 3 additions & 1 deletion packages/common/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const basePaths = Joi.array().items(basePath)

const chain = Joi.object({
namespace: Joi.string(),
id: Joi.string().required(),
id: Joi.string()
.pattern(/^0x[0-9a-fA-F]+$/)
.required(),
rpcUrl: Joi.string().required(),
label: Joi.string().required(),
token: Joi.string().required(),
Expand Down
5 changes: 2 additions & 3 deletions packages/common/src/views/AccountSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import CloseButton from '../elements/CloseButton.svelte'
import AddressTable from '../elements/AddressTable.svelte'
import TableHeader from '../elements/TableHeader.svelte'
import { utils } from 'ethers'

import type { Subject } from 'rxjs'
import type {
ScanAccountsOptions,
SelectAccountOptions,
Account,
AccountsList
} from '../types'
import { weiToEth } from '../utils'

export let selectAccountOptions: SelectAccountOptions
export let accounts$: Subject<Account[]>
Expand Down Expand Up @@ -61,7 +60,7 @@
accountsListObject = {
all: allAccounts,
filtered: allAccounts.filter(account => {
return parseFloat(utils.formatEther(account.balance.value)) > 0
return parseFloat(weiToEth(account.balance.value.toString())) > 0
})
}
loadingAccounts = false
Expand Down
Loading