@xelis/sdk 0.5.15 → 0.5.16
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 +6 -1
- package/daemon/types.js +1 -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;
|
|
@@ -255,5 +259,6 @@ export declare enum RPCEvent {
|
|
|
255
259
|
PeerDisconnected = "peer_disconnected",
|
|
256
260
|
PeerStateUpdated = "peer_state_updated",
|
|
257
261
|
PeerPeerListUpdated = "peer_peer_list_updated",
|
|
258
|
-
PeerPeerDisconnected = "peer_peer_disconnected"
|
|
262
|
+
PeerPeerDisconnected = "peer_peer_disconnected",
|
|
263
|
+
BlockOrphaned = "block_orphaned"
|
|
259
264
|
}
|
package/daemon/types.js
CHANGED
|
@@ -50,4 +50,5 @@ export var RPCEvent;
|
|
|
50
50
|
RPCEvent["PeerStateUpdated"] = "peer_state_updated";
|
|
51
51
|
RPCEvent["PeerPeerListUpdated"] = "peer_peer_list_updated";
|
|
52
52
|
RPCEvent["PeerPeerDisconnected"] = "peer_peer_disconnected";
|
|
53
|
+
RPCEvent["BlockOrphaned"] = "block_orphaned";
|
|
53
54
|
})(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