dipcoin-cli 0.8.1 → 0.8.2
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/dist/cli/utils/sdk-factory.d.ts.map +1 -1
- package/dist/cli.cjs +13 -4
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-factory.d.ts","sourceRoot":"","sources":["../../../cli/utils/sdk-factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAW9D,OAAO,EAAsB,cAAc,EAAE,MAAM,WAAW,CAAC;AAK/D;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAGzF;
|
|
1
|
+
{"version":3,"file":"sdk-factory.d.ts","sourceRoot":"","sources":["../../../cli/utils/sdk-factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAW9D,OAAO,EAAsB,cAAc,EAAE,MAAM,WAAW,CAAC;AAK/D;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAGzF;AA8BD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,CAkB1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAU9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO/F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CASpG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,cAAc,CAEjE;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnE"}
|
package/dist/cli.cjs
CHANGED
|
@@ -19423,9 +19423,18 @@ function deriveKeypairFromMnemonic(mnemonic, index) {
|
|
|
19423
19423
|
* Read and validate MNEMONIC from env.
|
|
19424
19424
|
*/
|
|
19425
19425
|
function getMnemonic() {
|
|
19426
|
-
const mnemonic = process.env.
|
|
19426
|
+
const mnemonic = process.env.DIPCOIN_MNEMONIC;
|
|
19427
19427
|
if (!mnemonic) {
|
|
19428
|
-
console.error(`Error:
|
|
19428
|
+
console.error(`Error: DIPCOIN_MNEMONIC not set.\n`);
|
|
19429
|
+
console.error(`Option 1 — Create a config file:\n`);
|
|
19430
|
+
console.error(` mkdir -p ~/.config/dipcoin`);
|
|
19431
|
+
console.error(` cat > ~/.config/dipcoin/env << 'EOF'`);
|
|
19432
|
+
console.error(`DIPCOIN_MNEMONIC=word1 word2 word3 ... word12`);
|
|
19433
|
+
console.error(`DIPCOIN_NETWORK=testnet`);
|
|
19434
|
+
console.error(`EOF\n`);
|
|
19435
|
+
console.error(`Option 2 — Export environment variables:\n`);
|
|
19436
|
+
console.error(` export DIPCOIN_MNEMONIC="word1 word2 word3 ... word12"`);
|
|
19437
|
+
console.error(` export DIPCOIN_NETWORK=testnet # or mainnet\n`);
|
|
19429
19438
|
process.exit(1);
|
|
19430
19439
|
}
|
|
19431
19440
|
return mnemonic;
|
|
@@ -19434,7 +19443,7 @@ function getMnemonic() {
|
|
|
19434
19443
|
* Get the network from env.
|
|
19435
19444
|
*/
|
|
19436
19445
|
function getNetwork() {
|
|
19437
|
-
return process.env.
|
|
19446
|
+
return process.env.DIPCOIN_NETWORK || "testnet";
|
|
19438
19447
|
}
|
|
19439
19448
|
/**
|
|
19440
19449
|
* Trading mode SDK: main keypair = index 0, sub keypair = index N.
|
|
@@ -19521,7 +19530,7 @@ function getGlobalVaultIndex(prog) {
|
|
|
19521
19530
|
return n;
|
|
19522
19531
|
}
|
|
19523
19532
|
// Fallback to DEFAULT_VAULT_INDEX env
|
|
19524
|
-
const envDefault = process.env.
|
|
19533
|
+
const envDefault = process.env.DIPCOIN_DEFAULT_VAULT_INDEX;
|
|
19525
19534
|
if (envDefault !== undefined) {
|
|
19526
19535
|
const n = Number(envDefault);
|
|
19527
19536
|
if (!isNaN(n) && n >= 0)
|