@injectivelabs/wallet-cosmos 1.17.2-alpha.2 → 1.17.2-alpha.3
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/index.cjs +10 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +9 -1
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,10 +3,17 @@ 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 __cosmjs_stargate = require("@cosmjs/stargate");
|
|
7
6
|
let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
|
|
8
7
|
let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
|
|
9
8
|
|
|
9
|
+
//#region src/lib.ts
|
|
10
|
+
let cachedSigningStargateClient = null;
|
|
11
|
+
const loadSigningStargateClient = async () => {
|
|
12
|
+
if (!cachedSigningStargateClient) cachedSigningStargateClient = (await import("@cosmjs/stargate")).SigningStargateClient;
|
|
13
|
+
return cachedSigningStargateClient;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
10
17
|
//#region \0@oxc-project+runtime@0.98.0/helpers/typeof.js
|
|
11
18
|
function _typeof(o) {
|
|
12
19
|
"@babel/helpers - typeof";
|
|
@@ -167,9 +174,10 @@ var CosmosWallet = class CosmosWallet {
|
|
|
167
174
|
const cosmosWallet = await this.getCosmosWallet();
|
|
168
175
|
if (![__injectivelabs_wallet_base.Wallet.Keplr, __injectivelabs_wallet_base.Wallet.OWallet].includes(wallet)) throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error(`signAndBroadcastAminoUsingCosmjs is not support on ${(0, __injectivelabs_utils.capitalize)(wallet)}`));
|
|
169
176
|
if (!endpoints.rpc) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error(`Please provide rpc endpoint`));
|
|
177
|
+
const SigningStargateClient = await loadSigningStargateClient();
|
|
170
178
|
const offlineSigner = cosmosWallet.getOfflineSignerOnlyAmino(chainId);
|
|
171
179
|
const [account] = await offlineSigner.getAccounts();
|
|
172
|
-
return await (await
|
|
180
|
+
return await (await SigningStargateClient.connectWithSigner(endpoints.rpc, offlineSigner)).signAndBroadcast(account.address, messages, stdFee);
|
|
173
181
|
}
|
|
174
182
|
async signArbitrary({ data, signer }) {
|
|
175
183
|
const { chainId, wallet } = this;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseConcreteStrategy, ConcreteWalletStrategy, SendTransactionOptions, StdSignDoc, Wallet, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
2
|
-
import * as _cosmjs_stargate0 from "@cosmjs/stargate";
|
|
3
|
-
import { StdFee } from "@cosmjs/stargate";
|
|
4
2
|
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
5
3
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
|
+
import * as _cosmjs_stargate0 from "@cosmjs/stargate";
|
|
5
|
+
import { StdFee } from "@cosmjs/stargate";
|
|
6
6
|
import { AccountAddress, ChainId, CosmosChainId, EvmChainId, TestnetCosmosChainId } from "@injectivelabs/ts-types";
|
|
7
7
|
import * as _keplr_wallet_types0 from "@keplr-wallet/types";
|
|
8
8
|
import { AminoSignResponse, Keplr, OfflineAminoSigner, StdSignDoc as StdSignDoc$1 } from "@keplr-wallet/types";
|
package/dist/esm/index.js
CHANGED
|
@@ -3,10 +3,17 @@ 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 { SigningStargateClient } from "@cosmjs/stargate";
|
|
7
6
|
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
8
7
|
import { createSignDocFromTransaction, createTxRawFromSigResponse, waitTxBroadcasted } from "@injectivelabs/sdk-ts/core/tx";
|
|
9
8
|
|
|
9
|
+
//#region src/lib.ts
|
|
10
|
+
let cachedSigningStargateClient = null;
|
|
11
|
+
const loadSigningStargateClient = async () => {
|
|
12
|
+
if (!cachedSigningStargateClient) cachedSigningStargateClient = (await import("@cosmjs/stargate")).SigningStargateClient;
|
|
13
|
+
return cachedSigningStargateClient;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
10
17
|
//#region \0@oxc-project+runtime@0.98.0/helpers/typeof.js
|
|
11
18
|
function _typeof(o) {
|
|
12
19
|
"@babel/helpers - typeof";
|
|
@@ -167,6 +174,7 @@ var CosmosWallet = class CosmosWallet {
|
|
|
167
174
|
const cosmosWallet = await this.getCosmosWallet();
|
|
168
175
|
if (![Wallet.Keplr, Wallet.OWallet].includes(wallet)) throw new CosmosWalletException(/* @__PURE__ */ new Error(`signAndBroadcastAminoUsingCosmjs is not support on ${capitalize(wallet)}`));
|
|
169
176
|
if (!endpoints.rpc) throw new GeneralException(/* @__PURE__ */ new Error(`Please provide rpc endpoint`));
|
|
177
|
+
const SigningStargateClient = await loadSigningStargateClient();
|
|
170
178
|
const offlineSigner = cosmosWallet.getOfflineSignerOnlyAmino(chainId);
|
|
171
179
|
const [account] = await offlineSigner.getAccounts();
|
|
172
180
|
return await (await SigningStargateClient.connectWithSigner(endpoints.rpc, offlineSigner)).signAndBroadcast(account.address, messages, stdFee);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-cosmos",
|
|
3
|
-
"version": "1.17.2-alpha.
|
|
3
|
+
"version": "1.17.2-alpha.3",
|
|
4
4
|
"description": "Cosmos wallet strategies for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@cosmjs/proto-signing": "0.33.0",
|
|
42
42
|
"@cosmjs/stargate": "0.33.0",
|
|
43
43
|
"@keplr-wallet/types": "^0.12.296",
|
|
44
|
-
"@injectivelabs/
|
|
45
|
-
"@injectivelabs/
|
|
46
|
-
"@injectivelabs/
|
|
47
|
-
"@injectivelabs/wallet-base": "1.17.2-alpha.
|
|
48
|
-
"@injectivelabs/
|
|
44
|
+
"@injectivelabs/exceptions": "1.17.2-alpha.3",
|
|
45
|
+
"@injectivelabs/sdk-ts": "1.17.2-alpha.3",
|
|
46
|
+
"@injectivelabs/utils": "1.17.2-alpha.3",
|
|
47
|
+
"@injectivelabs/wallet-base": "1.17.2-alpha.3",
|
|
48
|
+
"@injectivelabs/ts-types": "1.17.2-alpha.3"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|