coreum-js 2.8.23 → 2.8.25
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.
|
@@ -14,6 +14,7 @@ interface ClientProps {
|
|
|
14
14
|
network?: string;
|
|
15
15
|
custom_ws_endpoint?: string;
|
|
16
16
|
custom_node_endpoint?: string;
|
|
17
|
+
tx_memo?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare class Client {
|
|
19
20
|
private _tmClient;
|
|
@@ -25,6 +26,7 @@ export declare class Client {
|
|
|
25
26
|
private _eventSequence;
|
|
26
27
|
private _custom_ws_endpoint;
|
|
27
28
|
private _custom_node_endpoint;
|
|
29
|
+
private _tx_memo;
|
|
28
30
|
config: CoreumNetworkConfig;
|
|
29
31
|
get queryClients(): ClientQueryClient;
|
|
30
32
|
constructor(props?: ClientProps);
|
|
@@ -36,6 +36,7 @@ class Client {
|
|
|
36
36
|
this.config = (props === null || props === void 0 ? void 0 : props.network)
|
|
37
37
|
? coreum_2.COREUM_CONFIG[props.network]
|
|
38
38
|
: coreum_2.COREUM_CONFIG.mainnet;
|
|
39
|
+
this._tx_memo = (props === null || props === void 0 ? void 0 : props.tx_memo) || undefined;
|
|
39
40
|
this._custom_ws_endpoint = (props === null || props === void 0 ? void 0 : props.custom_ws_endpoint) || undefined;
|
|
40
41
|
this._custom_node_endpoint = (props === null || props === void 0 ? void 0 : props.custom_node_endpoint) || undefined;
|
|
41
42
|
if ((props === null || props === void 0 ? void 0 : props.custom_node_endpoint) && !props.network)
|
|
@@ -201,7 +202,9 @@ class Client {
|
|
|
201
202
|
try {
|
|
202
203
|
this._isSigningClientInit();
|
|
203
204
|
const { fee } = await this.getTxFee(msgs);
|
|
204
|
-
return await this._client.signAndBroadcast(this._address, msgs, fee,
|
|
205
|
+
return await this._client.signAndBroadcast(this._address, msgs, fee, this._tx_memo
|
|
206
|
+
? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
|
|
207
|
+
: memo || "");
|
|
205
208
|
}
|
|
206
209
|
catch (e) {
|
|
207
210
|
throw {
|
|
@@ -227,7 +230,9 @@ class Client {
|
|
|
227
230
|
sequence,
|
|
228
231
|
chainId: this.config.chain_id,
|
|
229
232
|
};
|
|
230
|
-
const signed = await signingClient.sign(this.address, msgs, fee,
|
|
233
|
+
const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
|
|
234
|
+
? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
|
|
235
|
+
: memo || "", signerData);
|
|
231
236
|
return cosmos_1.TxRaw.encode(signed).finish();
|
|
232
237
|
}
|
|
233
238
|
catch (e) {
|
|
@@ -378,7 +383,7 @@ class Client {
|
|
|
378
383
|
await (0, services_1.connectKeplr)(this.config);
|
|
379
384
|
await window.keplr.enable(this.config.chain_id);
|
|
380
385
|
// get offline signer for signing txs
|
|
381
|
-
const offlineSigner = await window.
|
|
386
|
+
const offlineSigner = await window.getOfflineSignerAuto(this.config.chain_id);
|
|
382
387
|
await this._createClient(offlineSigner);
|
|
383
388
|
}
|
|
384
389
|
catch (e) {
|
|
@@ -14,6 +14,7 @@ interface ClientProps {
|
|
|
14
14
|
network?: string;
|
|
15
15
|
custom_ws_endpoint?: string;
|
|
16
16
|
custom_node_endpoint?: string;
|
|
17
|
+
tx_memo?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare class Client {
|
|
19
20
|
private _tmClient;
|
|
@@ -25,6 +26,7 @@ export declare class Client {
|
|
|
25
26
|
private _eventSequence;
|
|
26
27
|
private _custom_ws_endpoint;
|
|
27
28
|
private _custom_node_endpoint;
|
|
29
|
+
private _tx_memo;
|
|
28
30
|
config: CoreumNetworkConfig;
|
|
29
31
|
get queryClients(): ClientQueryClient;
|
|
30
32
|
constructor(props?: ClientProps);
|
|
@@ -31,6 +31,7 @@ export class Client {
|
|
|
31
31
|
_eventSequence = 0;
|
|
32
32
|
_custom_ws_endpoint;
|
|
33
33
|
_custom_node_endpoint;
|
|
34
|
+
_tx_memo;
|
|
34
35
|
config;
|
|
35
36
|
get queryClients() {
|
|
36
37
|
return this._queryClient;
|
|
@@ -39,6 +40,7 @@ export class Client {
|
|
|
39
40
|
this.config = props?.network
|
|
40
41
|
? COREUM_CONFIG[props.network]
|
|
41
42
|
: COREUM_CONFIG.mainnet;
|
|
43
|
+
this._tx_memo = props?.tx_memo || undefined;
|
|
42
44
|
this._custom_ws_endpoint = props?.custom_ws_endpoint || undefined;
|
|
43
45
|
this._custom_node_endpoint = props?.custom_node_endpoint || undefined;
|
|
44
46
|
if (props?.custom_node_endpoint && !props.network)
|
|
@@ -203,7 +205,9 @@ export class Client {
|
|
|
203
205
|
try {
|
|
204
206
|
this._isSigningClientInit();
|
|
205
207
|
const { fee } = await this.getTxFee(msgs);
|
|
206
|
-
return await this._client.signAndBroadcast(this._address, msgs, fee,
|
|
208
|
+
return await this._client.signAndBroadcast(this._address, msgs, fee, this._tx_memo
|
|
209
|
+
? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
|
|
210
|
+
: memo || "");
|
|
207
211
|
}
|
|
208
212
|
catch (e) {
|
|
209
213
|
throw {
|
|
@@ -229,7 +233,9 @@ export class Client {
|
|
|
229
233
|
sequence,
|
|
230
234
|
chainId: this.config.chain_id,
|
|
231
235
|
};
|
|
232
|
-
const signed = await signingClient.sign(this.address, msgs, fee,
|
|
236
|
+
const signed = await signingClient.sign(this.address, msgs, fee, this._tx_memo
|
|
237
|
+
? `${this._tx_memo} ${memo ? `- ${memo}` : ""}`
|
|
238
|
+
: memo || "", signerData);
|
|
233
239
|
return TxRaw.encode(signed).finish();
|
|
234
240
|
}
|
|
235
241
|
catch (e) {
|
|
@@ -379,7 +385,7 @@ export class Client {
|
|
|
379
385
|
await connectKeplr(this.config);
|
|
380
386
|
await window.keplr.enable(this.config.chain_id);
|
|
381
387
|
// get offline signer for signing txs
|
|
382
|
-
const offlineSigner = await window.
|
|
388
|
+
const offlineSigner = await window.getOfflineSignerAuto(this.config.chain_id);
|
|
383
389
|
await this._createClient(offlineSigner);
|
|
384
390
|
}
|
|
385
391
|
catch (e) {
|