@injectivelabs/wallet-core 1.20.15 → 1.20.17
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/{BaseWalletStrategy-Bvs5nQRI.d.cts → BaseWalletStrategy-CD9sBzZB.d.cts} +1 -1
- package/dist/cjs/broadcaster.d.cts +2 -2
- package/dist/cjs/{index-BahXM0mK.d.cts → index-DIurlb8S.d.cts} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/{strategy-D8mmr647.cjs → strategy-BxKznCI0.cjs} +17 -17
- package/dist/cjs/strategy.cjs +1 -1
- package/dist/cjs/strategy.d.cts +1 -1
- package/dist/esm/{BaseWalletStrategy-D2xNJmzo.d.ts → BaseWalletStrategy-2HVN2oeB.d.ts} +1 -1
- package/dist/esm/broadcaster.d.ts +2 -2
- package/dist/esm/{index-D1ZQcpAC.d.ts → index-mLvMuoGv.d.ts} +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/{strategy-DU-V-GfI.js → strategy-Co4vD1wN.js} +1 -1
- package/dist/esm/strategy.d.ts +1 -1
- package/dist/esm/strategy.js +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
2
2
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
3
|
-
import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, WalletStrategyEmitter, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base/light";
|
|
3
|
+
import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, WalletStrategyEmitter, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base/runtime-light";
|
|
4
4
|
import { StdSignDoc } from "@keplr-wallet/types";
|
|
5
5
|
import { OfflineSigner } from "@cosmjs/proto-signing";
|
|
6
6
|
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./BaseWalletStrategy-
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
1
|
+
import "./BaseWalletStrategy-CD9sBzZB.cjs";
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-DIurlb8S.cjs";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-
|
|
1
|
+
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CD9sBzZB.cjs";
|
|
2
2
|
import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
|
|
3
3
|
import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
4
4
|
import { Network, NetworkEndpoints } from "@injectivelabs/networks";
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_broadcaster = require('./broadcaster-DTwN2Hve.cjs');
|
|
2
2
|
require('./defineProperty-CImP5zIM.cjs');
|
|
3
|
-
const require_strategy = require('./strategy-
|
|
3
|
+
const require_strategy = require('./strategy-BxKznCI0.cjs');
|
|
4
4
|
|
|
5
5
|
exports.BaseWalletStrategy = require_strategy.BaseWalletStrategy;
|
|
6
6
|
exports.MsgBroadcaster = require_broadcaster.MsgBroadcaster;
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
1
|
+
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-CD9sBzZB.cjs";
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-DIurlb8S.cjs";
|
|
3
3
|
import "./index-DLoAMD9J.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/tx.d.ts
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
const require_defineProperty = require('./defineProperty-CImP5zIM.cjs');
|
|
2
2
|
let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
|
|
3
3
|
let eventemitter3 = require("eventemitter3");
|
|
4
|
-
let
|
|
4
|
+
let __injectivelabs_wallet_base_runtime_light = require("@injectivelabs/wallet-base/runtime-light");
|
|
5
5
|
|
|
6
6
|
//#region src/strategy/BaseWalletStrategy.ts
|
|
7
7
|
const getInitialWallet = (args) => {
|
|
8
8
|
if (args.wallet) return args.wallet;
|
|
9
9
|
const keys = Object.keys(args.strategies || {});
|
|
10
|
-
if (keys.length === 0) return
|
|
11
|
-
if (keys.includes(
|
|
12
|
-
if (keys.includes(
|
|
10
|
+
if (keys.length === 0) return __injectivelabs_wallet_base_runtime_light.Wallet.Metamask;
|
|
11
|
+
if (keys.includes(__injectivelabs_wallet_base_runtime_light.Wallet.Metamask) && args.evmOptions) return __injectivelabs_wallet_base_runtime_light.Wallet.Metamask;
|
|
12
|
+
if (keys.includes(__injectivelabs_wallet_base_runtime_light.Wallet.Keplr) && !args.evmOptions) return __injectivelabs_wallet_base_runtime_light.Wallet.Keplr;
|
|
13
13
|
return keys[0];
|
|
14
14
|
};
|
|
15
15
|
var BaseWalletStrategy = class {
|
|
@@ -101,33 +101,33 @@ var BaseWalletStrategy = class {
|
|
|
101
101
|
return this.getStrategy().sendEvmTransaction(tx, options);
|
|
102
102
|
}
|
|
103
103
|
async signEip712TypedData(eip712TypedData, address, options = {}) {
|
|
104
|
-
if ((0,
|
|
104
|
+
if ((0, __injectivelabs_wallet_base_runtime_light.isCosmosWallet)(this.wallet)) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error(`You can't sign Ethereum Transaction using ${this.wallet}`));
|
|
105
105
|
/** Phantom wallet needs enabling before signing */
|
|
106
|
-
if (this.wallet ===
|
|
107
|
-
this.emit(
|
|
106
|
+
if (this.wallet === __injectivelabs_wallet_base_runtime_light.Wallet.Phantom) await this.enable();
|
|
107
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSignStart);
|
|
108
108
|
const response = await this.getStrategy().signEip712TypedData(eip712TypedData, address, options);
|
|
109
|
-
this.emit(
|
|
109
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSigned);
|
|
110
110
|
return response;
|
|
111
111
|
}
|
|
112
112
|
async signAminoCosmosTransaction(transaction) {
|
|
113
|
-
if ((0,
|
|
114
|
-
this.emit(
|
|
113
|
+
if ((0, __injectivelabs_wallet_base_runtime_light.isEvmWallet)(this.wallet)) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error(`You can't sign Cosmos Transaction using ${this.wallet}`));
|
|
114
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSignStart);
|
|
115
115
|
const response = await this.getStrategy().signAminoCosmosTransaction(transaction);
|
|
116
|
-
this.emit(
|
|
116
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSigned);
|
|
117
117
|
return response;
|
|
118
118
|
}
|
|
119
119
|
async signCosmosTransaction(transaction) {
|
|
120
|
-
if ((0,
|
|
121
|
-
this.emit(
|
|
120
|
+
if ((0, __injectivelabs_wallet_base_runtime_light.isEvmWallet)(this.wallet)) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error(`You can't sign Cosmos Transaction using ${this.wallet}`));
|
|
121
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSignStart);
|
|
122
122
|
const response = await this.getStrategy().signCosmosTransaction(transaction);
|
|
123
|
-
this.emit(
|
|
123
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSigned);
|
|
124
124
|
return response;
|
|
125
125
|
}
|
|
126
126
|
async signArbitrary(signer, data) {
|
|
127
127
|
if (this.getStrategy().signArbitrary) {
|
|
128
|
-
this.emit(
|
|
128
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSignStart);
|
|
129
129
|
const response = await this.getStrategy().signArbitrary(signer, data);
|
|
130
|
-
this.emit(
|
|
130
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.TransactionSigned);
|
|
131
131
|
return response;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -140,7 +140,7 @@ var BaseWalletStrategy = class {
|
|
|
140
140
|
async disconnect() {
|
|
141
141
|
if (this.getStrategy().disconnect) {
|
|
142
142
|
await this.getStrategy().disconnect();
|
|
143
|
-
this.emit(
|
|
143
|
+
this.emit(__injectivelabs_wallet_base_runtime_light.WalletStrategyEmitterEventType.WalletStrategyDisconnect);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
getCosmosWallet(chainId) {
|
package/dist/cjs/strategy.cjs
CHANGED
package/dist/cjs/strategy.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, WalletStrategyEmitter, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base/light";
|
|
1
|
+
import { ConcreteStrategiesArg, ConcreteWalletStrategy, CosmosWalletAbstraction, Eip1193Provider, SendTransactionOptions, Wallet, WalletDeviceType, WalletMetadata, WalletStrategy, WalletStrategyArguments, WalletStrategyEmitter, onAccountChangeCallback, onChainIdChangeCallback } from "@injectivelabs/wallet-base/runtime-light";
|
|
2
2
|
import { AccountAddress, ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
3
3
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
4
|
import { StdSignDoc } from "@keplr-wallet/types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./BaseWalletStrategy-
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
1
|
+
import "./BaseWalletStrategy-2HVN2oeB.js";
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-mLvMuoGv.js";
|
|
3
3
|
export { MsgBroadcaster, MsgBroadcasterOptions, MsgBroadcasterTxOptions, MsgBroadcasterTxOptionsWithAddresses, Web3Broadcaster };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-
|
|
1
|
+
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-2HVN2oeB.js";
|
|
2
2
|
import { ChainId, EvmChainId } from "@injectivelabs/ts-types";
|
|
3
3
|
import { Network, NetworkEndpoints } from "@injectivelabs/networks";
|
|
4
4
|
import { AuthBaseAccount } from "@injectivelabs/sdk-ts/client/chain";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-
|
|
2
|
-
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-
|
|
1
|
+
import { t as BaseWalletStrategy } from "./BaseWalletStrategy-2HVN2oeB.js";
|
|
2
|
+
import { a as MsgBroadcasterTxOptionsWithAddresses, i as MsgBroadcasterTxOptions, n as MsgBroadcaster, r as MsgBroadcasterOptions, t as Web3Broadcaster } from "./index-mLvMuoGv.js";
|
|
3
3
|
import "./index-DRYular4.js";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/tx.d.ts
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as MsgBroadcaster, r as checkIfTxRunOutOfGas, t as Web3Broadcaster } from "./broadcaster-DzLAEG3E.js";
|
|
2
2
|
import "./defineProperty-D4YE9KXX.js";
|
|
3
|
-
import { t as BaseWalletStrategy } from "./strategy-
|
|
3
|
+
import { t as BaseWalletStrategy } from "./strategy-Co4vD1wN.js";
|
|
4
4
|
|
|
5
5
|
export { BaseWalletStrategy, MsgBroadcaster, Web3Broadcaster, checkIfTxRunOutOfGas };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as _defineProperty } from "./defineProperty-D4YE9KXX.js";
|
|
2
2
|
import { GeneralException, WalletException } from "@injectivelabs/exceptions";
|
|
3
3
|
import { EventEmitter } from "eventemitter3";
|
|
4
|
-
import { Wallet, WalletStrategyEmitterEventType, isCosmosWallet, isEvmWallet } from "@injectivelabs/wallet-base/light";
|
|
4
|
+
import { Wallet, WalletStrategyEmitterEventType, isCosmosWallet, isEvmWallet } from "@injectivelabs/wallet-base/runtime-light";
|
|
5
5
|
|
|
6
6
|
//#region src/strategy/BaseWalletStrategy.ts
|
|
7
7
|
const getInitialWallet = (args) => {
|
package/dist/esm/strategy.d.ts
CHANGED
package/dist/esm/strategy.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.17",
|
|
4
4
|
"description": "Core wallet strategy",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@keplr-wallet/types": "^0.12.296",
|
|
86
86
|
"eventemitter3": "^5.0.1",
|
|
87
|
-
"@injectivelabs/exceptions": "1.20.
|
|
88
|
-
"@injectivelabs/
|
|
89
|
-
"@injectivelabs/
|
|
90
|
-
"@injectivelabs/
|
|
91
|
-
"@injectivelabs/
|
|
92
|
-
"@injectivelabs/ts-types": "1.20.
|
|
87
|
+
"@injectivelabs/exceptions": "1.20.17",
|
|
88
|
+
"@injectivelabs/networks": "1.20.17",
|
|
89
|
+
"@injectivelabs/utils": "1.20.17",
|
|
90
|
+
"@injectivelabs/wallet-base": "1.20.17",
|
|
91
|
+
"@injectivelabs/sdk-ts": "1.20.17",
|
|
92
|
+
"@injectivelabs/ts-types": "1.20.17"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|