Skip to content

Commit fff1ea1

Browse files
1.29.0-0.5.11: Revert lattice changes (#636)
1 parent d1eb042 commit fff1ea1

File tree

4 files changed

+11
-33
lines changed

4 files changed

+11
-33
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.29.0-0.5.10",
3+
"version": "1.29.0-0.5.11",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",
@@ -75,6 +75,7 @@
7575
"eth-lattice-keyring": "^0.2.7",
7676
"eth-provider": "^0.6.1",
7777
"eth-sig-util": "^3.0.1",
78+
"ethereumjs-tx": "^2.1.2",
7879
"ethereumjs-util": "^7.0.3",
7980
"fortmatic": "^2.2.1",
8081
"hdkey": "^2.0.1",

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default {
6666
'walletlink',
6767
'regenerator-runtime/runtime',
6868
'trezor-connect',
69+
'ethereumjs-tx',
6970
'@ethereumjs/tx',
7071
'@ethereumjs/common',
7172
'ethereumjs-util',

src/@types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ declare module 'web3-provider-engine/subproviders/subscriptions'
88
declare module 'web3-provider-engine/subproviders/filters'
99
declare module 'trezor-connect'
1010
declare module 'eth-lattice-keyring'
11+
declare module 'ethereumjs-tx'
1112
declare module '@ethereumjs/tx'
1213
declare module '@ethereumjs/common'
1314
declare module 'ethereumjs-util'

src/modules/select/wallets/lattice.ts

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1-
import {
2-
LatticeOptions,
3-
WalletModule,
4-
HardwareWalletCustomNetwork,
5-
Helpers
6-
} from '../../../interfaces'
1+
import { LatticeOptions, WalletModule, Helpers } from '../../../interfaces'
72
import latticeIcon from '../wallet-icons/icon-lattice'
83

94
function lattice(
105
options: LatticeOptions & { networkId: number }
116
): WalletModule {
12-
const {
13-
appName,
14-
rpcUrl,
15-
networkId,
16-
preferred,
17-
label,
18-
iconSrc,
19-
svg,
20-
customNetwork
21-
} = options
7+
const { appName, rpcUrl, networkId, preferred, label, iconSrc, svg } = options
228

239
return {
2410
name: label || 'Lattice',
@@ -33,7 +19,6 @@ function lattice(
3319
networkId,
3420
BigNumber,
3521
networkName,
36-
customNetwork,
3722
resetWalletState
3823
})
3924

@@ -72,21 +57,18 @@ async function latticeProvider(options: {
7257
rpcUrl: string
7358
BigNumber: any
7459
networkName: (id: number) => string
75-
customNetwork?: HardwareWalletCustomNetwork
7660
resetWalletState: (options?: {
7761
disconnected: boolean
7862
walletName: string
7963
}) => void
8064
}) {
8165
const { default: EthLatticeKeyring } = await import('eth-lattice-keyring')
82-
const { Transaction } = await import('@ethereumjs/tx')
83-
const { default: Common } = await import('@ethereumjs/common')
66+
const EthereumTx = await import('ethereumjs-tx')
8467
const { default: createProvider } = await import('./providerEngine')
8568

8669
const BASE_PATH = "m/44'/60'/0'/0"
8770

88-
const { networkId, appName, rpcUrl, BigNumber, networkName, customNetwork } =
89-
options
71+
const { networkId, appName, rpcUrl, BigNumber, networkName } = options
9072

9173
const params = {
9274
name: appName,
@@ -246,17 +228,10 @@ async function latticeProvider(options: {
246228
if (addressList.length === 0) {
247229
await enable()
248230
}
249-
const common = new Common({
250-
chain: customNetwork || networkName(networkId)
251-
})
252231

253-
const transaction = Transaction.fromTxData(
254-
{
255-
...transactionData,
256-
gasLimit: transactionData.gas ?? transactionData.gasLimit
257-
},
258-
{ common, freeze: false }
259-
)
232+
const transaction = new EthereumTx.Transaction(transactionData, {
233+
chain: networkName(networkId)
234+
})
260235

261236
try {
262237
const signedTx = await Lattice.signTransaction(

0 commit comments

Comments
 (0)