dipcoin-cli 0.8.2 → 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.
Files changed (63) hide show
  1. package/dist/cli.cjs +21 -23
  2. package/dist/cli.cjs.map +1 -1
  3. package/package.json +3 -24
  4. package/dist/cli/commands/account.d.ts +0 -3
  5. package/dist/cli/commands/account.d.ts.map +0 -1
  6. package/dist/cli/commands/balance.d.ts +0 -3
  7. package/dist/cli/commands/balance.d.ts.map +0 -1
  8. package/dist/cli/commands/history.d.ts +0 -3
  9. package/dist/cli/commands/history.d.ts.map +0 -1
  10. package/dist/cli/commands/market.d.ts +0 -3
  11. package/dist/cli/commands/market.d.ts.map +0 -1
  12. package/dist/cli/commands/orders.d.ts +0 -3
  13. package/dist/cli/commands/orders.d.ts.map +0 -1
  14. package/dist/cli/commands/position.d.ts +0 -3
  15. package/dist/cli/commands/position.d.ts.map +0 -1
  16. package/dist/cli/commands/sub-account.d.ts +0 -3
  17. package/dist/cli/commands/sub-account.d.ts.map +0 -1
  18. package/dist/cli/commands/trade.d.ts +0 -3
  19. package/dist/cli/commands/trade.d.ts.map +0 -1
  20. package/dist/cli/commands/vault.d.ts +0 -3
  21. package/dist/cli/commands/vault.d.ts.map +0 -1
  22. package/dist/cli/index.d.ts +0 -2
  23. package/dist/cli/index.d.ts.map +0 -1
  24. package/dist/cli/utils/output.d.ts +0 -15
  25. package/dist/cli/utils/output.d.ts.map +0 -1
  26. package/dist/cli/utils/sdk-factory.d.ts +0 -38
  27. package/dist/cli/utils/sdk-factory.d.ts.map +0 -1
  28. package/dist/cli/utils/vault-index.d.ts +0 -6
  29. package/dist/cli/utils/vault-index.d.ts.map +0 -1
  30. package/dist/index.cjs.js +0 -4
  31. package/dist/index.cjs.js.map +0 -1
  32. package/dist/index.esm.js +0 -4
  33. package/dist/index.esm.js.map +0 -1
  34. package/dist/index.mjs +0 -4
  35. package/dist/index.mjs.map +0 -1
  36. package/dist/src/__tests__/sdk.test.d.ts +0 -2
  37. package/dist/src/__tests__/sdk.test.d.ts.map +0 -1
  38. package/dist/src/config/index.d.ts +0 -15
  39. package/dist/src/config/index.d.ts.map +0 -1
  40. package/dist/src/constants/index.d.ts +0 -56
  41. package/dist/src/constants/index.d.ts.map +0 -1
  42. package/dist/src/index.d.ts +0 -20
  43. package/dist/src/index.d.ts.map +0 -1
  44. package/dist/src/onchain/exchange.d.ts +0 -41
  45. package/dist/src/onchain/exchange.d.ts.map +0 -1
  46. package/dist/src/onchain/index.d.ts +0 -5
  47. package/dist/src/onchain/index.d.ts.map +0 -1
  48. package/dist/src/onchain/order-signer.d.ts +0 -17
  49. package/dist/src/onchain/order-signer.d.ts.map +0 -1
  50. package/dist/src/onchain/transaction-builder.d.ts +0 -46
  51. package/dist/src/onchain/transaction-builder.d.ts.map +0 -1
  52. package/dist/src/sdk/index.d.ts +0 -2
  53. package/dist/src/sdk/index.d.ts.map +0 -1
  54. package/dist/src/sdk/sdk.d.ts +0 -413
  55. package/dist/src/sdk/sdk.d.ts.map +0 -1
  56. package/dist/src/services/httpClient.d.ts +0 -25
  57. package/dist/src/services/httpClient.d.ts.map +0 -1
  58. package/dist/src/types/index.d.ts +0 -608
  59. package/dist/src/types/index.d.ts.map +0 -1
  60. package/dist/src/utils/index.d.ts +0 -62
  61. package/dist/src/utils/index.d.ts.map +0 -1
  62. package/dist/src/utils/jwt-cache.d.ts +0 -14
  63. package/dist/src/utils/jwt-cache.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,18 +1,7 @@
1
1
  {
2
2
  "name": "dipcoin-cli",
3
- "version": "0.8.2",
4
- "description": "TypeScript SDK for DipCoin Perpetual Trading on Sui blockchain",
5
- "exports": {
6
- ".": {
7
- "import": "./dist/index.esm.js",
8
- "require": "./dist/index.cjs.js",
9
- "types": "./dist/index.d.ts"
10
- }
11
- },
12
- "main": "dist/index.cjs.js",
13
- "module": "dist/index.esm.js",
14
- "types": "dist/index.d.ts",
15
- "typings": "dist/index.d.ts",
3
+ "version": "0.8.3",
4
+ "description": "DipCoin Perpetual Trading CLI",
16
5
  "bin": {
17
6
  "dipcoin-cli": "./dist/cli.cjs"
18
7
  },
@@ -22,21 +11,15 @@
22
11
  "author": "dipcoinlab",
23
12
  "license": "Apache-2.0",
24
13
  "scripts": {
25
- "lint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
26
- "test": "jest",
14
+ "lint": "eslint src/ cli/ --ext .js,.jsx,.ts,.tsx",
27
15
  "clean": "rm -rf dist build package",
28
- "ts-node": "ts-node",
29
- "example": "tsx examples/index.ts",
30
16
  "cli": "tsx cli/index.ts",
31
- "docs": "typedoc --entryPoints src/index.ts",
32
- "build-ts": "tsc -p tsconfig.json",
33
17
  "build": "rm -rf dist; rollup -c rollup.config.js; mkdir -p dist/config/deployed/mainnet dist/config/deployed/testnet; cp -r src/config/deployed/* dist/config/deployed/"
34
18
  },
35
19
  "keywords": [
36
20
  "sui",
37
21
  "perp",
38
22
  "perpetual",
39
- "sdk",
40
23
  "dipcoin",
41
24
  "trading"
42
25
  ],
@@ -53,20 +36,16 @@
53
36
  "devDependencies": {
54
37
  "@rollup/plugin-commonjs": "^28.0.3",
55
38
  "@rollup/plugin-node-resolve": "^16.0.1",
56
- "@rollup/plugin-terser": "^1.0.0",
57
39
  "@rollup/plugin-typescript": "^8.5.0",
58
40
  "@types/bignumber.js": "^5.0.4",
59
- "@types/jest": "^28.1.1",
60
41
  "@types/node": "^20.8.10",
61
42
  "@typescript-eslint/eslint-plugin": "^5.26.0",
62
43
  "@typescript-eslint/parser": "^5.26.0",
63
44
  "eslint": "^8.16.0",
64
45
  "eslint-config-prettier": "^8.5.0",
65
46
  "eslint-plugin-prettier": "^4.0.0",
66
- "jest": "^28.1.1",
67
47
  "prettier": "^2.6.2",
68
48
  "rollup": "^2.79.0",
69
- "ts-jest": "^28.0.4",
70
49
  "ts-node": "^10.9.1",
71
50
  "tsx": "^4.20.6",
72
51
  "typescript": "^5.0.4"
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerAccountCommands(program: Command): void;
3
- //# sourceMappingURL=account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../cli/commands/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAgEvD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerBalanceCommand(program: Command): void;
3
- //# sourceMappingURL=balance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../cli/commands/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QA+BtD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerHistoryCommands(program: Command): void;
3
- //# sourceMappingURL=history.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../cli/commands/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,QAoIvD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerMarketCommands(program: Command): void;
3
- //# sourceMappingURL=market.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"market.d.ts","sourceRoot":"","sources":["../../../cli/commands/market.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAoGtD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerOrdersCommand(program: Command): void;
3
- //# sourceMappingURL=orders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../../cli/commands/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAuCrD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerPositionCommands(program: Command): void;
3
- //# sourceMappingURL=position.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../cli/commands/position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,QAwIxD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerSubAccountCommands(program: Command): void;
3
- //# sourceMappingURL=sub-account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sub-account.d.ts","sourceRoot":"","sources":["../../../cli/commands/sub-account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,QAiE1D"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerTradeCommands(program: Command): void;
3
- //# sourceMappingURL=trade.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trade.d.ts","sourceRoot":"","sources":["../../../cli/commands/trade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+GpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QAsDrD"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerVaultCommands(program: Command): void;
3
- //# sourceMappingURL=vault.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../../cli/commands/vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QA+SrD"}
@@ -1,2 +0,0 @@
1
- export { getGlobalVaultIndex } from "./utils/vault-index";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../cli/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,15 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function isJson(cmd: Command): boolean;
3
- export declare function printJson(data: any): void;
4
- export declare function printTable(headers: string[], rows: string[][]): void;
5
- export declare function formatWei(value: string | number | null | undefined): string;
6
- export declare function handleError(error: any): void;
7
- /**
8
- * Print a standard transaction result (success message or failure with exit).
9
- */
10
- export declare function printTxResult(program: Command, tx: any, successMsg: string): void;
11
- /**
12
- * Normalize a symbol to include "-PERP" suffix if missing.
13
- */
14
- export declare function normalizeSymbol(s: string): string;
15
- //# sourceMappingURL=output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../cli/utils/output.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAEzC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,CAIpE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAK3E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAG5C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CASjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -1,38 +0,0 @@
1
- import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
2
- import { DipCoinPerpSDK } from "../../src";
3
- /**
4
- * Derive an Ed25519 keypair from a mnemonic at a given account index.
5
- * Uses SLIP-0010 path: m/44'/784'/{index}'/0'/0'
6
- */
7
- export declare function deriveKeypairFromMnemonic(mnemonic: string, index: number): Ed25519Keypair;
8
- /**
9
- * Trading mode SDK: main keypair = index 0, sub keypair = index N.
10
- * Used for order signing where creator = main address, signer = sub keypair.
11
- * When no vaultIndex provided, returns SDK with main account only (index 0).
12
- */
13
- export declare function getSDK(vaultIndex?: number): DipCoinPerpSDK;
14
- /**
15
- * Vault on-chain mode SDK: main keypair = index N.
16
- * Used for vault's own deposit/withdraw/balance where the vault keypair signs the tx.
17
- */
18
- export declare function getVaultSDK(vaultIndex: number): DipCoinPerpSDK;
19
- /**
20
- * Resolve vault address from vault index or explicit address.
21
- * Returns undefined for main account (no vault).
22
- */
23
- export declare function resolveVaultAddress(vaultIndex?: number, vaultAddr?: string): string | undefined;
24
- /**
25
- * List derived vault addresses from mnemonic.
26
- */
27
- export declare function listVaultAddresses(count: number): {
28
- index: number;
29
- address: string;
30
- path: string;
31
- }[];
32
- /**
33
- * Get the appropriate SDK for on-chain operations (deposit/withdraw/margin).
34
- * Uses the vault's own keypair when vault-index > 0, otherwise main account.
35
- */
36
- export declare function getOnChainSDK(vaultIndex?: number): DipCoinPerpSDK;
37
- export declare function ensureAuth(sdk: DipCoinPerpSDK): Promise<void>;
38
- //# sourceMappingURL=sdk-factory.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,6 +0,0 @@
1
- import { Command } from "commander";
2
- /**
3
- * Get the global --vault-index value from the root program.
4
- */
5
- export declare function getGlobalVaultIndex(prog: Command): number | undefined;
6
- //# sourceMappingURL=vault-index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vault-index.d.ts","sourceRoot":"","sources":["../../../cli/utils/vault-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAiBrE"}