coreum-js 2.8.22 → 2.8.24

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, memo || "");
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, memo || "", signerData);
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) {
@@ -10,6 +10,6 @@ const convertStringToAny = (message) => {
10
10
  const formattedAnyDataValue = new any_pb_1.Any();
11
11
  formattedAnyDataValue.typeUrl = '/coreum.asset.nft.v1.DataBytes';
12
12
  formattedAnyDataValue.value = dataBytesBinary;
13
- return formattedValueOfData;
13
+ return formattedAnyDataValue;
14
14
  };
15
15
  exports.convertStringToAny = convertStringToAny;
@@ -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, memo || "");
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, memo || "", signerData);
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) {
@@ -7,5 +7,5 @@ export const convertStringToAny = (message) => {
7
7
  const formattedAnyDataValue = new Any();
8
8
  formattedAnyDataValue.typeUrl = '/coreum.asset.nft.v1.DataBytes';
9
9
  formattedAnyDataValue.value = dataBytesBinary;
10
- return formattedValueOfData;
10
+ return formattedAnyDataValue;
11
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coreum-js",
3
- "version": "2.8.22",
3
+ "version": "2.8.24",
4
4
  "description": "JS/TS Library to to easily make use of the Coreum Blockchain",
5
5
  "main": "dist/main/index.js",
6
6
  "module": "dist/module/index.js",