@injectivelabs/wallet-evm 1.16.12 → 1.16.13-alpha.0

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,8 +1,8 @@
1
- import { Eip1193Provider } from '@injectivelabs/wallet-base';
2
- import { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
- import { ErrorContext, ThrownException } from '@injectivelabs/exceptions';
4
- import { Wallet, StdSignDoc, WalletDeviceType, BaseConcreteStrategy, SendTransactionOptions, BrowserEip1993Provider, ConcreteWalletStrategy, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs } from '@injectivelabs/wallet-base';
5
- import { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
1
+ import { Wallet, WalletDeviceType, BaseConcreteStrategy } from '@injectivelabs/wallet-base';
2
+ import type { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
3
+ import type { ErrorContext, ThrownException } from '@injectivelabs/exceptions';
4
+ import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
5
+ import type { StdSignDoc, Eip1193Provider, SendTransactionOptions, BrowserEip1993Provider, ConcreteWalletStrategy, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs } from '@injectivelabs/wallet-base';
6
6
  export declare class EvmWallet extends BaseConcreteStrategy implements ConcreteWalletStrategy {
7
7
  wallet?: Wallet;
8
8
  evmProviders: Partial<Record<Wallet, BrowserEip1993Provider>>;
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EvmWallet = void 0;
4
- /* eslint-disable class-methods-use-this */
4
+ const utils_1 = require("@injectivelabs/utils");
5
5
  const wallet_base_1 = require("@injectivelabs/wallet-base");
6
6
  const sdk_ts_1 = require("@injectivelabs/sdk-ts");
7
- const exceptions_1 = require("@injectivelabs/exceptions");
8
7
  const wallet_base_2 = require("@injectivelabs/wallet-base");
9
- const utils_1 = require("@injectivelabs/utils");
8
+ const exceptions_1 = require("@injectivelabs/exceptions");
10
9
  const index_js_1 = require("./utils/index.js");
11
10
  class EvmWallet extends wallet_base_2.BaseConcreteStrategy {
12
11
  wallet;
@@ -99,7 +98,6 @@ class EvmWallet extends wallet_base_2.BaseConcreteStrategy {
99
98
  });
100
99
  }
101
100
  }
102
- // eslint-disable-next-line class-methods-use-this
103
101
  async getSessionOrConfirm(address) {
104
102
  return Promise.resolve(`0x${Buffer.from(`Confirmation for ${address} at time: ${Date.now()}`).toString('hex')}`);
105
103
  }
@@ -165,7 +163,6 @@ class EvmWallet extends wallet_base_2.BaseConcreteStrategy {
165
163
  contextModule: wallet_base_2.WalletAction.SignTransaction,
166
164
  });
167
165
  }
168
- // eslint-disable-next-line class-methods-use-this
169
166
  async signCosmosTransaction(_transaction) {
170
167
  throw new exceptions_1.WalletException(new Error('This wallet does not support signing Cosmos transactions'), {
171
168
  code: exceptions_1.UnspecifiedErrorCode,
@@ -228,7 +225,6 @@ class EvmWallet extends wallet_base_2.BaseConcreteStrategy {
228
225
  });
229
226
  }
230
227
  }
231
- // eslint-disable-next-line class-methods-use-this
232
228
  async getPubKey() {
233
229
  throw new exceptions_1.WalletException(new Error('You can only fetch PubKey from Cosmos native wallets'));
234
230
  }
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getOkxWalletProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getBitGetProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getMetamaskProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getPhantomProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getRabbyProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getRainbowProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getTrustWalletProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,5 @@
1
- import { Wallet, BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
- import { EvmChainId } from '@injectivelabs/ts-types';
1
+ import { Wallet } from '@injectivelabs/wallet-base';
2
+ import type { EvmChainId } from '@injectivelabs/ts-types';
3
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
3
4
  export declare const getEvmProvider: (wallet: Wallet) => Promise<BrowserEip1993Provider>;
4
5
  export declare const updateEvmNetwork: (wallet: Wallet, chainId: EvmChainId) => Promise<unknown>;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateEvmNetwork = exports.getEvmProvider = void 0;
4
- const wallet_base_1 = require("@injectivelabs/wallet-base");
5
4
  const utils_1 = require("@injectivelabs/utils");
6
5
  const exceptions_1 = require("@injectivelabs/exceptions");
6
+ const wallet_base_1 = require("@injectivelabs/wallet-base");
7
7
  const rabby_js_1 = require("../strategy/utils/rabby.js");
8
8
  const Okx_js_1 = require("../strategy/utils/Okx.js");
9
9
  const bitget_js_1 = require("../strategy/utils/bitget.js");
@@ -39,7 +39,7 @@ const getEvmProvider = async (wallet) => {
39
39
  }
40
40
  return provider;
41
41
  }
42
- catch (e) {
42
+ catch {
43
43
  throw new exceptions_1.WalletException(new Error(`Please install ${(0, utils_1.capitalize)(wallet)} Extension`));
44
44
  }
45
45
  };
@@ -66,7 +66,7 @@ const updateEvmNetwork = async (wallet, chainId) => {
66
66
  })),
67
67
  ]);
68
68
  }
69
- catch (e) {
69
+ catch {
70
70
  throw new exceptions_1.WalletException(new Error(`Please update your ${(0, utils_1.capitalize)(wallet)} network`));
71
71
  }
72
72
  };
@@ -1,8 +1,8 @@
1
- import { Eip1193Provider } from '@injectivelabs/wallet-base';
2
- import { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
- import { ErrorContext, ThrownException } from '@injectivelabs/exceptions';
4
- import { Wallet, StdSignDoc, WalletDeviceType, BaseConcreteStrategy, SendTransactionOptions, BrowserEip1993Provider, ConcreteWalletStrategy, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs } from '@injectivelabs/wallet-base';
5
- import { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
1
+ import { Wallet, WalletDeviceType, BaseConcreteStrategy } from '@injectivelabs/wallet-base';
2
+ import type { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
3
+ import type { ErrorContext, ThrownException } from '@injectivelabs/exceptions';
4
+ import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
5
+ import type { StdSignDoc, Eip1193Provider, SendTransactionOptions, BrowserEip1993Provider, ConcreteWalletStrategy, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs } from '@injectivelabs/wallet-base';
6
6
  export declare class EvmWallet extends BaseConcreteStrategy implements ConcreteWalletStrategy {
7
7
  wallet?: Wallet;
8
8
  evmProviders: Partial<Record<Wallet, BrowserEip1993Provider>>;
@@ -1,9 +1,8 @@
1
- /* eslint-disable class-methods-use-this */
1
+ import { sleep, capitalize } from '@injectivelabs/utils';
2
2
  import { isEvmBrowserWallet } from '@injectivelabs/wallet-base';
3
- import { toUtf8, TxGrpcApi, isServerSide, } from '@injectivelabs/sdk-ts';
3
+ import { toUtf8, TxGrpcApi, isServerSide } from '@injectivelabs/sdk-ts';
4
+ import { Wallet, WalletAction, WalletDeviceType, WalletEventListener, BaseConcreteStrategy } from '@injectivelabs/wallet-base';
4
5
  import { ErrorType, WalletException, BitGetException, MetamaskException, OkxWalletException, UnspecifiedErrorCode, TransactionException, TrustWalletException, RainbowWalletException, } from '@injectivelabs/exceptions';
5
- import { Wallet, WalletAction, WalletDeviceType, WalletEventListener, BaseConcreteStrategy, } from '@injectivelabs/wallet-base';
6
- import { sleep, capitalize } from '@injectivelabs/utils';
7
6
  import { getRabbyProvider, getBitGetProvider, getPhantomProvider, getRainbowProvider, getMetamaskProvider, getOkxWalletProvider, getTrustWalletProvider, } from './utils/index.js';
8
7
  export class EvmWallet extends BaseConcreteStrategy {
9
8
  wallet;
@@ -96,7 +95,6 @@ export class EvmWallet extends BaseConcreteStrategy {
96
95
  });
97
96
  }
98
97
  }
99
- // eslint-disable-next-line class-methods-use-this
100
98
  async getSessionOrConfirm(address) {
101
99
  return Promise.resolve(`0x${Buffer.from(`Confirmation for ${address} at time: ${Date.now()}`).toString('hex')}`);
102
100
  }
@@ -162,7 +160,6 @@ export class EvmWallet extends BaseConcreteStrategy {
162
160
  contextModule: WalletAction.SignTransaction,
163
161
  });
164
162
  }
165
- // eslint-disable-next-line class-methods-use-this
166
163
  async signCosmosTransaction(_transaction) {
167
164
  throw new WalletException(new Error('This wallet does not support signing Cosmos transactions'), {
168
165
  code: UnspecifiedErrorCode,
@@ -225,7 +222,6 @@ export class EvmWallet extends BaseConcreteStrategy {
225
222
  });
226
223
  }
227
224
  }
228
- // eslint-disable-next-line class-methods-use-this
229
225
  async getPubKey() {
230
226
  throw new WalletException(new Error('You can only fetch PubKey from Cosmos native wallets'));
231
227
  }
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getOkxWalletProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getBitGetProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getMetamaskProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getPhantomProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getRabbyProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getRainbowProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,4 @@
1
- import { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
1
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
2
  export declare function getTrustWalletProvider({ timeout }?: {
3
3
  timeout: number;
4
4
  }): Promise<BrowserEip1993Provider>;
@@ -1,4 +1,5 @@
1
- import { Wallet, BrowserEip1993Provider } from '@injectivelabs/wallet-base';
2
- import { EvmChainId } from '@injectivelabs/ts-types';
1
+ import { Wallet } from '@injectivelabs/wallet-base';
2
+ import type { EvmChainId } from '@injectivelabs/ts-types';
3
+ import type { BrowserEip1993Provider } from '@injectivelabs/wallet-base';
3
4
  export declare const getEvmProvider: (wallet: Wallet) => Promise<BrowserEip1993Provider>;
4
5
  export declare const updateEvmNetwork: (wallet: Wallet, chainId: EvmChainId) => Promise<unknown>;
@@ -1,6 +1,6 @@
1
- import { Wallet, isEvmBrowserWallet, } from '@injectivelabs/wallet-base';
2
1
  import { capitalize } from '@injectivelabs/utils';
3
2
  import { WalletException } from '@injectivelabs/exceptions';
3
+ import { Wallet, isEvmBrowserWallet } from '@injectivelabs/wallet-base';
4
4
  import { getRabbyProvider } from '../strategy/utils/rabby.js';
5
5
  import { getOkxWalletProvider } from '../strategy/utils/Okx.js';
6
6
  import { getBitGetProvider } from '../strategy/utils/bitget.js';
@@ -36,7 +36,7 @@ export const getEvmProvider = async (wallet) => {
36
36
  }
37
37
  return provider;
38
38
  }
39
- catch (e) {
39
+ catch {
40
40
  throw new WalletException(new Error(`Please install ${capitalize(wallet)} Extension`));
41
41
  }
42
42
  };
@@ -62,7 +62,7 @@ export const updateEvmNetwork = async (wallet, chainId) => {
62
62
  })),
63
63
  ]);
64
64
  }
65
- catch (e) {
65
+ catch {
66
66
  throw new WalletException(new Error(`Please update your ${capitalize(wallet)} network`));
67
67
  }
68
68
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-evm",
3
3
  "description": "EVM wallet strategies for use with @injectivelabs/wallet-core.",
4
- "version": "1.16.12",
4
+ "version": "1.16.13-alpha.0",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "author": {
@@ -56,17 +56,17 @@
56
56
  "start": "node dist/index.js"
57
57
  },
58
58
  "dependencies": {
59
- "@injectivelabs/exceptions": "1.16.12",
60
- "@injectivelabs/networks": "1.16.12",
61
- "@injectivelabs/sdk-ts": "1.16.12",
62
- "@injectivelabs/ts-types": "1.16.12",
63
- "@injectivelabs/utils": "1.16.12",
64
- "@injectivelabs/wallet-base": "1.16.12"
59
+ "@injectivelabs/exceptions": "1.16.13-alpha.0",
60
+ "@injectivelabs/networks": "1.16.13-alpha.0",
61
+ "@injectivelabs/sdk-ts": "1.16.13-alpha.0",
62
+ "@injectivelabs/ts-types": "1.16.13-alpha.0",
63
+ "@injectivelabs/utils": "1.16.13-alpha.0",
64
+ "@injectivelabs/wallet-base": "1.16.13-alpha.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "shx": "^0.3.3"
68
68
  },
69
- "gitHead": "11a4cd78ffb176786df6c4aff98476f90f0b354b",
69
+ "gitHead": "bb71ac9147c0a2f0946ea0c316caf094fbbe2f2c",
70
70
  "typedoc": {
71
71
  "entryPoint": "./src/index.ts",
72
72
  "readmeFile": "./README.md",