@leofcoin/endpoint-clients 0.3.15 → 0.3.16
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/exports/direct.js +6 -7
- package/exports/types/direct.d.ts +3 -3
- package/package.json +6 -5
package/exports/direct.js
CHANGED
|
@@ -128,16 +128,15 @@ class Client {
|
|
|
128
128
|
}
|
|
129
129
|
async networkStats() {
|
|
130
130
|
let accountsHolding = 0;
|
|
131
|
-
let accountsHoldingAmount =
|
|
132
|
-
|
|
133
|
-
const balances = Object.entries(await chain.balances)
|
|
131
|
+
let accountsHoldingAmount = 0n;
|
|
132
|
+
const topHolders = [];
|
|
133
|
+
const balances = Object.entries((await chain.balances))
|
|
134
134
|
.map(([holder, amount]) => {
|
|
135
|
-
amount
|
|
136
|
-
return { holder, amount };
|
|
135
|
+
return { holder, amount: BigInt(amount) };
|
|
137
136
|
})
|
|
138
|
-
.sort((a, b) =>
|
|
137
|
+
.sort((a, b) => (a.amount === b.amount ? 0 : a.amount > b.amount ? -1 : 1));
|
|
139
138
|
for (let { holder, amount } of balances) {
|
|
140
|
-
if (amount >
|
|
139
|
+
if (amount > 0n) {
|
|
141
140
|
accountsHoldingAmount += amount;
|
|
142
141
|
accountsHolding += 1;
|
|
143
142
|
topHolders.length < 100 && topHolders.push({ holder, amount: formatUnits(amount) });
|
|
@@ -4,8 +4,8 @@ export default class Client {
|
|
|
4
4
|
client: any;
|
|
5
5
|
constructor(url?: string, networkVersion?: string);
|
|
6
6
|
get pubsub(): {
|
|
7
|
-
publish: any;
|
|
8
|
-
subscribe: any;
|
|
7
|
+
publish: <T = any>(event: string, value: T, verbose?: boolean) => void;
|
|
8
|
+
subscribe: <T = any>(event: string, handler: import("@vandeurenglenn/little-pubsub").Handler<T>, options?: import("@vandeurenglenn/little-pubsub").SubscribeOptions) => () => void;
|
|
9
9
|
};
|
|
10
10
|
balances(): any;
|
|
11
11
|
balanceOf(address: string, format: boolean): Promise<any>;
|
|
@@ -47,7 +47,7 @@ export default class Client {
|
|
|
47
47
|
peers: {}[];
|
|
48
48
|
accounts: number;
|
|
49
49
|
accountsHolding: number;
|
|
50
|
-
accountsHoldingAmount:
|
|
50
|
+
accountsHoldingAmount: string;
|
|
51
51
|
topHolders: any[];
|
|
52
52
|
}>;
|
|
53
53
|
getNonce(address: string): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/endpoint-clients",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,11 +30,12 @@
|
|
|
30
30
|
"type": "module",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "rollup -c",
|
|
33
|
-
"test": "
|
|
33
|
+
"test": "node --test test/*.test.js"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "
|
|
37
|
+
"url": "https://github.com/leofcoin/monorepo.git",
|
|
38
|
+
"directory": "packages/endpoint-clients"
|
|
38
39
|
},
|
|
39
40
|
"keywords": [],
|
|
40
41
|
"author": "",
|
|
@@ -42,14 +43,14 @@
|
|
|
42
43
|
"bugs": {
|
|
43
44
|
"url": "https://github.com/leofcoin/endpoint-clients/issues"
|
|
44
45
|
},
|
|
45
|
-
"homepage": "https://github.com/leofcoin/endpoint-clients#readme",
|
|
46
|
+
"homepage": "https://github.com/leofcoin/monorepo/tree/main/packages/endpoint-clients#readme",
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
48
49
|
"rollup": "^4.34.7",
|
|
49
50
|
"tslib": "^2.8.1"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
|
-
"@leofcoin/utils": "^1.1.
|
|
53
|
+
"@leofcoin/utils": "^1.1.45",
|
|
53
54
|
"socket-request-client": "^2.0.9"
|
|
54
55
|
}
|
|
55
56
|
}
|