1
- import {
2
- LatticeOptions ,
3
- WalletModule ,
4
- HardwareWalletCustomNetwork ,
5
- Helpers
6
- } from '../../../interfaces'
1
+ import { LatticeOptions , WalletModule , Helpers } from '../../../interfaces'
7
2
import latticeIcon from '../wallet-icons/icon-lattice'
8
3
9
4
function lattice (
10
5
options : LatticeOptions & { networkId : number }
11
6
) : 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
22
8
23
9
return {
24
10
name : label || 'Lattice' ,
@@ -33,7 +19,6 @@ function lattice(
33
19
networkId,
34
20
BigNumber,
35
21
networkName,
36
- customNetwork,
37
22
resetWalletState
38
23
} )
39
24
@@ -72,21 +57,18 @@ async function latticeProvider(options: {
72
57
rpcUrl : string
73
58
BigNumber : any
74
59
networkName : ( id : number ) => string
75
- customNetwork ?: HardwareWalletCustomNetwork
76
60
resetWalletState : ( options ?: {
77
61
disconnected : boolean
78
62
walletName : string
79
63
} ) => void
80
64
} ) {
81
65
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' )
84
67
const { default : createProvider } = await import ( './providerEngine' )
85
68
86
69
const BASE_PATH = "m/44'/60'/0'/0"
87
70
88
- const { networkId, appName, rpcUrl, BigNumber, networkName, customNetwork } =
89
- options
71
+ const { networkId, appName, rpcUrl, BigNumber, networkName } = options
90
72
91
73
const params = {
92
74
name : appName ,
@@ -246,17 +228,10 @@ async function latticeProvider(options: {
246
228
if ( addressList . length === 0 ) {
247
229
await enable ( )
248
230
}
249
- const common = new Common ( {
250
- chain : customNetwork || networkName ( networkId )
251
- } )
252
231
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
+ } )
260
235
261
236
try {
262
237
const signedTx = await Lattice . signTransaction (
0 commit comments