@injectivelabs/wallet-private-key 1.20.64 → 1.20.65

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.
@@ -1,9 +1,9 @@
1
1
  let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
2
- let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
3
2
  let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
4
- let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
3
+ let __injectivelabs_sdk_ts_core_accounts = require("@injectivelabs/sdk-ts/core/accounts");
5
4
  let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
6
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
6
+ let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
7
7
 
8
8
  //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
9
9
  function _typeof(o) {
@@ -92,19 +92,7 @@ var PrivateKeyWallet = class extends __injectivelabs_wallet_base.BaseConcreteStr
92
92
  });
93
93
  }
94
94
  async sendTransaction(transaction, options) {
95
- const { endpoints, txTimeout, txInclusion, onBroadcast } = options;
96
- if (!endpoints) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
97
- const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(transaction, {
98
- txTimeout,
99
- ...txInclusion,
100
- onBroadcast
101
- });
102
- if (response.code !== 0) throw new __injectivelabs_exceptions.TransactionException(new Error(response.rawLog), {
103
- code: __injectivelabs_exceptions.UnspecifiedErrorCode,
104
- contextCode: response.code,
105
- contextModule: response.codespace
106
- });
107
- return response;
95
+ return (0, __injectivelabs_wallet_base.broadcastTxRaw)(transaction, options);
108
96
  }
109
97
  async signEip712TypedData(eip712json, address) {
110
98
  const pk = this.getPrivateKey();
@@ -191,20 +179,7 @@ var PrivateKeyWallet = class extends __injectivelabs_wallet_base.BaseConcreteStr
191
179
  //#region src/strategy/strategy-cosmos.ts
192
180
  var PrivateKeyCosmosWallet = class extends PrivateKeyWallet {
193
181
  async sendTransaction(transaction, options) {
194
- const { endpoints, txTimeout, txInclusion, onBroadcast } = options;
195
- if (!endpoints) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
196
- const txRaw = (0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction);
197
- const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
198
- txTimeout,
199
- ...txInclusion,
200
- onBroadcast
201
- });
202
- if (response.code !== 0) throw new __injectivelabs_exceptions.TransactionException(new Error(response.rawLog), {
203
- code: __injectivelabs_exceptions.UnspecifiedErrorCode,
204
- contextCode: response.code,
205
- contextModule: response.codespace
206
- });
207
- return response;
182
+ return (0, __injectivelabs_wallet_base.broadcastTxRaw)((0, __injectivelabs_sdk_ts_core_tx.createTxRawFromSigResponse)(transaction), options);
208
183
  }
209
184
  async signCosmosTransaction(transaction) {
210
185
  const privateKey = this.getPrivateKey();
@@ -1,6 +1,6 @@
1
1
  import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
- import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
3
2
  import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
3
+ import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
4
4
  import { BaseConcreteStrategy, ConcreteWalletStrategy, CosmosWalletAbstraction, SendTransactionOptions, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
5
5
  import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
6
6
 
package/dist/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
2
+ import { CosmosTxV1Beta1TxPb, createSignDocFromTransaction, createTxRawFromSigResponse, getInjectiveSignerAddress } from "@injectivelabs/sdk-ts/core/tx";
2
3
  import { PrivateKey } from "@injectivelabs/sdk-ts/core/accounts";
3
- import { CosmosTxV1Beta1TxPb, TxGrpcApi, createSignDocFromTransaction, createTxRawFromSigResponse, getInjectiveSignerAddress } from "@injectivelabs/sdk-ts/core/tx";
4
- import { BaseConcreteStrategy, WalletAction, WalletDeviceType } from "@injectivelabs/wallet-base";
5
4
  import { stringToUint8Array, toUtf8, uint8ArrayToBase64, uint8ArrayToHex } from "@injectivelabs/sdk-ts/utils";
6
- import { ErrorType, MetamaskException, TransactionException, UnspecifiedErrorCode, WalletException } from "@injectivelabs/exceptions";
5
+ import { ErrorType, MetamaskException, UnspecifiedErrorCode, WalletException } from "@injectivelabs/exceptions";
6
+ import { BaseConcreteStrategy, WalletAction, WalletDeviceType, broadcastTxRaw } from "@injectivelabs/wallet-base";
7
7
 
8
8
  //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
9
9
  function _typeof(o) {
@@ -92,19 +92,7 @@ var PrivateKeyWallet = class extends BaseConcreteStrategy {
92
92
  });
93
93
  }
94
94
  async sendTransaction(transaction, options) {
95
- const { endpoints, txTimeout, txInclusion, onBroadcast } = options;
96
- if (!endpoints) throw new WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
97
- const response = await new TxGrpcApi(endpoints.grpc).broadcast(transaction, {
98
- txTimeout,
99
- ...txInclusion,
100
- onBroadcast
101
- });
102
- if (response.code !== 0) throw new TransactionException(new Error(response.rawLog), {
103
- code: UnspecifiedErrorCode,
104
- contextCode: response.code,
105
- contextModule: response.codespace
106
- });
107
- return response;
95
+ return broadcastTxRaw(transaction, options);
108
96
  }
109
97
  async signEip712TypedData(eip712json, address) {
110
98
  const pk = this.getPrivateKey();
@@ -191,20 +179,7 @@ var PrivateKeyWallet = class extends BaseConcreteStrategy {
191
179
  //#region src/strategy/strategy-cosmos.ts
192
180
  var PrivateKeyCosmosWallet = class extends PrivateKeyWallet {
193
181
  async sendTransaction(transaction, options) {
194
- const { endpoints, txTimeout, txInclusion, onBroadcast } = options;
195
- if (!endpoints) throw new WalletException(/* @__PURE__ */ new Error("You have to pass endpoints within the options for using Ethereum native wallets"));
196
- const txRaw = createTxRawFromSigResponse(transaction);
197
- const response = await new TxGrpcApi(endpoints.grpc).broadcast(txRaw, {
198
- txTimeout,
199
- ...txInclusion,
200
- onBroadcast
201
- });
202
- if (response.code !== 0) throw new TransactionException(new Error(response.rawLog), {
203
- code: UnspecifiedErrorCode,
204
- contextCode: response.code,
205
- contextModule: response.codespace
206
- });
207
- return response;
182
+ return broadcastTxRaw(createTxRawFromSigResponse(transaction), options);
208
183
  }
209
184
  async signCosmosTransaction(transaction) {
210
185
  const privateKey = this.getPrivateKey();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-private-key",
3
- "version": "1.20.64",
3
+ "version": "1.20.65",
4
4
  "description": "Private key wallet strategy for use with @injectivelabs/wallet-core.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -42,10 +42,10 @@
42
42
  "dist"
43
43
  ],
44
44
  "dependencies": {
45
- "@injectivelabs/exceptions": "1.20.64",
46
- "@injectivelabs/sdk-ts": "1.20.64",
47
- "@injectivelabs/ts-types": "1.20.64",
48
- "@injectivelabs/wallet-base": "1.20.64"
45
+ "@injectivelabs/exceptions": "1.20.65",
46
+ "@injectivelabs/wallet-base": "1.20.65",
47
+ "@injectivelabs/ts-types": "1.20.65",
48
+ "@injectivelabs/sdk-ts": "1.20.65"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"