@ledgerhq/vault-cli 1.73.2 → 2.0.0
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/.turbo/turbo-build.log +16 -2
- package/CHANGELOG.md +64 -0
- package/__mocks__/@ledgerhq/vault-common.ts +1 -0
- package/bin/index.js +5615 -15
- package/bin/index.js.map +1 -1
- package/bin/index.mjs +5621 -0
- package/bin/index.mjs.map +1 -0
- package/package.json +6 -7
- package/tsup.config.ts +10 -0
- package/bin/__patchGateOptionsWithEnvVariables.d.ts +0 -4
- package/bin/__patchGateOptionsWithEnvVariables.d.ts.map +0 -1
- package/bin/__patchGateOptionsWithEnvVariables.js +0 -38
- package/bin/__patchGateOptionsWithEnvVariables.js.map +0 -1
- package/bin/__tests__/apdu.test.d.ts +0 -2
- package/bin/__tests__/apdu.test.d.ts.map +0 -1
- package/bin/__tests__/apdu.test.js +0 -33
- package/bin/__tests__/apdu.test.js.map +0 -1
- package/bin/__tests__/approve.test.d.ts +0 -2
- package/bin/__tests__/approve.test.d.ts.map +0 -1
- package/bin/__tests__/approve.test.js +0 -159
- package/bin/__tests__/approve.test.js.map +0 -1
- package/bin/__tests__/backupCompartment.test.d.ts +0 -2
- package/bin/__tests__/backupCompartment.test.d.ts.map +0 -1
- package/bin/__tests__/backupCompartment.test.js +0 -88
- package/bin/__tests__/backupCompartment.test.js.map +0 -1
- package/bin/__tests__/bake.test.d.ts +0 -2
- package/bin/__tests__/bake.test.d.ts.map +0 -1
- package/bin/__tests__/bake.test.js +0 -175
- package/bin/__tests__/bake.test.js.map +0 -1
- package/bin/__tests__/cli.test.d.ts +0 -2
- package/bin/__tests__/cli.test.d.ts.map +0 -1
- package/bin/__tests__/cli.test.js +0 -222
- package/bin/__tests__/cli.test.js.map +0 -1
- package/bin/__tests__/configcat.test.d.ts +0 -2
- package/bin/__tests__/configcat.test.d.ts.map +0 -1
- package/bin/__tests__/configcat.test.js +0 -100
- package/bin/__tests__/configcat.test.js.map +0 -1
- package/bin/__tests__/create.test.d.ts +0 -2
- package/bin/__tests__/create.test.d.ts.map +0 -1
- package/bin/__tests__/create.test.js +0 -264
- package/bin/__tests__/create.test.js.map +0 -1
- package/bin/__tests__/deploy.test.d.ts +0 -2
- package/bin/__tests__/deploy.test.d.ts.map +0 -1
- package/bin/__tests__/deploy.test.js +0 -95
- package/bin/__tests__/deploy.test.js.map +0 -1
- package/bin/__tests__/destroy.test.d.ts +0 -2
- package/bin/__tests__/destroy.test.d.ts.map +0 -1
- package/bin/__tests__/destroy.test.js +0 -44
- package/bin/__tests__/destroy.test.js.map +0 -1
- package/bin/__tests__/drain.test.d.ts +0 -2
- package/bin/__tests__/drain.test.d.ts.map +0 -1
- package/bin/__tests__/drain.test.js +0 -35
- package/bin/__tests__/drain.test.js.map +0 -1
- package/bin/__tests__/faucet.test.d.ts +0 -2
- package/bin/__tests__/faucet.test.d.ts.map +0 -1
- package/bin/__tests__/faucet.test.js +0 -31
- package/bin/__tests__/faucet.test.js.map +0 -1
- package/bin/__tests__/fetch.test.d.ts +0 -2
- package/bin/__tests__/fetch.test.d.ts.map +0 -1
- package/bin/__tests__/fetch.test.js +0 -54
- package/bin/__tests__/fetch.test.js.map +0 -1
- package/bin/__tests__/genKeys.test.d.ts +0 -2
- package/bin/__tests__/genKeys.test.d.ts.map +0 -1
- package/bin/__tests__/genKeys.test.js +0 -17
- package/bin/__tests__/genKeys.test.js.map +0 -1
- package/bin/__tests__/get.test.d.ts +0 -2
- package/bin/__tests__/get.test.d.ts.map +0 -1
- package/bin/__tests__/get.test.js +0 -133
- package/bin/__tests__/get.test.js.map +0 -1
- package/bin/__tests__/getAPIUserTokens.test.d.ts +0 -2
- package/bin/__tests__/getAPIUserTokens.test.d.ts.map +0 -1
- package/bin/__tests__/getAPIUserTokens.test.js +0 -69
- package/bin/__tests__/getAPIUserTokens.test.js.map +0 -1
- package/bin/__tests__/getAuthToken.test.d.ts +0 -2
- package/bin/__tests__/getAuthToken.test.d.ts.map +0 -1
- package/bin/__tests__/getAuthToken.test.js +0 -31
- package/bin/__tests__/getAuthToken.test.js.map +0 -1
- package/bin/__tests__/getCertFromPFX.test.d.ts +0 -2
- package/bin/__tests__/getCertFromPFX.test.d.ts.map +0 -1
- package/bin/__tests__/getCertFromPFX.test.js +0 -54
- package/bin/__tests__/getCertFromPFX.test.js.map +0 -1
- package/bin/__tests__/getMVInstances.test.d.ts +0 -2
- package/bin/__tests__/getMVInstances.test.d.ts.map +0 -1
- package/bin/__tests__/getMVInstances.test.js +0 -72
- package/bin/__tests__/getMVInstances.test.js.map +0 -1
- package/bin/__tests__/getSeeds.test.d.ts +0 -2
- package/bin/__tests__/getSeeds.test.d.ts.map +0 -1
- package/bin/__tests__/getSeeds.test.js +0 -20
- package/bin/__tests__/getSeeds.test.js.map +0 -1
- package/bin/__tests__/getUserID.test.d.ts +0 -2
- package/bin/__tests__/getUserID.test.d.ts.map +0 -1
- package/bin/__tests__/getUserID.test.js +0 -31
- package/bin/__tests__/getUserID.test.js.map +0 -1
- package/bin/__tests__/initCompartment.test.d.ts +0 -2
- package/bin/__tests__/initCompartment.test.d.ts.map +0 -1
- package/bin/__tests__/initCompartment.test.js +0 -86
- package/bin/__tests__/initCompartment.test.js.map +0 -1
- package/bin/__tests__/onboard.test.d.ts +0 -2
- package/bin/__tests__/onboard.test.d.ts.map +0 -1
- package/bin/__tests__/onboard.test.js +0 -63
- package/bin/__tests__/onboard.test.js.map +0 -1
- package/bin/__tests__/pathGateOptionsWithEnvVariables.test.d.ts +0 -2
- package/bin/__tests__/pathGateOptionsWithEnvVariables.test.d.ts.map +0 -1
- package/bin/__tests__/pathGateOptionsWithEnvVariables.test.js +0 -34
- package/bin/__tests__/pathGateOptionsWithEnvVariables.test.js.map +0 -1
- package/bin/__tests__/pledge.test.d.ts +0 -2
- package/bin/__tests__/pledge.test.d.ts.map +0 -1
- package/bin/__tests__/pledge.test.js +0 -110
- package/bin/__tests__/pledge.test.js.map +0 -1
- package/bin/__tests__/proxy.test.d.ts +0 -2
- package/bin/__tests__/proxy.test.d.ts.map +0 -1
- package/bin/__tests__/proxy.test.js +0 -22
- package/bin/__tests__/proxy.test.js.map +0 -1
- package/bin/__tests__/receive.test.d.ts +0 -2
- package/bin/__tests__/receive.test.d.ts.map +0 -1
- package/bin/__tests__/receive.test.js +0 -85
- package/bin/__tests__/receive.test.js.map +0 -1
- package/bin/__tests__/recipe.test.d.ts +0 -2
- package/bin/__tests__/recipe.test.d.ts.map +0 -1
- package/bin/__tests__/recipe.test.js +0 -41
- package/bin/__tests__/recipe.test.js.map +0 -1
- package/bin/__tests__/reject.test.d.ts +0 -2
- package/bin/__tests__/reject.test.d.ts.map +0 -1
- package/bin/__tests__/reject.test.js +0 -214
- package/bin/__tests__/reject.test.js.map +0 -1
- package/bin/__tests__/resetCompartment.test.d.ts +0 -2
- package/bin/__tests__/resetCompartment.test.d.ts.map +0 -1
- package/bin/__tests__/resetCompartment.test.js +0 -88
- package/bin/__tests__/resetCompartment.test.js.map +0 -1
- package/bin/__tests__/restoreCompartment.test.d.ts +0 -2
- package/bin/__tests__/restoreCompartment.test.d.ts.map +0 -1
- package/bin/__tests__/restoreCompartment.test.js +0 -95
- package/bin/__tests__/restoreCompartment.test.js.map +0 -1
- package/bin/__tests__/revoke.test.d.ts +0 -2
- package/bin/__tests__/revoke.test.d.ts.map +0 -1
- package/bin/__tests__/revoke.test.js +0 -62
- package/bin/__tests__/revoke.test.js.map +0 -1
- package/bin/__tests__/send.test.d.ts +0 -2
- package/bin/__tests__/send.test.d.ts.map +0 -1
- package/bin/__tests__/send.test.js +0 -216
- package/bin/__tests__/send.test.js.map +0 -1
- package/bin/__tests__/setQuorum.test.d.ts +0 -2
- package/bin/__tests__/setQuorum.test.d.ts.map +0 -1
- package/bin/__tests__/setQuorum.test.js +0 -32
- package/bin/__tests__/setQuorum.test.js.map +0 -1
- package/bin/__tests__/settle.test.d.ts +0 -2
- package/bin/__tests__/settle.test.d.ts.map +0 -1
- package/bin/__tests__/settle.test.js +0 -123
- package/bin/__tests__/settle.test.js.map +0 -1
- package/bin/__tests__/test-utils.d.ts +0 -19
- package/bin/__tests__/test-utils.d.ts.map +0 -1
- package/bin/__tests__/test-utils.js +0 -39
- package/bin/__tests__/test-utils.js.map +0 -1
- package/bin/__tests__/upgrade.test.d.ts +0 -2
- package/bin/__tests__/upgrade.test.d.ts.map +0 -1
- package/bin/__tests__/upgrade.test.js +0 -57
- package/bin/__tests__/upgrade.test.js.map +0 -1
- package/bin/__tests__/utils.test.d.ts +0 -2
- package/bin/__tests__/utils.test.d.ts.map +0 -1
- package/bin/__tests__/utils.test.js +0 -40
- package/bin/__tests__/utils.test.js.map +0 -1
- package/bin/__tests__/wipe.test.d.ts +0 -2
- package/bin/__tests__/wipe.test.d.ts.map +0 -1
- package/bin/__tests__/wipe.test.js +0 -92
- package/bin/__tests__/wipe.test.js.map +0 -1
- package/bin/cli.d.ts +0 -4
- package/bin/cli.d.ts.map +0 -1
- package/bin/cli.js +0 -152
- package/bin/cli.js.map +0 -1
- package/bin/cliOptions.d.ts +0 -8
- package/bin/cliOptions.d.ts.map +0 -1
- package/bin/cliOptions.js +0 -11
- package/bin/cliOptions.js.map +0 -1
- package/bin/commands/apdu.d.ts +0 -14
- package/bin/commands/apdu.d.ts.map +0 -1
- package/bin/commands/apdu.js +0 -35
- package/bin/commands/apdu.js.map +0 -1
- package/bin/commands/approve.d.ts +0 -34
- package/bin/commands/approve.d.ts.map +0 -1
- package/bin/commands/approve.js +0 -150
- package/bin/commands/approve.js.map +0 -1
- package/bin/commands/backupCompartment.d.ts +0 -31
- package/bin/commands/backupCompartment.d.ts.map +0 -1
- package/bin/commands/backupCompartment.js +0 -70
- package/bin/commands/backupCompartment.js.map +0 -1
- package/bin/commands/bake.d.ts +0 -73
- package/bin/commands/bake.d.ts.map +0 -1
- package/bin/commands/bake.js +0 -232
- package/bin/commands/bake.js.map +0 -1
- package/bin/commands/bridge.d.ts +0 -22
- package/bin/commands/bridge.d.ts.map +0 -1
- package/bin/commands/bridge.js +0 -137
- package/bin/commands/bridge.js.map +0 -1
- package/bin/commands/configcat.d.ts +0 -78
- package/bin/commands/configcat.d.ts.map +0 -1
- package/bin/commands/configcat.js +0 -208
- package/bin/commands/configcat.js.map +0 -1
- package/bin/commands/create.d.ts +0 -207
- package/bin/commands/create.d.ts.map +0 -1
- package/bin/commands/create.js +0 -554
- package/bin/commands/create.js.map +0 -1
- package/bin/commands/deploy.d.ts +0 -60
- package/bin/commands/deploy.d.ts.map +0 -1
- package/bin/commands/deploy.js +0 -106
- package/bin/commands/deploy.js.map +0 -1
- package/bin/commands/destroy.d.ts +0 -36
- package/bin/commands/destroy.d.ts.map +0 -1
- package/bin/commands/destroy.js +0 -58
- package/bin/commands/destroy.js.map +0 -1
- package/bin/commands/drain.d.ts +0 -26
- package/bin/commands/drain.d.ts.map +0 -1
- package/bin/commands/drain.js +0 -64
- package/bin/commands/drain.js.map +0 -1
- package/bin/commands/faucet.d.ts +0 -31
- package/bin/commands/faucet.d.ts.map +0 -1
- package/bin/commands/faucet.js +0 -68
- package/bin/commands/faucet.js.map +0 -1
- package/bin/commands/fetch.d.ts +0 -35
- package/bin/commands/fetch.d.ts.map +0 -1
- package/bin/commands/fetch.js +0 -83
- package/bin/commands/fetch.js.map +0 -1
- package/bin/commands/genKeys.d.ts +0 -14
- package/bin/commands/genKeys.d.ts.map +0 -1
- package/bin/commands/genKeys.js +0 -19
- package/bin/commands/genKeys.js.map +0 -1
- package/bin/commands/get.d.ts +0 -56
- package/bin/commands/get.d.ts.map +0 -1
- package/bin/commands/get.js +0 -211
- package/bin/commands/get.js.map +0 -1
- package/bin/commands/getAPIUserTokens.d.ts +0 -39
- package/bin/commands/getAPIUserTokens.d.ts.map +0 -1
- package/bin/commands/getAPIUserTokens.js +0 -63
- package/bin/commands/getAPIUserTokens.js.map +0 -1
- package/bin/commands/getAuthToken.d.ts +0 -26
- package/bin/commands/getAuthToken.d.ts.map +0 -1
- package/bin/commands/getAuthToken.js +0 -42
- package/bin/commands/getAuthToken.js.map +0 -1
- package/bin/commands/getMVInstances.d.ts +0 -33
- package/bin/commands/getMVInstances.d.ts.map +0 -1
- package/bin/commands/getMVInstances.js +0 -71
- package/bin/commands/getMVInstances.js.map +0 -1
- package/bin/commands/getSeeds.d.ts +0 -19
- package/bin/commands/getSeeds.d.ts.map +0 -1
- package/bin/commands/getSeeds.js +0 -95
- package/bin/commands/getSeeds.js.map +0 -1
- package/bin/commands/getUserID.d.ts +0 -27
- package/bin/commands/getUserID.d.ts.map +0 -1
- package/bin/commands/getUserID.js +0 -32
- package/bin/commands/getUserID.js.map +0 -1
- package/bin/commands/index.d.ts +0 -892
- package/bin/commands/index.d.ts.map +0 -1
- package/bin/commands/index.js +0 -111
- package/bin/commands/index.js.map +0 -1
- package/bin/commands/initCompartment.d.ts +0 -22
- package/bin/commands/initCompartment.d.ts.map +0 -1
- package/bin/commands/initCompartment.js +0 -62
- package/bin/commands/initCompartment.js.map +0 -1
- package/bin/commands/listen.d.ts +0 -31
- package/bin/commands/listen.d.ts.map +0 -1
- package/bin/commands/listen.js +0 -56
- package/bin/commands/listen.js.map +0 -1
- package/bin/commands/onboard.d.ts +0 -30
- package/bin/commands/onboard.d.ts.map +0 -1
- package/bin/commands/onboard.js +0 -68
- package/bin/commands/onboard.js.map +0 -1
- package/bin/commands/pledge.d.ts +0 -38
- package/bin/commands/pledge.d.ts.map +0 -1
- package/bin/commands/pledge.js +0 -89
- package/bin/commands/pledge.js.map +0 -1
- package/bin/commands/proxy.d.ts +0 -17
- package/bin/commands/proxy.d.ts.map +0 -1
- package/bin/commands/proxy.js +0 -227
- package/bin/commands/proxy.js.map +0 -1
- package/bin/commands/receive.d.ts +0 -40
- package/bin/commands/receive.d.ts.map +0 -1
- package/bin/commands/receive.js +0 -60
- package/bin/commands/receive.js.map +0 -1
- package/bin/commands/recipe.d.ts +0 -29
- package/bin/commands/recipe.d.ts.map +0 -1
- package/bin/commands/recipe.js +0 -62
- package/bin/commands/recipe.js.map +0 -1
- package/bin/commands/reject.d.ts +0 -49
- package/bin/commands/reject.d.ts.map +0 -1
- package/bin/commands/reject.js +0 -176
- package/bin/commands/reject.js.map +0 -1
- package/bin/commands/resetCompartment.d.ts +0 -31
- package/bin/commands/resetCompartment.d.ts.map +0 -1
- package/bin/commands/resetCompartment.js +0 -71
- package/bin/commands/resetCompartment.js.map +0 -1
- package/bin/commands/restoreCompartment.d.ts +0 -39
- package/bin/commands/restoreCompartment.d.ts.map +0 -1
- package/bin/commands/restoreCompartment.js +0 -80
- package/bin/commands/restoreCompartment.js.map +0 -1
- package/bin/commands/revoke.d.ts +0 -40
- package/bin/commands/revoke.d.ts.map +0 -1
- package/bin/commands/revoke.js +0 -80
- package/bin/commands/revoke.js.map +0 -1
- package/bin/commands/send.d.ts +0 -54
- package/bin/commands/send.d.ts.map +0 -1
- package/bin/commands/send.js +0 -170
- package/bin/commands/send.js.map +0 -1
- package/bin/commands/setQuorum.d.ts +0 -30
- package/bin/commands/setQuorum.d.ts.map +0 -1
- package/bin/commands/setQuorum.js +0 -44
- package/bin/commands/setQuorum.js.map +0 -1
- package/bin/commands/settle.d.ts +0 -43
- package/bin/commands/settle.d.ts.map +0 -1
- package/bin/commands/settle.js +0 -92
- package/bin/commands/settle.js.map +0 -1
- package/bin/commands/upgrade.d.ts +0 -44
- package/bin/commands/upgrade.d.ts.map +0 -1
- package/bin/commands/upgrade.js +0 -68
- package/bin/commands/upgrade.js.map +0 -1
- package/bin/commands/wipe.d.ts +0 -77
- package/bin/commands/wipe.d.ts.map +0 -1
- package/bin/commands/wipe.js +0 -86
- package/bin/commands/wipe.js.map +0 -1
- package/bin/deviceOption.d.ts +0 -9
- package/bin/deviceOption.d.ts.map +0 -1
- package/bin/deviceOption.js +0 -10
- package/bin/deviceOption.js.map +0 -1
- package/bin/gateOptions.d.ts +0 -39
- package/bin/gateOptions.d.ts.map +0 -1
- package/bin/gateOptions.js +0 -73
- package/bin/gateOptions.js.map +0 -1
- package/bin/getCertFromPFX.d.ts +0 -7
- package/bin/getCertFromPFX.d.ts.map +0 -1
- package/bin/getCertFromPFX.js +0 -43
- package/bin/getCertFromPFX.js.map +0 -1
- package/bin/index.d.ts +0 -3
- package/bin/index.d.ts.map +0 -1
- package/bin/lamOptions.d.ts +0 -15
- package/bin/lamOptions.d.ts.map +0 -1
- package/bin/lamOptions.js +0 -17
- package/bin/lamOptions.js.map +0 -1
- package/bin/logger.d.ts +0 -3
- package/bin/logger.d.ts.map +0 -1
- package/bin/logger.js +0 -5
- package/bin/logger.js.map +0 -1
- package/bin/manifests/beatles.json +0 -46
- package/bin/manifests/empty.json +0 -1
- package/bin/manifests/erc20.json +0 -32
- package/bin/manifests/message-signing.json +0 -36
- package/bin/manifests/mobile.json +0 -43
- package/bin/manifests/polkadot-staking.json +0 -152
- package/bin/manifests/polkadot.json +0 -37
- package/bin/manifests/rawsigning.json +0 -39
- package/bin/manifests/ripple.json +0 -37
- package/bin/manifests/sci.json +0 -146
- package/bin/manifests/solana-dev.json +0 -99
- package/bin/manifests/solana-staking.json +0 -44
- package/bin/manifests/solana.json +0 -30
- package/bin/manifests/stellar.json +0 -37
- package/bin/manifests/tezos.json +0 -51
- package/bin/manifests/tradelink-hsm.json +0 -429
- package/bin/manifests/tradelink.json +0 -361
- package/bin/miscOptions.d.ts +0 -20
- package/bin/miscOptions.d.ts.map +0 -1
- package/bin/miscOptions.js +0 -17
- package/bin/miscOptions.js.map +0 -1
- package/bin/registerTransports.d.ts +0 -2
- package/bin/registerTransports.d.ts.map +0 -1
- package/bin/registerTransports.js +0 -18
- package/bin/registerTransports.js.map +0 -1
- package/bin/types.d.ts +0 -23
- package/bin/types.d.ts.map +0 -1
- package/bin/types.js +0 -3
- package/bin/types.js.map +0 -1
- package/bin/utils.d.ts +0 -22
- package/bin/utils.d.ts.map +0 -1
- package/bin/utils.js +0 -156
- package/bin/utils.js.map +0 -1
package/bin/commands/reject.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.rejectTransactionRequestAPIV2 = exports.rejectTransactionRequest = exports.findApprover = void 0;
|
|
16
|
-
const vault_common_1 = require("@ledgerhq/vault-common");
|
|
17
|
-
const vault_common_2 = require("@ledgerhq/vault-common");
|
|
18
|
-
const cliOptions_1 = __importDefault(require("../cliOptions"));
|
|
19
|
-
const deviceOption_1 = __importDefault(require("../deviceOption"));
|
|
20
|
-
const gateOptions_1 = __importDefault(require("../gateOptions"));
|
|
21
|
-
const lamOptions_1 = __importDefault(require("../lamOptions"));
|
|
22
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
23
|
-
const runReject = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const { all, requestID, apiV2User } = options;
|
|
25
|
-
if (!all && !requestID) {
|
|
26
|
-
console.log("Usage: ledger-vault reject --all");
|
|
27
|
-
console.log("Usage: ledger-vault reject --requestID 1303");
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const pool = (0, vault_common_1.createDevicesPool)(Object.assign(Object.assign({}, options), { deviceAPIURL: options.deviceAPI }));
|
|
31
|
-
const isTransactionRequest = (request) => request.type === "CREATE_TRANSACTION";
|
|
32
|
-
const isMessageSigningRequest = (request) => request.type === "MESSAGE_SIGNING";
|
|
33
|
-
const isPledgeRequest = (request) => request.type === "CREATE_PLEDGE_INCREMENT";
|
|
34
|
-
const admin = yield pool.login(options.device);
|
|
35
|
-
const requestsConnection = yield admin.network("GET", "/requests?meta_status=PENDING&pageSize=-1");
|
|
36
|
-
const requests = requestsConnection.edges.map((elt) => elt.node);
|
|
37
|
-
const hasPendingTransactions = requests.some(isTransactionRequest);
|
|
38
|
-
let usersWithDevice = [];
|
|
39
|
-
if (hasPendingTransactions) {
|
|
40
|
-
const manifestFromGate = yield (0, vault_common_1.recipeManifest)(pool);
|
|
41
|
-
usersWithDevice = manifestFromGate.rawData.usersWithDevice;
|
|
42
|
-
}
|
|
43
|
-
if (all) {
|
|
44
|
-
if (requests.length === 0)
|
|
45
|
-
return;
|
|
46
|
-
logger_1.default.info("Rejecting all pending requests");
|
|
47
|
-
const pool = (0, vault_common_1.createDevicesPool)(Object.assign(Object.assign({}, options), { deviceAPIURL: options.deviceAPI }));
|
|
48
|
-
for (const request of requests) {
|
|
49
|
-
if ((isTransactionRequest(request) ||
|
|
50
|
-
isPledgeRequest(request) ||
|
|
51
|
-
isMessageSigningRequest(request)) &&
|
|
52
|
-
request.created_by) {
|
|
53
|
-
const approver = (0, exports.findApprover)(request);
|
|
54
|
-
if (!approver) {
|
|
55
|
-
throw new Error(`No approver found for request ${request.id}`);
|
|
56
|
-
}
|
|
57
|
-
if (approver.device_type === "API") {
|
|
58
|
-
yield (0, exports.rejectTransactionRequestAPIV2)({
|
|
59
|
-
pool,
|
|
60
|
-
gate: options.gate,
|
|
61
|
-
apiGateway: options.apiGateway,
|
|
62
|
-
requestID: request.id,
|
|
63
|
-
apiV2UserName: approver.username,
|
|
64
|
-
skipDecodeChallenge: isMessageSigningRequest(request),
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
yield (0, exports.rejectTransactionRequest)({ pool, request, usersWithDevice, approver });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
yield admin.rejectRequest(request.id);
|
|
73
|
-
}
|
|
74
|
-
logger_1.default.success(`Rejected request ${request.id}: ${request.type}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else if (requestID) {
|
|
78
|
-
const request = requests.find((request) => request.id === requestID);
|
|
79
|
-
if (!request)
|
|
80
|
-
throw new Error(`Couldn't find request ${requestID}`);
|
|
81
|
-
if (apiV2User) {
|
|
82
|
-
yield (0, exports.rejectTransactionRequestAPIV2)({
|
|
83
|
-
pool,
|
|
84
|
-
gate: options.gate,
|
|
85
|
-
apiGateway: options.apiGateway,
|
|
86
|
-
requestID,
|
|
87
|
-
apiV2UserName: apiV2User,
|
|
88
|
-
skipDecodeChallenge: isMessageSigningRequest(request),
|
|
89
|
-
});
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (isTransactionRequest(request) && request.created_by) {
|
|
93
|
-
yield (0, exports.rejectTransactionRequest)({ pool, request, usersWithDevice });
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
yield admin.rejectRequest(request.id);
|
|
97
|
-
}
|
|
98
|
-
logger_1.default.success(`Rejected request ${request.id}: ${request.type}`);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
exports.default = {
|
|
102
|
-
command: "reject",
|
|
103
|
-
description: "Reject specific request or all request",
|
|
104
|
-
options: [
|
|
105
|
-
...gateOptions_1.default,
|
|
106
|
-
...lamOptions_1.default,
|
|
107
|
-
...cliOptions_1.default,
|
|
108
|
-
deviceOption_1.default,
|
|
109
|
-
{
|
|
110
|
-
name: "all",
|
|
111
|
-
description: "Reject all pending request",
|
|
112
|
-
type: Boolean,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: "requestID",
|
|
116
|
-
description: "Reject a specific request",
|
|
117
|
-
type: Number,
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "apiV2User",
|
|
121
|
-
description: "API V2 user name",
|
|
122
|
-
type: String,
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
run: runReject,
|
|
126
|
-
};
|
|
127
|
-
const findApprover = (request) => {
|
|
128
|
-
var _a;
|
|
129
|
-
const approvalSteps = request.approvals_steps || [];
|
|
130
|
-
const approvalCount = ((_a = request.approvals) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
131
|
-
let quorumToCheck = 0;
|
|
132
|
-
for (let currentStep = 0; currentStep < approvalSteps.length; currentStep++) {
|
|
133
|
-
const step = approvalSteps[currentStep];
|
|
134
|
-
quorumToCheck += (step === null || step === void 0 ? void 0 : step.quorum) || 0;
|
|
135
|
-
if (approvalCount < quorumToCheck) {
|
|
136
|
-
return step === null || step === void 0 ? void 0 : step.group.members[(step === null || step === void 0 ? void 0 : step.group.members.length) - (quorumToCheck - approvalCount)];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return undefined;
|
|
140
|
-
};
|
|
141
|
-
exports.findApprover = findApprover;
|
|
142
|
-
const rejectTransactionRequest = ({ pool, request, usersWithDevice, approver, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
|
-
let user = usersWithDevice.find((ud) => request.created_by && ud.user.id === request.created_by.id);
|
|
144
|
-
if (approver) {
|
|
145
|
-
user = usersWithDevice.find((ud) => ud.user.id === approver.id);
|
|
146
|
-
}
|
|
147
|
-
if (!user)
|
|
148
|
-
throw new Error(`Couldn't find user who created request ${request.id}`);
|
|
149
|
-
const deviceIndex = user.deviceIndex;
|
|
150
|
-
const operator = yield pool.login(deviceIndex);
|
|
151
|
-
yield operator.rejectRequest(request.id);
|
|
152
|
-
});
|
|
153
|
-
exports.rejectTransactionRequest = rejectTransactionRequest;
|
|
154
|
-
const rejectTransactionRequestAPIV2 = ({ pool, gate, apiGateway, requestID, apiV2UserName, skipDecodeChallenge, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
155
|
-
var _a, _b;
|
|
156
|
-
const recipe = yield (0, vault_common_1.recipeManifest)(pool);
|
|
157
|
-
const { manifest } = recipe;
|
|
158
|
-
const myApiUser = (_b = (_a = manifest.users) === null || _a === void 0 ? void 0 : _a.apiV2) === null || _b === void 0 ? void 0 : _b.find((user) => user.name.includes(apiV2UserName));
|
|
159
|
-
if (!myApiUser) {
|
|
160
|
-
throw new Error(`No API V2 user found for ${apiV2UserName}`);
|
|
161
|
-
}
|
|
162
|
-
const approvalApiRequestData = {
|
|
163
|
-
pool,
|
|
164
|
-
requestID,
|
|
165
|
-
apiUser: myApiUser,
|
|
166
|
-
gate,
|
|
167
|
-
apiGateway,
|
|
168
|
-
reviewType: "REJECT",
|
|
169
|
-
skipDecodeChallenge,
|
|
170
|
-
};
|
|
171
|
-
yield (0, vault_common_2.reviewAPIRequest)(approvalApiRequestData, {
|
|
172
|
-
logger: logger_1.default,
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
exports.rejectTransactionRequestAPIV2 = rejectTransactionRequestAPIV2;
|
|
176
|
-
//# sourceMappingURL=reject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reject.js","sourceRoot":"","sources":["../../src/commands/reject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yDAAkG;AAClG,yDAKgC;AAGhC,+DAAuC;AACvC,mEAA2C;AAC3C,iEAAyC;AACzC,+DAAuC;AACvC,uDAA+B;AAU/B,MAAM,SAAS,GAAG,CAAO,OAAsB,EAAiB,EAAE;IAChE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9C,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE;QAEtB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAEhD,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,OAAO;KACR;IACD,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,WAAW,CAAC,CAAC;IAC/C,MAAM,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAA,CAAC;AArBW,QAAA,wBAAwB,4BAqBnC;AAEK,MAAM,6BAA6B,GAAG,CAAO,EAClD,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,GAQpB,EAAiB,EAAE;;IAClB,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAE5B,MAAM,SAAS,GAAG,MAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3F,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,aAAa,EAAE,CAAC,CAAC;KAC9D;IACD,MAAM,sBAAsB,GAA4B;QACtD,IAAI;QACJ,SAAS;QACT,OAAO,EAAE,SAAS;QAClB,IAAI;QACJ,UAAU;QACV,UAAU,EAAE,QAAQ;QACpB,mBAAmB;KACpB,CAAC;IAEF,MAAM,IAAA,+BAAgB,EAAC,sBAAsB,EAAE;QAC7C,MAAM,EAAN,gBAAM;KACP,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAnCW,QAAA,6BAA6B,iCAmCxC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export type Options = {
|
|
2
|
-
compartment: number;
|
|
3
|
-
hsm: string;
|
|
4
|
-
hsmCert: string;
|
|
5
|
-
hsmCertPassword: string;
|
|
6
|
-
};
|
|
7
|
-
declare const _default: {
|
|
8
|
-
command: string;
|
|
9
|
-
description: string;
|
|
10
|
-
help: {
|
|
11
|
-
content: string;
|
|
12
|
-
}[];
|
|
13
|
-
options: ({
|
|
14
|
-
name: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
type: NumberConstructor;
|
|
17
|
-
description: string;
|
|
18
|
-
defaultValue: string | undefined;
|
|
19
|
-
required: boolean;
|
|
20
|
-
} | {
|
|
21
|
-
name: string;
|
|
22
|
-
type: StringConstructor;
|
|
23
|
-
description: string;
|
|
24
|
-
defaultValue: string | undefined;
|
|
25
|
-
required: boolean;
|
|
26
|
-
alias?: undefined;
|
|
27
|
-
})[];
|
|
28
|
-
run: (options: Options) => Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
export default _default;
|
|
31
|
-
//# sourceMappingURL=resetCompartment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resetCompartment.d.ts","sourceRoot":"","sources":["../../src/commands/resetCompartment.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,OAAO,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;;;;;;;;;;;;;;;;;;;;;;mBAyCqB,OAAO,KAAG,QAAQ,IAAI,CAAC;;AAvC9C,wBA2DE"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const createHSMBridge_1 = __importDefault(require("@ledgerhq/vault-common/lib/createHSMBridge"));
|
|
16
|
-
const getCertFromPFX_1 = __importDefault(require("../getCertFromPFX"));
|
|
17
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
18
|
-
exports.default = {
|
|
19
|
-
command: "resetCompartment",
|
|
20
|
-
description: "Reset HSM simu compartment",
|
|
21
|
-
help: [
|
|
22
|
-
{
|
|
23
|
-
content: "{grey $} ledger-vault resetCompartment --cid 123",
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
options: [
|
|
27
|
-
{
|
|
28
|
-
name: "compartment",
|
|
29
|
-
alias: "c",
|
|
30
|
-
type: Number,
|
|
31
|
-
description: "HSM compartment ID {blue $VAULT_COMPARTMENT_ID}",
|
|
32
|
-
defaultValue: process.env.VAULT_COMPARTMENT_ID,
|
|
33
|
-
required: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "hsm",
|
|
37
|
-
type: String,
|
|
38
|
-
description: "HSM endpoint {blue $VAULT_HSM_ENDPOINT}",
|
|
39
|
-
defaultValue: process.env.VAULT_HSM_ENDPOINT,
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "hsmCert",
|
|
44
|
-
type: String,
|
|
45
|
-
description: "Path to HSM certificate {blue $VAULT_HSM_CLIENT_CERT_PATH}",
|
|
46
|
-
defaultValue: process.env.VAULT_HSM_CLIENT_CERT_PATH,
|
|
47
|
-
required: true,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: "hsmCertPassword",
|
|
51
|
-
type: String,
|
|
52
|
-
description: "HSM certificate password {blue $VAULT_HSM_CLIENT_CERT_PWD}",
|
|
53
|
-
defaultValue: process.env.VAULT_HSM_CLIENT_CERT_PWD,
|
|
54
|
-
required: true,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
run: (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
if (!options.hsmCert) {
|
|
59
|
-
throw new Error("You must specify the path to your HSM certificate in your environment variable VAULT_HSM_CLIENT_CERT_PATH or use the --hsmCert flag");
|
|
60
|
-
}
|
|
61
|
-
const cert = yield (0, getCertFromPFX_1.default)(options.hsmCert, options.hsmCertPassword);
|
|
62
|
-
const bridge = (0, createHSMBridge_1.default)({
|
|
63
|
-
hsmCert: cert.cert,
|
|
64
|
-
hsmCertKey: cert.key,
|
|
65
|
-
hsmEndpoint: options.hsm,
|
|
66
|
-
});
|
|
67
|
-
yield bridge.resetCompartment(options.compartment, { logger: logger_1.default });
|
|
68
|
-
logger_1.default.success("Compartment has been reset");
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=resetCompartment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resetCompartment.js","sourceRoot":"","sources":["../../src/commands/resetCompartment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iGAAyE;AAEzE,uEAA+C;AAC/C,uDAA+B;AAS/B,kBAAe;IACb,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,4BAA4B;IACzC,IAAI,EAAE;QACJ;YACE,OAAO,EAAE,kDAAkD;SAC5D;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iDAAiD;YAC9D,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;YAC9C,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,yCAAyC;YACtD,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YAC5C,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,4DAA4D;YACzE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACpD,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,4DAA4D;YACzE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;YACnD,QAAQ,EAAE,IAAI;SACf;KACF;IACD,GAAG,EAAE,CAAO,OAAgB,EAAiB,EAAE;QAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACpB,MAAM,IAAI,KAAK,CACb,qIAAqI,CACtI,CAAC;SACH;QAED,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAc,EAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QAE5E,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI,CAAC,GAAG;YACpB,WAAW,EAAE,OAAO,CAAC,GAAG;SACzB,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,MAAM,EAAN,gBAAM,EAAE,CAAC,CAAC;QAG/D,gBAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC/C,CAAC,CAAA;CACF,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type Options = {
|
|
2
|
-
compartment: number;
|
|
3
|
-
hsm: string;
|
|
4
|
-
hsmCert: string;
|
|
5
|
-
hsmCertPassword: string;
|
|
6
|
-
backupFile: string;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: {
|
|
9
|
-
command: string;
|
|
10
|
-
description: string;
|
|
11
|
-
help: {
|
|
12
|
-
content: string;
|
|
13
|
-
}[];
|
|
14
|
-
options: ({
|
|
15
|
-
name: string;
|
|
16
|
-
alias: string;
|
|
17
|
-
type: NumberConstructor;
|
|
18
|
-
description: string;
|
|
19
|
-
defaultValue: string | undefined;
|
|
20
|
-
required: boolean;
|
|
21
|
-
} | {
|
|
22
|
-
name: string;
|
|
23
|
-
alias: string;
|
|
24
|
-
type: StringConstructor;
|
|
25
|
-
description: string;
|
|
26
|
-
required: boolean;
|
|
27
|
-
defaultValue?: undefined;
|
|
28
|
-
} | {
|
|
29
|
-
name: string;
|
|
30
|
-
type: StringConstructor;
|
|
31
|
-
description: string;
|
|
32
|
-
defaultValue: string | undefined;
|
|
33
|
-
required: boolean;
|
|
34
|
-
alias?: undefined;
|
|
35
|
-
})[];
|
|
36
|
-
run: (options: Options) => Promise<void>;
|
|
37
|
-
};
|
|
38
|
-
export default _default;
|
|
39
|
-
//# sourceMappingURL=restoreCompartment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restoreCompartment.d.ts","sourceRoot":"","sources":["../../src/commands/restoreCompartment.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAgDqB,OAAO,KAAG,QAAQ,IAAI,CAAC;;AA9C9C,wBAkEE"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const createHSMBridge_1 = __importDefault(require("@ledgerhq/vault-common/lib/createHSMBridge"));
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const getCertFromPFX_1 = __importDefault(require("../getCertFromPFX"));
|
|
18
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
19
|
-
exports.default = {
|
|
20
|
-
command: "restoreCompartment",
|
|
21
|
-
description: "Restore HSM simu compartment",
|
|
22
|
-
help: [
|
|
23
|
-
{
|
|
24
|
-
content: "{grey $} ledger-vault restoreCompartment --cid 123 --backupFile backup.json",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
options: [
|
|
28
|
-
{
|
|
29
|
-
name: "compartment",
|
|
30
|
-
alias: "c",
|
|
31
|
-
type: Number,
|
|
32
|
-
description: "HSM compartment ID {blue $VAULT_COMPARTMENT_ID}",
|
|
33
|
-
defaultValue: process.env.VAULT_COMPARTMENT_ID,
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "backupFile",
|
|
38
|
-
alias: "b",
|
|
39
|
-
type: String,
|
|
40
|
-
description: "Location of the backup file (output of ledger-vault backupCompartment)",
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "hsm",
|
|
45
|
-
type: String,
|
|
46
|
-
description: "HSM endpoint {blue $VAULT_HSM_ENDPOINT}",
|
|
47
|
-
defaultValue: process.env.VAULT_HSM_ENDPOINT,
|
|
48
|
-
required: true,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "hsmCert",
|
|
52
|
-
type: String,
|
|
53
|
-
description: "Path to HSM certificate {blue $VAULT_HSM_CLIENT_CERT_PATH}",
|
|
54
|
-
defaultValue: process.env.VAULT_HSM_CLIENT_CERT_PATH,
|
|
55
|
-
required: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "hsmCertPassword",
|
|
59
|
-
type: String,
|
|
60
|
-
description: "HSM certificate password {blue $VAULT_HSM_CLIENT_CERT_PWD}",
|
|
61
|
-
defaultValue: process.env.VAULT_HSM_CLIENT_CERT_PWD,
|
|
62
|
-
required: true,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
run: (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
-
if (!options.hsmCert) {
|
|
67
|
-
throw new Error("You must specify the path to your HSM certificate in your environment variable VAULT_HSM_CLIENT_CERT_PATH or use the --hsmCert flag");
|
|
68
|
-
}
|
|
69
|
-
const cert = yield (0, getCertFromPFX_1.default)(options.hsmCert, options.hsmCertPassword);
|
|
70
|
-
const bridge = (0, createHSMBridge_1.default)({
|
|
71
|
-
hsmCert: cert.cert,
|
|
72
|
-
hsmCertKey: cert.key,
|
|
73
|
-
hsmEndpoint: options.hsm,
|
|
74
|
-
});
|
|
75
|
-
const fileContent = fs_1.default.readFileSync(options.backupFile, "utf-8");
|
|
76
|
-
const backup = JSON.parse(fileContent);
|
|
77
|
-
yield bridge.restoreCompartment(options.compartment, backup, { logger: logger_1.default });
|
|
78
|
-
}),
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=restoreCompartment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"restoreCompartment.js","sourceRoot":"","sources":["../../src/commands/restoreCompartment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iGAAyE;AACzE,4CAAoB;AAEpB,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AG,IAAA,yBAAe,EAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,UAAU,EAAE,IAAI,CAAC,GAAG;YACpB,WAAW,EAAE,OAAO,CAAC,GAAG;SACzB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEvC,MAAM,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,MAAM,EAAN,gBAAM,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAA;CACF,CAAC"}
|
package/bin/commands/revoke.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { GateOptions } from "../types";
|
|
2
|
-
export type RevokeOptions = GateOptions & {
|
|
3
|
-
command: "user" | "group";
|
|
4
|
-
device: number;
|
|
5
|
-
id: number;
|
|
6
|
-
noApproval: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const revokeEntity: (opts: RevokeOptions) => Promise<void>;
|
|
9
|
-
declare const _default: {
|
|
10
|
-
command: string;
|
|
11
|
-
description: string;
|
|
12
|
-
options: ({
|
|
13
|
-
name: string;
|
|
14
|
-
type: BooleanConstructor;
|
|
15
|
-
description: string;
|
|
16
|
-
} | {
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
type: StringConstructor;
|
|
20
|
-
} | {
|
|
21
|
-
name: string;
|
|
22
|
-
alias: string;
|
|
23
|
-
type: NumberConstructor;
|
|
24
|
-
description: string;
|
|
25
|
-
defaultValue: number;
|
|
26
|
-
})[];
|
|
27
|
-
subCommands: {
|
|
28
|
-
command: string;
|
|
29
|
-
description: string;
|
|
30
|
-
options: {
|
|
31
|
-
name: string;
|
|
32
|
-
type: NumberConstructor;
|
|
33
|
-
description: string;
|
|
34
|
-
required: boolean;
|
|
35
|
-
}[];
|
|
36
|
-
run: (opts: RevokeOptions) => Promise<void>;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
39
|
-
export default _default;
|
|
40
|
-
//# sourceMappingURL=revoke.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../src/commands/revoke.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,SAAgB,aAAa,KAAG,QAAQ,IAAI,CAyBpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,wBAwCE"}
|
package/bin/commands/revoke.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.revokeEntity = void 0;
|
|
16
|
-
const vault_common_1 = require("@ledgerhq/vault-common");
|
|
17
|
-
const deviceOption_1 = __importDefault(require("../deviceOption"));
|
|
18
|
-
const gateOptions_1 = __importDefault(require("../gateOptions"));
|
|
19
|
-
const logger_1 = __importDefault(require("../logger"));
|
|
20
|
-
const revokeEntity = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
const pool = (0, vault_common_1.createDevicesPool)(Object.assign(Object.assign({}, opts), { deviceAPIURL: opts.deviceAPI }));
|
|
22
|
-
const userDevice = yield pool.login(opts.device);
|
|
23
|
-
let request;
|
|
24
|
-
if (opts.command === "user") {
|
|
25
|
-
logger_1.default.info(`Revoking user ${opts.id}`);
|
|
26
|
-
request = yield userDevice.post("/requests", { type: "REVOKE_USER", user_id: opts.id });
|
|
27
|
-
}
|
|
28
|
-
if (opts.command === "group") {
|
|
29
|
-
logger_1.default.info(`Revoking group ${opts.id}`);
|
|
30
|
-
request = yield userDevice.post("/requests", { type: "REVOKE_GROUP", group_id: opts.id });
|
|
31
|
-
}
|
|
32
|
-
if (opts.noApproval)
|
|
33
|
-
return;
|
|
34
|
-
logger_1.default.info("Approving request...");
|
|
35
|
-
yield pool.getOnboardingAdminDevices();
|
|
36
|
-
yield pool.runWithQuorum((admin) => admin.approveRequest(request));
|
|
37
|
-
});
|
|
38
|
-
exports.revokeEntity = revokeEntity;
|
|
39
|
-
exports.default = {
|
|
40
|
-
command: "revoke",
|
|
41
|
-
description: "Revoke user or group",
|
|
42
|
-
options: [
|
|
43
|
-
...gateOptions_1.default,
|
|
44
|
-
deviceOption_1.default,
|
|
45
|
-
{
|
|
46
|
-
name: "noApproval",
|
|
47
|
-
type: Boolean,
|
|
48
|
-
description: "Create the request without approving it",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
subCommands: [
|
|
52
|
-
{
|
|
53
|
-
command: "user",
|
|
54
|
-
description: "Revoke user",
|
|
55
|
-
options: [
|
|
56
|
-
{
|
|
57
|
-
name: "id",
|
|
58
|
-
type: Number,
|
|
59
|
-
description: "User ID",
|
|
60
|
-
required: true,
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
run: exports.revokeEntity,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
command: "group",
|
|
67
|
-
description: "Revoke group",
|
|
68
|
-
options: [
|
|
69
|
-
{
|
|
70
|
-
name: "id",
|
|
71
|
-
type: Number,
|
|
72
|
-
description: "Group ID",
|
|
73
|
-
required: true,
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
run: exports.revokeEntity,
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=revoke.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../src/commands/revoke.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yDAA2D;AAE3D,mEAA2C;AAC3C,iEAAyC;AACzC,uDAA+B;AAUxB,MAAM,YAAY,GAAG,CAAO,IAAmB,EAAiB,EAAE;IACvE,MAAM,IAAI,GAAG,IAAA,gCAAiB,kCACzB,IAAI,KACP,YAAY,EAAE,IAAI,CAAC,SAAS,IAC5B,CAAC;IACH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjD,IAAI,OAAY,CAAC;IACjB,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,EAAE;QAC3B,gBAAM,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;KACzF;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,EAAE;QAC5B,gBAAM,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@@
|
|
|
1
|
-
import { FeesLevel, GateTransactionType } from "@ledgerhq/vault-common";
|
|
2
|
-
import { GateOptions } from "../types";
|
|
3
|
-
export interface SendOpts extends GateOptions {
|
|
4
|
-
noApproval: boolean;
|
|
5
|
-
strategy?: string;
|
|
6
|
-
account: string;
|
|
7
|
-
recipient: string;
|
|
8
|
-
amount: string;
|
|
9
|
-
feesLevel: FeesLevel;
|
|
10
|
-
gasPrice?: string;
|
|
11
|
-
gasLimit?: string;
|
|
12
|
-
contractPayload?: string;
|
|
13
|
-
txType: GateTransactionType;
|
|
14
|
-
title?: string;
|
|
15
|
-
comment?: string;
|
|
16
|
-
}
|
|
17
|
-
declare function sendTransaction(options: SendOpts): Promise<void>;
|
|
18
|
-
declare const _default: {
|
|
19
|
-
command: string;
|
|
20
|
-
description: string;
|
|
21
|
-
help: {
|
|
22
|
-
header: string;
|
|
23
|
-
content: string[];
|
|
24
|
-
}[];
|
|
25
|
-
options: ({
|
|
26
|
-
name: string;
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
description: string;
|
|
29
|
-
} | {
|
|
30
|
-
name: string;
|
|
31
|
-
description: string;
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
} | {
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
type: NumberConstructor;
|
|
37
|
-
defaultValue: number;
|
|
38
|
-
} | {
|
|
39
|
-
name: string;
|
|
40
|
-
type: StringConstructor;
|
|
41
|
-
description: string;
|
|
42
|
-
required: boolean;
|
|
43
|
-
defaultValue?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
type: StringConstructor;
|
|
48
|
-
defaultValue: string;
|
|
49
|
-
required?: undefined;
|
|
50
|
-
})[];
|
|
51
|
-
run: typeof sendTransaction;
|
|
52
|
-
};
|
|
53
|
-
export default _default;
|
|
54
|
-
//# sourceMappingURL=send.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,mBAAmB,EAMpB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,iBAAe,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAiF/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASD,wBAmFE"}
|