@ledgerhq/live-common 34.54.0-nightly.20251204135727 → 34.54.0-nightly.20251205111238
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/lib/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/broadcast.js +3 -3
- package/lib/bridge/generic-alpaca/broadcast.js.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/currencyBridge.js +1 -3
- package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
- package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getAccountShape.js +16 -7
- package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js +16 -1
- package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/prepareTransaction.js +38 -4
- package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signOperation.js +18 -2
- package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
- package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js +8 -1
- package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/signer/index.js +7 -0
- package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib/bridge/generic-alpaca/types.d.ts +4 -0
- package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib/bridge/generic-alpaca/utils.js +11 -3
- package/lib/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib/bridge/impl.d.ts.map +1 -1
- package/lib/bridge/impl.js +14 -3
- package/lib/bridge/impl.js.map +1 -1
- package/lib/currencies/helpers.d.ts +1 -0
- package/lib/currencies/helpers.d.ts.map +1 -1
- package/lib/currencies/helpers.js +7 -1
- package/lib/currencies/helpers.js.map +1 -1
- package/lib/families/canton/config.d.ts.map +1 -1
- package/lib/families/canton/config.js +4 -4
- package/lib/families/canton/config.js.map +1 -1
- package/lib/families/celo/setup.d.ts.map +1 -1
- package/lib/families/celo/setup.js +11 -0
- package/lib/families/celo/setup.js.map +1 -1
- package/lib/families/evm/bridge/mock.d.ts +1 -0
- package/lib/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib/families/evm/bridge/mock.js +12 -0
- package/lib/families/evm/bridge/mock.js.map +1 -1
- package/lib/families/evm/setup.d.ts +1 -4
- package/lib/families/evm/setup.d.ts.map +1 -1
- package/lib/families/evm/setup.js +1 -8
- package/lib/families/evm/setup.js.map +1 -1
- package/lib/families/evm/walletApiAdapter.d.ts +7 -0
- package/lib/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib/families/evm/walletApiAdapter.js +36 -2
- package/lib/families/evm/walletApiAdapter.js.map +1 -1
- package/lib/families/stacks/constants.d.ts +1 -1
- package/lib/families/stacks/constants.d.ts.map +1 -1
- package/lib/families/stacks/constants.js +1 -1
- package/lib/families/stacks/constants.js.map +1 -1
- package/lib/generated/bridge/js.d.ts +0 -1
- package/lib/generated/bridge/js.d.ts.map +1 -1
- package/lib/generated/bridge/js.js +30 -32
- package/lib/generated/bridge/js.js.map +1 -1
- package/lib/generated/bridge/mock.d.ts +1 -0
- package/lib/generated/bridge/mock.d.ts.map +1 -1
- package/lib/operation.d.ts.map +1 -1
- package/lib/operation.js +7 -2
- package/lib/operation.js.map +1 -1
- package/lib/wallet-api/constants.d.ts +1 -1
- package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/broadcast.js +3 -3
- package/lib-es/bridge/generic-alpaca/broadcast.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/currencyBridge.js +1 -3
- package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +2 -1
- package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getAccountShape.js +16 -7
- package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +16 -1
- package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js +38 -4
- package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signOperation.js +18 -2
- package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +2 -0
- package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/Eth.js +4 -0
- package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/signer/index.js +7 -0
- package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
- package/lib-es/bridge/generic-alpaca/types.d.ts +4 -0
- package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
- package/lib-es/bridge/generic-alpaca/utils.js +11 -3
- package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
- package/lib-es/bridge/impl.d.ts.map +1 -1
- package/lib-es/bridge/impl.js +14 -3
- package/lib-es/bridge/impl.js.map +1 -1
- package/lib-es/currencies/helpers.d.ts +1 -0
- package/lib-es/currencies/helpers.d.ts.map +1 -1
- package/lib-es/currencies/helpers.js +5 -0
- package/lib-es/currencies/helpers.js.map +1 -1
- package/lib-es/families/canton/config.d.ts.map +1 -1
- package/lib-es/families/canton/config.js +4 -4
- package/lib-es/families/canton/config.js.map +1 -1
- package/lib-es/families/celo/setup.d.ts.map +1 -1
- package/lib-es/families/celo/setup.js +11 -0
- package/lib-es/families/celo/setup.js.map +1 -1
- package/lib-es/families/evm/bridge/mock.d.ts +1 -0
- package/lib-es/families/evm/bridge/mock.d.ts.map +1 -1
- package/lib-es/families/evm/bridge/mock.js +12 -0
- package/lib-es/families/evm/bridge/mock.js.map +1 -1
- package/lib-es/families/evm/setup.d.ts +1 -4
- package/lib-es/families/evm/setup.d.ts.map +1 -1
- package/lib-es/families/evm/setup.js +2 -8
- package/lib-es/families/evm/setup.js.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.d.ts +7 -0
- package/lib-es/families/evm/walletApiAdapter.d.ts.map +1 -1
- package/lib-es/families/evm/walletApiAdapter.js +30 -1
- package/lib-es/families/evm/walletApiAdapter.js.map +1 -1
- package/lib-es/families/stacks/constants.d.ts +1 -1
- package/lib-es/families/stacks/constants.d.ts.map +1 -1
- package/lib-es/families/stacks/constants.js +1 -1
- package/lib-es/families/stacks/constants.js.map +1 -1
- package/lib-es/generated/bridge/js.d.ts +0 -1
- package/lib-es/generated/bridge/js.d.ts.map +1 -1
- package/lib-es/generated/bridge/js.js +0 -2
- package/lib-es/generated/bridge/js.js.map +1 -1
- package/lib-es/generated/bridge/mock.d.ts +1 -0
- package/lib-es/generated/bridge/mock.d.ts.map +1 -1
- package/lib-es/operation.d.ts.map +1 -1
- package/lib-es/operation.js +7 -2
- package/lib-es/operation.js.map +1 -1
- package/lib-es/wallet-api/constants.d.ts +1 -1
- package/package.json +57 -57
- package/src/bridge/generic-alpaca/broadcast.ts +6 -3
- package/src/bridge/generic-alpaca/currencyBridge.ts +1 -3
- package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +2 -1
- package/src/bridge/generic-alpaca/getAccountShape.ts +24 -12
- package/src/bridge/generic-alpaca/getTransactionStatus.ts +16 -1
- package/src/bridge/generic-alpaca/prepareTransaction.ts +44 -10
- package/src/bridge/generic-alpaca/signOperation.ts +18 -2
- package/src/bridge/generic-alpaca/signer/Eth.ts +5 -1
- package/src/bridge/generic-alpaca/signer/index.ts +7 -0
- package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +2 -2
- package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +32 -0
- package/src/bridge/generic-alpaca/types.ts +4 -0
- package/src/bridge/generic-alpaca/utils.test.ts +1 -0
- package/src/bridge/generic-alpaca/utils.ts +14 -3
- package/src/bridge/impl.ts +16 -3
- package/src/currencies/helpers.test.ts +10 -1
- package/src/currencies/helpers.ts +6 -0
- package/src/families/canton/config.ts +5 -4
- package/src/families/celo/setup.ts +12 -0
- package/src/families/evm/bridge/mock.ts +14 -0
- package/src/families/evm/setup.ts +3 -22
- package/src/families/evm/walletApiAdapter.ts +33 -1
- package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +57 -11
- package/src/families/stacks/__snapshots__/bridge.integration.test.ts.snap +1537 -18
- package/src/families/stacks/__tests__/sync.integration.test.ts +2 -2
- package/src/families/stacks/constants.ts +1 -1
- package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +9 -9
- package/src/generated/bridge/js.ts +0 -2
- package/src/operation.ts +10 -2
|
@@ -16,10 +16,10 @@ describe("sync for token transfers", () => {
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
test("sync build operations only for transfer type txn", async () => {
|
|
19
|
-
const
|
|
19
|
+
const [transfers] = await fetchFullTxs(address);
|
|
20
20
|
|
|
21
21
|
// Contains operations for txn of type token_transfer
|
|
22
|
-
const operations = flatMap(
|
|
22
|
+
const operations = flatMap(transfers, mapTxToOps(accountId, address));
|
|
23
23
|
|
|
24
24
|
expect(operations.length).toBeTruthy();
|
|
25
25
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Encapsulate for LLD & LLM
|
|
2
|
-
export * from "@ledgerhq/coin-stacks/
|
|
2
|
+
export * from "@ledgerhq/coin-stacks/constants";
|
|
@@ -16,7 +16,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
16
16
|
"spendableBalance": "311064932",
|
|
17
17
|
"subAccounts": [],
|
|
18
18
|
"swapHistory": [],
|
|
19
|
-
"syncHash": "
|
|
19
|
+
"syncHash": "0x8a6ee88a",
|
|
20
20
|
"used": true,
|
|
21
21
|
"xpub": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
|
|
22
22
|
},
|
|
@@ -31,10 +31,10 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
31
31
|
"operationsCount": 43,
|
|
32
32
|
"pendingOperations": [],
|
|
33
33
|
"seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
|
|
34
|
-
"spendableBalance": "
|
|
34
|
+
"spendableBalance": "79999760",
|
|
35
35
|
"subAccounts": [],
|
|
36
36
|
"swapHistory": [],
|
|
37
|
-
"syncHash": "
|
|
37
|
+
"syncHash": "0x8a6ee88a",
|
|
38
38
|
"used": true,
|
|
39
39
|
"xpub": "GAIXIJBMYPTSF2CDVQ35WOTULCLZIE4W2SDEK3RQGAA3A22BPWY7R53Z",
|
|
40
40
|
},
|
|
@@ -49,10 +49,10 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
49
49
|
"operationsCount": 38,
|
|
50
50
|
"pendingOperations": [],
|
|
51
51
|
"seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
|
|
52
|
-
"spendableBalance": "
|
|
52
|
+
"spendableBalance": "44999262",
|
|
53
53
|
"subAccounts": [],
|
|
54
54
|
"swapHistory": [],
|
|
55
|
-
"syncHash": "
|
|
55
|
+
"syncHash": "0x8a6ee88a",
|
|
56
56
|
"used": true,
|
|
57
57
|
"xpub": "GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS",
|
|
58
58
|
},
|
|
@@ -67,10 +67,10 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
67
67
|
"operationsCount": 17,
|
|
68
68
|
"pendingOperations": [],
|
|
69
69
|
"seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
|
|
70
|
-
"spendableBalance": "
|
|
70
|
+
"spendableBalance": "10145721",
|
|
71
71
|
"subAccounts": [],
|
|
72
72
|
"swapHistory": [],
|
|
73
|
-
"syncHash": "
|
|
73
|
+
"syncHash": "0x8a6ee88a",
|
|
74
74
|
"used": true,
|
|
75
75
|
"xpub": "GAHQKL7UW5DSNJXWNA4ASJ6D2I7JYFWVHDFWYJZK3WDR4BUTG27K2PWC",
|
|
76
76
|
},
|
|
@@ -88,7 +88,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
88
88
|
"spendableBalance": "0",
|
|
89
89
|
"subAccounts": [],
|
|
90
90
|
"swapHistory": [],
|
|
91
|
-
"syncHash": "
|
|
91
|
+
"syncHash": "0x8a6ee88a",
|
|
92
92
|
"used": true,
|
|
93
93
|
"xpub": "GBQMOU2WYJUP6AKY53FFKZJGQMDWCMTWSOUTZ5DVIAQPVW7AJUHSX2M5",
|
|
94
94
|
},
|
|
@@ -106,7 +106,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
|
|
|
106
106
|
"spendableBalance": "0",
|
|
107
107
|
"subAccounts": [],
|
|
108
108
|
"swapHistory": [],
|
|
109
|
-
"syncHash": "
|
|
109
|
+
"syncHash": "0x8a6ee88a",
|
|
110
110
|
"used": false,
|
|
111
111
|
"xpub": "GAJEKFXY76YWDSKJESDOKS2EGKRMCHSIC5AU32SU7OF54E5VVREUHXLH",
|
|
112
112
|
},
|
|
@@ -6,7 +6,6 @@ import { bridge as casper } from "../../families/casper/setup";
|
|
|
6
6
|
import { bridge as canton } from "../../families/canton/setup";
|
|
7
7
|
import { bridge as celo } from "../../families/celo/setup";
|
|
8
8
|
import { bridge as cosmos } from "../../families/cosmos/setup";
|
|
9
|
-
import { bridge as evm } from "../../families/evm/setup";
|
|
10
9
|
import { bridge as hedera } from "../../families/hedera/setup";
|
|
11
10
|
import { bridge as filecoin } from "../../families/filecoin/setup";
|
|
12
11
|
import { bridge as internet_computer } from "../../families/internet_computer/setup";
|
|
@@ -32,7 +31,6 @@ export default {
|
|
|
32
31
|
canton,
|
|
33
32
|
celo,
|
|
34
33
|
cosmos,
|
|
35
|
-
evm,
|
|
36
34
|
hedera,
|
|
37
35
|
filecoin,
|
|
38
36
|
internet_computer,
|
package/src/operation.ts
CHANGED
|
@@ -5,8 +5,16 @@ import {
|
|
|
5
5
|
isStuckOperation as isStuckOperationEvm,
|
|
6
6
|
getStuckAccountAndOperation as getStuckAccountAndOperationEvm,
|
|
7
7
|
} from "@ledgerhq/coin-evm/operation";
|
|
8
|
+
import { getCurrencyConfiguration } from "./config";
|
|
9
|
+
import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
10
|
+
import { EvmConfigInfo } from "@ledgerhq/coin-evm/config";
|
|
8
11
|
export * from "@ledgerhq/coin-framework/operation";
|
|
9
12
|
|
|
13
|
+
function hasGasTracker(currency: CryptoCurrency): boolean {
|
|
14
|
+
const config = getCurrencyConfiguration<EvmConfigInfo>(currency);
|
|
15
|
+
return !!config.gasTracker;
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
/**
|
|
11
19
|
* Return weather an operation is editable or not.
|
|
12
20
|
*/
|
|
@@ -18,7 +26,7 @@ export const isEditableOperation = ({
|
|
|
18
26
|
operation: Operation;
|
|
19
27
|
}): boolean => {
|
|
20
28
|
if (account.currency.family === "evm") {
|
|
21
|
-
return isEditableOperationEvm(account, operation);
|
|
29
|
+
return isEditableOperationEvm(account, operation, hasGasTracker);
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
return false;
|
|
@@ -58,7 +66,7 @@ export const getStuckAccountAndOperation = (
|
|
|
58
66
|
const mainAccount = getMainAccount(account, parentAccount);
|
|
59
67
|
|
|
60
68
|
if (mainAccount.currency.family === "evm") {
|
|
61
|
-
return getStuckAccountAndOperationEvm(account, parentAccount);
|
|
69
|
+
return getStuckAccountAndOperationEvm(account, parentAccount, hasGasTracker);
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
return undefined;
|