@xelis/sdk 0.5.14 → 0.5.15

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.
@@ -1,5 +1,5 @@
1
1
  import { MessageEvent } from 'ws';
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, AssetWithData } from './types';
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, AssetWithData, AssetData, GetAssetParams, HasBalanceParams, HasBalanceResult, IsTxExecutedInBlockParams } 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>>;
@@ -24,7 +24,9 @@ declare class WS extends BaseWS {
24
24
  getTopBlock(params: GetTopBlockParams): Promise<Block>;
25
25
  getNonce(params: GetNonceParams): Promise<GetNonceResult>;
26
26
  getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
27
+ hasBalance(params: HasBalanceParams): Promise<HasBalanceResult>;
27
28
  getBalanceAtTopoHeight(params: GetBalanceAtTopoHeightParams): Promise<Balance>;
29
+ getAsset(params: GetAssetParams): Promise<AssetData>;
28
30
  getAssets(): Promise<string[]>;
29
31
  countTransactions(): Promise<number>;
30
32
  getTips(): Promise<string[]>;
@@ -44,5 +46,6 @@ declare class WS extends BaseWS {
44
46
  getPeers(): Promise<Peer[]>;
45
47
  getDevFeeThresholds(): Promise<DevFee[]>;
46
48
  getSizeOnDisk(): Promise<DiskSize>;
49
+ isTxExecutedInBlock(params: IsTxExecutedInBlockParams): Promise<boolean>;
47
50
  }
48
51
  export default WS;
@@ -67,9 +67,15 @@ class WS extends BaseWS {
67
67
  getBalance(params) {
68
68
  return this.dataCall(RPCMethod.GetBalance, params);
69
69
  }
70
+ hasBalance(params) {
71
+ return this.dataCall(RPCMethod.HasBalance, params);
72
+ }
70
73
  getBalanceAtTopoHeight(params) {
71
74
  return this.dataCall(RPCMethod.GetBalanceAtTopoHeight, params);
72
75
  }
76
+ getAsset(params) {
77
+ return this.dataCall(RPCMethod.GetAsset, params);
78
+ }
73
79
  getAssets() {
74
80
  return this.dataCall(RPCMethod.GetAssets);
75
81
  }
@@ -127,5 +133,8 @@ class WS extends BaseWS {
127
133
  getSizeOnDisk() {
128
134
  return this.dataCall(RPCMethod.GetSizeOnDisk);
129
135
  }
136
+ isTxExecutedInBlock(params) {
137
+ return this.dataCall(RPCMethod.IsTxExecutedInBlock, params);
138
+ }
130
139
  }
131
140
  export default WS;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.14",
2
+ "version": "0.5.15",
3
3
  "name": "@xelis/sdk",
4
4
  "description": "Xelis software development kit for JS",
5
5
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "scripts": {
11
11
  "test": "jest",
12
12
  "build": "rm -rf ./dist && npx tsc --declaration && cp package.json ./dist && cp README.md ./dist",
13
- "publish": "cd ./dist && npm publish"
13
+ "publish-npm": "npm run build && cd ./dist && npm publish"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/jest": "^29.4.0",
@@ -1,5 +1,5 @@
1
1
  import { WS as BaseWS } from '../lib/websocket';
2
- import { Transaction } from '../daemon/types';
2
+ import { GetAssetParams, Transaction } from '../daemon/types';
3
3
  import { BuildTransactionParams, BuildTransactionResult, GetAddressParams, ListTransactionParams, SplitAddressParams, SplitAddressResult } from './types';
4
4
  declare class WS extends BaseWS {
5
5
  getVersion(): Promise<string>;
@@ -7,11 +7,14 @@ declare class WS extends BaseWS {
7
7
  getNonce(): Promise<number>;
8
8
  getTopoheight(): Promise<number>;
9
9
  getAddress(params?: GetAddressParams): Promise<string>;
10
+ rescan(): Promise<void>;
10
11
  splitAddress(params: SplitAddressParams): Promise<SplitAddressResult>;
11
12
  getBalance(asset?: string): Promise<number>;
12
13
  getTrackedAssets(): Promise<string[]>;
14
+ getAssetPrecision(params: GetAssetParams): Promise<number>;
13
15
  getTransaction(hash: string): Promise<Transaction>;
14
16
  buildTransaction(params: BuildTransactionParams): Promise<BuildTransactionResult>;
15
17
  listTransactions(params?: ListTransactionParams): Promise<Transaction[]>;
18
+ isOnline(): Promise<boolean>;
16
19
  }
17
20
  export default WS;
@@ -16,6 +16,9 @@ class WS extends BaseWS {
16
16
  getAddress(params) {
17
17
  return this.dataCall(RPCMethod.GetAddress, params);
18
18
  }
19
+ rescan() {
20
+ return this.dataCall(RPCMethod.Rescan);
21
+ }
19
22
  splitAddress(params) {
20
23
  return this.dataCall(RPCMethod.SplitAddress, params);
21
24
  }
@@ -25,6 +28,9 @@ class WS extends BaseWS {
25
28
  getTrackedAssets() {
26
29
  return this.dataCall(RPCMethod.GetTrackedAssets);
27
30
  }
31
+ getAssetPrecision(params) {
32
+ return this.dataCall(RPCMethod.GetAssetPrecision, params);
33
+ }
28
34
  getTransaction(hash) {
29
35
  return this.dataCall(RPCMethod.GetTransaction, { hash });
30
36
  }
@@ -34,5 +40,8 @@ class WS extends BaseWS {
34
40
  listTransactions(params) {
35
41
  return this.dataCall(RPCMethod.GetTransaction, params);
36
42
  }
43
+ isOnline() {
44
+ return this.dataCall(RPCMethod.IsOnline);
45
+ }
37
46
  }
38
47
  export default WS;