@clonegod/ttd-core 3.1.33 → 3.1.35

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.
@@ -0,0 +1,3 @@
1
+ export declare const BLOCK_TIME_MS: Record<string, number>;
2
+ export declare const DEFAULT_BLOCK_TIME_MS = 2000;
3
+ export declare function getBlockTimeMs(chain_id: string | undefined): number;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_BLOCK_TIME_MS = exports.BLOCK_TIME_MS = void 0;
4
+ exports.getBlockTimeMs = getBlockTimeMs;
5
+ const index_1 = require("../index");
6
+ exports.BLOCK_TIME_MS = {
7
+ [index_1.CHAIN_ID.BSC]: 450,
8
+ [index_1.CHAIN_ID.ETH]: 12000,
9
+ [index_1.CHAIN_ID.BASE]: 2000,
10
+ [index_1.CHAIN_ID.ARBITRUM]: 250,
11
+ [index_1.CHAIN_ID.AVAX]: 2000,
12
+ [index_1.CHAIN_ID.XLAYER]: 3000,
13
+ [index_1.CHAIN_ID.POLYGON]: 2000,
14
+ [index_1.CHAIN_ID.OPTIMISM]: 2000,
15
+ [index_1.CHAIN_ID.LINEA]: 2000,
16
+ [index_1.CHAIN_ID.SONIC]: 1000,
17
+ [index_1.CHAIN_ID.TRON]: 3000,
18
+ [index_1.CHAIN_ID.SOLANA]: 400,
19
+ [index_1.CHAIN_ID.SUI]: 400,
20
+ [index_1.CHAIN_ID.APTOS]: 250,
21
+ };
22
+ exports.DEFAULT_BLOCK_TIME_MS = 2000;
23
+ function getBlockTimeMs(chain_id) {
24
+ var _a;
25
+ if (!chain_id)
26
+ return exports.DEFAULT_BLOCK_TIME_MS;
27
+ return (_a = exports.BLOCK_TIME_MS[chain_id.toUpperCase()]) !== null && _a !== void 0 ? _a : exports.DEFAULT_BLOCK_TIME_MS;
28
+ }
@@ -1 +1,2 @@
1
1
  export * from './service_ports';
2
+ export * from './block_time';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./service_ports"), exports);
18
+ __exportStar(require("./block_time"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "3.1.33",
3
+ "version": "3.1.35",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",