@clonegod/ttd-base-common 1.0.26 → 1.1.2

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 (144) hide show
  1. package/dist/appconfig/BaseQuoteAppConfig.d.ts +10 -0
  2. package/dist/appconfig/BaseQuoteAppConfig.js +36 -0
  3. package/dist/appconfig/BaseTradeAppConfig.d.ts +7 -0
  4. package/dist/appconfig/BaseTradeAppConfig.js +13 -0
  5. package/dist/appconfig/base_dex_env_args.d.ts +5 -0
  6. package/dist/appconfig/base_dex_env_args.js +68 -0
  7. package/dist/appconfig/base_env_args.d.ts +82 -0
  8. package/dist/appconfig/base_env_args.js +91 -0
  9. package/dist/appconfig/ensure_core_env.d.ts +1 -0
  10. package/dist/appconfig/ensure_core_env.js +18 -0
  11. package/dist/appconfig/index.d.ts +5 -0
  12. package/dist/appconfig/index.js +21 -0
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +2 -2
  15. package/dist/quote/depth/amm_depth_calculator.d.ts +19 -0
  16. package/dist/quote/depth/amm_depth_calculator.js +55 -0
  17. package/dist/quote/depth/clmm_depth_calculator.d.ts +28 -0
  18. package/dist/quote/depth/clmm_depth_calculator.js +176 -0
  19. package/dist/quote/depth/index.d.ts +51 -0
  20. package/dist/quote/depth/index.js +264 -0
  21. package/dist/quote/depth/tick_liquidity_snapshot.d.ts +58 -0
  22. package/dist/quote/depth/tick_liquidity_snapshot.js +143 -0
  23. package/dist/quote/event/index.d.ts +1 -0
  24. package/dist/quote/event/index.js +1 -0
  25. package/dist/quote/event/pool_event_listener.d.ts +5 -3
  26. package/dist/quote/event/pool_event_listener.js +128 -150
  27. package/dist/quote/event/swap_debouncer.d.ts +22 -0
  28. package/dist/quote/event/swap_debouncer.js +80 -0
  29. package/dist/quote/get_base_token_price.d.ts +6 -0
  30. package/dist/quote/get_base_token_price.js +90 -0
  31. package/dist/quote/index.d.ts +7 -0
  32. package/dist/quote/index.js +7 -0
  33. package/dist/quote/preload_token_prices.d.ts +2 -0
  34. package/dist/quote/preload_token_prices.js +37 -0
  35. package/dist/quote/price_feed_handler.d.ts +15 -0
  36. package/dist/quote/price_feed_handler.js +56 -0
  37. package/dist/quote/pricing/fee_helpers.d.ts +13 -0
  38. package/dist/quote/pricing/fee_helpers.js +68 -0
  39. package/dist/quote/pricing/index.d.ts +3 -1
  40. package/dist/quote/pricing/index.js +3 -1
  41. package/dist/quote/pricing/pool_state_initializer.d.ts +12 -0
  42. package/dist/quote/pricing/pool_state_initializer.js +191 -0
  43. package/dist/quote/pricing/sdk_token_factory.d.ts +2 -0
  44. package/dist/quote/pricing/sdk_token_factory.js +21 -0
  45. package/dist/quote/quote_amount.d.ts +4 -0
  46. package/dist/quote/quote_amount.js +24 -0
  47. package/dist/quote/tick/cached_tick_data_provider.d.ts +12 -0
  48. package/dist/quote/tick/cached_tick_data_provider.js +45 -0
  49. package/dist/quote/tick/clmm_tick_cache.d.ts +42 -0
  50. package/dist/quote/tick/clmm_tick_cache.js +236 -0
  51. package/dist/quote/tick/index.d.ts +4 -0
  52. package/dist/{ws → quote/tick}/index.js +4 -2
  53. package/dist/quote/tick/state_view_tick_loader.d.ts +17 -0
  54. package/dist/quote/tick/state_view_tick_loader.js +136 -0
  55. package/dist/quote/tick/tick_lens_loaders.d.ts +24 -0
  56. package/dist/quote/tick/tick_lens_loaders.js +158 -0
  57. package/dist/quote/verify/index.d.ts +2 -0
  58. package/dist/quote/verify/index.js +5 -0
  59. package/dist/quote/verify/quote_price_verify.d.ts +30 -0
  60. package/dist/quote/verify/quote_price_verify.js +240 -0
  61. package/dist/redis/redis_client.d.ts +3 -2
  62. package/dist/redis/redis_client.js +86 -116
  63. package/dist/send-tx/constants.d.ts +2 -0
  64. package/dist/send-tx/constants.js +6 -0
  65. package/dist/send-tx/index.d.ts +2 -0
  66. package/dist/{config → send-tx}/index.js +2 -1
  67. package/dist/send-tx/types.d.ts +4 -0
  68. package/dist/send-tx/types.js +2 -0
  69. package/dist/trade/abstract_dex_trade.d.ts +43 -21
  70. package/dist/trade/abstract_dex_trade.js +347 -133
  71. package/dist/trade/caller_manager.d.ts +31 -0
  72. package/dist/trade/caller_manager.js +202 -0
  73. package/dist/trade/check/abstract_tx_result_checker.d.ts +28 -0
  74. package/dist/trade/check/abstract_tx_result_checker.js +192 -0
  75. package/dist/trade/check/index.d.ts +1 -1
  76. package/dist/trade/check/index.js +1 -1
  77. package/dist/trade/index.d.ts +2 -2
  78. package/dist/trade/index.js +2 -2
  79. package/dist/trade/parse/base_parser.d.ts +1 -2
  80. package/dist/trade/parse/base_parser.js +36 -36
  81. package/dist/trade/trade_trace.d.ts +17 -0
  82. package/dist/trade/trade_trace.js +65 -0
  83. package/dist/types/config_types.d.ts +3 -3
  84. package/dist/types/event_types.d.ts +3 -3
  85. package/dist/types/pool_state.d.ts +140 -13
  86. package/dist/utils/ethers_compat.d.ts +13 -0
  87. package/dist/utils/ethers_compat.js +18 -0
  88. package/dist/utils/fast_signer.d.ts +1 -0
  89. package/dist/utils/fast_signer.js +87 -0
  90. package/dist/utils/gas_helper.d.ts +2 -2
  91. package/dist/utils/gas_helper.js +48 -60
  92. package/dist/utils/index.d.ts +5 -2
  93. package/dist/utils/index.js +6 -2
  94. package/dist/utils/pool_filter.d.ts +8 -0
  95. package/dist/utils/pool_filter.js +38 -0
  96. package/dist/utils/trade_direction.d.ts +14 -0
  97. package/dist/utils/trade_direction.js +23 -0
  98. package/package.json +3 -3
  99. package/dist/config/base_env_args.d.ts +0 -11
  100. package/dist/config/base_env_args.js +0 -19
  101. package/dist/config/index.d.ts +0 -1
  102. package/dist/quote/event/verify_clmm_swap_event.d.ts +0 -1
  103. package/dist/quote/event/verify_clmm_swap_event.js +0 -178
  104. package/dist/quote/pricing/token_price_cache.d.ts +0 -10
  105. package/dist/quote/pricing/token_price_cache.js +0 -40
  106. package/dist/trade/abstract_dex_trade_plus.d.ts +0 -43
  107. package/dist/trade/abstract_dex_trade_plus.js +0 -421
  108. package/dist/trade/check/tx_websocket_manager.d.ts +0 -23
  109. package/dist/trade/check/tx_websocket_manager.js +0 -119
  110. package/dist/trade/send/alchemy_base.d.ts +0 -5
  111. package/dist/trade/send/alchemy_base.js +0 -48
  112. package/dist/trade/send/ankr_base.d.ts +0 -5
  113. package/dist/trade/send/ankr_base.js +0 -48
  114. package/dist/trade/send/base_rpc.d.ts +0 -5
  115. package/dist/trade/send/base_rpc.js +0 -48
  116. package/dist/trade/send/blockpi_base.d.ts +0 -5
  117. package/dist/trade/send/blockpi_base.js +0 -48
  118. package/dist/trade/send/bloxroute_base.d.ts +0 -11
  119. package/dist/trade/send/bloxroute_base.js +0 -115
  120. package/dist/trade/send/chainstack_base.d.ts +0 -5
  121. package/dist/trade/send/chainstack_base.js +0 -48
  122. package/dist/trade/send/drpc_base.d.ts +0 -5
  123. package/dist/trade/send/drpc_base.js +0 -48
  124. package/dist/trade/send/getblock_base.d.ts +0 -5
  125. package/dist/trade/send/getblock_base.js +0 -48
  126. package/dist/trade/send/index.d.ts +0 -15
  127. package/dist/trade/send/index.js +0 -33
  128. package/dist/trade/send/infura_base.d.ts +0 -5
  129. package/dist/trade/send/infura_base.js +0 -48
  130. package/dist/trade/send/moralis_base.d.ts +0 -5
  131. package/dist/trade/send/moralis_base.js +0 -48
  132. package/dist/trade/send/onerpc_base.d.ts +0 -5
  133. package/dist/trade/send/onerpc_base.js +0 -48
  134. package/dist/trade/send/quicknode_base.d.ts +0 -5
  135. package/dist/trade/send/quicknode_base.js +0 -48
  136. package/dist/trade/send/send_tx.d.ts +0 -17
  137. package/dist/trade/send/send_tx.js +0 -163
  138. package/dist/ws/event_filter.d.ts +0 -8
  139. package/dist/ws/event_filter.js +0 -36
  140. package/dist/ws/index.d.ts +0 -2
  141. package/dist/ws/subscribe_v2_events.d.ts +0 -14
  142. package/dist/ws/subscribe_v2_events.js +0 -174
  143. package/dist/ws/subscribe_v3_events.d.ts +0 -14
  144. package/dist/ws/subscribe_v3_events.js +0 -174
@@ -1,5 +0,0 @@
1
- export declare class BaseRpc {
2
- private endpoint;
3
- constructor(rpc_endpoint: string);
4
- eth_sendRawTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.BaseRpc = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class BaseRpc {
19
- constructor(rpc_endpoint) {
20
- this.endpoint = rpc_endpoint || process.env.BASE_OFFICIAL_RPC_ENDPOINT || 'https://mainnet.base.org';
21
- }
22
- eth_sendRawTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: "2.0",
27
- method: "eth_sendRawTransaction",
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- "Content-Type": "application/json"
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`Base Mainnet RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`Base Mainnet transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.BaseRpc = BaseRpc;
@@ -1,5 +0,0 @@
1
- export declare class BlockpiBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.BlockpiBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class BlockpiBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_BLOCKPI_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`BlockPI RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`BlockPI transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.BlockpiBase = BlockpiBase;
@@ -1,11 +0,0 @@
1
- export declare class BloxrouteBase {
2
- private endpoint;
3
- private authToken;
4
- private ws_endpoint;
5
- private wsClient;
6
- constructor();
7
- private initWsConnection;
8
- sendTransaction(signedTx: string): Promise<string>;
9
- private sendTransactionByHttp;
10
- private sendTransactionByWs;
11
- }
@@ -1,115 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.BloxrouteBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class BloxrouteBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_BLOXROUTE_RPC_ENDPOINT || 'https://api.blxrbdn.com';
21
- this.authToken = process.env.BASE_BLOXROUTE_AUTH_TOKEN || '';
22
- this.ws_endpoint = process.env.BASE_BLOXROUTE_WS_ENDPOINT || 'wss://api.blxrbdn.com/ws';
23
- if (this.authToken) {
24
- this.initWsConnection();
25
- }
26
- else {
27
- (0, dist_1.log_warn)('BloXroute authToken is not set!!! BASE_BLOXROUTE_AUTH_TOKEN is empty or null');
28
- }
29
- }
30
- initWsConnection() {
31
- if (!this.wsClient) {
32
- this.wsClient = new dist_1.WebSocketClient(this.ws_endpoint, {
33
- headers: {
34
- 'Authorization': this.authToken || ''
35
- }
36
- });
37
- this.wsClient.onOpen(() => {
38
- (0, dist_1.log_info)('BloXroute Base ws connected:', this.ws_endpoint);
39
- });
40
- this.wsClient.onMessage((message) => {
41
- (0, dist_1.log_info)('BloXroute Base ws message', (0, dist_1.to_json_str)(message));
42
- });
43
- this.wsClient.connect();
44
- }
45
- }
46
- sendTransaction(signedTx) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- if (!this.authToken) {
49
- (0, dist_1.log_warn)('BloXroute Base authToken is not set!!! BASE_BLOXROUTE_AUTH_TOKEN is empty or null');
50
- return '';
51
- }
52
- if (signedTx.startsWith('0x')) {
53
- signedTx = signedTx.slice(2);
54
- }
55
- this.sendTransactionByWs(signedTx);
56
- return yield this.sendTransactionByHttp(signedTx);
57
- });
58
- }
59
- sendTransactionByHttp(signedTx) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- try {
62
- const response = yield axios_1.default.post(this.endpoint, {
63
- jsonrpc: "2.0",
64
- id: "1",
65
- method: "blxr_tx",
66
- params: {
67
- "transaction": signedTx,
68
- "blockchain_network": "Base-Mainnet"
69
- }
70
- }, {
71
- headers: {
72
- 'Content-Type': 'application/json',
73
- 'Authorization': this.authToken
74
- },
75
- timeout: 3000
76
- });
77
- if (response.data.error) {
78
- throw new Error(`BloXroute Base Error: ${response.data.error.code} - ${response.data.error.message}`);
79
- }
80
- return response.data.result.txHash;
81
- }
82
- catch (error) {
83
- (0, dist_1.log_error)('BloXroute Base sendPrivateTransaction failed!!!', error);
84
- throw error;
85
- }
86
- });
87
- }
88
- sendTransactionByWs(signedTx) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- if (!this.ws_endpoint) {
91
- return '';
92
- }
93
- try {
94
- if (!this.wsClient || !this.wsClient.isConnected()) {
95
- (0, dist_1.log_warn)('BloXroute Base ws is not connected!!!');
96
- return '';
97
- }
98
- this.wsClient.send(JSON.stringify({
99
- jsonrpc: "2.0",
100
- id: "1",
101
- method: "blxr_tx",
102
- params: {
103
- "transaction": signedTx,
104
- "blockchain_network": "Base-Mainnet"
105
- }
106
- }));
107
- return '';
108
- }
109
- catch (error) {
110
- (0, dist_1.log_error)('BloXroute Base sendTransactionByWs failed!!!', error);
111
- }
112
- });
113
- }
114
- }
115
- exports.BloxrouteBase = BloxrouteBase;
@@ -1,5 +0,0 @@
1
- export declare class ChainstackBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ChainstackBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class ChainstackBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_CHAINSTACK_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`Chainstack RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`Chainstack transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.ChainstackBase = ChainstackBase;
@@ -1,5 +0,0 @@
1
- export declare class DrpcBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.DrpcBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class DrpcBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_DRPC_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`DRPC RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`DRPC transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.DrpcBase = DrpcBase;
@@ -1,5 +0,0 @@
1
- export declare class GetblockBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.GetblockBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class GetblockBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_GETBLOCK_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`GetBlock RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`GetBlock transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.GetblockBase = GetblockBase;
@@ -1,15 +0,0 @@
1
- export * from './send_tx';
2
- export * from './alchemy_base';
3
- export * from './base_rpc';
4
- export * from './bloxroute_base';
5
- export * from './drpc_base';
6
- export * from './quicknode_base';
7
- export * from './infura_base';
8
- export * from './blockpi_base';
9
- export * from './getblock_base';
10
- export * from './ankr_base';
11
- export * from './chainstack_base';
12
- export * from './moralis_base';
13
- export * from './onerpc_base';
14
- export declare enum BASE_EOA_ADDRESS {
15
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.BASE_EOA_ADDRESS = void 0;
18
- __exportStar(require("./send_tx"), exports);
19
- __exportStar(require("./alchemy_base"), exports);
20
- __exportStar(require("./base_rpc"), exports);
21
- __exportStar(require("./bloxroute_base"), exports);
22
- __exportStar(require("./drpc_base"), exports);
23
- __exportStar(require("./quicknode_base"), exports);
24
- __exportStar(require("./infura_base"), exports);
25
- __exportStar(require("./blockpi_base"), exports);
26
- __exportStar(require("./getblock_base"), exports);
27
- __exportStar(require("./ankr_base"), exports);
28
- __exportStar(require("./chainstack_base"), exports);
29
- __exportStar(require("./moralis_base"), exports);
30
- __exportStar(require("./onerpc_base"), exports);
31
- var BASE_EOA_ADDRESS;
32
- (function (BASE_EOA_ADDRESS) {
33
- })(BASE_EOA_ADDRESS || (exports.BASE_EOA_ADDRESS = BASE_EOA_ADDRESS = {}));
@@ -1,5 +0,0 @@
1
- export declare class InfuraBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.InfuraBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class InfuraBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_INFURA_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`Infura RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`Infura transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.InfuraBase = InfuraBase;
@@ -1,5 +0,0 @@
1
- export declare class MoralisBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.MoralisBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class MoralisBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_MORALIS_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`Moralis RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`Moralis transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.MoralisBase = MoralisBase;
@@ -1,5 +0,0 @@
1
- export declare class OneRpcBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.OneRpcBase = void 0;
16
- const dist_1 = require("@clonegod/ttd-core/dist");
17
- const axios_1 = __importDefault(require("axios"));
18
- class OneRpcBase {
19
- constructor() {
20
- this.endpoint = process.env.BASE_1RPC_RPC_ENDPOINT || '';
21
- }
22
- sendTransaction(signedTx) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield axios_1.default.post(this.endpoint, {
26
- jsonrpc: '2.0',
27
- method: 'eth_sendRawTransaction',
28
- params: [signedTx],
29
- id: 1
30
- }, {
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- timeout: 3000
35
- });
36
- if (response.data.error) {
37
- throw new Error(`1RPC error: ${response.data.error.message}`);
38
- }
39
- return response.data.result;
40
- }
41
- catch (error) {
42
- (0, dist_1.log_info)(`1RPC transaction sending failed`, { error: error.message });
43
- throw error;
44
- }
45
- });
46
- }
47
- }
48
- exports.OneRpcBase = OneRpcBase;
@@ -1,5 +0,0 @@
1
- export declare class QuickNodeBase {
2
- private endpoint;
3
- constructor();
4
- sendTransaction(signedTx: string): Promise<string>;
5
- }