@xelis/sdk 0.5.6 → 0.5.7

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { Balance, Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetLastBalanceResult, P2PStatusResult, Transaction, GetLastBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory } from './types';
1
+ import { Balance, Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetLastBalanceResult, P2PStatusResult, Transaction, GetLastBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, Peer } 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>>;
@@ -31,5 +31,6 @@ declare class RPC extends BaseRPC {
31
31
  submitTransaction(hexData: string): Promise<import("../lib/types").RPCResponse<boolean>>;
32
32
  getAccountHistory(params: GetAccountHistoryParams): Promise<import("../lib/types").RPCResponse<AccounHistory[]>>;
33
33
  getAccountAssets(address: string): Promise<import("../lib/types").RPCResponse<string[]>>;
34
+ getPeers(): Promise<import("../lib/types").RPCResponse<Peer[]>>;
34
35
  }
35
36
  export default RPC;
package/daemon/rpc.js CHANGED
@@ -91,5 +91,8 @@ class RPC extends BaseRPC {
91
91
  getAccountAssets(address) {
92
92
  return this.post(RPCMethod.GetAccountAssets, { address });
93
93
  }
94
+ getPeers() {
95
+ return this.post(RPCMethod.GetPeers);
96
+ }
94
97
  }
95
98
  export default RPC;
package/daemon/types.d.ts CHANGED
@@ -74,6 +74,18 @@ export interface HeightRangeParams {
74
74
  export interface RPCEventResult {
75
75
  event: string;
76
76
  }
77
+ export interface Peer {
78
+ addr: string;
79
+ cumulative_difficulty: number;
80
+ height: number;
81
+ id: number;
82
+ last_ping: number;
83
+ pruned_topoheight: number;
84
+ tag: string;
85
+ top_block_hash: string;
86
+ topoheight: number;
87
+ version: string;
88
+ }
77
89
  export interface BlockOrdered {
78
90
  topoheight: number;
79
91
  block_hash: string;
@@ -179,7 +191,8 @@ export declare enum RPCMethod {
179
191
  SubmitTransaction = "submit_transaction",
180
192
  CountAccounts = "count_accounts",
181
193
  GetAccountHistory = "get_account_history",
182
- GetAccountAssets = "get_account_assets"
194
+ GetAccountAssets = "get_account_assets",
195
+ GetPeers = "get_peers"
183
196
  }
184
197
  export declare enum RPCEvent {
185
198
  NewBlock = "NewBlock",
package/daemon/types.js CHANGED
@@ -30,6 +30,7 @@ export var RPCMethod;
30
30
  RPCMethod["CountAccounts"] = "count_accounts";
31
31
  RPCMethod["GetAccountHistory"] = "get_account_history";
32
32
  RPCMethod["GetAccountAssets"] = "get_account_assets";
33
+ RPCMethod["GetPeers"] = "get_peers";
33
34
  })(RPCMethod || (RPCMethod = {}));
34
35
  export var RPCEvent;
35
36
  (function (RPCEvent) {
@@ -1,5 +1,5 @@
1
1
  import { MessageEvent } from 'ws';
2
- import { Block, GetInfoResult, RPCEventResult, Transaction, TopoHeightRangeParams, P2PStatusResult, Balance, GetBalanceAtTopoHeightParams, GetLastBalanceResult, HeightRangeParams, BlockOrdered, GetLastBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory } from './types';
2
+ import { Block, GetInfoResult, RPCEventResult, Transaction, TopoHeightRangeParams, P2PStatusResult, Balance, GetBalanceAtTopoHeightParams, GetLastBalanceResult, HeightRangeParams, BlockOrdered, GetLastBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer } 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>>;
@@ -35,5 +35,6 @@ declare class WS extends BaseWS {
35
35
  countAccounts(): Promise<number>;
36
36
  getAccountHistory(params: GetAccountHistoryParams): Promise<AccounHistory[]>;
37
37
  getAccountAssets(address: string): Promise<string[]>;
38
+ getPeers(): Promise<Peer[]>;
38
39
  }
39
40
  export default WS;
@@ -100,5 +100,8 @@ class WS extends BaseWS {
100
100
  getAccountAssets(address) {
101
101
  return this.dataCall(RPCMethod.GetAccountAssets, { address });
102
102
  }
103
+ getPeers() {
104
+ return this.dataCall(RPCMethod.GetPeers);
105
+ }
103
106
  }
104
107
  export default WS;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.6",
2
+ "version": "0.5.7",
3
3
  "name": "@xelis/sdk",
4
4
  "description": "Xelis software development kit for JS",
5
5
  "repository": {