@injectivelabs/wallet-base 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,5 +1,5 @@
1
- import { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
- import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
1
+ import type { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
+ import type { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
3
3
  export default abstract class BaseConcreteStrategy {
4
4
  protected chainId: ChainId | CosmosChainId;
5
5
  protected evmChainId?: EvmChainId;
@@ -1,63 +1,64 @@
1
- import { WalletErrorActionModule } from '@injectivelabs/exceptions';
2
- export declare enum BroadcastMode {
3
- /** Return after tx commit */
4
- Block = "block",
5
- /** Return after CheckTx */
6
- Sync = "sync",
7
- /** Return right away */
8
- Async = "async"
9
- }
10
- export declare enum Wallet {
11
- Leap = "leap",
12
- Keplr = "keplr",
13
- Ninji = "ninji",
14
- Magic = "magic",
15
- Rabby = "rabby",
16
- Ledger = "ledger",
17
- BitGet = "BitGet",
18
- OWallet = "owallet",
19
- Phantom = "phantom",
20
- Rainbow = "rainbow",
21
- Turnkey = "turnkey",
22
- Metamask = "metamask",
23
- OkxWallet = "okx-wallet",
24
- PrivateKey = "private-key",
25
- TrustWallet = "trust-wallet",
26
- TrezorBip32 = "trezor-bip32",
27
- TrezorBip44 = "trezor-bip44",
28
- Cosmostation = "cosmostation",
29
- LedgerCosmos = "ledger-cosmos",
30
- LedgerLegacy = "ledger-legacy",
31
- WalletConnect = "wallet-connect",
32
- CosmostationEth = "cosmostation-eth"
33
- }
34
- export declare enum MagicProvider {
35
- Email = "email",
36
- Apple = "apple",
37
- Github = "github",
38
- Google = "google",
39
- Discord = "discord",
40
- Twitter = "twitter",
41
- Facebook = "facebook"
42
- }
43
- export declare enum WalletDeviceType {
44
- Mobile = "mobile",
45
- Other = "other",
46
- Browser = "browser",
47
- Hardware = "hardware"
48
- }
49
- export declare enum WalletEventListener {
50
- AccountChange = "account-change",
51
- ChainIdChange = "chain-id-change"
52
- }
1
+ export declare const BroadcastMode: {
2
+ readonly Block: "block";
3
+ readonly Sync: "sync";
4
+ readonly Async: "async";
5
+ };
6
+ export type BroadcastMode = typeof BroadcastMode[keyof typeof BroadcastMode];
7
+ export declare const Wallet: {
8
+ readonly Leap: "leap";
9
+ readonly Keplr: "keplr";
10
+ readonly Ninji: "ninji";
11
+ readonly Magic: "magic";
12
+ readonly Rabby: "rabby";
13
+ readonly Ledger: "ledger";
14
+ readonly BitGet: "BitGet";
15
+ readonly OWallet: "owallet";
16
+ readonly Phantom: "phantom";
17
+ readonly Rainbow: "rainbow";
18
+ readonly Turnkey: "turnkey";
19
+ readonly Metamask: "metamask";
20
+ readonly OkxWallet: "okx-wallet";
21
+ readonly PrivateKey: "private-key";
22
+ readonly TrustWallet: "trust-wallet";
23
+ readonly TrezorBip32: "trezor-bip32";
24
+ readonly TrezorBip44: "trezor-bip44";
25
+ readonly Cosmostation: "cosmostation";
26
+ readonly LedgerCosmos: "ledger-cosmos";
27
+ readonly LedgerLegacy: "ledger-legacy";
28
+ readonly WalletConnect: "wallet-connect";
29
+ readonly CosmostationEth: "cosmostation-eth";
30
+ };
31
+ export type Wallet = typeof Wallet[keyof typeof Wallet];
32
+ export declare const MagicProvider: {
33
+ readonly Email: "email";
34
+ readonly Apple: "apple";
35
+ readonly Github: "github";
36
+ readonly Google: "google";
37
+ readonly Discord: "discord";
38
+ readonly Twitter: "twitter";
39
+ readonly Facebook: "facebook";
40
+ };
41
+ export type MagicProvider = typeof MagicProvider[keyof typeof MagicProvider];
42
+ export declare const WalletDeviceType: {
43
+ readonly Mobile: "mobile";
44
+ readonly Other: "other";
45
+ readonly Browser: "browser";
46
+ readonly Hardware: "hardware";
47
+ };
48
+ export type WalletDeviceType = typeof WalletDeviceType[keyof typeof WalletDeviceType];
49
+ export declare const WalletEventListener: {
50
+ readonly AccountChange: "account-change";
51
+ readonly ChainIdChange: "chain-id-change";
52
+ };
53
+ export type WalletEventListener = typeof WalletEventListener[keyof typeof WalletEventListener];
53
54
  export declare const WalletAction: {
54
- GetChainId: WalletErrorActionModule.GetChainId;
55
- GetAccounts: WalletErrorActionModule.GetAccounts;
56
- GetNetworkId: WalletErrorActionModule.GetNetworkId;
57
- SignArbitrary: WalletErrorActionModule.SignArbitrary;
58
- SignTransaction: WalletErrorActionModule.SignTransaction;
59
- SendTransaction: WalletErrorActionModule.SendTransaction;
60
- SendEvmTransaction: WalletErrorActionModule.SendEvmTransaction;
61
- SignEvmTransaction: WalletErrorActionModule.SignEvmTransaction;
62
- GetEvmTransactionReceipt: WalletErrorActionModule.GetEvmTransactionReceipt;
55
+ GetChainId: "get-chain-id";
56
+ GetAccounts: "get-accounts";
57
+ GetNetworkId: "get-network-id";
58
+ SignArbitrary: "sign-arbitrary";
59
+ SignTransaction: "sign-transaction";
60
+ SendTransaction: "send-transaction";
61
+ SendEvmTransaction: "send-evm-transaction";
62
+ SignEvmTransaction: "sign-evm-transaction";
63
+ GetEvmTransactionReceipt: "get-evm-transaction-receipt";
63
64
  };
@@ -2,60 +2,52 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WalletAction = exports.WalletEventListener = exports.WalletDeviceType = exports.MagicProvider = exports.Wallet = exports.BroadcastMode = void 0;
4
4
  const exceptions_1 = require("@injectivelabs/exceptions");
5
- var BroadcastMode;
6
- (function (BroadcastMode) {
7
- /** Return after tx commit */
8
- BroadcastMode["Block"] = "block";
9
- /** Return after CheckTx */
10
- BroadcastMode["Sync"] = "sync";
11
- /** Return right away */
12
- BroadcastMode["Async"] = "async";
13
- })(BroadcastMode || (exports.BroadcastMode = BroadcastMode = {}));
14
- var Wallet;
15
- (function (Wallet) {
16
- Wallet["Leap"] = "leap";
17
- Wallet["Keplr"] = "keplr";
18
- Wallet["Ninji"] = "ninji";
19
- Wallet["Magic"] = "magic";
20
- Wallet["Rabby"] = "rabby";
21
- Wallet["Ledger"] = "ledger";
22
- Wallet["BitGet"] = "BitGet";
23
- Wallet["OWallet"] = "owallet";
24
- Wallet["Phantom"] = "phantom";
25
- Wallet["Rainbow"] = "rainbow";
26
- Wallet["Turnkey"] = "turnkey";
27
- Wallet["Metamask"] = "metamask";
28
- Wallet["OkxWallet"] = "okx-wallet";
29
- Wallet["PrivateKey"] = "private-key";
30
- Wallet["TrustWallet"] = "trust-wallet";
31
- Wallet["TrezorBip32"] = "trezor-bip32";
32
- Wallet["TrezorBip44"] = "trezor-bip44";
33
- Wallet["Cosmostation"] = "cosmostation";
34
- Wallet["LedgerCosmos"] = "ledger-cosmos";
35
- Wallet["LedgerLegacy"] = "ledger-legacy";
36
- Wallet["WalletConnect"] = "wallet-connect";
37
- Wallet["CosmostationEth"] = "cosmostation-eth";
38
- })(Wallet || (exports.Wallet = Wallet = {}));
39
- var MagicProvider;
40
- (function (MagicProvider) {
41
- MagicProvider["Email"] = "email";
42
- MagicProvider["Apple"] = "apple";
43
- MagicProvider["Github"] = "github";
44
- MagicProvider["Google"] = "google";
45
- MagicProvider["Discord"] = "discord";
46
- MagicProvider["Twitter"] = "twitter";
47
- MagicProvider["Facebook"] = "facebook";
48
- })(MagicProvider || (exports.MagicProvider = MagicProvider = {}));
49
- var WalletDeviceType;
50
- (function (WalletDeviceType) {
51
- WalletDeviceType["Mobile"] = "mobile";
52
- WalletDeviceType["Other"] = "other";
53
- WalletDeviceType["Browser"] = "browser";
54
- WalletDeviceType["Hardware"] = "hardware";
55
- })(WalletDeviceType || (exports.WalletDeviceType = WalletDeviceType = {}));
56
- var WalletEventListener;
57
- (function (WalletEventListener) {
58
- WalletEventListener["AccountChange"] = "account-change";
59
- WalletEventListener["ChainIdChange"] = "chain-id-change";
60
- })(WalletEventListener || (exports.WalletEventListener = WalletEventListener = {}));
5
+ exports.BroadcastMode = {
6
+ Block: 'block',
7
+ Sync: 'sync',
8
+ Async: 'async',
9
+ };
10
+ exports.Wallet = {
11
+ Leap: 'leap',
12
+ Keplr: 'keplr',
13
+ Ninji: 'ninji',
14
+ Magic: 'magic',
15
+ Rabby: 'rabby',
16
+ Ledger: 'ledger',
17
+ BitGet: 'BitGet',
18
+ OWallet: 'owallet',
19
+ Phantom: 'phantom',
20
+ Rainbow: 'rainbow',
21
+ Turnkey: 'turnkey',
22
+ Metamask: 'metamask',
23
+ OkxWallet: 'okx-wallet',
24
+ PrivateKey: 'private-key',
25
+ TrustWallet: 'trust-wallet',
26
+ TrezorBip32: 'trezor-bip32',
27
+ TrezorBip44: 'trezor-bip44',
28
+ Cosmostation: 'cosmostation',
29
+ LedgerCosmos: 'ledger-cosmos',
30
+ LedgerLegacy: 'ledger-legacy',
31
+ WalletConnect: 'wallet-connect',
32
+ CosmostationEth: 'cosmostation-eth',
33
+ };
34
+ exports.MagicProvider = {
35
+ Email: 'email',
36
+ Apple: 'apple',
37
+ Github: 'github',
38
+ Google: 'google',
39
+ Discord: 'discord',
40
+ Twitter: 'twitter',
41
+ Facebook: 'facebook',
42
+ };
43
+ exports.WalletDeviceType = {
44
+ Mobile: 'mobile',
45
+ Other: 'other',
46
+ Browser: 'browser',
47
+ Hardware: 'hardware',
48
+ };
49
+ exports.WalletEventListener = {
50
+ AccountChange: 'account-change',
51
+ ChainIdChange: 'chain-id-change',
52
+ };
61
53
  exports.WalletAction = { ...exceptions_1.WalletErrorActionModule };
@@ -1,3 +1,3 @@
1
1
  export * from './enums.js';
2
2
  export * from './strategy.js';
3
- export * from './provider.js';
3
+ export type * from './provider.js';
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./enums.js"), exports);
18
18
  __exportStar(require("./strategy.js"), exports);
19
- __exportStar(require("./provider.js"), exports);
@@ -1,4 +1,4 @@
1
- import { type EIP1193Provider } from 'eip1193-provider';
1
+ import type { EIP1193Provider } from 'eip1193-provider';
2
2
  export interface BrowserEip1993Provider extends EIP1193Provider {
3
3
  removeAllListeners(): void;
4
4
  isTrust: boolean;
@@ -1,8 +1,8 @@
1
- import { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
1
+ import type { StdSignDoc } from '@keplr-wallet/types';
2
+ import type { WalletDeviceType, Wallet } from './enums.js';
3
+ import type { OfflineSigner } from '@cosmjs/proto-signing';
4
+ import type { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
2
5
  import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
- import { StdSignDoc } from '@keplr-wallet/types';
4
- import { WalletDeviceType, Wallet } from './enums.js';
5
- import { OfflineSigner } from '@cosmjs/proto-signing';
6
6
  export type onAccountChangeCallback = (account: string | string[]) => void;
7
7
  export type onChainIdChangeCallback = () => void;
8
8
  export type Eip1193Provider = {
@@ -46,11 +46,12 @@ export interface SendTransactionOptions {
46
46
  tm?: string;
47
47
  };
48
48
  }
49
- export declare enum TurnkeyProvider {
50
- Email = "email",
51
- Google = "google",
52
- Apple = "apple"
53
- }
49
+ export declare const TurnkeyProvider: {
50
+ readonly Email: "email";
51
+ readonly Google: "google";
52
+ readonly Apple: "apple";
53
+ };
54
+ export type TurnkeyProvider = typeof TurnkeyProvider[keyof typeof TurnkeyProvider];
54
55
  export type TurnkeySession = {
55
56
  sessionType: any;
56
57
  userId: string;
@@ -248,4 +249,4 @@ export interface WalletStrategy {
248
249
  getEip1193Provider?(): Promise<Eip1193Provider>;
249
250
  getOfflineSigner?(chainId: string): Promise<OfflineSigner>;
250
251
  }
251
- export { StdSignDoc };
252
+ export type { StdSignDoc };
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TurnkeyProvider = void 0;
4
- var TurnkeyProvider;
5
- (function (TurnkeyProvider) {
6
- TurnkeyProvider["Email"] = "email";
7
- TurnkeyProvider["Google"] = "google";
8
- TurnkeyProvider["Apple"] = "apple";
9
- })(TurnkeyProvider || (exports.TurnkeyProvider = TurnkeyProvider = {}));
4
+ exports.TurnkeyProvider = {
5
+ Email: 'email',
6
+ Google: 'google',
7
+ Apple: 'apple',
8
+ };
@@ -1,5 +1,5 @@
1
- import { ChainId } from '@injectivelabs/ts-types';
2
- import { Msgs } from '@injectivelabs/sdk-ts';
1
+ import type { Msgs } from '@injectivelabs/sdk-ts';
2
+ import type { ChainId } from '@injectivelabs/ts-types';
3
3
  export declare const createEip712StdSignDoc: ({ memo, chainId, accountNumber, timeoutHeight, sequence, gas, msgs, }: {
4
4
  memo?: string;
5
5
  chainId: ChainId;
@@ -15,13 +15,13 @@ export declare const createEip712StdSignDoc: ({ memo, chainId, accountNumber, ti
15
15
  sequence: string;
16
16
  fee: {
17
17
  amount: {
18
- denom: string;
19
18
  amount: string;
19
+ denom: string;
20
20
  }[];
21
21
  gas: string;
22
- payer: string | undefined;
23
- granter: string | undefined;
24
- feePayer: string | undefined;
22
+ payer: string;
23
+ granter: string;
24
+ feePayer: string;
25
25
  };
26
26
  msgs: {
27
27
  type: string;
@@ -26,8 +26,8 @@ exports.isCosmosWallet = isCosmosWallet;
26
26
  const isEvmBrowserWallet = (wallet) => [
27
27
  enums_js_1.Wallet.Rabby,
28
28
  enums_js_1.Wallet.BitGet,
29
- enums_js_1.Wallet.Rainbow,
30
29
  enums_js_1.Wallet.Phantom,
30
+ enums_js_1.Wallet.Rainbow,
31
31
  enums_js_1.Wallet.Metamask,
32
32
  enums_js_1.Wallet.OkxWallet,
33
33
  enums_js_1.Wallet.TrustWallet,
@@ -35,16 +35,16 @@ const isEvmBrowserWallet = (wallet) => [
35
35
  exports.isEvmBrowserWallet = isEvmBrowserWallet;
36
36
  const isCosmosBrowserWallet = (wallet) => [
37
37
  enums_js_1.Wallet.Leap,
38
- enums_js_1.Wallet.Ninji,
39
38
  enums_js_1.Wallet.Keplr,
39
+ enums_js_1.Wallet.Ninji,
40
40
  enums_js_1.Wallet.OWallet,
41
41
  enums_js_1.Wallet.Cosmostation,
42
42
  ].includes(wallet);
43
43
  exports.isCosmosBrowserWallet = isCosmosBrowserWallet;
44
44
  const isEip712V2OnlyWallet = (wallet) => [
45
45
  enums_js_1.Wallet.Magic,
46
- enums_js_1.Wallet.Metamask,
47
46
  enums_js_1.Wallet.Phantom,
47
+ enums_js_1.Wallet.Metamask,
48
48
  enums_js_1.Wallet.WalletConnect,
49
49
  ].includes(wallet);
50
50
  exports.isEip712V2OnlyWallet = isEip712V2OnlyWallet;
@@ -1,5 +1,5 @@
1
- import { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
- import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
1
+ import type { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
+ import type { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
3
3
  export default abstract class BaseConcreteStrategy {
4
4
  protected chainId: ChainId | CosmosChainId;
5
5
  protected evmChainId?: EvmChainId;
@@ -1,63 +1,64 @@
1
- import { WalletErrorActionModule } from '@injectivelabs/exceptions';
2
- export declare enum BroadcastMode {
3
- /** Return after tx commit */
4
- Block = "block",
5
- /** Return after CheckTx */
6
- Sync = "sync",
7
- /** Return right away */
8
- Async = "async"
9
- }
10
- export declare enum Wallet {
11
- Leap = "leap",
12
- Keplr = "keplr",
13
- Ninji = "ninji",
14
- Magic = "magic",
15
- Rabby = "rabby",
16
- Ledger = "ledger",
17
- BitGet = "BitGet",
18
- OWallet = "owallet",
19
- Phantom = "phantom",
20
- Rainbow = "rainbow",
21
- Turnkey = "turnkey",
22
- Metamask = "metamask",
23
- OkxWallet = "okx-wallet",
24
- PrivateKey = "private-key",
25
- TrustWallet = "trust-wallet",
26
- TrezorBip32 = "trezor-bip32",
27
- TrezorBip44 = "trezor-bip44",
28
- Cosmostation = "cosmostation",
29
- LedgerCosmos = "ledger-cosmos",
30
- LedgerLegacy = "ledger-legacy",
31
- WalletConnect = "wallet-connect",
32
- CosmostationEth = "cosmostation-eth"
33
- }
34
- export declare enum MagicProvider {
35
- Email = "email",
36
- Apple = "apple",
37
- Github = "github",
38
- Google = "google",
39
- Discord = "discord",
40
- Twitter = "twitter",
41
- Facebook = "facebook"
42
- }
43
- export declare enum WalletDeviceType {
44
- Mobile = "mobile",
45
- Other = "other",
46
- Browser = "browser",
47
- Hardware = "hardware"
48
- }
49
- export declare enum WalletEventListener {
50
- AccountChange = "account-change",
51
- ChainIdChange = "chain-id-change"
52
- }
1
+ export declare const BroadcastMode: {
2
+ readonly Block: "block";
3
+ readonly Sync: "sync";
4
+ readonly Async: "async";
5
+ };
6
+ export type BroadcastMode = typeof BroadcastMode[keyof typeof BroadcastMode];
7
+ export declare const Wallet: {
8
+ readonly Leap: "leap";
9
+ readonly Keplr: "keplr";
10
+ readonly Ninji: "ninji";
11
+ readonly Magic: "magic";
12
+ readonly Rabby: "rabby";
13
+ readonly Ledger: "ledger";
14
+ readonly BitGet: "BitGet";
15
+ readonly OWallet: "owallet";
16
+ readonly Phantom: "phantom";
17
+ readonly Rainbow: "rainbow";
18
+ readonly Turnkey: "turnkey";
19
+ readonly Metamask: "metamask";
20
+ readonly OkxWallet: "okx-wallet";
21
+ readonly PrivateKey: "private-key";
22
+ readonly TrustWallet: "trust-wallet";
23
+ readonly TrezorBip32: "trezor-bip32";
24
+ readonly TrezorBip44: "trezor-bip44";
25
+ readonly Cosmostation: "cosmostation";
26
+ readonly LedgerCosmos: "ledger-cosmos";
27
+ readonly LedgerLegacy: "ledger-legacy";
28
+ readonly WalletConnect: "wallet-connect";
29
+ readonly CosmostationEth: "cosmostation-eth";
30
+ };
31
+ export type Wallet = typeof Wallet[keyof typeof Wallet];
32
+ export declare const MagicProvider: {
33
+ readonly Email: "email";
34
+ readonly Apple: "apple";
35
+ readonly Github: "github";
36
+ readonly Google: "google";
37
+ readonly Discord: "discord";
38
+ readonly Twitter: "twitter";
39
+ readonly Facebook: "facebook";
40
+ };
41
+ export type MagicProvider = typeof MagicProvider[keyof typeof MagicProvider];
42
+ export declare const WalletDeviceType: {
43
+ readonly Mobile: "mobile";
44
+ readonly Other: "other";
45
+ readonly Browser: "browser";
46
+ readonly Hardware: "hardware";
47
+ };
48
+ export type WalletDeviceType = typeof WalletDeviceType[keyof typeof WalletDeviceType];
49
+ export declare const WalletEventListener: {
50
+ readonly AccountChange: "account-change";
51
+ readonly ChainIdChange: "chain-id-change";
52
+ };
53
+ export type WalletEventListener = typeof WalletEventListener[keyof typeof WalletEventListener];
53
54
  export declare const WalletAction: {
54
- GetChainId: WalletErrorActionModule.GetChainId;
55
- GetAccounts: WalletErrorActionModule.GetAccounts;
56
- GetNetworkId: WalletErrorActionModule.GetNetworkId;
57
- SignArbitrary: WalletErrorActionModule.SignArbitrary;
58
- SignTransaction: WalletErrorActionModule.SignTransaction;
59
- SendTransaction: WalletErrorActionModule.SendTransaction;
60
- SendEvmTransaction: WalletErrorActionModule.SendEvmTransaction;
61
- SignEvmTransaction: WalletErrorActionModule.SignEvmTransaction;
62
- GetEvmTransactionReceipt: WalletErrorActionModule.GetEvmTransactionReceipt;
55
+ GetChainId: "get-chain-id";
56
+ GetAccounts: "get-accounts";
57
+ GetNetworkId: "get-network-id";
58
+ SignArbitrary: "sign-arbitrary";
59
+ SignTransaction: "sign-transaction";
60
+ SendTransaction: "send-transaction";
61
+ SendEvmTransaction: "send-evm-transaction";
62
+ SignEvmTransaction: "sign-evm-transaction";
63
+ GetEvmTransactionReceipt: "get-evm-transaction-receipt";
63
64
  };
@@ -1,58 +1,50 @@
1
1
  import { WalletErrorActionModule } from '@injectivelabs/exceptions';
2
- export var BroadcastMode;
3
- (function (BroadcastMode) {
4
- /** Return after tx commit */
5
- BroadcastMode["Block"] = "block";
6
- /** Return after CheckTx */
7
- BroadcastMode["Sync"] = "sync";
8
- /** Return right away */
9
- BroadcastMode["Async"] = "async";
10
- })(BroadcastMode || (BroadcastMode = {}));
11
- export var Wallet;
12
- (function (Wallet) {
13
- Wallet["Leap"] = "leap";
14
- Wallet["Keplr"] = "keplr";
15
- Wallet["Ninji"] = "ninji";
16
- Wallet["Magic"] = "magic";
17
- Wallet["Rabby"] = "rabby";
18
- Wallet["Ledger"] = "ledger";
19
- Wallet["BitGet"] = "BitGet";
20
- Wallet["OWallet"] = "owallet";
21
- Wallet["Phantom"] = "phantom";
22
- Wallet["Rainbow"] = "rainbow";
23
- Wallet["Turnkey"] = "turnkey";
24
- Wallet["Metamask"] = "metamask";
25
- Wallet["OkxWallet"] = "okx-wallet";
26
- Wallet["PrivateKey"] = "private-key";
27
- Wallet["TrustWallet"] = "trust-wallet";
28
- Wallet["TrezorBip32"] = "trezor-bip32";
29
- Wallet["TrezorBip44"] = "trezor-bip44";
30
- Wallet["Cosmostation"] = "cosmostation";
31
- Wallet["LedgerCosmos"] = "ledger-cosmos";
32
- Wallet["LedgerLegacy"] = "ledger-legacy";
33
- Wallet["WalletConnect"] = "wallet-connect";
34
- Wallet["CosmostationEth"] = "cosmostation-eth";
35
- })(Wallet || (Wallet = {}));
36
- export var MagicProvider;
37
- (function (MagicProvider) {
38
- MagicProvider["Email"] = "email";
39
- MagicProvider["Apple"] = "apple";
40
- MagicProvider["Github"] = "github";
41
- MagicProvider["Google"] = "google";
42
- MagicProvider["Discord"] = "discord";
43
- MagicProvider["Twitter"] = "twitter";
44
- MagicProvider["Facebook"] = "facebook";
45
- })(MagicProvider || (MagicProvider = {}));
46
- export var WalletDeviceType;
47
- (function (WalletDeviceType) {
48
- WalletDeviceType["Mobile"] = "mobile";
49
- WalletDeviceType["Other"] = "other";
50
- WalletDeviceType["Browser"] = "browser";
51
- WalletDeviceType["Hardware"] = "hardware";
52
- })(WalletDeviceType || (WalletDeviceType = {}));
53
- export var WalletEventListener;
54
- (function (WalletEventListener) {
55
- WalletEventListener["AccountChange"] = "account-change";
56
- WalletEventListener["ChainIdChange"] = "chain-id-change";
57
- })(WalletEventListener || (WalletEventListener = {}));
2
+ export const BroadcastMode = {
3
+ Block: 'block',
4
+ Sync: 'sync',
5
+ Async: 'async',
6
+ };
7
+ export const Wallet = {
8
+ Leap: 'leap',
9
+ Keplr: 'keplr',
10
+ Ninji: 'ninji',
11
+ Magic: 'magic',
12
+ Rabby: 'rabby',
13
+ Ledger: 'ledger',
14
+ BitGet: 'BitGet',
15
+ OWallet: 'owallet',
16
+ Phantom: 'phantom',
17
+ Rainbow: 'rainbow',
18
+ Turnkey: 'turnkey',
19
+ Metamask: 'metamask',
20
+ OkxWallet: 'okx-wallet',
21
+ PrivateKey: 'private-key',
22
+ TrustWallet: 'trust-wallet',
23
+ TrezorBip32: 'trezor-bip32',
24
+ TrezorBip44: 'trezor-bip44',
25
+ Cosmostation: 'cosmostation',
26
+ LedgerCosmos: 'ledger-cosmos',
27
+ LedgerLegacy: 'ledger-legacy',
28
+ WalletConnect: 'wallet-connect',
29
+ CosmostationEth: 'cosmostation-eth',
30
+ };
31
+ export const MagicProvider = {
32
+ Email: 'email',
33
+ Apple: 'apple',
34
+ Github: 'github',
35
+ Google: 'google',
36
+ Discord: 'discord',
37
+ Twitter: 'twitter',
38
+ Facebook: 'facebook',
39
+ };
40
+ export const WalletDeviceType = {
41
+ Mobile: 'mobile',
42
+ Other: 'other',
43
+ Browser: 'browser',
44
+ Hardware: 'hardware',
45
+ };
46
+ export const WalletEventListener = {
47
+ AccountChange: 'account-change',
48
+ ChainIdChange: 'chain-id-change',
49
+ };
58
50
  export const WalletAction = { ...WalletErrorActionModule };
@@ -1,3 +1,3 @@
1
1
  export * from './enums.js';
2
2
  export * from './strategy.js';
3
- export * from './provider.js';
3
+ export type * from './provider.js';
@@ -1,3 +1,2 @@
1
1
  export * from './enums.js';
2
2
  export * from './strategy.js';
3
- export * from './provider.js';
@@ -1,4 +1,4 @@
1
- import { type EIP1193Provider } from 'eip1193-provider';
1
+ import type { EIP1193Provider } from 'eip1193-provider';
2
2
  export interface BrowserEip1993Provider extends EIP1193Provider {
3
3
  removeAllListeners(): void;
4
4
  isTrust: boolean;
@@ -1,8 +1,8 @@
1
- import { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
1
+ import type { StdSignDoc } from '@keplr-wallet/types';
2
+ import type { WalletDeviceType, Wallet } from './enums.js';
3
+ import type { OfflineSigner } from '@cosmjs/proto-signing';
4
+ import type { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
2
5
  import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
- import { StdSignDoc } from '@keplr-wallet/types';
4
- import { WalletDeviceType, Wallet } from './enums.js';
5
- import { OfflineSigner } from '@cosmjs/proto-signing';
6
6
  export type onAccountChangeCallback = (account: string | string[]) => void;
7
7
  export type onChainIdChangeCallback = () => void;
8
8
  export type Eip1193Provider = {
@@ -46,11 +46,12 @@ export interface SendTransactionOptions {
46
46
  tm?: string;
47
47
  };
48
48
  }
49
- export declare enum TurnkeyProvider {
50
- Email = "email",
51
- Google = "google",
52
- Apple = "apple"
53
- }
49
+ export declare const TurnkeyProvider: {
50
+ readonly Email: "email";
51
+ readonly Google: "google";
52
+ readonly Apple: "apple";
53
+ };
54
+ export type TurnkeyProvider = typeof TurnkeyProvider[keyof typeof TurnkeyProvider];
54
55
  export type TurnkeySession = {
55
56
  sessionType: any;
56
57
  userId: string;
@@ -248,4 +249,4 @@ export interface WalletStrategy {
248
249
  getEip1193Provider?(): Promise<Eip1193Provider>;
249
250
  getOfflineSigner?(chainId: string): Promise<OfflineSigner>;
250
251
  }
251
- export { StdSignDoc };
252
+ export type { StdSignDoc };
@@ -1,6 +1,5 @@
1
- export var TurnkeyProvider;
2
- (function (TurnkeyProvider) {
3
- TurnkeyProvider["Email"] = "email";
4
- TurnkeyProvider["Google"] = "google";
5
- TurnkeyProvider["Apple"] = "apple";
6
- })(TurnkeyProvider || (TurnkeyProvider = {}));
1
+ export const TurnkeyProvider = {
2
+ Email: 'email',
3
+ Google: 'google',
4
+ Apple: 'apple',
5
+ };
@@ -1,5 +1,5 @@
1
- import { ChainId } from '@injectivelabs/ts-types';
2
- import { Msgs } from '@injectivelabs/sdk-ts';
1
+ import type { Msgs } from '@injectivelabs/sdk-ts';
2
+ import type { ChainId } from '@injectivelabs/ts-types';
3
3
  export declare const createEip712StdSignDoc: ({ memo, chainId, accountNumber, timeoutHeight, sequence, gas, msgs, }: {
4
4
  memo?: string;
5
5
  chainId: ChainId;
@@ -15,13 +15,13 @@ export declare const createEip712StdSignDoc: ({ memo, chainId, accountNumber, ti
15
15
  sequence: string;
16
16
  fee: {
17
17
  amount: {
18
- denom: string;
19
18
  amount: string;
19
+ denom: string;
20
20
  }[];
21
21
  gas: string;
22
- payer: string | undefined;
23
- granter: string | undefined;
24
- feePayer: string | undefined;
22
+ payer: string;
23
+ granter: string;
24
+ feePayer: string;
25
25
  };
26
26
  msgs: {
27
27
  type: string;
@@ -21,23 +21,23 @@ export const isCosmosWallet = (wallet) => !isEvmWallet(wallet);
21
21
  export const isEvmBrowserWallet = (wallet) => [
22
22
  Wallet.Rabby,
23
23
  Wallet.BitGet,
24
- Wallet.Rainbow,
25
24
  Wallet.Phantom,
25
+ Wallet.Rainbow,
26
26
  Wallet.Metamask,
27
27
  Wallet.OkxWallet,
28
28
  Wallet.TrustWallet,
29
29
  ].includes(wallet);
30
30
  export const isCosmosBrowserWallet = (wallet) => [
31
31
  Wallet.Leap,
32
- Wallet.Ninji,
33
32
  Wallet.Keplr,
33
+ Wallet.Ninji,
34
34
  Wallet.OWallet,
35
35
  Wallet.Cosmostation,
36
36
  ].includes(wallet);
37
37
  export const isEip712V2OnlyWallet = (wallet) => [
38
38
  Wallet.Magic,
39
- Wallet.Metamask,
40
39
  Wallet.Phantom,
40
+ Wallet.Metamask,
41
41
  Wallet.WalletConnect,
42
42
  ].includes(wallet);
43
43
  export const isCosmosAminoOnlyWallet = (wallet) => [Wallet.LedgerCosmos].includes(wallet);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-base",
3
3
  "description": "Base wallet strategy 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,14 +56,14 @@
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",
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
63
  "eip1193-provider": "^1.0.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "shx": "^0.3.3"
67
67
  },
68
- "gitHead": "11a4cd78ffb176786df6c4aff98476f90f0b354b"
68
+ "gitHead": "bb71ac9147c0a2f0946ea0c316caf094fbbe2f2c"
69
69
  }