Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:LedgerHQ/ledger-live-common
Browse files Browse the repository at this point in the history
* 'master' of github.com:LedgerHQ/ledger-live-common:
  Fixes reconciliation + CI
  reconciliation to remove .nfts on disabling
  cli
  v21.19.1
  LL-8436 Update fillDeviceTransactionConfig for NFT (#1553)
  LL-8508 - Fix NFT merging in incremental sync + tests (#1552)
  DOGE v3 is go
  • Loading branch information
valpinkman committed Dec 3, 2021
2 parents eb631f7 + 4e483a3 commit b73e7a5
Show file tree
Hide file tree
Showing 17 changed files with 243 additions and 109 deletions.
8 changes: 4 additions & 4 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ledger-live",
"version": "21.18.0",
"version": "21.19.1",
"description": "ledger-live CLI version",
"repository": {
"type": "git",
Expand Down Expand Up @@ -28,16 +28,16 @@
"@ledgerhq/hw-transport-node-ble": "5.7.0"
},
"dependencies": {
"@ledgerhq/cryptoassets": "6.17.0",
"@ledgerhq/cryptoassets": "6.18.0",
"@ledgerhq/errors": "6.10.0",
"@ledgerhq/hw-app-btc": "6.17.0",
"@ledgerhq/hw-app-btc": "6.17.1",
"@ledgerhq/hw-transport-http": "6.15.0",
"@ledgerhq/hw-transport-mocker": "6.11.2",
"@ledgerhq/hw-transport-node-ble": "^6.15.0",
"@ledgerhq/hw-transport-node-hid": "6.11.2",
"@ledgerhq/hw-transport-node-speculos": "6.11.2",
"@ledgerhq/ledger-core": "6.14.5",
"@ledgerhq/live-common": "^21.18.0",
"@ledgerhq/live-common": "^21.19.1",
"@ledgerhq/logs": "6.10.0",
"@walletconnect/client": "^1.6.6",
"asciichart": "^1.5.25",
Expand Down
71 changes: 22 additions & 49 deletions cli/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,10 @@
dependencies:
commander "^2.20.0"

"@ledgerhq/cryptoassets@6.17.0", "@ledgerhq/cryptoassets@^6.17.0":
version "6.17.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.17.0.tgz#cc3963b0ed726efcba976b78185d7f72ea9bedbc"
integrity sha512-xvXmS0fCLBOr54/lBF4w4pfWVhmbEcf/Wf45k0Carx4vtSUzMChd/KyAvIuLODNeIBj9lXOK2OqXB0u8wc8p5A==
"@ledgerhq/cryptoassets@6.18.0", "@ledgerhq/cryptoassets@^6.18.0":
version "6.18.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-6.18.0.tgz#8cf1b581fe17f3018f60abeedee6b97d809dee72"
integrity sha512-OGJlWFMWp26y/ZgUQVFwyPGd9BHVvmdxO8eA7mNg5mLQgcO5KQVchXbkCTqf6P3beFJ9eapBO35f+ngbveuUaw==
dependencies:
invariant "2"

Expand Down Expand Up @@ -739,10 +739,10 @@
js-sha512 "^0.8.0"
tweetnacl "^1.0.3"

"@ledgerhq/[email protected].0":
version "6.17.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.17.0.tgz#c08090dcd0ad78eb7a2a288735c3bcf8e914a423"
integrity sha512-3aFFL1oqn8wd4xccRlBpdDkmNo0K64wr1jg5leGhES5utRLflhTiJhBL3RlHPn4RD3EoFH9X9TuFzrIpJQlHeg==
"@ledgerhq/[email protected].1":
version "6.17.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-6.17.1.tgz#4b54cf18c7e88b8baee7dd0fab5a191472f5760d"
integrity sha512-xyfYnKr6b+0DoQ6veiXJIBLGhz2YwDVs3bEMBY2EoZA9CbsvyQbnVxETFHNCRsRp/LWZJyr4Atvj0bT0wZCWQQ==
dependencies:
"@ledgerhq/hw-transport" "^6.11.2"
"@ledgerhq/logs" "^6.10.0"
Expand All @@ -765,12 +765,12 @@
"@ledgerhq/hw-transport" "^6.11.2"
bip32-path "^0.4.2"

"@ledgerhq/hw-app-eth@6.17.0":
version "6.17.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.17.0.tgz#9f2f7ee18b0fe553277a08d007a8271ec94014ff"
integrity sha512-msZD5mU/Ck/2ODKCNPSyMDq3v8FBOI3R3QasDDm7WNfH5H8UVB+mobjExPjmlke+t1GsM864V2EU2/YiLGM/lg==
"@ledgerhq/hw-app-eth@6.18.0":
version "6.18.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.18.0.tgz#9af0c4d90a5e4805fdb0cd98c26d14f823cc2fda"
integrity sha512-QQGd0uIeY7LDDsg1AoaobdvlSs7ymG0BqxPqEgOH/YnOlixC/BsK4P5BQJSWWP5wJX3qYBwQ04f1AMzzM2FnmA==
dependencies:
"@ledgerhq/cryptoassets" "^6.17.0"
"@ledgerhq/cryptoassets" "^6.18.0"
"@ledgerhq/errors" "^6.10.0"
"@ledgerhq/hw-transport" "^6.11.2"
"@ledgerhq/logs" "^6.10.0"
Expand Down Expand Up @@ -934,20 +934,20 @@
bignumber.js "^9.0.1"
json-rpc-2.0 "^0.2.16"

"@ledgerhq/live-common@^21.18.0":
version "21.18.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-21.18.0.tgz#54d2b147cf1b2e5e31a4196418ccf5e9db4726a4"
integrity sha512-Jv0wnyUK6gLyThyQhpiKzohSiAIcrnFLOt0NMkMN2S2dsSU6+pb8Rl/GFM/odTfJ/0giK7Lw4AAlQEEwr3Thrg==
"@ledgerhq/live-common@^21.19.1":
version "21.19.1"
resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-21.19.1.tgz#a4b1fd5068b5e79735e91a5d29d44e3e6d673bf5"
integrity sha512-k5YjJUO+LorxkVffF0xsklhuxxoqXNwvVdvajwComMyP6wT73Tq1r6brPm8NFH9d6xS6qDDjknOyypnj3PhVow==
dependencies:
"@crypto-com/chain-jslib" "0.0.19"
"@ledgerhq/compressjs" "1.3.2"
"@ledgerhq/cryptoassets" "6.17.0"
"@ledgerhq/cryptoassets" "6.18.0"
"@ledgerhq/devices" "6.11.2"
"@ledgerhq/errors" "6.10.0"
"@ledgerhq/hw-app-algorand" "6.11.2"
"@ledgerhq/hw-app-btc" "6.17.0"
"@ledgerhq/hw-app-btc" "6.17.1"
"@ledgerhq/hw-app-cosmos" "6.11.2"
"@ledgerhq/hw-app-eth" "6.17.0"
"@ledgerhq/hw-app-eth" "6.18.0"
"@ledgerhq/hw-app-polkadot" "6.11.2"
"@ledgerhq/hw-app-str" "6.11.2"
"@ledgerhq/hw-app-tezos" "6.11.2"
Expand Down Expand Up @@ -1955,13 +1955,6 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=

[email protected]:
version "3.0.7"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.7.tgz#1c5a7fafe8f66b4114063e8da102799d4e7c408f"
integrity sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==
dependencies:
safe-buffer "^5.0.1"

[email protected], base-x@^3.0.2:
version "3.0.9"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320"
Expand Down Expand Up @@ -4567,35 +4560,15 @@ ripemd160@2, ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2:
hash-base "^3.0.0"
inherits "^2.0.1"

ripple-address-codec@^4.0.0, ripple-address-codec@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.1.1.tgz#48e5d76b00b6b9752b1d376646d5abbcd3c8bd67"
integrity sha512-mcVD8f7+CH6XaBnLkRcmw4KyHMufa0HTJE3TYeaecwleIQASLYVenjQmVJLgmJQcDUS2Ldh/EltqktmiFMFgkg==
dependencies:
base-x "3.0.7"
create-hash "^1.1.2"

ripple-address-codec@^4.2.0:
ripple-address-codec@^4.0.0, ripple-address-codec@^4.1.1, ripple-address-codec@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.2.0.tgz#dc3291394ff22f46d8aeac6ef30d51be1416d7c9"
integrity sha512-9QhBNDiWjwj7l+WQ7H7klXF/VwxVj2Q0HRhd4vLCueTPoxUtaNQyfvUZFiXJrqxg0heM3/iWxupkq4TwrXgSuQ==
dependencies:
base-x "3.0.9"
create-hash "^1.1.2"

ripple-binary-codec@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.1.3.tgz#9dc6cd139fd587ec6fc2ffe72fc1f0ced53ca906"
integrity sha512-NnFNZZ+225BxdDdHtcEn4GiGzup+V0DGAbtKygZIwbqA5116oZBt6uY3g43gYpdDMISsEbM7NewBij8+7jdlvA==
dependencies:
assert "^2.0.0"
big-integer "^1.6.48"
buffer "5.6.0"
create-hash "^1.2.0"
decimal.js "^10.2.0"
ripple-address-codec "^4.1.1"

ripple-binary-codec@^1.2.0:
ripple-binary-codec@^1.1.3, ripple-binary-codec@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.2.0.tgz#4058281c045fd6f9f8eb8be9402bbaf2d56aad8b"
integrity sha512-XMRCbFXyG+dGp3x7tMs9IwA+FVWPPaGjdHYW2+g4Q/WQJqFp5MRED+jjOBOUafmrW4TUsOn1PEEdbB4ozWbDBw==
Expand Down
2 changes: 1 addition & 1 deletion explorers-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| Dash | DASH | https://explorers.api.live.ledger.com/blockchain/v3/dash | N/A |
| Decred | DCR | https://explorers.api.live.ledger.com/blockchain/v3/dcr | N/A |
| DigiByte | DGB | https://explorers.api.live.ledger.com/blockchain/v3/dgb | N/A |
| Dogecoin | DOGE | https://explorers.api.live.ledger.com/blockchain/v2/doge | https://explorers.api.live.ledger.com/blockchain/v3/doge |
| Dogecoin | DOGE | https://explorers.api.live.ledger.com/blockchain/v3/doge | N/A |
| Ethereum | ETH | https://explorers.api.live.ledger.com/blockchain/v3/eth | N/A |
| Ethereum Classic | ETC | https://explorers.api.live.ledger.com/blockchain/v3/etc | N/A |
| Komodo | KMD | https://explorers.api.live.ledger.com/blockchain/v3/kmd | N/A |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/LedgerHQ/ledger-live-common"
},
"version": "21.19.0",
"version": "21.19.1",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"license": "Apache-2.0",
Expand Down
20 changes: 10 additions & 10 deletions src/__tests__/__snapshots__/all.libcore.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15177,7 +15177,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -15218,7 +15218,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -15698,7 +15698,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -16033,7 +16033,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -16130,7 +16130,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -16255,7 +16255,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -16352,7 +16352,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_6026",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_6026",
"unitMagnitude": 18,
"used": true,
},
Expand Down Expand Up @@ -48285,7 +48285,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_0",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_0",
"unitMagnitude": 18,
"used": true,
},
Expand All @@ -48312,7 +48312,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_0",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_0",
"unitMagnitude": 18,
"used": true,
},
Expand All @@ -48339,7 +48339,7 @@ Array [
"starred": false,
"subAccounts": Array [],
"swapHistory": Array [],
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_0",
"syncHash": "[\\"ethereum/erc20/ampleforth\\",\\"ethereum/erc20/steth\\"]_false_0",
"unitMagnitude": 18,
"used": true,
},
Expand Down
4 changes: 0 additions & 4 deletions src/api/explorerConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ const initialExplorerConfig: FullConfig = {
dogecoin: {
id: "doge",
stable: {
base: "EXPLORER",
version: "v2",
},
experimental: {
base: "EXPLORER",
version: "v3",
},
Expand Down
13 changes: 7 additions & 6 deletions src/bridge/jsHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ export const mergeNfts = (
const nfts = oldNfts?.slice() ?? [];
for (let i = 0; i < nfts.length; i++) {
const nft = nfts[i];

// The NFTs are the same, do don't anything
if (!newNftsPerId[nft.id] || isEqual(nft, newNftsPerId[nft.id])) {
// NFT already in, deleting it from the newNfts to keep only the un-added ones at the end
delete newNftsPerId[nft.id];
continue;
if (!newNftsPerId[nft.id]) {
nfts.splice(i, 1);
i--;
} else if (!isEqual(nft, newNftsPerId[nft.id])) {
// Use the new NFT instead (as a copy cause we're deleting the reference just after)
nfts[i] = Object.assign({}, newNftsPerId[nft.id]);
}

// Use the new NFT instead (as a copy cause we're deleting the reference just after)
nfts[i] = Object.assign({}, newNftsPerId[nft.id]);
// Delete it from the newNfts to keep only the un-added ones at the end
delete newNftsPerId[nft.id];
}
Expand Down
9 changes: 8 additions & 1 deletion src/families/ethereum/bridge/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ import {
estimateGasLimit,
} from "../transaction";
import { getAccountShape } from "../synchronisation";
import { preload, hydrate } from "../modules";
import {
preload,
hydrate,
prepareTransaction as prepareTransactionModules,
} from "../modules";
import { signOperation } from "../signOperation";
import { modes } from "../modules";
import postSyncPatch from "../postSyncPatch";
import { inferDynamicRange } from "../../../range";

const receive = makeAccountBridgeReceive();

const broadcast = async ({
Expand Down Expand Up @@ -173,6 +178,8 @@ const prepareTransaction = async (a, t: Transaction): Promise<Transaction> => {
t.estimatedGasLimit = estimatedGasLimit;
}

t = await prepareTransactionModules(a, t);

return t;
};

Expand Down
29 changes: 22 additions & 7 deletions src/families/ethereum/modules/erc1155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { validateRecipient } from "../transaction";
import type { ModeModule, Transaction } from "../types";
import type { Account } from "../../../types";
import { prepareTransaction } from "./erc721";

const notOwnedNft = createCustomErrorClass("NotOwnedNft");
const notEnoughNftOwned = createCustomErrorClass("NotEnoughNftOwned");
Expand Down Expand Up @@ -75,25 +76,37 @@ const erc1155Transfer: ModeModule = {
fields.push({
type: "text",
label: "Type",
value: `ERC721.transfer`,
value: `NFT Transfer`,
});

fields.push({
type: "text",
label: "Collection",
value: input.transaction.collection ?? "",
label: "To",
value: input.transaction.recipient ?? "",
});

fields.push({
type: "text",
label: "Token IDs",
value: input.transaction.tokenIds?.join(",") ?? "",
label: "Collection Name",
value: input.transaction.collectionName || "",
});

fields.push({
type: "text",
label: "Quantities",
value: input.transaction.quantities?.join(",") ?? "",
label: "Quantity",
value: input.transaction.quantities?.[0]?.toFixed() ?? "",
});

fields.push({
type: "address",
label: "NFT Address",
address: input.transaction.collection ?? "",
});

fields.push({
type: "text",
label: "NFT ID",
value: input.transaction.tokenIds?.[0] ?? "",
});
},

Expand All @@ -107,6 +120,8 @@ const erc1155Transfer: ModeModule = {
approving: true, // workaround to track the status ENABLING
};
},

prepareTransaction,
};

function serializeTransactionData(
Expand Down
Loading

0 comments on commit b73e7a5

Please sign in to comment.