@xelis/sdk 0.5.12 → 0.5.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/daemon/rpc.d.ts +2 -2
- package/daemon/rpc.js +2 -2
- package/daemon/types.d.ts +4 -4
- package/daemon/types.js +1 -1
- package/daemon/websocket.d.ts +2 -2
- package/daemon/websocket.js +2 -2
- package/package.json +1 -1
package/daemon/rpc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Balance, Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams,
|
|
1
|
+
import { Balance, Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetBalanceResult, P2PStatusResult, Transaction, GetBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, Peer, DevFee, DiskSize } from './types';
|
|
2
2
|
import { RPC as BaseRPC } from '../lib/rpc';
|
|
3
3
|
declare class RPC extends BaseRPC {
|
|
4
4
|
getVersion(): Promise<import("../lib/types").RPCResponse<string>>;
|
|
@@ -12,7 +12,7 @@ declare class RPC extends BaseRPC {
|
|
|
12
12
|
getBlockByHash(params: GetBlockByHashParams): Promise<import("../lib/types").RPCResponse<Block>>;
|
|
13
13
|
getTopBlock(params: GetTopBlockParams): Promise<import("../lib/types").RPCResponse<Block>>;
|
|
14
14
|
getNonce(params: GetNonceParams): Promise<import("../lib/types").RPCResponse<GetNonceResult>>;
|
|
15
|
-
|
|
15
|
+
getBalance(params: GetBalanceParams): Promise<import("../lib/types").RPCResponse<GetBalanceResult>>;
|
|
16
16
|
getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<import("../lib/types").RPCResponse<Balance>>;
|
|
17
17
|
getAssets(): Promise<import("../lib/types").RPCResponse<string[]>>;
|
|
18
18
|
countTransactions(): Promise<import("../lib/types").RPCResponse<number>>;
|
package/daemon/rpc.js
CHANGED
|
@@ -34,8 +34,8 @@ class RPC extends BaseRPC {
|
|
|
34
34
|
getNonce(params) {
|
|
35
35
|
return this.post(RPCMethod.GetNonce, params);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
return this.post(RPCMethod.
|
|
37
|
+
getBalance(params) {
|
|
38
|
+
return this.post(RPCMethod.GetBalance, params);
|
|
39
39
|
}
|
|
40
40
|
getBalanceAtTopoHeight(params) {
|
|
41
41
|
return this.post(RPCMethod.GetBalanceAtTopoHeight, params);
|
package/daemon/types.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface Block {
|
|
|
30
30
|
txs_hashes: string[];
|
|
31
31
|
version: number;
|
|
32
32
|
}
|
|
33
|
-
export interface
|
|
33
|
+
export interface GetBalanceParams {
|
|
34
34
|
address: string;
|
|
35
35
|
asset: string;
|
|
36
36
|
}
|
|
@@ -52,9 +52,9 @@ export interface Balance {
|
|
|
52
52
|
balance: number;
|
|
53
53
|
previous_topoheight: number;
|
|
54
54
|
}
|
|
55
|
-
export interface
|
|
55
|
+
export interface GetBalanceResult {
|
|
56
|
+
version: Balance;
|
|
56
57
|
topoheight: number;
|
|
57
|
-
balance: Balance;
|
|
58
58
|
}
|
|
59
59
|
export interface P2PStatusResult {
|
|
60
60
|
peer_count: number;
|
|
@@ -202,7 +202,7 @@ export declare enum RPCMethod {
|
|
|
202
202
|
GetBlockByHash = "get_block_by_hash",
|
|
203
203
|
GetTopBlock = "get_top_block",
|
|
204
204
|
GetNonce = "get_nonce",
|
|
205
|
-
|
|
205
|
+
GetBalance = "get_balance",
|
|
206
206
|
GetBalanceAtTopoHeight = "get_balance_at_topoheight",
|
|
207
207
|
GetAssets = "get_assets",
|
|
208
208
|
CountAssets = "count_assets",
|
package/daemon/types.js
CHANGED
|
@@ -11,7 +11,7 @@ export var RPCMethod;
|
|
|
11
11
|
RPCMethod["GetBlockByHash"] = "get_block_by_hash";
|
|
12
12
|
RPCMethod["GetTopBlock"] = "get_top_block";
|
|
13
13
|
RPCMethod["GetNonce"] = "get_nonce";
|
|
14
|
-
RPCMethod["
|
|
14
|
+
RPCMethod["GetBalance"] = "get_balance";
|
|
15
15
|
RPCMethod["GetBalanceAtTopoHeight"] = "get_balance_at_topoheight";
|
|
16
16
|
RPCMethod["GetAssets"] = "get_assets";
|
|
17
17
|
RPCMethod["CountAssets"] = "count_assets";
|
package/daemon/websocket.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageEvent } from 'ws';
|
|
2
|
-
import { Block, GetInfoResult, RPCEventResult, Transaction, TopoHeightRangeParams, P2PStatusResult, Balance, GetBalanceAtTopoHeightParams,
|
|
2
|
+
import { Block, GetInfoResult, RPCEventResult, Transaction, TopoHeightRangeParams, P2PStatusResult, Balance, GetBalanceAtTopoHeightParams, GetBalanceResult, HeightRangeParams, BlockOrdered, GetBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer, PeerPeerListUpdated, PeerPeerDisconnected, DevFee, DiskSize, AssetData } from './types';
|
|
3
3
|
import { WS as BaseWS } from '../lib/websocket';
|
|
4
4
|
declare class WS extends BaseWS {
|
|
5
5
|
onNewBlock(onData: (msgEvent: MessageEvent, data?: Block & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
@@ -23,7 +23,7 @@ declare class WS extends BaseWS {
|
|
|
23
23
|
getBlockByHash(params: GetBlockByHashParams): Promise<Block>;
|
|
24
24
|
getTopBlock(params: GetTopBlockParams): Promise<Block>;
|
|
25
25
|
getNonce(params: GetNonceParams): Promise<GetNonceResult>;
|
|
26
|
-
|
|
26
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
|
|
27
27
|
getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<Balance>;
|
|
28
28
|
getAssets(): Promise<string[]>;
|
|
29
29
|
countTransactions(): Promise<number>;
|
package/daemon/websocket.js
CHANGED
|
@@ -64,8 +64,8 @@ class WS extends BaseWS {
|
|
|
64
64
|
getNonce(params) {
|
|
65
65
|
return this.dataCall(RPCMethod.GetNonce, params);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
return this.dataCall(RPCMethod.
|
|
67
|
+
getBalance(params) {
|
|
68
|
+
return this.dataCall(RPCMethod.GetBalance, params);
|
|
69
69
|
}
|
|
70
70
|
getBalanceAtTopoHeight(params) {
|
|
71
71
|
return this.dataCall(RPCMethod.GetBalanceAtTopoHeight, params);
|
package/package.json
CHANGED