@leofcoin/endpoint-clients 0.2.4 → 0.2.5
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/http.js +3 -0
- package/exports/types/http.d.ts +3 -2
- package/exports/types/ws.d.ts +1 -0
- package/exports/ws.js +3 -0
- package/package.json +1 -1
- package/src/http.ts +5 -1
- package/src/ws.ts +4 -0
package/exports/http.js
CHANGED
package/exports/types/http.d.ts
CHANGED
|
@@ -37,11 +37,12 @@ export default class Client {
|
|
|
37
37
|
createContractAddress(owner: any, code: any, params: any): Promise<any>;
|
|
38
38
|
deployContract(code: any, params: any): Promise<any>;
|
|
39
39
|
network(): Promise<any>;
|
|
40
|
-
networkStats(): {
|
|
40
|
+
networkStats(): Promise<{
|
|
41
41
|
version: string;
|
|
42
42
|
peers: {}[];
|
|
43
43
|
accounts: number;
|
|
44
44
|
accountsHolding: number;
|
|
45
|
-
}
|
|
45
|
+
}>;
|
|
46
|
+
getNonce(address: string): Promise<number>;
|
|
46
47
|
}
|
|
47
48
|
export {};
|
package/exports/types/ws.d.ts
CHANGED
package/exports/ws.js
CHANGED
package/package.json
CHANGED
package/src/http.ts
CHANGED
|
@@ -129,7 +129,11 @@ export default class Client {
|
|
|
129
129
|
return this._fetch('network')
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
networkStats(): { version: string; peers: {}[]; accounts: number; accountsHolding: number; } {
|
|
132
|
+
networkStats(): Promise<{ version: string; peers: {}[]; accounts: number; accountsHolding: number; }> {
|
|
133
133
|
return this._fetch('networkStats')
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
getNonce(address: string) {
|
|
137
|
+
return this._fetchNumber('getNonce', { address })
|
|
138
|
+
}
|
|
135
139
|
}
|
package/src/ws.ts
CHANGED
|
@@ -121,4 +121,8 @@ export default class Client {
|
|
|
121
121
|
networkStats(): { version: string; peers: {}[]; accounts: number; accountsHolding: number } {
|
|
122
122
|
return this.request('networkStats')
|
|
123
123
|
}
|
|
124
|
+
|
|
125
|
+
getNonce(address: string) {
|
|
126
|
+
return this.request('getNonce', { address })
|
|
127
|
+
}
|
|
124
128
|
}
|