dipcoin-cli 0.8.1 → 0.8.3
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.cjs +34 -27
- package/dist/cli.cjs.map +1 -1
- package/package.json +3 -24
- package/dist/cli/commands/account.d.ts +0 -3
- package/dist/cli/commands/account.d.ts.map +0 -1
- package/dist/cli/commands/balance.d.ts +0 -3
- package/dist/cli/commands/balance.d.ts.map +0 -1
- package/dist/cli/commands/history.d.ts +0 -3
- package/dist/cli/commands/history.d.ts.map +0 -1
- package/dist/cli/commands/market.d.ts +0 -3
- package/dist/cli/commands/market.d.ts.map +0 -1
- package/dist/cli/commands/orders.d.ts +0 -3
- package/dist/cli/commands/orders.d.ts.map +0 -1
- package/dist/cli/commands/position.d.ts +0 -3
- package/dist/cli/commands/position.d.ts.map +0 -1
- package/dist/cli/commands/sub-account.d.ts +0 -3
- package/dist/cli/commands/sub-account.d.ts.map +0 -1
- package/dist/cli/commands/trade.d.ts +0 -3
- package/dist/cli/commands/trade.d.ts.map +0 -1
- package/dist/cli/commands/vault.d.ts +0 -3
- package/dist/cli/commands/vault.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/utils/output.d.ts +0 -15
- package/dist/cli/utils/output.d.ts.map +0 -1
- package/dist/cli/utils/sdk-factory.d.ts +0 -38
- package/dist/cli/utils/sdk-factory.d.ts.map +0 -1
- package/dist/cli/utils/vault-index.d.ts +0 -6
- package/dist/cli/utils/vault-index.d.ts.map +0 -1
- package/dist/index.cjs.js +0 -4
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -4
- package/dist/index.esm.js.map +0 -1
- package/dist/index.mjs +0 -4
- package/dist/index.mjs.map +0 -1
- package/dist/src/__tests__/sdk.test.d.ts +0 -2
- package/dist/src/__tests__/sdk.test.d.ts.map +0 -1
- package/dist/src/config/index.d.ts +0 -15
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/constants/index.d.ts +0 -56
- package/dist/src/constants/index.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -20
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/onchain/exchange.d.ts +0 -41
- package/dist/src/onchain/exchange.d.ts.map +0 -1
- package/dist/src/onchain/index.d.ts +0 -5
- package/dist/src/onchain/index.d.ts.map +0 -1
- package/dist/src/onchain/order-signer.d.ts +0 -17
- package/dist/src/onchain/order-signer.d.ts.map +0 -1
- package/dist/src/onchain/transaction-builder.d.ts +0 -46
- package/dist/src/onchain/transaction-builder.d.ts.map +0 -1
- package/dist/src/sdk/index.d.ts +0 -2
- package/dist/src/sdk/index.d.ts.map +0 -1
- package/dist/src/sdk/sdk.d.ts +0 -413
- package/dist/src/sdk/sdk.d.ts.map +0 -1
- package/dist/src/services/httpClient.d.ts +0 -25
- package/dist/src/services/httpClient.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -608
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts +0 -62
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/jwt-cache.d.ts +0 -14
- package/dist/src/utils/jwt-cache.d.ts.map +0 -1
package/dist/cli.cjs
CHANGED
|
@@ -27,27 +27,6 @@ var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
|
27
27
|
var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
|
|
28
28
|
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
29
29
|
|
|
30
|
-
// Copyright (c) 2025 Dipcoin LLC
|
|
31
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
32
|
-
/**
|
|
33
|
-
* Default API base URLs
|
|
34
|
-
*/
|
|
35
|
-
const DEFAULT_API_URLS = {
|
|
36
|
-
mainnet: "https://gray-api.dipcoin.io",
|
|
37
|
-
testnet: "https://demoapi.dipcoin.io/exchange",
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Initialize SDK options with defaults
|
|
41
|
-
*/
|
|
42
|
-
function initSDKOptions(options) {
|
|
43
|
-
return {
|
|
44
|
-
apiBaseUrl: options.apiBaseUrl || DEFAULT_API_URLS[options.network],
|
|
45
|
-
network: options.network,
|
|
46
|
-
customRpc: options.customRpc,
|
|
47
|
-
subAccountKey: options.subAccountKey,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
30
|
const PACKAGE_VERSION = "1.45.2";
|
|
52
31
|
const TARGETED_RPC_VERSION = "1.62.0";
|
|
53
32
|
|
|
@@ -9479,6 +9458,27 @@ class SuiJsonRpcClient extends Experimental_BaseClient {
|
|
|
9479
9458
|
}
|
|
9480
9459
|
}
|
|
9481
9460
|
|
|
9461
|
+
// Copyright (c) 2025 Dipcoin LLC
|
|
9462
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
9463
|
+
/**
|
|
9464
|
+
* Default API base URLs
|
|
9465
|
+
*/
|
|
9466
|
+
const DEFAULT_API_URLS = {
|
|
9467
|
+
mainnet: "https://gray-api.dipcoin.io",
|
|
9468
|
+
testnet: "https://demoapi.dipcoin.io/exchange",
|
|
9469
|
+
};
|
|
9470
|
+
/**
|
|
9471
|
+
* Initialize SDK options with defaults
|
|
9472
|
+
*/
|
|
9473
|
+
function initSDKOptions(options) {
|
|
9474
|
+
return {
|
|
9475
|
+
apiBaseUrl: options.apiBaseUrl || DEFAULT_API_URLS[options.network],
|
|
9476
|
+
network: options.network,
|
|
9477
|
+
customRpc: options.customRpc,
|
|
9478
|
+
subAccountKey: options.subAccountKey,
|
|
9479
|
+
};
|
|
9480
|
+
}
|
|
9481
|
+
|
|
9482
9482
|
// Copyright (c) 2025 Dipcoin LLC
|
|
9483
9483
|
/**
|
|
9484
9484
|
* API endpoints
|
|
@@ -19388,8 +19388,6 @@ class DipCoinPerpSDK {
|
|
|
19388
19388
|
}
|
|
19389
19389
|
}
|
|
19390
19390
|
}
|
|
19391
|
-
|
|
19392
|
-
// Copyright (c) 2025 Dipcoin LLC
|
|
19393
19391
|
/**
|
|
19394
19392
|
* Initialize DipCoin Perpetual Trading SDK
|
|
19395
19393
|
* @param privateKey Private key string or Keypair instance
|
|
@@ -19423,9 +19421,18 @@ function deriveKeypairFromMnemonic(mnemonic, index) {
|
|
|
19423
19421
|
* Read and validate MNEMONIC from env.
|
|
19424
19422
|
*/
|
|
19425
19423
|
function getMnemonic() {
|
|
19426
|
-
const mnemonic = process.env.
|
|
19424
|
+
const mnemonic = process.env.DIPCOIN_MNEMONIC;
|
|
19427
19425
|
if (!mnemonic) {
|
|
19428
|
-
console.error(`Error:
|
|
19426
|
+
console.error(`Error: DIPCOIN_MNEMONIC not set.\n`);
|
|
19427
|
+
console.error(`Option 1 — Create a config file:\n`);
|
|
19428
|
+
console.error(` mkdir -p ~/.config/dipcoin`);
|
|
19429
|
+
console.error(` cat > ~/.config/dipcoin/env << 'EOF'`);
|
|
19430
|
+
console.error(`DIPCOIN_MNEMONIC=word1 word2 word3 ... word12`);
|
|
19431
|
+
console.error(`DIPCOIN_NETWORK=testnet`);
|
|
19432
|
+
console.error(`EOF\n`);
|
|
19433
|
+
console.error(`Option 2 — Export environment variables:\n`);
|
|
19434
|
+
console.error(` export DIPCOIN_MNEMONIC="word1 word2 word3 ... word12"`);
|
|
19435
|
+
console.error(` export DIPCOIN_NETWORK=testnet # or mainnet\n`);
|
|
19429
19436
|
process.exit(1);
|
|
19430
19437
|
}
|
|
19431
19438
|
return mnemonic;
|
|
@@ -19434,7 +19441,7 @@ function getMnemonic() {
|
|
|
19434
19441
|
* Get the network from env.
|
|
19435
19442
|
*/
|
|
19436
19443
|
function getNetwork() {
|
|
19437
|
-
return process.env.
|
|
19444
|
+
return process.env.DIPCOIN_NETWORK || "testnet";
|
|
19438
19445
|
}
|
|
19439
19446
|
/**
|
|
19440
19447
|
* Trading mode SDK: main keypair = index 0, sub keypair = index N.
|
|
@@ -19521,7 +19528,7 @@ function getGlobalVaultIndex(prog) {
|
|
|
19521
19528
|
return n;
|
|
19522
19529
|
}
|
|
19523
19530
|
// Fallback to DEFAULT_VAULT_INDEX env
|
|
19524
|
-
const envDefault = process.env.
|
|
19531
|
+
const envDefault = process.env.DIPCOIN_DEFAULT_VAULT_INDEX;
|
|
19525
19532
|
if (envDefault !== undefined) {
|
|
19526
19533
|
const n = Number(envDefault);
|
|
19527
19534
|
if (!isNaN(n) && n >= 0)
|