@sidhujag/sysweb3-keyring 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +46 -0
- package/cjs/evm-fees.js +223 -0
- package/cjs/evm-fees.js.map +1 -0
- package/cjs/keyring-core.js +1 -1
- package/cjs/keyring-core.js.map +1 -1
- package/cjs/keyring-manager.js +4 -3
- package/cjs/keyring-manager.js.map +1 -1
- package/cjs/software.js +12 -3
- package/cjs/software.js.map +1 -1
- package/cjs/transactions/ethereum.js +194 -190
- package/cjs/transactions/ethereum.js.map +1 -1
- package/cjs/transactions/evm-local-signer.js +28 -7
- package/cjs/transactions/evm-local-signer.js.map +1 -1
- package/cjs/transactions/evm-submission.js +179 -0
- package/cjs/transactions/evm-submission.js.map +1 -0
- package/cjs/transactions/index.js +1 -0
- package/cjs/transactions/index.js.map +1 -1
- package/cjs/transactions/prepared-evm.js +3 -0
- package/cjs/transactions/prepared-evm.js.map +1 -1
- package/cjs/types.js.map +1 -1
- package/cjs/utils/derivation-paths.js +4 -3
- package/cjs/utils/derivation-paths.js.map +1 -1
- package/cjs/utils/watch-descriptor.js +3 -2
- package/cjs/utils/watch-descriptor.js.map +1 -1
- package/esm/types.js.map +1 -1
- package/esm/utils/derivation-paths.js +2 -1
- package/esm/utils/derivation-paths.js.map +1 -1
- package/package.json +28 -3
- package/types/evm-fees.d.ts +42 -0
- package/types/keyring-core.d.ts +3 -0
- package/types/keyring-manager.d.ts +8 -3
- package/types/software.d.ts +6 -1
- package/types/transactions/ethereum.d.ts +10 -8
- package/types/transactions/evm-local-signer.d.ts +4 -1
- package/types/transactions/evm-submission.d.ts +48 -0
- package/types/transactions/index.d.ts +1 -0
- package/types/types.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased — API removal pending release-version decision
|
|
4
|
+
|
|
5
|
+
- Remove the duplicate public BIP84 and bounded native-transfer APIs introduced in 2.1.0. Existing descriptor, SJS/HD and generic PSBT paths remain. This removes published exports and is **not** a compatible 2.1.1 patch. Historical 2.1.0 notes below describe the already-published package.
|
|
6
|
+
|
|
7
|
+
## 2.1.1
|
|
8
|
+
|
|
9
|
+
- Share the existing successful gas-estimate 20% buffer/minimum calculation through `bufferedEvmGasLimit`; SDK and mobile can use the same integer rounding without copying the formula.
|
|
10
|
+
|
|
11
|
+
- Expose dependency-free `cjs/evm-fees` for the existing standard EVM fee recommendation and make `EthereumTransactions` use the same implementation.
|
|
12
|
+
- Keep observed legacy/EIP-1559 behavior, zero tips, configured floors/multipliers, and unsupported-method-only history fallback. Add uint256/history bounds, snapshot options, synchronous host guards and cancellation checks for restricted hosts.
|
|
13
|
+
|
|
14
|
+
## 2.1.0
|
|
15
|
+
|
|
16
|
+
- Add the standalone `cjs/public-bip84` entry for strict Bitcoin/Syscoin mainnet account parsing and native SegWit address derivation. It returns public data only; an account public key does not prove ancestry or ownership.
|
|
17
|
+
- Add `SoftwareKeyring.deriveBip84HdPublicAccount` for guarded public derivation from an unlocked software HD wallet, without selecting accounts, writing storage or discovering addresses.
|
|
18
|
+
- Add the standalone `cjs/bip84-native` planner for bounded native-coin P2WPKH transactions with explicit parent data, change, RBF and exact fee limits. Asset, special and coinbase parents are excluded.
|
|
19
|
+
- Add `SoftwareKeyring.signPreparedBip84Transaction` for the selected Bitcoin/Syscoin mainnet HD account. It binds the account, network and synchronous host guard, verifies the rebuilt transaction and signatures, and returns immutable signed bytes, identifiers and exact fee/size data.
|
|
20
|
+
- These offline APIs do not unlock, access a provider, persist records or broadcast. Hosts still own input eligibility, fresh approval, change reservations and durable journaling before broadcast. Existing vault, EVM, generic PSBT and hardware APIs remain unchanged; native and live qualification remain separate.
|
|
21
|
+
|
|
3
22
|
## 2.0.0
|
|
4
23
|
|
|
5
24
|
- Add `SoftwareKeyring.deriveEvmHdRuntimeAccount` for host-allocated Ethereum BIP44 indices. It returns the existing password-encrypted runtime account record without installing an account, writing storage or querying a network. The method binds session, selection and network identity and requires a synchronous host guard. Hosts must strip encrypted `xprv` before producing public metadata.
|
package/README.md
CHANGED
|
@@ -359,3 +359,49 @@ Signatures are checked against the expected account; UTXO signatures must also
|
|
|
359
359
|
match the approved PSBT and its requested sighash coverage. The custom UTXO host
|
|
360
360
|
supports the existing Syscoin and Bitcoin app protocols. Physical-device and
|
|
361
361
|
firmware qualification remain separate from source and mocked-device tests.
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
## Shared standard EVM fees
|
|
365
|
+
|
|
366
|
+
`cjs/evm-fees` is a dependency-free read-only entry. Both the existing
|
|
367
|
+
`EthereumTransactions.getFeeDataWithDynamicMaxPriorityFeePerGas` method and
|
|
368
|
+
restricted hosts use the same calculation:
|
|
369
|
+
|
|
370
|
+
```ts
|
|
371
|
+
import { getEvmFeeData } from '@sidhujag/sysweb3-keyring/cjs/evm-fees';
|
|
372
|
+
|
|
373
|
+
const fees = await getEvmFeeData(readOnlyProvider, {
|
|
374
|
+
signal,
|
|
375
|
+
assertCurrent: () => assertSameAccountAndNetwork(),
|
|
376
|
+
});
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
The reader supplies only `getGasPrice()`, `getBlock('latest')`, and
|
|
380
|
+
`send('eth_maxPriorityFeePerGas' | 'eth_feeHistory', params)`. It must validate
|
|
381
|
+
its RPC responses and bind its endpoint/chain; this helper does not instantiate
|
|
382
|
+
a provider, estimate gas, select an account, sign or broadcast. The host must
|
|
383
|
+
retain request deadlines and perform its ordinary account/network/session
|
|
384
|
+
checks before signing.
|
|
385
|
+
|
|
386
|
+
Results are frozen bigint fields: `gasPrice`, `maxFeePerGas`, and
|
|
387
|
+
`maxPriorityFeePerGas`, with `baseFeePerGas` only when the observed header has
|
|
388
|
+
that field. An absent base fee produces the existing legacy zero sentinels for
|
|
389
|
+
the two EIP-1559 fields. A zero base fee or zero tip remains valid EIP-1559 data.
|
|
390
|
+
An explicitly unsupported priority method may use actual recent fee-history
|
|
391
|
+
rewards; other failures never turn into fallback fees. Quantities and calculated
|
|
392
|
+
fees are bounded to uint256, history to the requested five blocks, and no
|
|
393
|
+
signing authority or dependencies are loaded by this entry.
|
|
394
|
+
|
|
395
|
+
The optional `minPriorityFee` and whole-percent `feeMultiplier` preserve the
|
|
396
|
+
existing configured recommendation policy (default multiplier 250). Options
|
|
397
|
+
are snapshotted before asynchronous reads. The synchronous `assertCurrent`
|
|
398
|
+
callback must return `undefined`; an async callback is rejected. Cancellation
|
|
399
|
+
rejects pending discovery without permitting later results to produce a quote.
|
|
400
|
+
|
|
401
|
+
`bufferedEvmGasLimit(estimate: bigint, minimum?: bigint)` shares the existing
|
|
402
|
+
successful gas estimate policy used by `EthereumTransactions.getTxGasLimit`:
|
|
403
|
+
floor the estimate times120/100 and apply the configured minimum if larger.
|
|
404
|
+
It includes ordinary native transfers. The helper performs no estimation,
|
|
405
|
+
fallback request, transaction cap selection or broadcasting; callers enforce
|
|
406
|
+
the selected network's limits after applying it. The SDK's existing estimation
|
|
407
|
+
failure/fallback behavior is unchanged.
|
package/cjs/evm-fees.js
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvmGasLimitError = void 0;
|
|
4
|
+
exports.assertEvmGasLimit = assertEvmGasLimit;
|
|
5
|
+
exports.parseEvmFeeQuantity = parseEvmFeeQuantity;
|
|
6
|
+
exports.bufferedEvmGasLimit = bufferedEvmGasLimit;
|
|
7
|
+
exports.getEvmFeeData = getEvmFeeData;
|
|
8
|
+
/** Standard EVM fee discovery shared by extension and restricted native hosts. */
|
|
9
|
+
const evm_js_1 = require("@sidhujag/sysweb3-network/cjs/evm.js");
|
|
10
|
+
const MAX_FEE = (1n << 256n) - 1n;
|
|
11
|
+
/** A validated limit failed its wire bounds or an activated protocol bound. */
|
|
12
|
+
class EvmGasLimitError extends Error {
|
|
13
|
+
constructor(code) {
|
|
14
|
+
super(code === 'SYSWEB3_EVM_GAS_LIMIT_INVALID'
|
|
15
|
+
? 'Invalid EVM gas limit'
|
|
16
|
+
: 'EVM gas limit exceeds the network limit');
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.name = 'EvmGasLimitError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.EvmGasLimitError = EvmGasLimitError;
|
|
22
|
+
/** The host supplies a verified chain and, if sampled, its block gas limit. */
|
|
23
|
+
function assertEvmGasLimit(gasLimit, chainId, sampledBlockGasLimit) {
|
|
24
|
+
if (typeof gasLimit !== 'bigint' ||
|
|
25
|
+
gasLimit <= 0n ||
|
|
26
|
+
gasLimit > MAX_FEE ||
|
|
27
|
+
typeof chainId !== 'bigint' ||
|
|
28
|
+
chainId < 0n ||
|
|
29
|
+
chainId > MAX_FEE ||
|
|
30
|
+
(sampledBlockGasLimit !== undefined &&
|
|
31
|
+
(typeof sampledBlockGasLimit !== 'bigint' ||
|
|
32
|
+
sampledBlockGasLimit <= 0n ||
|
|
33
|
+
sampledBlockGasLimit > MAX_FEE)))
|
|
34
|
+
throw new EvmGasLimitError('SYSWEB3_EVM_GAS_LIMIT_INVALID');
|
|
35
|
+
const { maxTransactionGas } = (0, evm_js_1.getEvmProtocolLimits)(chainId);
|
|
36
|
+
if ((maxTransactionGas !== undefined && gasLimit > BigInt(maxTransactionGas)) ||
|
|
37
|
+
(sampledBlockGasLimit !== undefined && gasLimit > sampledBlockGasLimit))
|
|
38
|
+
throw new EvmGasLimitError('SYSWEB3_EVM_GAS_LIMIT_EXCEEDED');
|
|
39
|
+
return gasLimit;
|
|
40
|
+
}
|
|
41
|
+
/** Accept the SDK's existing BigNumberish forms without permissive zero coercion. */
|
|
42
|
+
function parseEvmFeeQuantity(value, label = 'fee quantity') {
|
|
43
|
+
if (value !== null && typeof value === 'object') {
|
|
44
|
+
const object = value;
|
|
45
|
+
value =
|
|
46
|
+
object._hex ??
|
|
47
|
+
object.hex ??
|
|
48
|
+
(typeof object.toString === 'function' ? object.toString() : undefined);
|
|
49
|
+
if (typeof value !== 'string')
|
|
50
|
+
throw new Error(`Invalid ${label}`);
|
|
51
|
+
}
|
|
52
|
+
if (!((typeof value === 'string' &&
|
|
53
|
+
value.length <= 80 &&
|
|
54
|
+
/^(?:0x[\da-f]+|\d+)$/i.test(value)) ||
|
|
55
|
+
(typeof value === 'number' &&
|
|
56
|
+
Number.isSafeInteger(value) &&
|
|
57
|
+
value >= 0) ||
|
|
58
|
+
(typeof value === 'bigint' && value >= 0n)))
|
|
59
|
+
throw new Error(`Invalid ${label}`);
|
|
60
|
+
const quantity = BigInt(value);
|
|
61
|
+
if (quantity > MAX_FEE)
|
|
62
|
+
throw new Error(`Invalid ${label}`);
|
|
63
|
+
return quantity;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The existing successful-estimate policy: floor(estimate * 120 / 100), then
|
|
67
|
+
* the configured minimum if larger. Callers retain chain/resource bounds.
|
|
68
|
+
*/
|
|
69
|
+
function bufferedEvmGasLimit(estimate, minimum) {
|
|
70
|
+
if (typeof estimate !== 'bigint' ||
|
|
71
|
+
estimate < 0n ||
|
|
72
|
+
(minimum !== undefined && typeof minimum !== 'bigint'))
|
|
73
|
+
throw new Error('Invalid gas estimate');
|
|
74
|
+
const buffered = (estimate * 120n) / 100n;
|
|
75
|
+
return minimum !== undefined && minimum > buffered ? minimum : buffered;
|
|
76
|
+
}
|
|
77
|
+
function unsupportedPriorityMethod(error) {
|
|
78
|
+
const unsupportedCode = (code) => code === -32601 || code === 4200;
|
|
79
|
+
if (unsupportedCode(error?.code))
|
|
80
|
+
return true;
|
|
81
|
+
if (!['UNKNOWN_ERROR', 'UNSUPPORTED_OPERATION'].includes(error?.code))
|
|
82
|
+
return false;
|
|
83
|
+
if (error?.operation != null &&
|
|
84
|
+
error.operation !== 'eth_maxPriorityFeePerGas')
|
|
85
|
+
return false;
|
|
86
|
+
return [
|
|
87
|
+
{ cause: error.error, payload: error.payload },
|
|
88
|
+
{ cause: error.info?.error, payload: error.info?.payload },
|
|
89
|
+
].some(({ cause, payload }) => cause?.name !== 'AbortError' &&
|
|
90
|
+
unsupportedCode(cause?.code) &&
|
|
91
|
+
payload?.method === 'eth_maxPriorityFeePerGas' &&
|
|
92
|
+
Array.isArray(payload.params) &&
|
|
93
|
+
payload.params.length === 0);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* No signer, transport, network registry or provider implementation is imported.
|
|
97
|
+
* Reads are serialized and guarded; RPC failures never become fabricated fees.
|
|
98
|
+
*/
|
|
99
|
+
async function getEvmFeeData(reader, options = {}) {
|
|
100
|
+
const signals = [options.signal, reader.signal].filter((signal) => signal !== undefined);
|
|
101
|
+
const assertCurrent = options.assertCurrent;
|
|
102
|
+
const check = () => {
|
|
103
|
+
if (signals.some((signal) => signal.aborted)) {
|
|
104
|
+
const error = new Error('EVM fee discovery aborted');
|
|
105
|
+
error.name = 'AbortError';
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
if (assertCurrent) {
|
|
109
|
+
const result = assertCurrent();
|
|
110
|
+
if (result !== undefined) {
|
|
111
|
+
// A void callback type also accepts async functions. Never await one.
|
|
112
|
+
void Promise.resolve(result).catch(() => undefined);
|
|
113
|
+
throw new Error('EVM fee guard must be synchronous');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (signals.some((signal) => signal.aborted)) {
|
|
117
|
+
const error = new Error('EVM fee discovery aborted');
|
|
118
|
+
error.name = 'AbortError';
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
check();
|
|
123
|
+
const minPriorityFee = options.minPriorityFee == null
|
|
124
|
+
? undefined
|
|
125
|
+
: parseEvmFeeQuantity(options.minPriorityFee, 'minimum priority fee');
|
|
126
|
+
// Retain the existing zero/absent override behavior.
|
|
127
|
+
const multiplier = options.feeMultiplier || 250;
|
|
128
|
+
if (!Number.isSafeInteger(multiplier) || multiplier < 1)
|
|
129
|
+
throw new Error('Invalid fee multiplier');
|
|
130
|
+
const getGasPrice = reader.getGasPrice.bind(reader);
|
|
131
|
+
const getBlock = reader.getBlock.bind(reader);
|
|
132
|
+
const send = reader.send.bind(reader);
|
|
133
|
+
const read = async (operation) => {
|
|
134
|
+
check();
|
|
135
|
+
let cleanup = () => undefined;
|
|
136
|
+
try {
|
|
137
|
+
const interrupted = new Promise((_, reject) => {
|
|
138
|
+
const abort = () => {
|
|
139
|
+
const error = new Error('EVM fee discovery aborted');
|
|
140
|
+
error.name = 'AbortError';
|
|
141
|
+
reject(error);
|
|
142
|
+
};
|
|
143
|
+
signals.forEach((signal) => signal.addEventListener('abort', abort, { once: true }));
|
|
144
|
+
cleanup = () => {
|
|
145
|
+
signals.forEach((signal) => signal.removeEventListener('abort', abort));
|
|
146
|
+
return undefined;
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
// No asynchronous gap between the current-owner check and dispatch.
|
|
150
|
+
const result = await Promise.race([operation(), interrupted]);
|
|
151
|
+
check();
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
check();
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
cleanup();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const gasPrice = parseEvmFeeQuantity(await read(getGasPrice), 'gas price');
|
|
163
|
+
const block = await read(() => getBlock('latest'));
|
|
164
|
+
if (!block)
|
|
165
|
+
throw new Error('Block not found');
|
|
166
|
+
if (typeof block !== 'object' || Array.isArray(block))
|
|
167
|
+
throw new Error('Invalid block');
|
|
168
|
+
const rawBaseFee = block.baseFeePerGas;
|
|
169
|
+
if (rawBaseFee == null) {
|
|
170
|
+
check();
|
|
171
|
+
return Object.freeze({
|
|
172
|
+
gasPrice,
|
|
173
|
+
maxFeePerGas: 0n,
|
|
174
|
+
maxPriorityFeePerGas: 0n,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const baseFeePerGas = parseEvmFeeQuantity(rawBaseFee, 'base fee');
|
|
178
|
+
let maxPriorityFeePerGas;
|
|
179
|
+
try {
|
|
180
|
+
maxPriorityFeePerGas = parseEvmFeeQuantity(await read(() => send('eth_maxPriorityFeePerGas', [])), 'priority fee');
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
check();
|
|
184
|
+
if (error?.code === 'SYSWEB3_RPC_RESPONSE_INVALID' ||
|
|
185
|
+
error?.name === 'AbortError' ||
|
|
186
|
+
!unsupportedPriorityMethod(error))
|
|
187
|
+
throw error;
|
|
188
|
+
const history = await read(() => send('eth_feeHistory', ['0x5', 'latest', [25, 50, 75]]));
|
|
189
|
+
const rewards = history?.reward;
|
|
190
|
+
if (!Array.isArray(rewards) || rewards.length < 1 || rewards.length > 5)
|
|
191
|
+
throw new Error('Priority fee history unavailable');
|
|
192
|
+
const recentFees = rewards
|
|
193
|
+
.map((reward) => {
|
|
194
|
+
if (!Array.isArray(reward) || reward.length !== 3)
|
|
195
|
+
throw new Error('Invalid priority fee history');
|
|
196
|
+
const parsed = reward.map((value) => parseEvmFeeQuantity(value, 'priority fee history'));
|
|
197
|
+
return parsed[1];
|
|
198
|
+
})
|
|
199
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
200
|
+
maxPriorityFeePerGas =
|
|
201
|
+
(recentFees[Math.floor(recentFees.length / 2)] * 150n) / 100n;
|
|
202
|
+
}
|
|
203
|
+
if (minPriorityFee !== undefined && maxPriorityFeePerGas < minPriorityFee)
|
|
204
|
+
maxPriorityFeePerGas = minPriorityFee;
|
|
205
|
+
const baseline = (gasPrice * 120n) / 100n;
|
|
206
|
+
const calculated = (baseFeePerGas * BigInt(multiplier)) / 100n + maxPriorityFeePerGas;
|
|
207
|
+
let maxFeePerGas = calculated > baseline ? calculated : baseline;
|
|
208
|
+
const minimum = (maxPriorityFeePerGas * 120n) / 100n;
|
|
209
|
+
if (maxFeePerGas < minimum)
|
|
210
|
+
maxFeePerGas = minimum;
|
|
211
|
+
if (maxFeePerGas === 0n)
|
|
212
|
+
throw new Error('Invalid EIP-1559 maximum fee');
|
|
213
|
+
parseEvmFeeQuantity(maxFeePerGas, 'maximum fee');
|
|
214
|
+
parseEvmFeeQuantity(maxPriorityFeePerGas, 'priority fee');
|
|
215
|
+
check();
|
|
216
|
+
return Object.freeze({
|
|
217
|
+
gasPrice,
|
|
218
|
+
baseFeePerGas,
|
|
219
|
+
maxFeePerGas,
|
|
220
|
+
maxPriorityFeePerGas,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=evm-fees.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evm-fees.js","sourceRoot":"","sources":["../../src/evm-fees.ts"],"names":[],"mappings":";;;AAiDA,8CAyBC;AAGD,kDA+BC;AAMD,kDAYC;AA6BD,sCA0IC;AArSD,kFAAkF;AAClF,iEAA4E;AA6B5E,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AAElC,+EAA+E;AAC/E,MAAa,gBAAiB,SAAQ,KAAK;IACzC,YACkB,IAEoB;QAEpC,KAAK,CACH,IAAI,KAAK,+BAA+B;YACtC,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,yCAAyC,CAC9C,CAAC;QARc,SAAI,GAAJ,IAAI,CAEgB;QAOpC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAbD,4CAaC;AAED,+EAA+E;AAC/E,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,OAAe,EACf,oBAA6B;IAE7B,IACE,OAAO,QAAQ,KAAK,QAAQ;QAC5B,QAAQ,IAAI,EAAE;QACd,QAAQ,GAAG,OAAO;QAClB,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,GAAG,EAAE;QACZ,OAAO,GAAG,OAAO;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OAAO,CAAC;IACnD,IAAI,YAAY,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACzE,mBAAmB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACjD,mBAAmB,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;IAC1D,KAAK,EAAE,CAAC;IACR,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,QAAQ;QACR,aAAa;QACb,YAAY;QACZ,oBAAoB;KACrB,CAAC,CAAC;AACL,CAAC"}
|
package/cjs/keyring-core.js
CHANGED
|
@@ -1257,7 +1257,7 @@ class KeyringCore {
|
|
|
1257
1257
|
this.initialTrezorAccountState = initial_state_1.initialActiveTrezorAccountState;
|
|
1258
1258
|
this.initialLedgerAccountState = initial_state_1.initialActiveLedgerAccountState;
|
|
1259
1259
|
this.syscoinTransaction = this.createSyscoinTransactions();
|
|
1260
|
-
this.ethereumTransaction = new ethereum_1.EthereumTransactions(this.getNetwork, this.getDecryptedPrivateKey, this.getAccountsState, this.ledgerSigner, this.trezorSigner, this.capturePsbtSigningContext);
|
|
1260
|
+
this.ethereumTransaction = new ethereum_1.EthereumTransactions(this.getNetwork, this.getDecryptedPrivateKey, this.getAccountsState, this.ledgerSigner, this.trezorSigner, this.capturePsbtSigningContext, dependencies.captureEvmSubmission);
|
|
1261
1261
|
}
|
|
1262
1262
|
// Convenience method for complete setup after construction
|
|
1263
1263
|
async initialize(seed, password, network) {
|