@injectivelabs/wallet-base 1.16.38-alpha.1 → 1.16.38-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.
@@ -34,6 +34,7 @@ viem_chains = __toESM(viem_chains);
34
34
  let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
35
35
  let viem = require("viem");
36
36
  let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
37
+ let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
37
38
 
38
39
  //#region src/types/enums.ts
39
40
  const BroadcastMode = {
@@ -54,6 +55,7 @@ const Wallet = {
54
55
  Rainbow: "rainbow",
55
56
  Turnkey: "turnkey",
56
57
  Metamask: "metamask",
58
+ KeplrEvm: "keplr-evm",
57
59
  OkxWallet: "okx-wallet",
58
60
  PrivateKey: "private-key",
59
61
  TrustWallet: "trust-wallet",
@@ -1712,6 +1714,7 @@ const isEvmWallet = (wallet) => [
1712
1714
  Wallet.Rainbow,
1713
1715
  Wallet.Turnkey,
1714
1716
  Wallet.Metamask,
1717
+ Wallet.KeplrEvm,
1715
1718
  Wallet.OkxWallet,
1716
1719
  Wallet.PrivateKey,
1717
1720
  Wallet.TrezorBip32,
@@ -1728,6 +1731,7 @@ const isEvmBrowserWallet = (wallet) => [
1728
1731
  Wallet.Phantom,
1729
1732
  Wallet.Rainbow,
1730
1733
  Wallet.Metamask,
1734
+ Wallet.KeplrEvm,
1731
1735
  Wallet.OkxWallet,
1732
1736
  Wallet.TrustWallet
1733
1737
  ].includes(wallet);
@@ -1762,13 +1766,13 @@ const createCosmosSignDocFromSignDoc = (signDoc) => {
1762
1766
  const getInjectiveSignerAddress = (address) => {
1763
1767
  if (!address) return "";
1764
1768
  if (address.startsWith("inj")) return address;
1765
- if (address.startsWith("0x")) return (0, __injectivelabs_sdk_ts.getInjectiveAddress)(address);
1769
+ if (address.startsWith("0x")) return (0, __injectivelabs_sdk_ts_utils.getInjectiveAddress)(address);
1766
1770
  return "";
1767
1771
  };
1768
1772
  const getEthereumSignerAddress = (address) => {
1769
1773
  if (!address) return "";
1770
1774
  if (address.startsWith("0x")) return address;
1771
- if (address.startsWith("inj")) return (0, __injectivelabs_sdk_ts.getEthereumAddress)(address);
1775
+ if (address.startsWith("inj")) return (0, __injectivelabs_sdk_ts_utils.getEthereumAddress)(address);
1772
1776
  return "";
1773
1777
  };
1774
1778
 
@@ -1,9 +1,12 @@
1
1
  import { StdSignDoc } from "@keplr-wallet/types";
2
2
  import { OfflineSigner } from "@cosmjs/proto-signing";
3
+ import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
3
4
  import { AccountAddress, ChainId, CosmosChainId, EvmChainId } from "@injectivelabs/ts-types";
4
- import { AminoSignResponse, CosmosTxV1Beta1TxPb, DirectSignResponse, Msgs, TxRaw, TxResponse } from "@injectivelabs/sdk-ts";
5
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
5
6
  import { EIP1193Provider } from "eip1193-provider";
7
+ import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
6
8
  import { Account, Chain, LocalAccount, PublicClient, WalletClient } from "viem";
9
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
7
10
  import { BigNumber } from "@injectivelabs/utils";
8
11
 
9
12
  //#region src/types/enums.d.ts
@@ -26,6 +29,7 @@ declare const Wallet: {
26
29
  readonly Rainbow: "rainbow";
27
30
  readonly Turnkey: "turnkey";
28
31
  readonly Metamask: "metamask";
32
+ readonly KeplrEvm: "keplr-evm";
29
33
  readonly OkxWallet: "okx-wallet";
30
34
  readonly PrivateKey: "private-key";
31
35
  readonly TrustWallet: "trust-wallet";
@@ -284,7 +288,7 @@ interface WalletStrategy {
284
288
  metadata?: WalletMetadata;
285
289
  getWallet(): Wallet;
286
290
  getWalletClient?<T>(): Promise<T>;
287
- setWallet(wallet: Wallet): void;
291
+ setWallet(wallet: Wallet): Promise<void>;
288
292
  setMetadata(metadata?: WalletMetadata): void;
289
293
  getStrategy(): ConcreteWalletStrategy;
290
294
  getAddresses(args?: unknown): Promise<AccountAddress[]>;
@@ -326,6 +330,7 @@ interface WalletStrategy {
326
330
  interface BrowserEip1993Provider extends EIP1193Provider {
327
331
  removeAllListeners(): void;
328
332
  isTrust: boolean;
333
+ isKeplr: boolean;
329
334
  isRabby: boolean;
330
335
  isRainbow: boolean;
331
336
  isPhantom: boolean;
@@ -395,7 +400,7 @@ declare const createEip712StdSignDoc: ({
395
400
  };
396
401
  msgs: {
397
402
  type: string;
398
- value: ObjectRepresentation | SnakeCaseKeys$12<ProtoRepresentation>;
403
+ value: ObjectRepresentation | SnakeCaseKeys$1<ProtoRepresentation>;
399
404
  }[];
400
405
  memo: string;
401
406
  };
@@ -1,9 +1,12 @@
1
1
  import { AccountAddress, ChainId, CosmosChainId, EvmChainId } from "@injectivelabs/ts-types";
2
2
  import { Account, Chain, LocalAccount, PublicClient, WalletClient } from "viem";
3
- import { AminoSignResponse, CosmosTxV1Beta1TxPb, DirectSignResponse, Msgs, TxRaw, TxResponse } from "@injectivelabs/sdk-ts";
3
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
4
4
  import { StdSignDoc } from "@keplr-wallet/types";
5
5
  import { OfflineSigner } from "@cosmjs/proto-signing";
6
+ import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
7
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
6
8
  import { EIP1193Provider } from "eip1193-provider";
9
+ import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
7
10
  import { BigNumber } from "@injectivelabs/utils";
8
11
 
9
12
  //#region src/types/enums.d.ts
@@ -26,6 +29,7 @@ declare const Wallet: {
26
29
  readonly Rainbow: "rainbow";
27
30
  readonly Turnkey: "turnkey";
28
31
  readonly Metamask: "metamask";
32
+ readonly KeplrEvm: "keplr-evm";
29
33
  readonly OkxWallet: "okx-wallet";
30
34
  readonly PrivateKey: "private-key";
31
35
  readonly TrustWallet: "trust-wallet";
@@ -284,7 +288,7 @@ interface WalletStrategy {
284
288
  metadata?: WalletMetadata;
285
289
  getWallet(): Wallet;
286
290
  getWalletClient?<T>(): Promise<T>;
287
- setWallet(wallet: Wallet): void;
291
+ setWallet(wallet: Wallet): Promise<void>;
288
292
  setMetadata(metadata?: WalletMetadata): void;
289
293
  getStrategy(): ConcreteWalletStrategy;
290
294
  getAddresses(args?: unknown): Promise<AccountAddress[]>;
@@ -326,6 +330,7 @@ interface WalletStrategy {
326
330
  interface BrowserEip1993Provider extends EIP1193Provider {
327
331
  removeAllListeners(): void;
328
332
  isTrust: boolean;
333
+ isKeplr: boolean;
329
334
  isRabby: boolean;
330
335
  isRainbow: boolean;
331
336
  isPhantom: boolean;
@@ -395,7 +400,7 @@ declare const createEip712StdSignDoc: ({
395
400
  };
396
401
  msgs: {
397
402
  type: string;
398
- value: ObjectRepresentation | SnakeCaseKeys$12<ProtoRepresentation>;
403
+ value: ObjectRepresentation | SnakeCaseKeys$1<ProtoRepresentation>;
399
404
  }[];
400
405
  memo: string;
401
406
  };
package/dist/esm/index.js CHANGED
@@ -5,7 +5,8 @@ import * as viemChains from "viem/chains";
5
5
  import { injective } from "viem/chains";
6
6
  import { EvmChainId } from "@injectivelabs/ts-types";
7
7
  import { createPublicClient, createWalletClient, custom, extractChain, http } from "viem";
8
- import { CosmosTxV1Beta1TxPb, getEthereumAddress, getInjectiveAddress } from "@injectivelabs/sdk-ts";
8
+ import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
9
+ import { getEthereumAddress, getInjectiveAddress } from "@injectivelabs/sdk-ts/utils";
9
10
 
10
11
  //#region src/types/enums.ts
11
12
  const BroadcastMode = {
@@ -26,6 +27,7 @@ const Wallet = {
26
27
  Rainbow: "rainbow",
27
28
  Turnkey: "turnkey",
28
29
  Metamask: "metamask",
30
+ KeplrEvm: "keplr-evm",
29
31
  OkxWallet: "okx-wallet",
30
32
  PrivateKey: "private-key",
31
33
  TrustWallet: "trust-wallet",
@@ -1422,6 +1424,7 @@ const isEvmWallet = (wallet) => [
1422
1424
  Wallet.Rainbow,
1423
1425
  Wallet.Turnkey,
1424
1426
  Wallet.Metamask,
1427
+ Wallet.KeplrEvm,
1425
1428
  Wallet.OkxWallet,
1426
1429
  Wallet.PrivateKey,
1427
1430
  Wallet.TrezorBip32,
@@ -1438,6 +1441,7 @@ const isEvmBrowserWallet = (wallet) => [
1438
1441
  Wallet.Phantom,
1439
1442
  Wallet.Rainbow,
1440
1443
  Wallet.Metamask,
1444
+ Wallet.KeplrEvm,
1441
1445
  Wallet.OkxWallet,
1442
1446
  Wallet.TrustWallet
1443
1447
  ].includes(wallet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-base",
3
- "version": "1.16.38-alpha.1",
3
+ "version": "1.16.38-alpha.3",
4
4
  "description": "Base wallet strategy for use with @injectivelabs/wallet-core.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,6 +37,20 @@
37
37
  "files": [
38
38
  "dist"
39
39
  ],
40
+ "dependencies": {
41
+ "eip1193-provider": "^1.0.1",
42
+ "viem": "^2.40.3",
43
+ "@injectivelabs/exceptions": "1.16.38-alpha.2",
44
+ "@injectivelabs/networks": "1.16.38-alpha.1",
45
+ "@injectivelabs/sdk-ts": "1.16.38-alpha.3",
46
+ "@injectivelabs/ts-types": "1.16.38-alpha.1"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "_moduleAliases": {
52
+ "~wallet-base": "dist"
53
+ },
40
54
  "scripts": {
41
55
  "build": "pnpm type-check && tsdown",
42
56
  "build:fast": "tsdown",
@@ -51,20 +65,5 @@
51
65
  "dev": "ts-node -r tsconfig-paths/register src/index.ts",
52
66
  "start": "node dist/index.js",
53
67
  "lint": "eslint . --ext .ts,.js"
54
- },
55
- "dependencies": {
56
- "@injectivelabs/exceptions": "1.16.38-alpha.0",
57
- "@injectivelabs/networks": "1.16.38-alpha.0",
58
- "@injectivelabs/sdk-ts": "1.16.38-alpha.1",
59
- "@injectivelabs/ts-types": "1.16.38-alpha.0",
60
- "eip1193-provider": "catalog:",
61
- "viem": "catalog:"
62
- },
63
- "publishConfig": {
64
- "access": "public"
65
- },
66
- "_moduleAliases": {
67
- "~wallet-base": "dist"
68
- },
69
- "gitHead": "35dab975c20dbf43d52a85fb161cf810c46d8f6f"
70
- }
68
+ }
69
+ }