@ercworldio/blockchain-shared 1.0.1-dev.11 → 1.0.1-dev.13
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/build/chains/networks_stg-dz.json +24 -13
- package/build/services/quicknode-notifications/QnWebhookAddressManager.d.ts.map +1 -1
- package/build/services/quicknode-notifications/QnWebhookAddressManager.js +6 -2
- package/build/utils/Logger.d.ts.map +1 -1
- package/build/utils/Logger.js +13 -2
- package/package.json +1 -1
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"type": "native",
|
|
63
63
|
"decimals": 18,
|
|
64
64
|
"address": "0x0000000000000000000000000000000000000000",
|
|
65
|
+
"isStableCoin": false,
|
|
65
66
|
"sweepThreshold": 0.004,
|
|
66
67
|
"sweepWalletMinBalance": 0.0002
|
|
67
68
|
},
|
|
@@ -72,8 +73,9 @@
|
|
|
72
73
|
"type": "erc20",
|
|
73
74
|
"decimals": 6,
|
|
74
75
|
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
76
|
+
"isStableCoin": true,
|
|
77
|
+
"sweepThreshold": 1,
|
|
78
|
+
"sweepWalletMinBalance": 0
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
"name": "Circle Token",
|
|
@@ -83,8 +85,8 @@
|
|
|
83
85
|
"isStableCoin": true,
|
|
84
86
|
"decimals": 6,
|
|
85
87
|
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
86
|
-
"sweepThreshold":
|
|
87
|
-
"sweepWalletMinBalance": 1
|
|
88
|
+
"sweepThreshold": 1,
|
|
89
|
+
"sweepWalletMinBalance": 0.1
|
|
88
90
|
}
|
|
89
91
|
]
|
|
90
92
|
},
|
|
@@ -149,6 +151,7 @@
|
|
|
149
151
|
"symbol": "BNB",
|
|
150
152
|
"token_standard": "BEP-20",
|
|
151
153
|
"type": "native",
|
|
154
|
+
"isStableCoin": false,
|
|
152
155
|
"decimals": 18,
|
|
153
156
|
"address": "0x0000000000000000000000000000000000000000",
|
|
154
157
|
"sweepThreshold": 0.008,
|
|
@@ -160,9 +163,10 @@
|
|
|
160
163
|
"token_standard": "BEP-20",
|
|
161
164
|
"type": "erc20",
|
|
162
165
|
"decimals": 18,
|
|
166
|
+
"isStableCoin": true,
|
|
163
167
|
"address": "0x55d398326f99059fF775485246999027B3197955",
|
|
164
|
-
"sweepThreshold":
|
|
165
|
-
"sweepWalletMinBalance": 1
|
|
168
|
+
"sweepThreshold": 1,
|
|
169
|
+
"sweepWalletMinBalance": 0.1
|
|
166
170
|
}
|
|
167
171
|
]
|
|
168
172
|
},
|
|
@@ -242,7 +246,7 @@
|
|
|
242
246
|
"decimals": 6,
|
|
243
247
|
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
244
248
|
"sweepThreshold": 1,
|
|
245
|
-
"sweepWalletMinBalance": 1
|
|
249
|
+
"sweepWalletMinBalance": 0.1
|
|
246
250
|
}
|
|
247
251
|
]
|
|
248
252
|
},
|
|
@@ -307,6 +311,7 @@
|
|
|
307
311
|
"symbol": "POL",
|
|
308
312
|
"token_standard": "POL",
|
|
309
313
|
"type": "native",
|
|
314
|
+
"isStableCoin": false,
|
|
310
315
|
"decimals": 18,
|
|
311
316
|
"address": "0x0000000000000000000000000000000000000000",
|
|
312
317
|
"sweepThreshold": 10,
|
|
@@ -317,10 +322,11 @@
|
|
|
317
322
|
"symbol": "USDT",
|
|
318
323
|
"token_standard": "POL",
|
|
319
324
|
"type": "erc20",
|
|
325
|
+
"isStableCoin": true,
|
|
320
326
|
"decimals": 6,
|
|
321
327
|
"address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
|
|
322
|
-
"sweepThreshold":
|
|
323
|
-
"sweepWalletMinBalance": 1
|
|
328
|
+
"sweepThreshold": 1,
|
|
329
|
+
"sweepWalletMinBalance": 0.1
|
|
324
330
|
}
|
|
325
331
|
]
|
|
326
332
|
},
|
|
@@ -386,6 +392,7 @@
|
|
|
386
392
|
"token_standard": "ERC-20",
|
|
387
393
|
"type": "native",
|
|
388
394
|
"decimals": 18,
|
|
395
|
+
"isStableCoin": false,
|
|
389
396
|
"address": "0x0000000000000000000000000000000000000000",
|
|
390
397
|
"sweepThreshold": 10,
|
|
391
398
|
"sweepWalletMinBalance": 0.1
|
|
@@ -453,6 +460,7 @@
|
|
|
453
460
|
"symbol": "AVAX",
|
|
454
461
|
"token_standard": "AVAXC",
|
|
455
462
|
"type": "native",
|
|
463
|
+
"isStableCoin": false,
|
|
456
464
|
"decimals": 18,
|
|
457
465
|
"address": "0x0000000000000000000000000000000000000000",
|
|
458
466
|
"sweepThreshold": 0.05,
|
|
@@ -463,10 +471,11 @@
|
|
|
463
471
|
"symbol": "USDT",
|
|
464
472
|
"token_standard": "AVAXC",
|
|
465
473
|
"type": "erc20",
|
|
474
|
+
"isStableCoin": true,
|
|
466
475
|
"decimals": 6,
|
|
467
476
|
"address": "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
|
|
468
|
-
"sweepThreshold":
|
|
469
|
-
"sweepWalletMinBalance": 1
|
|
477
|
+
"sweepThreshold": 1,
|
|
478
|
+
"sweepWalletMinBalance": 0.1
|
|
470
479
|
}
|
|
471
480
|
]
|
|
472
481
|
},
|
|
@@ -522,6 +531,7 @@
|
|
|
522
531
|
"symbol": "TRX",
|
|
523
532
|
"token_standard": "TRX",
|
|
524
533
|
"type": "native",
|
|
534
|
+
"isStableCoin": false,
|
|
525
535
|
"decimals": 6,
|
|
526
536
|
"address": "0000000000000000000000000000000000000000",
|
|
527
537
|
"sweepThreshold": 10,
|
|
@@ -532,10 +542,11 @@
|
|
|
532
542
|
"symbol": "USDT",
|
|
533
543
|
"token_standard": "TRC-20",
|
|
534
544
|
"type": "trc20",
|
|
545
|
+
"isStableCoin": true,
|
|
535
546
|
"decimals": 6,
|
|
536
547
|
"address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
|
|
537
|
-
"sweepThreshold":
|
|
538
|
-
"sweepWalletMinBalance": 1
|
|
548
|
+
"sweepThreshold": 1,
|
|
549
|
+
"sweepWalletMinBalance": 0.1
|
|
539
550
|
}
|
|
540
551
|
]
|
|
541
552
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QnWebhookAddressManager.d.ts","sourceRoot":"","sources":["../../../src/services/quicknode-notifications/QnWebhookAddressManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AA8BlE,cAAM,uBAAuB;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA0B;IACjD,OAAO,CAAC,GAAG,CAAqB;IAChC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,KAAK,CAAmD;IAEhE,OAAO,CAAC,EAAE,CAAgB;IAC1B,OAAO;IAMP,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,kBAAkB,GAAG,uBAAuB;IAOzG,OAAO,CAAC,wBAAwB;IAKhC,yFAAyF;IACzF,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,QAAQ;YAMF,IAAI;YAyCJ,aAAa;IAQ3B,OAAO,CAAC,WAAW;IAIN,WAAW,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB1E,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB1F;;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AwBvF;;;;OAIG;IACU,yBAAyB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB5F;;;;OAIG;IACU,qBAAqB,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzH;;;;OAIG;IACU,0BAA0B,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAsBhH,sBAAsB;CAuBvC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -127,7 +127,7 @@ class QnWebhookAddressManager {
|
|
|
127
127
|
continue;
|
|
128
128
|
entry.address_set.add(address);
|
|
129
129
|
try {
|
|
130
|
-
console.log(`Adding addresses: `, entry.address_set);
|
|
130
|
+
console.log(`add_address : Adding addresses: `, entry.address_set);
|
|
131
131
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
132
132
|
console.log(`QnWebhookAddressManager: Added ${address} to ${entry.name} webhook`);
|
|
133
133
|
}
|
|
@@ -149,7 +149,7 @@ class QnWebhookAddressManager {
|
|
|
149
149
|
continue;
|
|
150
150
|
entry.address_set.delete(address);
|
|
151
151
|
try {
|
|
152
|
-
console.log(`Updating webhook addresses to :`, Array.from(entry.address_set));
|
|
152
|
+
console.log(`remove_address: Updating webhook addresses to :`, Array.from(entry.address_set));
|
|
153
153
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
154
154
|
console.log(`QnWebhookAddressManager: Removed ${address} from ${entry.name} webhook`);
|
|
155
155
|
}
|
|
@@ -180,6 +180,7 @@ class QnWebhookAddressManager {
|
|
|
180
180
|
continue;
|
|
181
181
|
entry.address_set.add(address);
|
|
182
182
|
try {
|
|
183
|
+
console.log(`add_address_to_chain: Updating webhook addresses. new set ${entry.address_set.size} addresses`);
|
|
183
184
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
184
185
|
console.log(`QnWebhookAddressManager: Added ${address} to ${entry.name} webhook (chain ${chain_id})`);
|
|
185
186
|
}
|
|
@@ -210,6 +211,7 @@ class QnWebhookAddressManager {
|
|
|
210
211
|
continue;
|
|
211
212
|
entry.address_set.delete(address);
|
|
212
213
|
try {
|
|
214
|
+
console.log(`remove_address_from_chain: Updating webhook addresses. new set ${entry.address_set.size} addresses`);
|
|
213
215
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
214
216
|
console.log(`QnWebhookAddressManager: Removed ${address} from ${entry.name} webhook (chain ${chain_id})`);
|
|
215
217
|
}
|
|
@@ -237,6 +239,7 @@ class QnWebhookAddressManager {
|
|
|
237
239
|
continue;
|
|
238
240
|
entry.address_set.add(address);
|
|
239
241
|
try {
|
|
242
|
+
console.log(`sync_add_to_remaining: Updating webhook addresses. new set ${entry.address_set.size} addresses`);
|
|
240
243
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
241
244
|
console.log(`QnWebhookAddressManager: Synced add ${address} to ${entry.name} webhook`);
|
|
242
245
|
}
|
|
@@ -262,6 +265,7 @@ class QnWebhookAddressManager {
|
|
|
262
265
|
continue;
|
|
263
266
|
entry.address_set.delete(address);
|
|
264
267
|
try {
|
|
268
|
+
console.log(`sync_remove_from_remaining: Updating webhook addresses. new set ${entry.address_set.size} addresses`);
|
|
265
269
|
yield this.api.update_webhook_addresses(entry.webhook_id, entry.template, Array.from(entry.address_set));
|
|
266
270
|
console.log(`QnWebhookAddressManager: Synced remove ${address} from ${entry.name} webhook`);
|
|
267
271
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/utils/Logger.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MA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,MAAM,CAAC,WAAW,CAAC,MAAM,GAAE,MAAc,EAAE,WAAW,GAAE,MAAsB,GAAG,MAAM;IAOvF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAI/C;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM;IAcxE;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAI/C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAI9C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAM9C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAO/C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAM/C;;OAEG;IACH,OAAO,CAAC,aAAa;IAuCrB;;OAEG;IACH,OAAO,CAAC,cAAc;CAezB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,aAAa,MAAM,EAAE,UAAU,UAAU,KAAG,MAExF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/build/utils/Logger.js
CHANGED
|
@@ -84,8 +84,9 @@ class Logger {
|
|
|
84
84
|
* Warn level - sent to ElasticSearch
|
|
85
85
|
*/
|
|
86
86
|
warn(message, data) {
|
|
87
|
-
|
|
88
|
-
this.
|
|
87
|
+
const logData = this.normalizeData(data);
|
|
88
|
+
this.pino.warn(Object.assign({ source: this.source }, logData), message);
|
|
89
|
+
this.indexToElastic('Warning', message, logData);
|
|
89
90
|
}
|
|
90
91
|
/**
|
|
91
92
|
* Error level - sent to ElasticSearch
|
|
@@ -129,6 +130,16 @@ class Logger {
|
|
|
129
130
|
stack: value.stack,
|
|
130
131
|
};
|
|
131
132
|
}
|
|
133
|
+
else if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
134
|
+
// Recurse one level to catch nested Error objects (e.g. { data: { err: Error } })
|
|
135
|
+
const nested = {};
|
|
136
|
+
for (const [nk, nv] of Object.entries(value)) {
|
|
137
|
+
nested[nk] = nv instanceof Error
|
|
138
|
+
? { name: nv.name, message: nv.message, stack: nv.stack }
|
|
139
|
+
: nv;
|
|
140
|
+
}
|
|
141
|
+
normalized[key] = nested;
|
|
142
|
+
}
|
|
132
143
|
else {
|
|
133
144
|
normalized[key] = value;
|
|
134
145
|
}
|