@xelis/sdk 0.11.1 → 0.11.3

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.
@@ -92,7 +92,8 @@ var WSRPC = /** @class */ (function () {
92
92
  if (eventData && typeof msgEvent.data === "string") {
93
93
  try {
94
94
  var data_1 = (0, parse_json_1.parseJSON)(msgEvent.data);
95
- if (data_1.id === idRefObject_1.id) {
95
+ // event result will contain an event parameter with the event name defined
96
+ if (data_1.result["event"] === event && data_1.id === idRefObject_1.id) {
96
97
  eventData.listeners.forEach(function (listener) {
97
98
  if (data_1.error) {
98
99
  listener(undefined, new Error(data_1.error.message));
@@ -86,7 +86,8 @@ var WSRPC = /** @class */ (function () {
86
86
  if (eventData && typeof msgEvent.data === "string") {
87
87
  try {
88
88
  var data_1 = parseJSON(msgEvent.data);
89
- if (data_1.id === idRefObject_1.id) {
89
+ // event result will contain an event parameter with the event name defined
90
+ if (data_1.result["event"] === event && data_1.id === idRefObject_1.id) {
90
91
  eventData.listeners.forEach(function (listener) {
91
92
  if (data_1.error) {
92
93
  listener(undefined, new Error(data_1.error.message));
@@ -104,9 +104,6 @@ export interface HeightRangeParams {
104
104
  start_height?: number;
105
105
  end_height?: number;
106
106
  }
107
- export interface RPCEventResult {
108
- event: string;
109
- }
110
107
  export interface TimedDirection {
111
108
  in?: {
112
109
  received_at: number;
@@ -1,26 +1,26 @@
1
- import { RPCEvent, RPCEventResult } from './types';
1
+ import { RPCEvent } from './types';
2
2
  import * as types from './types';
3
3
  import { WSRPC } from '../rpc/websocket';
4
4
  export interface DaemonEventsData {
5
- [RPCEvent.NewBlock]: types.Block & RPCEventResult;
6
- [RPCEvent.BlockOrdered]: types.BlockOrdered & RPCEventResult;
7
- [RPCEvent.BlockOrphaned]: types.BlockOrphaned & RPCEventResult;
8
- [RPCEvent.StableHeightChanged]: types.StableHeightChanged & RPCEventResult;
9
- [RPCEvent.StableTopoHeightChanged]: types.StableTopoHeightChanged & RPCEventResult;
10
- [RPCEvent.TransactionOrphaned]: types.TransactionResponse & RPCEventResult;
11
- [RPCEvent.TransactionAddedInMempool]: types.MempoolTransactionSummary & RPCEventResult;
12
- [RPCEvent.TransactionExecuted]: types.TransactionExecuted & RPCEventResult;
13
- [RPCEvent.InvokeContract]: types.InvokeContract & RPCEventResult;
14
- [RPCEvent.ContractTransfer]: types.ContractTransfer & RPCEventResult;
15
- [RPCEvent.ContractEvent]: types.ContractEvent & RPCEventResult;
16
- [RPCEvent.DeployContract]: types.NewContract & RPCEventResult;
17
- [RPCEvent.NewAsset]: types.AssetWithData & RPCEventResult;
18
- [RPCEvent.PeerConnected]: types.Peer & RPCEventResult;
19
- [RPCEvent.PeerDisconnected]: number & RPCEventResult;
20
- [RPCEvent.PeerStateUpdated]: types.Peer & RPCEventResult;
21
- [RPCEvent.PeerPeerListUpdated]: types.PeerPeerListUpdated & RPCEventResult;
22
- [RPCEvent.PeerPeerDisconnected]: types.PeerPeerDisconnected & RPCEventResult;
23
- [RPCEvent.NewBlockTemplate]: types.GetBlockTemplateResult & RPCEventResult;
5
+ [RPCEvent.NewBlock]: types.Block;
6
+ [RPCEvent.BlockOrdered]: types.BlockOrdered;
7
+ [RPCEvent.BlockOrphaned]: types.BlockOrphaned;
8
+ [RPCEvent.StableHeightChanged]: types.StableHeightChanged;
9
+ [RPCEvent.StableTopoHeightChanged]: types.StableTopoHeightChanged;
10
+ [RPCEvent.TransactionOrphaned]: types.TransactionResponse;
11
+ [RPCEvent.TransactionAddedInMempool]: types.MempoolTransactionSummary;
12
+ [RPCEvent.TransactionExecuted]: types.TransactionExecuted;
13
+ [RPCEvent.InvokeContract]: types.InvokeContract;
14
+ [RPCEvent.ContractTransfer]: types.ContractTransfer;
15
+ [RPCEvent.ContractEvent]: types.ContractEvent;
16
+ [RPCEvent.DeployContract]: types.NewContract;
17
+ [RPCEvent.NewAsset]: types.AssetWithData;
18
+ [RPCEvent.PeerConnected]: types.Peer;
19
+ [RPCEvent.PeerDisconnected]: number;
20
+ [RPCEvent.PeerStateUpdated]: types.Peer;
21
+ [RPCEvent.PeerPeerListUpdated]: types.PeerPeerListUpdated;
22
+ [RPCEvent.PeerPeerDisconnected]: types.PeerPeerDisconnected;
23
+ [RPCEvent.NewBlockTemplate]: types.GetBlockTemplateResult;
24
24
  }
25
25
  export declare class DaemonMethods {
26
26
  ws: WSRPC;
@@ -1,18 +1,17 @@
1
1
  import { WSRPC } from '../rpc/websocket';
2
- import { RPCEventResult } from '../daemon/types';
3
2
  import * as daemonTypes from '../daemon/types';
4
3
  import { RPCEvent } from './types';
5
4
  import * as types from './types';
6
5
  import { Element } from '../data/element';
7
6
  export interface WalletEventsData {
8
- [RPCEvent.NewTopoheight]: types.NewTopoheightResult & RPCEventResult;
9
- [RPCEvent.NewAsset]: daemonTypes.AssetWithData & RPCEventResult;
10
- [RPCEvent.NewTransaction]: types.TransactionEntry & RPCEventResult;
11
- [RPCEvent.BalanceChanged]: types.BalanceChangedResult & RPCEventResult;
12
- [RPCEvent.Rescan]: types.RescanResult & RPCEventResult;
13
- [RPCEvent.HistorySynced]: types.HistorySyncedResult & RPCEventResult;
14
- [RPCEvent.Online]: RPCEventResult;
15
- [RPCEvent.Offline]: RPCEventResult;
7
+ [RPCEvent.NewTopoheight]: types.NewTopoheightResult;
8
+ [RPCEvent.NewAsset]: daemonTypes.AssetWithData;
9
+ [RPCEvent.NewTransaction]: types.TransactionEntry;
10
+ [RPCEvent.BalanceChanged]: types.BalanceChangedResult;
11
+ [RPCEvent.Rescan]: types.RescanResult;
12
+ [RPCEvent.HistorySynced]: types.HistorySyncedResult;
13
+ [RPCEvent.Online]: void;
14
+ [RPCEvent.Offline]: void;
16
15
  }
17
16
  export declare class WalletMethods {
18
17
  ws: WSRPC;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.1",
2
+ "version": "0.11.3",
3
3
  "name": "@xelis/sdk",
4
4
  "description": "Xelis software development kit for JS",
5
5
  "exports": {