Skip to content

Commit

Permalink
Fixes ledger transaction on polygon (#1101)
Browse files Browse the repository at this point in the history
* Fixes ledger transaction on polygon
* version bumps
* formating + prettier ignore
  • Loading branch information
taylorjdawson authored Jun 28, 2022
1 parent f4dd1e7 commit 29ab8d9
Show file tree
Hide file tree
Showing 27 changed files with 65 additions and 48 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/**/dist
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.6-alpha.1",
"version": "2.0.6-alpha.2",
"description": "Coinbase Wallet module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -21,6 +21,6 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.0.5",
"@web3-onboard/common": "2.1.3-alpha.1"
"@web3-onboard/common": "^2.1.3-alpha.2"
}
}
2 changes: 1 addition & 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.3-alpha.1",
"version": "2.1.3-alpha.2",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
Expand Down
18 changes: 13 additions & 5 deletions packages/common/src/hdwallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ export const getCommon = async ({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const CommonConstructor: typeof Common = Common.default || Common

const commonOptions = {
// Berlin is the minimum hardfork that will allow for EIP1559
hardfork: Hardfork.Berlin,
// List of supported EIPS
eips: [1559]
}
let common: Common
try {
common = new CommonConstructor({
chain: customNetwork || chainId,
// Berlin is the minimum hardfork that will allow for EIP1559
hardfork: Hardfork.Berlin,
// List of supported EIPS
eips: [1559]
...commonOptions
})
} catch (e: any) {
if (e.message && /Chain.*not supported/.test(e.message)) {
common = CommonConstructor.custom({ chainId })
common = CommonConstructor.custom({ chainId }, commonOptions)
} else {
throw e
}
Expand Down Expand Up @@ -91,7 +95,11 @@ export const getHardwareWalletProvider = (
request: ({ method, params }) =>
fetch(getRpcUrl(), {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: '42',
method,
params
Expand Down
6 changes: 5 additions & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export { createEIP1193Provider } from './eip-1193'
export { default as accountSelect } from './account-select'
export { entryModal } from './entry-modal'
export { SofiaProLight, SofiaProRegular, SofiaProSemiBold } from './fonts'
export { getCommon, bigNumberFieldsToStrings, getHardwareWalletProvider } from './hdwallets'
export {
getCommon,
bigNumberFieldsToStrings,
getHardwareWalletProvider
} from './hdwallets'

export type {
RequestPatch,
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ export interface BootstrapNode {
}

export interface RPCResponse {
id: number,
id: number
jsonrpc: string
error?: { code: number, message: string}
error?: { code: number; message: string }
result?: any
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"bignumber.js": "^9.0.0",
"bnc-sdk": "^4.4.1",
"bowser": "^2.11.0",
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ interface ExposedActions {
update: UpdateNotification
}
updateBalances: (addresses?: string[]) => Promise<void>
updateAccountCenter: (
update: AccountCenter | Partial<AccountCenter>
) => void
updateAccountCenter: (update: AccountCenter | Partial<AccountCenter>) => void
}

export interface ConnectOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/dcent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/dcent",
"version": "2.0.3-alpha.1",
"version": "2.0.3-alpha.2",
"description": "D'CENT module for web3-onboard",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -18,7 +18,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"@ethereumjs/common": "^2.6.1",
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
label: 'Polygon',
rpcUrl: 'https://matic-mainnet.chainstacklabs.com'
},
{
id: '0x13881',
token: 'MATIC',
label: 'Polygon - Mumbai',
rpcUrl: 'https://matic-mumbai.chainstacklabs.com '
},
{
id: '0xa',
token: 'OETH',
Expand Down
4 changes: 2 additions & 2 deletions packages/fortmatic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/fortmatic",
"version": "2.0.5-alpha.1",
"version": "2.0.5-alpha.2",
"description": "Fortmatic module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -20,7 +20,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"fortmatic": "^2.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/gnosis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/gnosis",
"version": "2.0.4-alpha.1",
"version": "2.0.4-alpha.2",
"description": "Gnosis module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -23,6 +23,6 @@
"dependencies": {
"@gnosis.pm/safe-apps-provider": "^0.9.2",
"@gnosis.pm/safe-apps-sdk": "^6.1.1",
"@web3-onboard/common": "^2.1.3-alpha.1"
"@web3-onboard/common": "^2.1.3-alpha.2"
}
}
4 changes: 2 additions & 2 deletions packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.0.11-alpha.1",
"version": "2.0.11-alpha.2",
"description": "Injected wallets module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -25,7 +25,7 @@
"window": "^4.2.7"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"joi": "^17.4.2",
"lodash.uniqby": "^4.7.0"
}
Expand Down
4 changes: 2 additions & 2 deletions 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.3-alpha.1",
"version": "2.1.3-alpha.2",
"description": "KeepKey module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -27,7 +27,7 @@
"@ethersproject/providers": "^5.5.0",
"@shapeshiftoss/hdwallet-core": "^1.15.2",
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"ethereumjs-util": "^7.1.3"
}
}
4 changes: 2 additions & 2 deletions 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.4-alpha.1",
"version": "2.1.4-alpha.2",
"description": "Keystone module for web3-onboard",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -21,6 +21,6 @@
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@keystonehq/eth-keyring": "^0.14.0-alpha.10.3",
"@web3-onboard/common": "^2.1.3-alpha.1"
"@web3-onboard/common": "^2.1.3-alpha.2"
}
}
4 changes: 2 additions & 2 deletions packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/ledger",
"version": "2.1.3-alpha.1",
"version": "2.1.3-alpha.2",
"description": "Ledger module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -27,7 +27,7 @@
"@ledgerhq/hw-transport-u2f": "^5.36.0-deprecated",
"@ledgerhq/hw-transport-webusb": "^6.19.0",
"@metamask/eth-sig-util": "^4.0.0",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"buffer": "^6.0.3",
"ethereumjs-util": "^7.1.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function ledger({
return `0x${result['r']}${result['s']}${v}`
})
}

const ledgerProvider = getHardwareWalletProvider(
() => currentChain?.rpcUrl
)
Expand Down
4 changes: 2 additions & 2 deletions packages/magic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/magic",
"version": "2.0.6-alpha.1",
"version": "2.0.6-alpha.2",
"description": "Magic module for Onboard.js",
"scripts": {
"build": "rollup -c",
Expand Down Expand Up @@ -42,7 +42,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"joi": "^17.4.2",
"magic-sdk": "^8.1.0",
"rxjs": "^7.5.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/mew/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/mew",
"version": "2.0.3-alpha.1",
"version": "2.0.3-alpha.2",
"description": "MEW module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -23,7 +23,7 @@
"@myetherwallet/mewconnect-web-client": "^2.2.0-beta.14"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"rxjs": "^7.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/portis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/portis",
"version": "2.0.3-alpha.1",
"version": "2.0.3-alpha.2",
"description": "Portis module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -21,6 +21,6 @@
},
"dependencies": {
"@portis/web3": "^4.0.6",
"@web3-onboard/common": "^2.1.3-alpha.1"
"@web3-onboard/common": "^2.1.3-alpha.2"
}
}
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@web3-onboard/core": "^2.3.1-alpha.4",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"use-sync-external-store": "1.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/torus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/torus",
"version": "2.0.4-alpha.1",
"version": "2.0.4-alpha.2",
"description": "Torus module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -21,6 +21,6 @@
},
"dependencies": {
"@toruslabs/torus-embed": "^1.18.3",
"@web3-onboard/common": "^2.1.3-alpha.1"
"@web3-onboard/common": "^2.1.3-alpha.2"
}
}
4 changes: 2 additions & 2 deletions packages/trezor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/trezor",
"version": "2.1.3-alpha.1",
"version": "2.1.3-alpha.2",
"description": "Trezor module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -22,7 +22,7 @@
"dependencies": {
"@ethereumjs/tx": "^3.4.0",
"@ethersproject/providers": "^5.5.0",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"buffer": "^6.0.3",
"eth-crypto": "^2.1.0",
"ethereumjs-util": "^7.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@vueuse/core": "^8.4.2",
"@vueuse/rxjs": "^8.2.0",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"@web3-onboard/core": "^2.3.1-alpha.4",
"vue-demi": "^0.12.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/walletconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@ethersproject/providers": "^5.5.0",
"@walletconnect/client": "^1.7.1",
"@walletconnect/qrcode-modal": "^1.7.1",
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"rxjs": "^7.5.2"
}
}
4 changes: 2 additions & 2 deletions packages/walletlink/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/walletlink",
"version": "2.0.3-alpha.1",
"version": "2.0.3-alpha.2",
"description": "WalletLink module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -20,7 +20,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"walletlink": "^2.5.0"
}
}
4 changes: 2 additions & 2 deletions packages/web3auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/web3auth",
"version": "2.0.2-alpha.1",
"version": "2.0.2-alpha.2",
"description": "Web3Auth module for web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -20,7 +20,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3-alpha.1",
"@web3-onboard/common": "^2.1.3-alpha.2",
"@web3auth/web3auth": "^1.0.0"
}
}

0 comments on commit 29ab8d9

Please sign in to comment.