@injectivelabs/wallet-base 1.16.38-alpha.2 → 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.
- package/dist/cjs/index.cjs +6 -2
- package/dist/cjs/index.d.cts +8 -3
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.js +5 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -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,
|
|
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,
|
|
1775
|
+
if (address.startsWith("inj")) return (0, __injectivelabs_sdk_ts_utils.getEthereumAddress)(address);
|
|
1772
1776
|
return "";
|
|
1773
1777
|
};
|
|
1774
1778
|
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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,
|
|
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$
|
|
403
|
+
value: ObjectRepresentation | SnakeCaseKeys$1<ProtoRepresentation>;
|
|
399
404
|
}[];
|
|
400
405
|
memo: string;
|
|
401
406
|
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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 {
|
|
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$
|
|
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
|
|
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.
|
|
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": {
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"eip1193-provider": "^1.0.1",
|
|
42
42
|
"viem": "^2.40.3",
|
|
43
|
-
"@injectivelabs/exceptions": "1.16.38-alpha.
|
|
43
|
+
"@injectivelabs/exceptions": "1.16.38-alpha.2",
|
|
44
44
|
"@injectivelabs/networks": "1.16.38-alpha.1",
|
|
45
|
-
"@injectivelabs/ts
|
|
46
|
-
"@injectivelabs/
|
|
45
|
+
"@injectivelabs/sdk-ts": "1.16.38-alpha.3",
|
|
46
|
+
"@injectivelabs/ts-types": "1.16.38-alpha.1"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|