@pioneer-platform/evm-network 0.31.17 → 0.31.20
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +27 -0
- package/lib/index.js +28 -10
- package/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @pioneer-platform/evm-network@0.31.
|
|
3
|
+
> @pioneer-platform/evm-network@0.31.20 build /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/modules/coins/evm/evm-network
|
|
4
4
|
> tsc -p .
|
|
5
5
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @pioneer-platform/evm-network
|
|
2
2
|
|
|
3
|
+
## 0.31.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d1d2546: Production hotfix sweep landed via #28, #29, #30, #31, #32:
|
|
8
|
+
|
|
9
|
+
- `eth-network`: detect structurally-dead EVM RPCs via error-body signatures ("no longer available", "has been sunset", etc.) and quarantine for 24h instead of retrying every 5 min. Stop misclassifying transient network failures (ECONNRESET, timeout, 5xx wrapped as CALL_EXCEPTION) as contract-not-found — was reporting USDT as nonexistent on Ethereum.
|
|
10
|
+
- `evm-network`: pin `staticNetwork` on `JsonRpcProvider` and `destroy()` after use, so a failed detect doesn't spin up ethers v6's unbounded retry loop and leak a log-spamming async task per request.
|
|
11
|
+
- `pioneer-nodes`: filter known-dead providers (`*.public.blastapi.io`, `1rpc.io`) at `getWeb3Nodes()` boundary via regex.
|
|
12
|
+
- @pioneer-platform/blockbook@8.38.20
|
|
13
|
+
|
|
14
|
+
## 0.31.19
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- chore: chore: chore: chore: chore: version bump pioneer-sdk and pioneer-server for perf fixes
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @pioneer-platform/blockbook@8.38.19
|
|
21
|
+
|
|
22
|
+
## 0.31.18
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- chore: chore: chore: chore: chore: version bump pioneer-sdk and pioneer-server for perf fixes
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @pioneer-platform/blockbook@8.38.18
|
|
29
|
+
|
|
3
30
|
## 0.31.17
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/lib/index.js
CHANGED
|
@@ -21,6 +21,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
const TAG = " | eth-network | ";
|
|
23
23
|
const ethers_1 = require("ethers");
|
|
24
|
+
// Base mainnet is the only network this module currently targets.
|
|
25
|
+
// Pinning staticNetwork prevents ethers v6's unbounded `while (!destroyed)`
|
|
26
|
+
// detection retry loop, which otherwise logs "JsonRpcProvider failed to detect
|
|
27
|
+
// network and cannot start up" once per second forever on each failed provider.
|
|
28
|
+
const BASE_RPC_URL = "https://mainnet.base.org";
|
|
29
|
+
const BASE_NETWORK = ethers_1.Network.from(8453);
|
|
30
|
+
const createBaseProvider = () => new ethers_1.JsonRpcProvider(BASE_RPC_URL, BASE_NETWORK, { staticNetwork: BASE_NETWORK });
|
|
24
31
|
module.exports = {
|
|
25
32
|
init: function (settings) {
|
|
26
33
|
return true;
|
|
@@ -65,26 +72,27 @@ module.exports = {
|
|
|
65
72
|
const get_transaction = function (networkId, txid) {
|
|
66
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
74
|
let tag = TAG + " | get_pending | ";
|
|
75
|
+
const provider = createBaseProvider();
|
|
68
76
|
try {
|
|
69
|
-
//get total LP tokens
|
|
70
|
-
let rpcUrl = "https://mainnet.base.org";
|
|
71
|
-
const provider = new ethers_1.JsonRpcProvider(rpcUrl);
|
|
72
|
-
//
|
|
73
77
|
const tx = yield provider.getTransaction(txid);
|
|
74
78
|
console.log("tx:", tx);
|
|
75
79
|
}
|
|
76
80
|
catch (e) {
|
|
77
81
|
console.error(tag, e);
|
|
78
82
|
}
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
provider.destroy();
|
|
86
|
+
}
|
|
87
|
+
catch ( /* best-effort */_a) { /* best-effort */ }
|
|
88
|
+
}
|
|
79
89
|
});
|
|
80
90
|
};
|
|
81
91
|
const get_pending = function (networkId, address) {
|
|
82
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
93
|
let tag = TAG + " | get_pending | ";
|
|
94
|
+
const provider = createBaseProvider();
|
|
84
95
|
try {
|
|
85
|
-
//get total LP tokens
|
|
86
|
-
let rpcUrl = "https://mainnet.base.org";
|
|
87
|
-
const provider = new ethers_1.JsonRpcProvider(rpcUrl);
|
|
88
96
|
// Fetch the "pending" block which includes pending transactions.
|
|
89
97
|
const blockWithPendingTxs = yield provider.send("eth_getBlockByNumber", ["pending", true]);
|
|
90
98
|
console.log("blockWithPendingTxs:", blockWithPendingTxs);
|
|
@@ -98,15 +106,19 @@ const get_pending = function (networkId, address) {
|
|
|
98
106
|
catch (e) {
|
|
99
107
|
console.error(tag, e);
|
|
100
108
|
}
|
|
109
|
+
finally {
|
|
110
|
+
try {
|
|
111
|
+
provider.destroy();
|
|
112
|
+
}
|
|
113
|
+
catch ( /* best-effort */_a) { /* best-effort */ }
|
|
114
|
+
}
|
|
101
115
|
});
|
|
102
116
|
};
|
|
103
117
|
const get_fees = function (networkId) {
|
|
104
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
119
|
let tag = TAG + " | get_stream | ";
|
|
120
|
+
const provider = createBaseProvider();
|
|
106
121
|
try {
|
|
107
|
-
//get total LP tokens
|
|
108
|
-
let rpcUrl = "https://mainnet.base.org";
|
|
109
|
-
const provider = new ethers_1.JsonRpcProvider(rpcUrl);
|
|
110
122
|
const feeData = yield provider.getFeeData();
|
|
111
123
|
console.log("feeData: ", feeData);
|
|
112
124
|
//convert to base units
|
|
@@ -120,5 +132,11 @@ const get_fees = function (networkId) {
|
|
|
120
132
|
catch (e) {
|
|
121
133
|
console.error(tag, e);
|
|
122
134
|
}
|
|
135
|
+
finally {
|
|
136
|
+
try {
|
|
137
|
+
provider.destroy();
|
|
138
|
+
}
|
|
139
|
+
catch ( /* best-effort */_a) { /* best-effort */ }
|
|
140
|
+
}
|
|
123
141
|
});
|
|
124
142
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/evm-network",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.20",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"request-promise": "^4.2.6",
|
|
13
13
|
"ts-node": "^10.9.2",
|
|
14
14
|
"typescript": "^5.0.4",
|
|
15
|
-
"@pioneer-platform/
|
|
16
|
-
"@pioneer-platform/
|
|
15
|
+
"@pioneer-platform/blockbook": "8.38.20",
|
|
16
|
+
"@pioneer-platform/loggerdog": "8.11.0"
|
|
17
17
|
},
|
|
18
18
|
"description": "",
|
|
19
19
|
"keywords": [
|