@xelis/sdk 0.10.2 → 0.10.5
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/dist/cjs/address/{address.js → index.js} +7 -7
- package/dist/cjs/daemon/rpc.js +5 -2
- package/dist/cjs/daemon/types.js +1 -0
- package/dist/cjs/daemon/websocket.js +5 -2
- package/dist/esm/address/{address.js → index.js} +7 -7
- package/dist/esm/daemon/rpc.js +5 -2
- package/dist/esm/daemon/types.js +1 -0
- package/dist/esm/daemon/websocket.js +5 -2
- package/dist/types/daemon/rpc.d.ts +2 -1
- package/dist/types/daemon/types.d.ts +20 -0
- package/dist/types/daemon/websocket.d.ts +3 -2
- package/package.json +1 -1
- /package/dist/types/address/{address.d.ts → index.d.ts} +0 -0
|
@@ -10,17 +10,17 @@ var ErrInvalidNetworkPrefix = "invalid network prefix (xel or xet)";
|
|
|
10
10
|
var Address = /** @class */ (function () {
|
|
11
11
|
function Address(data, hrp) {
|
|
12
12
|
this.isMainnet = hrp === PrefixAddress;
|
|
13
|
-
this.publicKey =
|
|
14
|
-
|
|
15
|
-
switch (addrType) {
|
|
16
|
-
case 0:
|
|
17
|
-
this.isIntegrated = false;
|
|
18
|
-
break;
|
|
13
|
+
this.publicKey = Array.from(data);
|
|
14
|
+
switch (data[32]) {
|
|
19
15
|
case 1:
|
|
20
16
|
this.isIntegrated = true;
|
|
21
|
-
var
|
|
17
|
+
var extraData = new Uint8Array(this.publicKey.slice(33));
|
|
18
|
+
var reader = new value_1.ValueReader(extraData);
|
|
22
19
|
this.extraData = reader.read();
|
|
23
20
|
break;
|
|
21
|
+
case 0:
|
|
22
|
+
this.isIntegrated = false;
|
|
23
|
+
break;
|
|
24
24
|
default:
|
|
25
25
|
throw "invalid address type";
|
|
26
26
|
}
|
package/dist/cjs/daemon/rpc.js
CHANGED
|
@@ -131,8 +131,11 @@ var RPC = /** @class */ (function (_super) {
|
|
|
131
131
|
RPC.prototype.getPeers = function () {
|
|
132
132
|
return this.request(types_1.RPCMethod.GetPeers);
|
|
133
133
|
};
|
|
134
|
-
RPC.prototype.getMemPool = function () {
|
|
135
|
-
return this.request(types_1.RPCMethod.GetMempool);
|
|
134
|
+
RPC.prototype.getMemPool = function (params) {
|
|
135
|
+
return this.request(types_1.RPCMethod.GetMempool, params);
|
|
136
|
+
};
|
|
137
|
+
RPC.prototype.getMempoolSummary = function (params) {
|
|
138
|
+
return this.request(types_1.RPCMethod.GetMempoolSummary, params);
|
|
136
139
|
};
|
|
137
140
|
RPC.prototype.getMempoolCache = function (address) {
|
|
138
141
|
return this.request(types_1.RPCMethod.GetMempoolCache, { address: address });
|
package/dist/cjs/daemon/types.js
CHANGED
|
@@ -54,6 +54,7 @@ var RPCMethod;
|
|
|
54
54
|
RPCMethod["GetPeers"] = "get_peers";
|
|
55
55
|
RPCMethod["GetMempool"] = "get_mempool";
|
|
56
56
|
RPCMethod["GetMempoolCache"] = "get_mempool_cache";
|
|
57
|
+
RPCMethod["GetMempoolSummary"] = "get_mempool_summary";
|
|
57
58
|
RPCMethod["GetEstimatedFeeRates"] = "get_estimated_fee_rates";
|
|
58
59
|
RPCMethod["GetDAGOrder"] = "get_dag_order";
|
|
59
60
|
RPCMethod["GetBlocksRangeByTopoheight"] = "get_blocks_range_by_topoheight";
|
|
@@ -187,8 +187,11 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
187
187
|
DaemonMethods.prototype.getPeers = function () {
|
|
188
188
|
return this.dataCall(types_1.RPCMethod.GetPeers);
|
|
189
189
|
};
|
|
190
|
-
DaemonMethods.prototype.getMemPool = function () {
|
|
191
|
-
return this.dataCall(types_1.RPCMethod.GetMempool);
|
|
190
|
+
DaemonMethods.prototype.getMemPool = function (params) {
|
|
191
|
+
return this.dataCall(types_1.RPCMethod.GetMempool, params);
|
|
192
|
+
};
|
|
193
|
+
DaemonMethods.prototype.getMempoolSummary = function (params) {
|
|
194
|
+
return this.dataCall(types_1.RPCMethod.GetMempoolSummary, params);
|
|
192
195
|
};
|
|
193
196
|
DaemonMethods.prototype.getMempoolCache = function (address) {
|
|
194
197
|
return this.dataCall(types_1.RPCMethod.GetMempoolCache, { address: address });
|
|
@@ -8,17 +8,17 @@ var ErrInvalidNetworkPrefix = "invalid network prefix (xel or xet)";
|
|
|
8
8
|
var Address = /** @class */ (function () {
|
|
9
9
|
function Address(data, hrp) {
|
|
10
10
|
this.isMainnet = hrp === PrefixAddress;
|
|
11
|
-
this.publicKey =
|
|
12
|
-
|
|
13
|
-
switch (addrType) {
|
|
14
|
-
case 0:
|
|
15
|
-
this.isIntegrated = false;
|
|
16
|
-
break;
|
|
11
|
+
this.publicKey = Array.from(data);
|
|
12
|
+
switch (data[32]) {
|
|
17
13
|
case 1:
|
|
18
14
|
this.isIntegrated = true;
|
|
19
|
-
var
|
|
15
|
+
var extraData = new Uint8Array(this.publicKey.slice(33));
|
|
16
|
+
var reader = new ValueReader(extraData);
|
|
20
17
|
this.extraData = reader.read();
|
|
21
18
|
break;
|
|
19
|
+
case 0:
|
|
20
|
+
this.isIntegrated = false;
|
|
21
|
+
break;
|
|
22
22
|
default:
|
|
23
23
|
throw "invalid address type";
|
|
24
24
|
}
|
package/dist/esm/daemon/rpc.js
CHANGED
|
@@ -128,8 +128,11 @@ var RPC = /** @class */ (function (_super) {
|
|
|
128
128
|
RPC.prototype.getPeers = function () {
|
|
129
129
|
return this.request(RPCMethod.GetPeers);
|
|
130
130
|
};
|
|
131
|
-
RPC.prototype.getMemPool = function () {
|
|
132
|
-
return this.request(RPCMethod.GetMempool);
|
|
131
|
+
RPC.prototype.getMemPool = function (params) {
|
|
132
|
+
return this.request(RPCMethod.GetMempool, params);
|
|
133
|
+
};
|
|
134
|
+
RPC.prototype.getMempoolSummary = function (params) {
|
|
135
|
+
return this.request(RPCMethod.GetMempoolSummary, params);
|
|
133
136
|
};
|
|
134
137
|
RPC.prototype.getMempoolCache = function (address) {
|
|
135
138
|
return this.request(RPCMethod.GetMempoolCache, { address: address });
|
package/dist/esm/daemon/types.js
CHANGED
|
@@ -51,6 +51,7 @@ export var RPCMethod;
|
|
|
51
51
|
RPCMethod["GetPeers"] = "get_peers";
|
|
52
52
|
RPCMethod["GetMempool"] = "get_mempool";
|
|
53
53
|
RPCMethod["GetMempoolCache"] = "get_mempool_cache";
|
|
54
|
+
RPCMethod["GetMempoolSummary"] = "get_mempool_summary";
|
|
54
55
|
RPCMethod["GetEstimatedFeeRates"] = "get_estimated_fee_rates";
|
|
55
56
|
RPCMethod["GetDAGOrder"] = "get_dag_order";
|
|
56
57
|
RPCMethod["GetBlocksRangeByTopoheight"] = "get_blocks_range_by_topoheight";
|
|
@@ -184,8 +184,11 @@ var DaemonMethods = /** @class */ (function () {
|
|
|
184
184
|
DaemonMethods.prototype.getPeers = function () {
|
|
185
185
|
return this.dataCall(RPCMethod.GetPeers);
|
|
186
186
|
};
|
|
187
|
-
DaemonMethods.prototype.getMemPool = function () {
|
|
188
|
-
return this.dataCall(RPCMethod.GetMempool);
|
|
187
|
+
DaemonMethods.prototype.getMemPool = function (params) {
|
|
188
|
+
return this.dataCall(RPCMethod.GetMempool, params);
|
|
189
|
+
};
|
|
190
|
+
DaemonMethods.prototype.getMempoolSummary = function (params) {
|
|
191
|
+
return this.dataCall(RPCMethod.GetMempoolSummary, params);
|
|
189
192
|
};
|
|
190
193
|
DaemonMethods.prototype.getMempoolCache = function (address) {
|
|
191
194
|
return this.dataCall(RPCMethod.GetMempoolCache, { address: address });
|
|
@@ -37,7 +37,8 @@ export declare class RPC extends HttpRPC {
|
|
|
37
37
|
isTxExecutedInBlock(params: types.IsTxExecutedInBlockParams): Promise<boolean>;
|
|
38
38
|
p2pStatus(): Promise<types.P2PStatusResult>;
|
|
39
39
|
getPeers(): Promise<types.GetPeersResult>;
|
|
40
|
-
getMemPool(): Promise<types.
|
|
40
|
+
getMemPool(params?: types.GetMempoolParams): Promise<types.GetMempoolResult>;
|
|
41
|
+
getMempoolSummary(params?: types.GetMempoolParams): Promise<types.GetMempoolSummaryResult>;
|
|
41
42
|
getMempoolCache(address: String): Promise<types.GetMempoolCacheResult>;
|
|
42
43
|
getEstimatedFeeRates(): Promise<types.FeeRatesEstimated>;
|
|
43
44
|
getDAGOrder(params?: types.TopoheightRangeParams): Promise<string[]>;
|
|
@@ -494,6 +494,25 @@ export interface TransactionResponse extends Transaction {
|
|
|
494
494
|
in_mempool: boolean;
|
|
495
495
|
first_seen?: number;
|
|
496
496
|
}
|
|
497
|
+
export interface GetMempoolParams {
|
|
498
|
+
maximum?: number;
|
|
499
|
+
skip?: number;
|
|
500
|
+
}
|
|
501
|
+
export interface GetMempoolResult {
|
|
502
|
+
total: number;
|
|
503
|
+
transactions: TransactionResponse[];
|
|
504
|
+
}
|
|
505
|
+
export interface MempoolTransactionSummary {
|
|
506
|
+
hash: string;
|
|
507
|
+
source: string;
|
|
508
|
+
fee: number;
|
|
509
|
+
first_seen: number;
|
|
510
|
+
size: number;
|
|
511
|
+
}
|
|
512
|
+
export interface GetMempoolSummaryResult {
|
|
513
|
+
total: number;
|
|
514
|
+
transactions: MempoolTransactionSummary;
|
|
515
|
+
}
|
|
497
516
|
export interface StableTopoHeightChanged {
|
|
498
517
|
previous_stable_topoheight: number;
|
|
499
518
|
new_stable_topoheight: number;
|
|
@@ -551,6 +570,7 @@ export declare enum RPCMethod {
|
|
|
551
570
|
GetPeers = "get_peers",
|
|
552
571
|
GetMempool = "get_mempool",
|
|
553
572
|
GetMempoolCache = "get_mempool_cache",
|
|
573
|
+
GetMempoolSummary = "get_mempool_summary",
|
|
554
574
|
GetEstimatedFeeRates = "get_estimated_fee_rates",
|
|
555
575
|
GetDAGOrder = "get_dag_order",
|
|
556
576
|
GetBlocksRangeByTopoheight = "get_blocks_range_by_topoheight",
|
|
@@ -12,7 +12,7 @@ export declare class DaemonMethods {
|
|
|
12
12
|
onStableHeightChanged(onData: (msgEvent: MessageEvent, data?: types.StableHeightChanged & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
13
13
|
onStableTopoHeightChanged(onData: (msgEvent: MessageEvent, data?: types.StableTopoHeightChanged & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
14
14
|
onTransactionOrphaned(onData: (msgEvent: MessageEvent, data?: types.TransactionResponse & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
15
|
-
onTransactionAddedInMempool(onData: (msgEvent: MessageEvent, data?: types.
|
|
15
|
+
onTransactionAddedInMempool(onData: (msgEvent: MessageEvent, data?: types.MempoolTransactionSummary & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
16
16
|
onTransactionExecuted(onData: (msgEvent: MessageEvent, data?: types.TransactionExecuted & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
17
17
|
onInvokeContract(contract: string, onData: (msgEvent: MessageEvent, data?: types.InvokeContract & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
18
18
|
onDeployContract(onData: (msgEvent: MessageEvent, data?: types.NewContract & types.RPCEventResult, err?: Error) => void): Promise<() => Promise<void>>;
|
|
@@ -59,7 +59,8 @@ export declare class DaemonMethods {
|
|
|
59
59
|
isTxExecutedInBlock(params: types.IsTxExecutedInBlockParams): Promise<boolean>;
|
|
60
60
|
p2pStatus(): Promise<types.P2PStatusResult>;
|
|
61
61
|
getPeers(): Promise<types.GetPeersResult>;
|
|
62
|
-
getMemPool(): Promise<types.
|
|
62
|
+
getMemPool(params?: types.GetMempoolParams): Promise<types.GetMempoolResult>;
|
|
63
|
+
getMempoolSummary(params?: types.GetMempoolParams): Promise<types.GetMempoolSummaryResult>;
|
|
63
64
|
getMempoolCache(address: string): Promise<types.GetMempoolCacheResult>;
|
|
64
65
|
getEstimatedFeeRates(): Promise<types.FeeRatesEstimated>;
|
|
65
66
|
getDAGOrder(params: types.TopoheightRangeParams): Promise<string[]>;
|
package/package.json
CHANGED
|
File without changes
|