@injectivelabs/wallet-strategy 1.16.2-alpha.0 → 1.16.2-alpha.1
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/strategy/index.js +25 -20
- package/dist/esm/strategy/index.js +25 -20
- package/package.json +18 -18
|
@@ -45,19 +45,11 @@ const createStrategy = ({ args, wallet, }) => {
|
|
|
45
45
|
...ethWalletArgs,
|
|
46
46
|
wallet: wallet_base_1.Wallet.Metamask,
|
|
47
47
|
});
|
|
48
|
-
case wallet_base_1.Wallet.Ledger:
|
|
49
|
-
return new wallet_ledger_1.LedgerLiveStrategy(ethWalletArgs);
|
|
50
|
-
case wallet_base_1.Wallet.LedgerLegacy:
|
|
51
|
-
return new wallet_ledger_1.LedgerLegacyStrategy(ethWalletArgs);
|
|
52
48
|
case wallet_base_1.Wallet.TrustWallet:
|
|
53
49
|
return new wallet_evm_1.EvmWalletStrategy({
|
|
54
50
|
...ethWalletArgs,
|
|
55
51
|
wallet: wallet_base_1.Wallet.TrustWallet,
|
|
56
52
|
});
|
|
57
|
-
case wallet_base_1.Wallet.TrezorBip32:
|
|
58
|
-
return new wallet_trezor_1.TrezorBip32Strategy(ethWalletArgs);
|
|
59
|
-
case wallet_base_1.Wallet.TrezorBip44:
|
|
60
|
-
return new wallet_trezor_1.TrezorBip44Strategy(ethWalletArgs);
|
|
61
53
|
case wallet_base_1.Wallet.Phantom:
|
|
62
54
|
return new wallet_evm_1.EvmWalletStrategy({
|
|
63
55
|
...ethWalletArgs,
|
|
@@ -78,33 +70,46 @@ const createStrategy = ({ args, wallet, }) => {
|
|
|
78
70
|
...ethWalletArgs,
|
|
79
71
|
wallet: wallet_base_1.Wallet.Rainbow,
|
|
80
72
|
});
|
|
81
|
-
case wallet_base_1.Wallet.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
case wallet_base_1.Wallet.PrivateKey:
|
|
87
|
-
return new wallet_private_key_1.PrivateKeyWalletStrategy(ethWalletArgs);
|
|
73
|
+
case wallet_base_1.Wallet.Rabby:
|
|
74
|
+
return new wallet_evm_1.EvmWalletStrategy({
|
|
75
|
+
...ethWalletArgs,
|
|
76
|
+
wallet: wallet_base_1.Wallet.Rabby,
|
|
77
|
+
});
|
|
88
78
|
case wallet_base_1.Wallet.Keplr:
|
|
89
79
|
return new wallet_cosmos_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Keplr });
|
|
90
|
-
case wallet_base_1.Wallet.Cosmostation:
|
|
91
|
-
return new wallet_cosmostation_1.CosmostationWalletStrategy({ ...args });
|
|
92
80
|
case wallet_base_1.Wallet.Leap:
|
|
93
81
|
return new wallet_cosmos_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Leap });
|
|
94
82
|
case wallet_base_1.Wallet.Ninji:
|
|
95
83
|
return new wallet_cosmos_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Ninji });
|
|
96
84
|
case wallet_base_1.Wallet.OWallet:
|
|
97
85
|
return new wallet_cosmos_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.OWallet });
|
|
86
|
+
case wallet_base_1.Wallet.Cosmostation:
|
|
87
|
+
return new wallet_cosmostation_1.CosmostationWalletStrategy({ ...args });
|
|
88
|
+
case wallet_base_1.Wallet.Ledger:
|
|
89
|
+
return new wallet_ledger_1.LedgerLiveStrategy(ethWalletArgs);
|
|
90
|
+
case wallet_base_1.Wallet.LedgerLegacy:
|
|
91
|
+
return new wallet_ledger_1.LedgerLegacyStrategy(ethWalletArgs);
|
|
92
|
+
case wallet_base_1.Wallet.TrezorBip32:
|
|
93
|
+
return new wallet_trezor_1.TrezorBip32Strategy(ethWalletArgs);
|
|
94
|
+
case wallet_base_1.Wallet.TrezorBip44:
|
|
95
|
+
return new wallet_trezor_1.TrezorBip44Strategy(ethWalletArgs);
|
|
96
|
+
case wallet_base_1.Wallet.PrivateKey:
|
|
97
|
+
return new wallet_private_key_1.PrivateKeyWalletStrategy(ethWalletArgs);
|
|
98
|
+
case wallet_base_1.Wallet.Turnkey:
|
|
99
|
+
if (!args.metadata?.turnkey?.defaultOrganizationId) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
return new wallet_turnkey_1.TurnkeyWalletStrategy(ethWalletArgs);
|
|
98
103
|
case wallet_base_1.Wallet.Magic:
|
|
99
104
|
if (!args.metadata?.magic?.apiKey || !args.metadata?.magic?.rpcEndpoint) {
|
|
100
105
|
return undefined;
|
|
101
106
|
}
|
|
102
107
|
return new wallet_magic_1.MagicStrategy(args);
|
|
103
|
-
case wallet_base_1.Wallet.
|
|
104
|
-
if (!args.metadata?.
|
|
108
|
+
case wallet_base_1.Wallet.WalletConnect:
|
|
109
|
+
if (!args.metadata?.walletConnect?.projectId) {
|
|
105
110
|
return undefined;
|
|
106
111
|
}
|
|
107
|
-
return new
|
|
112
|
+
return new wallet_wallet_connect_1.WalletConnectStrategy(ethWalletArgs);
|
|
108
113
|
default:
|
|
109
114
|
return undefined;
|
|
110
115
|
}
|
|
@@ -42,19 +42,11 @@ const createStrategy = ({ args, wallet, }) => {
|
|
|
42
42
|
...ethWalletArgs,
|
|
43
43
|
wallet: Wallet.Metamask,
|
|
44
44
|
});
|
|
45
|
-
case Wallet.Ledger:
|
|
46
|
-
return new LedgerLiveStrategy(ethWalletArgs);
|
|
47
|
-
case Wallet.LedgerLegacy:
|
|
48
|
-
return new LedgerLegacyStrategy(ethWalletArgs);
|
|
49
45
|
case Wallet.TrustWallet:
|
|
50
46
|
return new EvmWalletStrategy({
|
|
51
47
|
...ethWalletArgs,
|
|
52
48
|
wallet: Wallet.TrustWallet,
|
|
53
49
|
});
|
|
54
|
-
case Wallet.TrezorBip32:
|
|
55
|
-
return new TrezorBip32Strategy(ethWalletArgs);
|
|
56
|
-
case Wallet.TrezorBip44:
|
|
57
|
-
return new TrezorBip44Strategy(ethWalletArgs);
|
|
58
50
|
case Wallet.Phantom:
|
|
59
51
|
return new EvmWalletStrategy({
|
|
60
52
|
...ethWalletArgs,
|
|
@@ -75,33 +67,46 @@ const createStrategy = ({ args, wallet, }) => {
|
|
|
75
67
|
...ethWalletArgs,
|
|
76
68
|
wallet: Wallet.Rainbow,
|
|
77
69
|
});
|
|
78
|
-
case Wallet.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
case Wallet.PrivateKey:
|
|
84
|
-
return new PrivateKeyWalletStrategy(ethWalletArgs);
|
|
70
|
+
case Wallet.Rabby:
|
|
71
|
+
return new EvmWalletStrategy({
|
|
72
|
+
...ethWalletArgs,
|
|
73
|
+
wallet: Wallet.Rabby,
|
|
74
|
+
});
|
|
85
75
|
case Wallet.Keplr:
|
|
86
76
|
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Keplr });
|
|
87
|
-
case Wallet.Cosmostation:
|
|
88
|
-
return new CosmostationWalletStrategy({ ...args });
|
|
89
77
|
case Wallet.Leap:
|
|
90
78
|
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Leap });
|
|
91
79
|
case Wallet.Ninji:
|
|
92
80
|
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Ninji });
|
|
93
81
|
case Wallet.OWallet:
|
|
94
82
|
return new CosmosWalletStrategy({ ...args, wallet: Wallet.OWallet });
|
|
83
|
+
case Wallet.Cosmostation:
|
|
84
|
+
return new CosmostationWalletStrategy({ ...args });
|
|
85
|
+
case Wallet.Ledger:
|
|
86
|
+
return new LedgerLiveStrategy(ethWalletArgs);
|
|
87
|
+
case Wallet.LedgerLegacy:
|
|
88
|
+
return new LedgerLegacyStrategy(ethWalletArgs);
|
|
89
|
+
case Wallet.TrezorBip32:
|
|
90
|
+
return new TrezorBip32Strategy(ethWalletArgs);
|
|
91
|
+
case Wallet.TrezorBip44:
|
|
92
|
+
return new TrezorBip44Strategy(ethWalletArgs);
|
|
93
|
+
case Wallet.PrivateKey:
|
|
94
|
+
return new PrivateKeyWalletStrategy(ethWalletArgs);
|
|
95
|
+
case Wallet.Turnkey:
|
|
96
|
+
if (!args.metadata?.turnkey?.defaultOrganizationId) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
return new TurnkeyWalletStrategy(ethWalletArgs);
|
|
95
100
|
case Wallet.Magic:
|
|
96
101
|
if (!args.metadata?.magic?.apiKey || !args.metadata?.magic?.rpcEndpoint) {
|
|
97
102
|
return undefined;
|
|
98
103
|
}
|
|
99
104
|
return new MagicStrategy(args);
|
|
100
|
-
case Wallet.
|
|
101
|
-
if (!args.metadata?.
|
|
105
|
+
case Wallet.WalletConnect:
|
|
106
|
+
if (!args.metadata?.walletConnect?.projectId) {
|
|
102
107
|
return undefined;
|
|
103
108
|
}
|
|
104
|
-
return new
|
|
109
|
+
return new WalletConnectStrategy(ethWalletArgs);
|
|
105
110
|
default:
|
|
106
111
|
return undefined;
|
|
107
112
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-strategy",
|
|
3
3
|
"description": "Wallet strategy with instantiated wallets",
|
|
4
|
-
"version": "1.16.2-alpha.
|
|
4
|
+
"version": "1.16.2-alpha.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -58,22 +58,22 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@ethereumjs/common": "^3.1.1",
|
|
60
60
|
"@ethereumjs/tx": "^4.1.1",
|
|
61
|
-
"@injectivelabs/exceptions": "1.16.2-alpha.
|
|
62
|
-
"@injectivelabs/networks": "1.16.2-alpha.
|
|
63
|
-
"@injectivelabs/sdk-ts": "1.16.2-alpha.
|
|
64
|
-
"@injectivelabs/ts-types": "1.16.2-alpha.
|
|
65
|
-
"@injectivelabs/utils": "1.16.2-alpha.
|
|
66
|
-
"@injectivelabs/wallet-base": "1.16.2-alpha.
|
|
67
|
-
"@injectivelabs/wallet-core": "1.16.2-alpha.
|
|
68
|
-
"@injectivelabs/wallet-cosmos": "1.16.2-alpha.
|
|
69
|
-
"@injectivelabs/wallet-cosmostation": "1.16.2-alpha.
|
|
70
|
-
"@injectivelabs/wallet-evm": "1.16.2-alpha.
|
|
71
|
-
"@injectivelabs/wallet-ledger": "1.16.2-alpha.
|
|
72
|
-
"@injectivelabs/wallet-magic": "1.16.2-alpha.
|
|
73
|
-
"@injectivelabs/wallet-private-key": "1.16.2-alpha.
|
|
74
|
-
"@injectivelabs/wallet-trezor": "1.16.2-alpha.
|
|
75
|
-
"@injectivelabs/wallet-turnkey": "1.16.2-alpha.
|
|
76
|
-
"@injectivelabs/wallet-wallet-connect": "1.16.2-alpha.
|
|
61
|
+
"@injectivelabs/exceptions": "1.16.2-alpha.1",
|
|
62
|
+
"@injectivelabs/networks": "1.16.2-alpha.1",
|
|
63
|
+
"@injectivelabs/sdk-ts": "1.16.2-alpha.1",
|
|
64
|
+
"@injectivelabs/ts-types": "1.16.2-alpha.1",
|
|
65
|
+
"@injectivelabs/utils": "1.16.2-alpha.1",
|
|
66
|
+
"@injectivelabs/wallet-base": "1.16.2-alpha.1",
|
|
67
|
+
"@injectivelabs/wallet-core": "1.16.2-alpha.1",
|
|
68
|
+
"@injectivelabs/wallet-cosmos": "1.16.2-alpha.1",
|
|
69
|
+
"@injectivelabs/wallet-cosmostation": "1.16.2-alpha.1",
|
|
70
|
+
"@injectivelabs/wallet-evm": "1.16.2-alpha.1",
|
|
71
|
+
"@injectivelabs/wallet-ledger": "1.16.2-alpha.1",
|
|
72
|
+
"@injectivelabs/wallet-magic": "1.16.2-alpha.1",
|
|
73
|
+
"@injectivelabs/wallet-private-key": "1.16.2-alpha.1",
|
|
74
|
+
"@injectivelabs/wallet-trezor": "1.16.2-alpha.1",
|
|
75
|
+
"@injectivelabs/wallet-turnkey": "1.16.2-alpha.1",
|
|
76
|
+
"@injectivelabs/wallet-wallet-connect": "1.16.2-alpha.1",
|
|
77
77
|
"alchemy-sdk": "^3.4.7",
|
|
78
78
|
"eip1193-provider": "^1.0.1",
|
|
79
79
|
"eth-sig-util": "^3.0.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"@types/hdkey": "^2.0.1",
|
|
88
88
|
"shx": "^0.3.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "25f2492ee251504d8b0c1f3e4ce49e96e759294b"
|
|
91
91
|
}
|