@clonegod/ttd-sol-common 1.0.5 → 1.0.6
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/index.d.ts +5 -0
- package/dist/index.js +9 -4
- package/package.json +1 -1
- package/types/index.d.ts +1 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { StandardPoolInfoType } from '@clonegod/ttd-common';
|
|
2
2
|
export declare const ONE_SOL_IN_LAMPORTS = 1000000000;
|
|
3
|
+
export declare enum COMMITMENT_LEVEL {
|
|
4
|
+
PROCESSED = "processed",
|
|
5
|
+
CONFIRMED = "confirmed",
|
|
6
|
+
_FINALIZED = "finalized"
|
|
7
|
+
}
|
|
3
8
|
export declare const subscribe_pool_change_by_geyser: (geyser_ws_url: string, pool_list: StandardPoolInfoType[], callback: (data_buff: any) => {}) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -12,11 +12,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.subscribe_pool_change_by_geyser = exports.ONE_SOL_IN_LAMPORTS = void 0;
|
|
16
|
-
const dist_1 = require("@clonegod/ttd-common/dist");
|
|
15
|
+
exports.subscribe_pool_change_by_geyser = exports.COMMITMENT_LEVEL = exports.ONE_SOL_IN_LAMPORTS = void 0;
|
|
17
16
|
const ws_1 = __importDefault(require("ws"));
|
|
18
|
-
const
|
|
17
|
+
const dist_1 = require("@clonegod/ttd-common/dist");
|
|
19
18
|
exports.ONE_SOL_IN_LAMPORTS = 1e9;
|
|
19
|
+
var COMMITMENT_LEVEL;
|
|
20
|
+
(function (COMMITMENT_LEVEL) {
|
|
21
|
+
COMMITMENT_LEVEL["PROCESSED"] = "processed";
|
|
22
|
+
COMMITMENT_LEVEL["CONFIRMED"] = "confirmed";
|
|
23
|
+
COMMITMENT_LEVEL["_FINALIZED"] = "finalized";
|
|
24
|
+
})(COMMITMENT_LEVEL || (exports.COMMITMENT_LEVEL = COMMITMENT_LEVEL = {}));
|
|
20
25
|
const subscribe_pool_change_by_geyser = (geyser_ws_url, pool_list, callback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
26
|
if ((0, dist_1.isEmpty)(geyser_ws_url)) {
|
|
22
27
|
(0, dist_1.log_warn)(`geyser_ws_url is empty, cann't subscribe`);
|
|
@@ -38,7 +43,7 @@ const subscribe_pool_change_by_geyser = (geyser_ws_url, pool_list, callback) =>
|
|
|
38
43
|
pool.pool_address,
|
|
39
44
|
{
|
|
40
45
|
encoding: 'jsonParsed',
|
|
41
|
-
commitment:
|
|
46
|
+
commitment: COMMITMENT_LEVEL.PROCESSED,
|
|
42
47
|
},
|
|
43
48
|
],
|
|
44
49
|
};
|
package/package.json
CHANGED