@xelis/sdk 0.5.15 → 0.5.17
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/types.d.ts +12 -1
- package/daemon/types.js +8 -0
- package/daemon/websocket.d.ts +2 -1
- package/daemon/websocket.js +3 -0
- package/package.json +1 -1
package/daemon/types.d.ts
CHANGED
|
@@ -96,6 +96,10 @@ export interface BlockOrdered {
|
|
|
96
96
|
block_hash: string;
|
|
97
97
|
block_type: string;
|
|
98
98
|
}
|
|
99
|
+
export interface BlockOrphaned {
|
|
100
|
+
block_hash: string;
|
|
101
|
+
old_topoheight: number;
|
|
102
|
+
}
|
|
99
103
|
export interface Transfer {
|
|
100
104
|
amount: number;
|
|
101
105
|
asset: string;
|
|
@@ -206,6 +210,12 @@ export interface IsTxExecutedInBlockParams {
|
|
|
206
210
|
export interface GetAssetParams {
|
|
207
211
|
asset: string;
|
|
208
212
|
}
|
|
213
|
+
export declare enum BlockType {
|
|
214
|
+
Sync = "Sync",
|
|
215
|
+
Normal = "Normal",
|
|
216
|
+
Side = "Side",
|
|
217
|
+
Orphaned = "Orphaned"
|
|
218
|
+
}
|
|
209
219
|
export declare enum RPCMethod {
|
|
210
220
|
GetVersion = "get_version",
|
|
211
221
|
GetInfo = "get_info",
|
|
@@ -255,5 +265,6 @@ export declare enum RPCEvent {
|
|
|
255
265
|
PeerDisconnected = "peer_disconnected",
|
|
256
266
|
PeerStateUpdated = "peer_state_updated",
|
|
257
267
|
PeerPeerListUpdated = "peer_peer_list_updated",
|
|
258
|
-
PeerPeerDisconnected = "peer_peer_disconnected"
|
|
268
|
+
PeerPeerDisconnected = "peer_peer_disconnected",
|
|
269
|
+
BlockOrphaned = "block_orphaned"
|
|
259
270
|
}
|
package/daemon/types.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export var BlockType;
|
|
2
|
+
(function (BlockType) {
|
|
3
|
+
BlockType["Sync"] = "Sync";
|
|
4
|
+
BlockType["Normal"] = "Normal";
|
|
5
|
+
BlockType["Side"] = "Side";
|
|
6
|
+
BlockType["Orphaned"] = "Orphaned";
|
|
7
|
+
})(BlockType || (BlockType = {}));
|
|
1
8
|
export var RPCMethod;
|
|
2
9
|
(function (RPCMethod) {
|
|
3
10
|
RPCMethod["GetVersion"] = "get_version";
|
|
@@ -50,4 +57,5 @@ export var RPCEvent;
|
|
|
50
57
|
RPCEvent["PeerStateUpdated"] = "peer_state_updated";
|
|
51
58
|
RPCEvent["PeerPeerListUpdated"] = "peer_peer_list_updated";
|
|
52
59
|
RPCEvent["PeerPeerDisconnected"] = "peer_peer_disconnected";
|
|
60
|
+
RPCEvent["BlockOrphaned"] = "block_orphaned";
|
|
53
61
|
})(RPCEvent || (RPCEvent = {}));
|
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, 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';
|
|
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, BlockOrphaned } 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>>;
|
|
@@ -12,6 +12,7 @@ declare class WS extends BaseWS {
|
|
|
12
12
|
onPeerPeerDisconnected(onData: (msgEvent: MessageEvent, data?: PeerPeerDisconnected & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
13
13
|
onPeerStateUpdated(onData: (msgEvent: MessageEvent, data?: Peer & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
14
14
|
onNewAsset(onData: (msgEvent: MessageEvent, data?: AssetWithData & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
15
|
+
onBlockOrphaned(onData: (msgEvent: MessageEvent, data?: BlockOrphaned & RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
15
16
|
getVersion(): Promise<string>;
|
|
16
17
|
getInfo(): Promise<GetInfoResult>;
|
|
17
18
|
getHeight(): Promise<number>;
|
package/daemon/websocket.js
CHANGED
|
@@ -31,6 +31,9 @@ class WS extends BaseWS {
|
|
|
31
31
|
onNewAsset(onData) {
|
|
32
32
|
return this.listenEvent(RPCEvent.NewAsset, onData);
|
|
33
33
|
}
|
|
34
|
+
onBlockOrphaned(onData) {
|
|
35
|
+
return this.listenEvent(RPCEvent.BlockOrphaned, onData);
|
|
36
|
+
}
|
|
34
37
|
getVersion() {
|
|
35
38
|
return this.dataCall(RPCMethod.GetVersion);
|
|
36
39
|
}
|
package/package.json
CHANGED