@clonegod/ttd-sol-common 2.0.8 → 2.0.10

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.
@@ -6,7 +6,6 @@ import { TransactionResultParser } from "./tx_result_parse";
6
6
  export declare class TransactionResultChecker extends AbstractTransactionResultCheck {
7
7
  env_args: any;
8
8
  event_emitter: EventEmitter;
9
- connection: Connection;
10
9
  wallet: string;
11
10
  context: TradeContext;
12
11
  group_id: string;
@@ -19,7 +18,8 @@ export declare class TransactionResultChecker extends AbstractTransactionResultC
19
18
  check_count: number;
20
19
  transactionParser: TransactionResultParser;
21
20
  trade_result_already_processed: boolean;
22
- constructor(env_args: any, event_emitter: EventEmitter, context: TradeContext, txid: string);
21
+ connection: Connection;
22
+ constructor(env_args: any, event_emitter: EventEmitter);
23
23
  init_tx_status(): this;
24
24
  check(): Promise<void>;
25
25
  on_subscibe_transaction(): void;
@@ -15,21 +15,13 @@ const web3_js_1 = require("@solana/web3.js");
15
15
  const tx_result_parse_1 = require("./tx_result_parse");
16
16
  const common_1 = require("../common");
17
17
  class TransactionResultChecker extends dist_1.AbstractTransactionResultCheck {
18
- constructor(env_args, event_emitter, context, txid) {
18
+ constructor(env_args, event_emitter) {
19
19
  super(env_args, event_emitter);
20
20
  this.env_args = env_args;
21
21
  this.event_emitter = event_emitter;
22
- this.context = context;
23
- this.group_id = context.group_id;
24
22
  this.connection = new web3_js_1.Connection(env_args.rpc_endpoint, {
25
23
  commitment: common_1.COMMITMENT_LEVEL.CONFIRMED,
26
24
  });
27
- this.wallet = context.trade_runtime.wallet.public_key;
28
- this.txid = txid;
29
- this.price_msg = context.price_msg;
30
- this.order_msg = context.order_msg;
31
- this.pool_info = context.pool_info;
32
- this.trace_id = context.order_msg.order_trace_id;
33
25
  this.check_count = 0;
34
26
  this.transactionParser = new tx_result_parse_1.TransactionResultParser(this.env_args, new web3_js_1.PublicKey(this.wallet), this.event_emitter);
35
27
  this.trade_result_already_processed = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sol-common",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "push": "npm run build && npm publish"
14
14
  },
15
15
  "dependencies": {
16
- "@clonegod/ttd-core": "2.1.3",
16
+ "@clonegod/ttd-core": "2.1.4",
17
17
  "@solana/web3.js": "1.91.6",
18
18
  "rpc-websockets": "7.10.0",
19
19
  "axios": "^1.2.3",
@@ -13,41 +13,34 @@ import { COMMITMENT_LEVEL } from "../common"
13
13
  export class TransactionResultChecker extends AbstractTransactionResultCheck {
14
14
  env_args: any
15
15
  event_emitter: EventEmitter
16
- connection: Connection
17
16
  wallet: string
18
-
17
+
19
18
  context: TradeContext
20
19
  group_id: string
21
20
  txid: string
22
-
21
+
23
22
  trace_id: string
24
23
  price_msg: PriceMessageType
25
24
  order_msg: OrderMessageType
26
25
  pool_info: StandardPoolInfoType
27
-
26
+
28
27
  intervalId: any
29
28
  check_count: number
30
29
  transactionParser: TransactionResultParser
31
-
30
+
32
31
  trade_result_already_processed: boolean
33
-
34
- constructor(env_args: any, event_emitter: EventEmitter, context: TradeContext, txid: string) {
32
+
33
+ connection: Connection
34
+
35
+ constructor(env_args: any, event_emitter: EventEmitter) {
35
36
  super(env_args, event_emitter)
36
37
  this.env_args = env_args
37
38
  this.event_emitter = event_emitter
38
39
 
39
- this.context = context
40
- this.group_id = context.group_id
40
+
41
41
  this.connection = new Connection(env_args.rpc_endpoint, {
42
42
  commitment: COMMITMENT_LEVEL.CONFIRMED,
43
43
  })
44
- this.wallet = context.trade_runtime.wallet.public_key
45
-
46
- this.txid = txid
47
- this.price_msg = context.price_msg
48
- this.order_msg = context.order_msg
49
- this.pool_info = context.pool_info
50
- this.trace_id = context.order_msg.order_trace_id
51
44
 
52
45
  this.check_count = 0
53
46
  this.transactionParser = new TransactionResultParser(this.env_args, new PublicKey(this.wallet), this.event_emitter)