@injectivelabs/wallet-cosmos 1.20.7 → 1.20.9

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.
@@ -3,7 +3,7 @@ let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
3
3
  let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
4
4
  let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
5
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
6
- let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
6
+ let __injectivelabs_sdk_ts_proto_cosmos_tx = require("@injectivelabs/sdk-ts/proto/cosmos-tx");
7
7
  let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
8
8
 
9
9
  //#region src/lib.ts
@@ -136,7 +136,7 @@ var CosmosWallet = class CosmosWallet {
136
136
  const { chainId, wallet } = this;
137
137
  const cosmosWallet = await this.getCosmosWallet();
138
138
  try {
139
- const result = await cosmosWallet.sendTx(chainId, __injectivelabs_sdk_ts.CosmosTxV1Beta1TxPb.TxRaw.toBinary(txRaw), __injectivelabs_wallet_base.BroadcastMode.Sync);
139
+ const result = await cosmosWallet.sendTx(chainId, __injectivelabs_sdk_ts_proto_cosmos_tx.CosmosTxV1Beta1TxPb.TxRaw.toBinary(txRaw), __injectivelabs_wallet_base.BroadcastMode.Sync);
140
140
  if (!result || result.length === 0) throw new __injectivelabs_exceptions.TransactionException(/* @__PURE__ */ new Error("Transaction failed to be broadcasted"), { contextModule: wallet });
141
141
  return (0, __injectivelabs_sdk_ts_utils.uint8ArrayToHex)(result);
142
142
  } catch (e) {
@@ -158,7 +158,7 @@ var CosmosWallet = class CosmosWallet {
158
158
  const { chainId, wallet } = this;
159
159
  const cosmosWallet = await this.getCosmosWallet();
160
160
  try {
161
- const result = await cosmosWallet.sendTx(chainId, __injectivelabs_sdk_ts.CosmosTxV1Beta1TxPb.TxRaw.toBinary(txRaw), __injectivelabs_wallet_base.BroadcastMode.Block);
161
+ const result = await cosmosWallet.sendTx(chainId, __injectivelabs_sdk_ts_proto_cosmos_tx.CosmosTxV1Beta1TxPb.TxRaw.toBinary(txRaw), __injectivelabs_wallet_base.BroadcastMode.Block);
162
162
  if (!result || result.length === 0) throw new __injectivelabs_exceptions.TransactionException(/* @__PURE__ */ new Error("Transaction failed to be broadcasted"), { contextModule: wallet });
163
163
  return (0, __injectivelabs_sdk_ts_utils.uint8ArrayToHex)(result);
164
164
  } catch (e) {
@@ -391,7 +391,10 @@ var CosmosWalletStrategy = class extends __injectivelabs_wallet_base.BaseConcret
391
391
  const txRaw = (0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction);
392
392
  if (!options.endpoints) throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options to broadcast transaction"));
393
393
  try {
394
- return await (0, __injectivelabs_sdk_ts_core_tx.waitTxBroadcasted)(await cosmosWallet.broadcastTx(txRaw), options);
394
+ var _options$onBroadcast;
395
+ const txHash = await cosmosWallet.broadcastTx(txRaw);
396
+ (_options$onBroadcast = options.onBroadcast) === null || _options$onBroadcast === void 0 || _options$onBroadcast.call(options, txHash);
397
+ return await (0, __injectivelabs_sdk_ts_core_tx.waitTxBroadcasted)(txHash, options);
395
398
  } catch (e) {
396
399
  if (e instanceof __injectivelabs_exceptions.TransactionException) throw e;
397
400
  throw new __injectivelabs_exceptions.TransactionException(new Error(e.message), {
@@ -4,7 +4,7 @@ import * as _keplr_wallet_types0 from "@keplr-wallet/types";
4
4
  import { AminoSignResponse, Keplr, OfflineAminoSigner, StdSignDoc as StdSignDoc$1 } from "@keplr-wallet/types";
5
5
  import * as _cosmjs_stargate0 from "@cosmjs/stargate";
6
6
  import { StdFee } from "@cosmjs/stargate";
7
- import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
7
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts/proto/cosmos-tx";
8
8
  import { EncodeObject, OfflineSigner } from "@cosmjs/proto-signing";
9
9
  import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
10
10
  import { AminoSignResponse as AminoSignResponse$1, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
@@ -1,5 +1,5 @@
1
1
  import { BaseConcreteStrategy, ConcreteWalletStrategy, SendTransactionOptions, StdSignDoc, Wallet, WalletDeviceType } from "@injectivelabs/wallet-base";
2
- import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
2
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts/proto/cosmos-tx";
3
3
  import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
4
4
  import * as _cosmjs_stargate0 from "@cosmjs/stargate";
5
5
  import { StdFee } from "@cosmjs/stargate";
package/dist/esm/index.js CHANGED
@@ -3,7 +3,7 @@ import { BaseConcreteStrategy, BroadcastMode, Wallet, WalletAction, WalletDevice
3
3
  import { PublicKey } from "@injectivelabs/sdk-ts/core/accounts";
4
4
  import { stringToUint8Array, uint8ArrayToBase64, uint8ArrayToHex } from "@injectivelabs/sdk-ts/utils";
5
5
  import { CosmosWalletException, ErrorType, GeneralException, TransactionException, UnspecifiedErrorCode, WalletErrorActionModule } from "@injectivelabs/exceptions";
6
- import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
6
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts/proto/cosmos-tx";
7
7
  import { createSignDocFromTransaction, createTxRawFromSigResponse, waitTxBroadcasted } from "@injectivelabs/sdk-ts/core/tx";
8
8
 
9
9
  //#region src/lib.ts
@@ -391,7 +391,10 @@ var CosmosWalletStrategy = class extends BaseConcreteStrategy {
391
391
  const txRaw = createTxRawFromSigResponse(transaction);
392
392
  if (!options.endpoints) throw new CosmosWalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options to broadcast transaction"));
393
393
  try {
394
- return await waitTxBroadcasted(await cosmosWallet.broadcastTx(txRaw), options);
394
+ var _options$onBroadcast;
395
+ const txHash = await cosmosWallet.broadcastTx(txRaw);
396
+ (_options$onBroadcast = options.onBroadcast) === null || _options$onBroadcast === void 0 || _options$onBroadcast.call(options, txHash);
397
+ return await waitTxBroadcasted(txHash, options);
395
398
  } catch (e) {
396
399
  if (e instanceof TransactionException) throw e;
397
400
  throw new TransactionException(new Error(e.message), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-cosmos",
3
- "version": "1.20.7",
3
+ "version": "1.20.9",
4
4
  "description": "Cosmos wallet strategies for use with @injectivelabs/wallet-core.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -45,11 +45,11 @@
45
45
  "@cosmjs/proto-signing": "0.33.0",
46
46
  "@cosmjs/stargate": "0.33.0",
47
47
  "@keplr-wallet/types": "^0.12.296",
48
- "@injectivelabs/exceptions": "1.20.7",
49
- "@injectivelabs/sdk-ts": "1.20.7",
50
- "@injectivelabs/utils": "1.20.7",
51
- "@injectivelabs/wallet-base": "1.20.7",
52
- "@injectivelabs/ts-types": "1.20.7"
48
+ "@injectivelabs/utils": "1.20.9",
49
+ "@injectivelabs/exceptions": "1.20.9",
50
+ "@injectivelabs/wallet-base": "1.20.9",
51
+ "@injectivelabs/ts-types": "1.20.9",
52
+ "@injectivelabs/sdk-ts": "1.20.9"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"