@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.
- package/dist/cjs/base.d.ts +2 -2
- package/dist/cjs/types/enums.d.ts +62 -61
- package/dist/cjs/types/enums.js +48 -56
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/types/provider.d.ts +1 -1
- package/dist/cjs/types/strategy.d.ts +11 -10
- package/dist/cjs/types/strategy.js +5 -6
- package/dist/cjs/utils/tx.d.ts +6 -6
- package/dist/cjs/utils/wallet.js +3 -3
- package/dist/esm/base.d.ts +2 -2
- package/dist/esm/types/enums.d.ts +62 -61
- package/dist/esm/types/enums.js +48 -56
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/provider.d.ts +1 -1
- package/dist/esm/types/strategy.d.ts +11 -10
- package/dist/esm/types/strategy.js +5 -6
- package/dist/esm/utils/tx.d.ts +6 -6
- package/dist/esm/utils/wallet.js +3 -3
- package/package.json +6 -6
package/dist/cjs/base.d.ts
CHANGED
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export declare
|
|
50
|
-
AccountChange
|
|
51
|
-
ChainIdChange
|
|
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:
|
|
55
|
-
GetAccounts:
|
|
56
|
-
GetNetworkId:
|
|
57
|
-
SignArbitrary:
|
|
58
|
-
SignTransaction:
|
|
59
|
-
SendTransaction:
|
|
60
|
-
SendEvmTransaction:
|
|
61
|
-
SignEvmTransaction:
|
|
62
|
-
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
|
};
|
package/dist/cjs/types/enums.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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 };
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
|
50
|
-
Email
|
|
51
|
-
Google
|
|
52
|
-
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(TurnkeyProvider || (exports.TurnkeyProvider = TurnkeyProvider = {}));
|
|
4
|
+
exports.TurnkeyProvider = {
|
|
5
|
+
Email: 'email',
|
|
6
|
+
Google: 'google',
|
|
7
|
+
Apple: 'apple',
|
|
8
|
+
};
|
package/dist/cjs/utils/tx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
23
|
-
granter: string
|
|
24
|
-
feePayer: string
|
|
22
|
+
payer: string;
|
|
23
|
+
granter: string;
|
|
24
|
+
feePayer: string;
|
|
25
25
|
};
|
|
26
26
|
msgs: {
|
|
27
27
|
type: string;
|
package/dist/cjs/utils/wallet.js
CHANGED
|
@@ -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;
|
package/dist/esm/base.d.ts
CHANGED
|
@@ -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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export declare
|
|
50
|
-
AccountChange
|
|
51
|
-
ChainIdChange
|
|
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:
|
|
55
|
-
GetAccounts:
|
|
56
|
-
GetNetworkId:
|
|
57
|
-
SignArbitrary:
|
|
58
|
-
SignTransaction:
|
|
59
|
-
SendTransaction:
|
|
60
|
-
SendEvmTransaction:
|
|
61
|
-
SignEvmTransaction:
|
|
62
|
-
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
|
};
|
package/dist/esm/types/enums.js
CHANGED
|
@@ -1,58 +1,50 @@
|
|
|
1
1
|
import { WalletErrorActionModule } from '@injectivelabs/exceptions';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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 };
|
package/dist/esm/types/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
|
50
|
-
Email
|
|
51
|
-
Google
|
|
52
|
-
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(TurnkeyProvider || (TurnkeyProvider = {}));
|
|
1
|
+
export const TurnkeyProvider = {
|
|
2
|
+
Email: 'email',
|
|
3
|
+
Google: 'google',
|
|
4
|
+
Apple: 'apple',
|
|
5
|
+
};
|
package/dist/esm/utils/tx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
23
|
-
granter: string
|
|
24
|
-
feePayer: string
|
|
22
|
+
payer: string;
|
|
23
|
+
granter: string;
|
|
24
|
+
feePayer: string;
|
|
25
25
|
};
|
|
26
26
|
msgs: {
|
|
27
27
|
type: string;
|
package/dist/esm/utils/wallet.js
CHANGED
|
@@ -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.
|
|
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.
|
|
60
|
-
"@injectivelabs/networks": "1.16.
|
|
61
|
-
"@injectivelabs/sdk-ts": "1.16.
|
|
62
|
-
"@injectivelabs/ts-types": "1.16.
|
|
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": "
|
|
68
|
+
"gitHead": "bb71ac9147c0a2f0946ea0c316caf094fbbe2f2c"
|
|
69
69
|
}
|