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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hzheng-ledger committed Nov 26, 2021
2 parents 3a84a11 + d19fe2c commit 4b36216
Show file tree
Hide file tree
Showing 25 changed files with 884 additions and 1,772 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/bot1.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/mere-denis-on-bitcoin-js.yml

This file was deleted.

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.16.1",
"version": "21.18.0",
"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.14.0",
"@ledgerhq/cryptoassets": "6.17.0",
"@ledgerhq/errors": "6.10.0",
"@ledgerhq/hw-app-btc": "6.15.0",
"@ledgerhq/hw-app-btc": "6.17.0",
"@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.16.1",
"@ledgerhq/live-common": "^21.18.0",
"@ledgerhq/logs": "6.10.0",
"@walletconnect/client": "^1.6.6",
"asciichart": "^1.5.25",
Expand Down
28 changes: 28 additions & 0 deletions cli/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export type InferTransactionsOpts = Partial<{
amount: string;
shuffle: boolean;
"fees-strategy": string;
collection: string;
tokenIds: string;
quantities: string;
}>;
export const inferTransactionsOpts = uniqBy(
[
Expand Down Expand Up @@ -74,6 +77,21 @@ export const inferTransactionsOpts = uniqBy(
type: Boolean,
desc: "if using multiple token or recipient, order will be randomized",
},
{
name: "collection",
type: String,
desc: "collection of an NFT (in corelation with --tokenIds)",
},
{
name: "tokenIds",
type: String,
desc: "tokenId or list of tokenIds of an NFT separated by commas (order is kept in corelation with --quantities)",
},
{
name: "quantities",
type: String,
desc: "quantity or list of quantity of an ERC1155 NFT separated by commas (order is kept in corelation with --tokenIds)",
},
].concat(
flatMap(Object.values(perFamily), (m: any) => (m && m.options) || [])
),
Expand Down Expand Up @@ -106,6 +124,16 @@ export async function inferTransactions(
transaction.amount = transaction.useAllAmount
? new BigNumber(0)
: inferAmount(account, opts.amount || "0");

// NFT collection and tokenId go by pair
if (opts.tokenIds && opts.collection) {
transaction.tokenIds = opts.tokenIds.split(",");
transaction.collection = opts.collection;
transaction.quantities = opts.quantities
?.split(",")
?.map((q) => new BigNumber(q));
}

return {
account,
transaction,
Expand Down
Loading

0 comments on commit 4b36216

Please sign in to comment.