@injectivelabs/wallet-base 1.20.7 → 1.20.9
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-BGVbNgzY.d.cts +473 -0
- package/dist/cjs/base-CCDH4BFB.cjs +316 -0
- package/dist/cjs/index.cjs +22 -226
- package/dist/cjs/index.d.cts +4 -469
- package/dist/cjs/light.cjs +20 -0
- package/dist/cjs/light.d.cts +2 -0
- package/dist/esm/base-Bek8jyaS.d.ts +473 -0
- package/dist/esm/base-DDrF_yw2.js +208 -0
- package/dist/esm/index.d.ts +4 -469
- package/dist/esm/index.js +2 -207
- package/dist/esm/light.d.ts +2 -0
- package/dist/esm/light.js +3 -0
- package/package.json +24 -4
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
const require_index = require('./index.cjs');
|
|
2
|
+
let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
|
|
3
|
+
|
|
4
|
+
//#region src/types/events.ts
|
|
5
|
+
const StrategyEventType = {
|
|
6
|
+
ConnectionEnd: "connection-end",
|
|
7
|
+
ConnectionStart: "connection-start",
|
|
8
|
+
WalletSigningEnd: "wallet-signing-end",
|
|
9
|
+
WalletSigningStart: "wallet-signing-start"
|
|
10
|
+
};
|
|
11
|
+
const WalletConnectStrategyEventType = { WalletConnectSigningWithTxTimeout: "signing-with-tx-timeout" };
|
|
12
|
+
const WalletStrategyEmitterEventType = {
|
|
13
|
+
TransactionFail: "transaction-fail",
|
|
14
|
+
TransactionSigned: "transaction-signed",
|
|
15
|
+
TransactionSignStart: "transaction-sign-start",
|
|
16
|
+
TransactionBroadcastEnd: "transaction-broadcast-end",
|
|
17
|
+
TransactionBroadcastStart: "transaction-broadcast-start",
|
|
18
|
+
TransactionBroadcastSynced: "transaction-broadcast-synced",
|
|
19
|
+
TransactionPreparationEnd: "transaction-preparation-end",
|
|
20
|
+
TransactionPreparationStart: "transaction-preparation-start",
|
|
21
|
+
WalletStrategyDisconnect: "wallet-strategy-disconnect"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/types/enums.ts
|
|
26
|
+
const BroadcastMode = {
|
|
27
|
+
Block: "block",
|
|
28
|
+
Sync: "sync",
|
|
29
|
+
Async: "async"
|
|
30
|
+
};
|
|
31
|
+
const Wallet = {
|
|
32
|
+
Leap: "leap",
|
|
33
|
+
Keplr: "keplr",
|
|
34
|
+
Ninji: "ninji",
|
|
35
|
+
Magic: "magic",
|
|
36
|
+
Rabby: "rabby",
|
|
37
|
+
Ledger: "ledger",
|
|
38
|
+
BitGet: "BitGet",
|
|
39
|
+
OWallet: "owallet",
|
|
40
|
+
Phantom: "phantom",
|
|
41
|
+
Rainbow: "rainbow",
|
|
42
|
+
Turnkey: "turnkey",
|
|
43
|
+
Metamask: "metamask",
|
|
44
|
+
KeplrEvm: "keplr-evm",
|
|
45
|
+
OkxWallet: "okx-wallet",
|
|
46
|
+
PrivateKey: "private-key",
|
|
47
|
+
TrustWallet: "trust-wallet",
|
|
48
|
+
TrezorBip32: "trezor-bip32",
|
|
49
|
+
TrezorBip44: "trezor-bip44",
|
|
50
|
+
Cosmostation: "cosmostation",
|
|
51
|
+
LedgerCosmos: "ledger-cosmos",
|
|
52
|
+
LedgerLegacy: "ledger-legacy",
|
|
53
|
+
WalletConnect: "wallet-connect",
|
|
54
|
+
CosmostationEth: "cosmostation-eth"
|
|
55
|
+
};
|
|
56
|
+
const MagicProvider = {
|
|
57
|
+
Email: "email",
|
|
58
|
+
Apple: "apple",
|
|
59
|
+
Github: "github",
|
|
60
|
+
Google: "google",
|
|
61
|
+
Discord: "discord",
|
|
62
|
+
Twitter: "twitter",
|
|
63
|
+
Facebook: "facebook"
|
|
64
|
+
};
|
|
65
|
+
const WalletDeviceType = {
|
|
66
|
+
Mobile: "mobile",
|
|
67
|
+
Other: "other",
|
|
68
|
+
Browser: "browser",
|
|
69
|
+
Hardware: "hardware"
|
|
70
|
+
};
|
|
71
|
+
const WalletEventListener = {
|
|
72
|
+
AccountChange: "account-change",
|
|
73
|
+
ChainIdChange: "chain-id-change"
|
|
74
|
+
};
|
|
75
|
+
const EvmWalletProviderErrorCode = {
|
|
76
|
+
InternalError: -32603,
|
|
77
|
+
UserRejectedRequest: 4001,
|
|
78
|
+
UnrecognizedChain: 4902
|
|
79
|
+
};
|
|
80
|
+
const WalletAction = { ...__injectivelabs_exceptions.WalletErrorActionModule };
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/types/strategy.ts
|
|
84
|
+
const TurnkeyProvider = {
|
|
85
|
+
Sms: "sms",
|
|
86
|
+
Apple: "apple",
|
|
87
|
+
Email: "email",
|
|
88
|
+
Google: "google",
|
|
89
|
+
Twitter: "twitter"
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/utils/wallet.ts
|
|
94
|
+
const isEvmWallet = (wallet) => [
|
|
95
|
+
Wallet.Magic,
|
|
96
|
+
Wallet.Rabby,
|
|
97
|
+
Wallet.BitGet,
|
|
98
|
+
Wallet.Ledger,
|
|
99
|
+
Wallet.Phantom,
|
|
100
|
+
Wallet.Rainbow,
|
|
101
|
+
Wallet.Turnkey,
|
|
102
|
+
Wallet.Metamask,
|
|
103
|
+
Wallet.KeplrEvm,
|
|
104
|
+
Wallet.OkxWallet,
|
|
105
|
+
Wallet.PrivateKey,
|
|
106
|
+
Wallet.TrezorBip32,
|
|
107
|
+
Wallet.TrezorBip44,
|
|
108
|
+
Wallet.TrustWallet,
|
|
109
|
+
Wallet.LedgerLegacy,
|
|
110
|
+
Wallet.WalletConnect,
|
|
111
|
+
Wallet.CosmostationEth
|
|
112
|
+
].includes(wallet);
|
|
113
|
+
const isCosmosWallet = (wallet) => !isEvmWallet(wallet);
|
|
114
|
+
const isEvmBrowserWallet = (wallet) => [
|
|
115
|
+
Wallet.Rabby,
|
|
116
|
+
Wallet.BitGet,
|
|
117
|
+
Wallet.Phantom,
|
|
118
|
+
Wallet.Rainbow,
|
|
119
|
+
Wallet.Metamask,
|
|
120
|
+
Wallet.KeplrEvm,
|
|
121
|
+
Wallet.OkxWallet,
|
|
122
|
+
Wallet.TrustWallet
|
|
123
|
+
].includes(wallet);
|
|
124
|
+
const isCosmosBrowserWallet = (wallet) => [
|
|
125
|
+
Wallet.Leap,
|
|
126
|
+
Wallet.Keplr,
|
|
127
|
+
Wallet.Ninji,
|
|
128
|
+
Wallet.OWallet,
|
|
129
|
+
Wallet.Cosmostation
|
|
130
|
+
].includes(wallet);
|
|
131
|
+
const isEip712V2OnlyWallet = (wallet) => [
|
|
132
|
+
Wallet.Magic,
|
|
133
|
+
Wallet.Phantom,
|
|
134
|
+
Wallet.Metamask,
|
|
135
|
+
Wallet.WalletConnect
|
|
136
|
+
].includes(wallet);
|
|
137
|
+
const isCosmosAminoOnlyWallet = (wallet) => [Wallet.LedgerCosmos].includes(wallet);
|
|
138
|
+
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
141
|
+
function _typeof(o) {
|
|
142
|
+
"@babel/helpers - typeof";
|
|
143
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
144
|
+
return typeof o$1;
|
|
145
|
+
} : function(o$1) {
|
|
146
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
147
|
+
}, _typeof(o);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
152
|
+
function toPrimitive(t, r) {
|
|
153
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
154
|
+
var e = t[Symbol.toPrimitive];
|
|
155
|
+
if (void 0 !== e) {
|
|
156
|
+
var i = e.call(t, r || "default");
|
|
157
|
+
if ("object" != _typeof(i)) return i;
|
|
158
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
159
|
+
}
|
|
160
|
+
return ("string" === r ? String : Number)(t);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
165
|
+
function toPropertyKey(t) {
|
|
166
|
+
var i = toPrimitive(t, "string");
|
|
167
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
172
|
+
function _defineProperty(e, r, t) {
|
|
173
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
174
|
+
value: t,
|
|
175
|
+
enumerable: !0,
|
|
176
|
+
configurable: !0,
|
|
177
|
+
writable: !0
|
|
178
|
+
}) : e[r] = t, e;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/base.ts
|
|
183
|
+
var BaseConcreteStrategy = class {
|
|
184
|
+
constructor(args) {
|
|
185
|
+
_defineProperty(this, "chainId", void 0);
|
|
186
|
+
_defineProperty(this, "evmChainId", void 0);
|
|
187
|
+
_defineProperty(this, "listeners", {});
|
|
188
|
+
_defineProperty(this, "metadata", void 0);
|
|
189
|
+
_defineProperty(this, "emitter", void 0);
|
|
190
|
+
this.evmChainId = "evmOptions" in args && args.evmOptions ? args.evmOptions.evmChainId : void 0;
|
|
191
|
+
this.chainId = args.chainId;
|
|
192
|
+
this.metadata = args.metadata;
|
|
193
|
+
this.emitter = args.emitter;
|
|
194
|
+
}
|
|
195
|
+
setMetadata(metadata) {
|
|
196
|
+
this.metadata = metadata;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Emit an event from this strategy.
|
|
200
|
+
* If emitter was provided from parent, events go directly to parent.
|
|
201
|
+
*/
|
|
202
|
+
emit(event, data) {
|
|
203
|
+
var _this$emitter;
|
|
204
|
+
(_this$emitter = this.emitter) === null || _this$emitter === void 0 || _this$emitter.emit(event, data);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
//#endregion
|
|
209
|
+
Object.defineProperty(exports, 'BaseConcreteStrategy', {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: function () {
|
|
212
|
+
return BaseConcreteStrategy;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
Object.defineProperty(exports, 'BroadcastMode', {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function () {
|
|
218
|
+
return BroadcastMode;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(exports, 'EvmWalletProviderErrorCode', {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: function () {
|
|
224
|
+
return EvmWalletProviderErrorCode;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
Object.defineProperty(exports, 'MagicProvider', {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () {
|
|
230
|
+
return MagicProvider;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, 'StrategyEventType', {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function () {
|
|
236
|
+
return StrategyEventType;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
Object.defineProperty(exports, 'TurnkeyProvider', {
|
|
240
|
+
enumerable: true,
|
|
241
|
+
get: function () {
|
|
242
|
+
return TurnkeyProvider;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
Object.defineProperty(exports, 'Wallet', {
|
|
246
|
+
enumerable: true,
|
|
247
|
+
get: function () {
|
|
248
|
+
return Wallet;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(exports, 'WalletAction', {
|
|
252
|
+
enumerable: true,
|
|
253
|
+
get: function () {
|
|
254
|
+
return WalletAction;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
Object.defineProperty(exports, 'WalletConnectStrategyEventType', {
|
|
258
|
+
enumerable: true,
|
|
259
|
+
get: function () {
|
|
260
|
+
return WalletConnectStrategyEventType;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
Object.defineProperty(exports, 'WalletDeviceType', {
|
|
264
|
+
enumerable: true,
|
|
265
|
+
get: function () {
|
|
266
|
+
return WalletDeviceType;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
Object.defineProperty(exports, 'WalletEventListener', {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
get: function () {
|
|
272
|
+
return WalletEventListener;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
Object.defineProperty(exports, 'WalletStrategyEmitterEventType', {
|
|
276
|
+
enumerable: true,
|
|
277
|
+
get: function () {
|
|
278
|
+
return WalletStrategyEmitterEventType;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
Object.defineProperty(exports, 'isCosmosAminoOnlyWallet', {
|
|
282
|
+
enumerable: true,
|
|
283
|
+
get: function () {
|
|
284
|
+
return isCosmosAminoOnlyWallet;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
Object.defineProperty(exports, 'isCosmosBrowserWallet', {
|
|
288
|
+
enumerable: true,
|
|
289
|
+
get: function () {
|
|
290
|
+
return isCosmosBrowserWallet;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
Object.defineProperty(exports, 'isCosmosWallet', {
|
|
294
|
+
enumerable: true,
|
|
295
|
+
get: function () {
|
|
296
|
+
return isCosmosWallet;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
Object.defineProperty(exports, 'isEip712V2OnlyWallet', {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get: function () {
|
|
302
|
+
return isEip712V2OnlyWallet;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
Object.defineProperty(exports, 'isEvmBrowserWallet', {
|
|
306
|
+
enumerable: true,
|
|
307
|
+
get: function () {
|
|
308
|
+
return isEvmBrowserWallet;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
Object.defineProperty(exports, 'isEvmWallet', {
|
|
312
|
+
enumerable: true,
|
|
313
|
+
get: function () {
|
|
314
|
+
return isEvmWallet;
|
|
315
|
+
}
|
|
316
|
+
});
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -25,104 +25,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
|
|
28
|
+
const require_base = require('./base-CCDH4BFB.cjs');
|
|
29
29
|
let __injectivelabs_utils = require("@injectivelabs/utils");
|
|
30
30
|
let viem_chains = require("viem/chains");
|
|
31
31
|
viem_chains = __toESM(viem_chains);
|
|
32
32
|
let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
|
|
33
33
|
let viem = require("viem");
|
|
34
|
-
let
|
|
34
|
+
let __injectivelabs_sdk_ts_proto_cosmos_tx = require("@injectivelabs/sdk-ts/proto/cosmos-tx");
|
|
35
35
|
let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
|
|
36
36
|
|
|
37
|
-
//#region src/types/events.ts
|
|
38
|
-
const StrategyEventType = {
|
|
39
|
-
ConnectionEnd: "connection-end",
|
|
40
|
-
ConnectionStart: "connection-start",
|
|
41
|
-
WalletSigningEnd: "wallet-signing-end",
|
|
42
|
-
WalletSigningStart: "wallet-signing-start"
|
|
43
|
-
};
|
|
44
|
-
const WalletConnectStrategyEventType = { WalletConnectSigningWithTxTimeout: "signing-with-tx-timeout" };
|
|
45
|
-
const WalletStrategyEmitterEventType = {
|
|
46
|
-
TransactionFail: "transaction-fail",
|
|
47
|
-
TransactionSigned: "transaction-signed",
|
|
48
|
-
TransactionSignStart: "transaction-sign-start",
|
|
49
|
-
TransactionBroadcastEnd: "transaction-broadcast-end",
|
|
50
|
-
TransactionBroadcastStart: "transaction-broadcast-start",
|
|
51
|
-
TransactionBroadcastSynced: "transaction-broadcast-synced",
|
|
52
|
-
TransactionPreparationEnd: "transaction-preparation-end",
|
|
53
|
-
TransactionPreparationStart: "transaction-preparation-start",
|
|
54
|
-
WalletStrategyDisconnect: "wallet-strategy-disconnect"
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/types/enums.ts
|
|
59
|
-
const BroadcastMode = {
|
|
60
|
-
Block: "block",
|
|
61
|
-
Sync: "sync",
|
|
62
|
-
Async: "async"
|
|
63
|
-
};
|
|
64
|
-
const Wallet = {
|
|
65
|
-
Leap: "leap",
|
|
66
|
-
Keplr: "keplr",
|
|
67
|
-
Ninji: "ninji",
|
|
68
|
-
Magic: "magic",
|
|
69
|
-
Rabby: "rabby",
|
|
70
|
-
Ledger: "ledger",
|
|
71
|
-
BitGet: "BitGet",
|
|
72
|
-
OWallet: "owallet",
|
|
73
|
-
Phantom: "phantom",
|
|
74
|
-
Rainbow: "rainbow",
|
|
75
|
-
Turnkey: "turnkey",
|
|
76
|
-
Metamask: "metamask",
|
|
77
|
-
KeplrEvm: "keplr-evm",
|
|
78
|
-
OkxWallet: "okx-wallet",
|
|
79
|
-
PrivateKey: "private-key",
|
|
80
|
-
TrustWallet: "trust-wallet",
|
|
81
|
-
TrezorBip32: "trezor-bip32",
|
|
82
|
-
TrezorBip44: "trezor-bip44",
|
|
83
|
-
Cosmostation: "cosmostation",
|
|
84
|
-
LedgerCosmos: "ledger-cosmos",
|
|
85
|
-
LedgerLegacy: "ledger-legacy",
|
|
86
|
-
WalletConnect: "wallet-connect",
|
|
87
|
-
CosmostationEth: "cosmostation-eth"
|
|
88
|
-
};
|
|
89
|
-
const MagicProvider = {
|
|
90
|
-
Email: "email",
|
|
91
|
-
Apple: "apple",
|
|
92
|
-
Github: "github",
|
|
93
|
-
Google: "google",
|
|
94
|
-
Discord: "discord",
|
|
95
|
-
Twitter: "twitter",
|
|
96
|
-
Facebook: "facebook"
|
|
97
|
-
};
|
|
98
|
-
const WalletDeviceType = {
|
|
99
|
-
Mobile: "mobile",
|
|
100
|
-
Other: "other",
|
|
101
|
-
Browser: "browser",
|
|
102
|
-
Hardware: "hardware"
|
|
103
|
-
};
|
|
104
|
-
const WalletEventListener = {
|
|
105
|
-
AccountChange: "account-change",
|
|
106
|
-
ChainIdChange: "chain-id-change"
|
|
107
|
-
};
|
|
108
|
-
const EvmWalletProviderErrorCode = {
|
|
109
|
-
InternalError: -32603,
|
|
110
|
-
UserRejectedRequest: 4001,
|
|
111
|
-
UnrecognizedChain: 4902
|
|
112
|
-
};
|
|
113
|
-
const WalletAction = { ...__injectivelabs_exceptions.WalletErrorActionModule };
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/types/strategy.ts
|
|
117
|
-
const TurnkeyProvider = {
|
|
118
|
-
Sms: "sms",
|
|
119
|
-
Apple: "apple",
|
|
120
|
-
Email: "email",
|
|
121
|
-
Google: "google",
|
|
122
|
-
Twitter: "twitter"
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
//#endregion
|
|
126
37
|
//#region src/utils/tx.ts
|
|
127
38
|
const createEip712StdSignDoc = ({ memo, chainId, accountNumber, timeoutHeight, sequence, gas, msgs }) => ({
|
|
128
39
|
chain_id: chainId,
|
|
@@ -203,57 +114,10 @@ const getViemPublicClientFromEip1193Provider = (chainId, provider) => {
|
|
|
203
114
|
});
|
|
204
115
|
};
|
|
205
116
|
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/utils/wallet.ts
|
|
208
|
-
const isEvmWallet = (wallet) => [
|
|
209
|
-
Wallet.Magic,
|
|
210
|
-
Wallet.Rabby,
|
|
211
|
-
Wallet.BitGet,
|
|
212
|
-
Wallet.Ledger,
|
|
213
|
-
Wallet.Phantom,
|
|
214
|
-
Wallet.Rainbow,
|
|
215
|
-
Wallet.Turnkey,
|
|
216
|
-
Wallet.Metamask,
|
|
217
|
-
Wallet.KeplrEvm,
|
|
218
|
-
Wallet.OkxWallet,
|
|
219
|
-
Wallet.PrivateKey,
|
|
220
|
-
Wallet.TrezorBip32,
|
|
221
|
-
Wallet.TrezorBip44,
|
|
222
|
-
Wallet.TrustWallet,
|
|
223
|
-
Wallet.LedgerLegacy,
|
|
224
|
-
Wallet.WalletConnect,
|
|
225
|
-
Wallet.CosmostationEth
|
|
226
|
-
].includes(wallet);
|
|
227
|
-
const isCosmosWallet = (wallet) => !isEvmWallet(wallet);
|
|
228
|
-
const isEvmBrowserWallet = (wallet) => [
|
|
229
|
-
Wallet.Rabby,
|
|
230
|
-
Wallet.BitGet,
|
|
231
|
-
Wallet.Phantom,
|
|
232
|
-
Wallet.Rainbow,
|
|
233
|
-
Wallet.Metamask,
|
|
234
|
-
Wallet.KeplrEvm,
|
|
235
|
-
Wallet.OkxWallet,
|
|
236
|
-
Wallet.TrustWallet
|
|
237
|
-
].includes(wallet);
|
|
238
|
-
const isCosmosBrowserWallet = (wallet) => [
|
|
239
|
-
Wallet.Leap,
|
|
240
|
-
Wallet.Keplr,
|
|
241
|
-
Wallet.Ninji,
|
|
242
|
-
Wallet.OWallet,
|
|
243
|
-
Wallet.Cosmostation
|
|
244
|
-
].includes(wallet);
|
|
245
|
-
const isEip712V2OnlyWallet = (wallet) => [
|
|
246
|
-
Wallet.Magic,
|
|
247
|
-
Wallet.Phantom,
|
|
248
|
-
Wallet.Metamask,
|
|
249
|
-
Wallet.WalletConnect
|
|
250
|
-
].includes(wallet);
|
|
251
|
-
const isCosmosAminoOnlyWallet = (wallet) => [Wallet.LedgerCosmos].includes(wallet);
|
|
252
|
-
|
|
253
117
|
//#endregion
|
|
254
118
|
//#region src/utils/cosmos.ts
|
|
255
119
|
const createCosmosSignDocFromSignDoc = (signDoc) => {
|
|
256
|
-
return
|
|
120
|
+
return __injectivelabs_sdk_ts_proto_cosmos_tx.CosmosTxV1Beta1TxPb.SignDoc.create({
|
|
257
121
|
bodyBytes: signDoc.bodyBytes,
|
|
258
122
|
authInfoBytes: signDoc.authInfoBytes,
|
|
259
123
|
accountNumber: BigInt(signDoc.accountNumber),
|
|
@@ -285,92 +149,24 @@ const DEFAULT_NUM_ADDRESSES_TO_FETCH = 5;
|
|
|
285
149
|
const DEFAULT_ADDRESS_SEARCH_LIMIT = 100;
|
|
286
150
|
|
|
287
151
|
//#endregion
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"@babel/helpers - typeof";
|
|
291
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
292
|
-
return typeof o$1;
|
|
293
|
-
} : function(o$1) {
|
|
294
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
295
|
-
}, _typeof(o);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
300
|
-
function toPrimitive(t, r) {
|
|
301
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
302
|
-
var e = t[Symbol.toPrimitive];
|
|
303
|
-
if (void 0 !== e) {
|
|
304
|
-
var i = e.call(t, r || "default");
|
|
305
|
-
if ("object" != _typeof(i)) return i;
|
|
306
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
307
|
-
}
|
|
308
|
-
return ("string" === r ? String : Number)(t);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
313
|
-
function toPropertyKey(t) {
|
|
314
|
-
var i = toPrimitive(t, "string");
|
|
315
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
320
|
-
function _defineProperty(e, r, t) {
|
|
321
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
322
|
-
value: t,
|
|
323
|
-
enumerable: !0,
|
|
324
|
-
configurable: !0,
|
|
325
|
-
writable: !0
|
|
326
|
-
}) : e[r] = t, e;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/base.ts
|
|
331
|
-
var BaseConcreteStrategy = class {
|
|
332
|
-
constructor(args) {
|
|
333
|
-
_defineProperty(this, "chainId", void 0);
|
|
334
|
-
_defineProperty(this, "evmChainId", void 0);
|
|
335
|
-
_defineProperty(this, "listeners", {});
|
|
336
|
-
_defineProperty(this, "metadata", void 0);
|
|
337
|
-
_defineProperty(this, "emitter", void 0);
|
|
338
|
-
this.evmChainId = "evmOptions" in args && args.evmOptions ? args.evmOptions.evmChainId : void 0;
|
|
339
|
-
this.chainId = args.chainId;
|
|
340
|
-
this.metadata = args.metadata;
|
|
341
|
-
this.emitter = args.emitter;
|
|
342
|
-
}
|
|
343
|
-
setMetadata(metadata) {
|
|
344
|
-
this.metadata = metadata;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Emit an event from this strategy.
|
|
348
|
-
* If emitter was provided from parent, events go directly to parent.
|
|
349
|
-
*/
|
|
350
|
-
emit(event, data) {
|
|
351
|
-
var _this$emitter;
|
|
352
|
-
(_this$emitter = this.emitter) === null || _this$emitter === void 0 || _this$emitter.emit(event, data);
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
//#endregion
|
|
357
|
-
exports.BaseConcreteStrategy = BaseConcreteStrategy;
|
|
358
|
-
exports.BroadcastMode = BroadcastMode;
|
|
152
|
+
exports.BaseConcreteStrategy = require_base.BaseConcreteStrategy;
|
|
153
|
+
exports.BroadcastMode = require_base.BroadcastMode;
|
|
359
154
|
exports.DEFAULT_ADDRESS_SEARCH_LIMIT = DEFAULT_ADDRESS_SEARCH_LIMIT;
|
|
360
155
|
exports.DEFAULT_BASE_DERIVATION_PATH = DEFAULT_BASE_DERIVATION_PATH;
|
|
361
156
|
exports.DEFAULT_NUM_ADDRESSES_TO_FETCH = DEFAULT_NUM_ADDRESSES_TO_FETCH;
|
|
362
|
-
exports.EvmWalletProviderErrorCode = EvmWalletProviderErrorCode;
|
|
157
|
+
exports.EvmWalletProviderErrorCode = require_base.EvmWalletProviderErrorCode;
|
|
363
158
|
exports.GWEI_IN_WEI = GWEI_IN_WEI;
|
|
364
|
-
exports.MagicProvider = MagicProvider;
|
|
365
|
-
exports.StrategyEventType = StrategyEventType;
|
|
159
|
+
exports.MagicProvider = require_base.MagicProvider;
|
|
160
|
+
exports.StrategyEventType = require_base.StrategyEventType;
|
|
366
161
|
exports.TIP_IN_GWEI = TIP_IN_GWEI;
|
|
367
|
-
exports.TurnkeyProvider = TurnkeyProvider;
|
|
368
|
-
exports.Wallet = Wallet;
|
|
369
|
-
exports.WalletAction = WalletAction;
|
|
370
|
-
exports.WalletConnectStrategyEventType = WalletConnectStrategyEventType;
|
|
371
|
-
exports.WalletDeviceType = WalletDeviceType;
|
|
372
|
-
exports.WalletEventListener = WalletEventListener;
|
|
373
|
-
exports.WalletStrategyEmitterEventType = WalletStrategyEmitterEventType;
|
|
162
|
+
exports.TurnkeyProvider = require_base.TurnkeyProvider;
|
|
163
|
+
exports.Wallet = require_base.Wallet;
|
|
164
|
+
exports.WalletAction = require_base.WalletAction;
|
|
165
|
+
exports.WalletConnectStrategyEventType = require_base.WalletConnectStrategyEventType;
|
|
166
|
+
exports.WalletDeviceType = require_base.WalletDeviceType;
|
|
167
|
+
exports.WalletEventListener = require_base.WalletEventListener;
|
|
168
|
+
exports.WalletStrategyEmitterEventType = require_base.WalletStrategyEmitterEventType;
|
|
169
|
+
exports.__toESM = __toESM;
|
|
374
170
|
exports.createCosmosSignDocFromSignDoc = createCosmosSignDocFromSignDoc;
|
|
375
171
|
exports.createEip712StdSignDoc = createEip712StdSignDoc;
|
|
376
172
|
exports.getEthereumSignerAddress = getEthereumSignerAddress;
|
|
@@ -379,9 +175,9 @@ exports.getInjectiveSignerAddress = getInjectiveSignerAddress;
|
|
|
379
175
|
exports.getViemPublicClient = getViemPublicClient;
|
|
380
176
|
exports.getViemPublicClientFromEip1193Provider = getViemPublicClientFromEip1193Provider;
|
|
381
177
|
exports.getViemWalletClient = getViemWalletClient;
|
|
382
|
-
exports.isCosmosAminoOnlyWallet = isCosmosAminoOnlyWallet;
|
|
383
|
-
exports.isCosmosBrowserWallet = isCosmosBrowserWallet;
|
|
384
|
-
exports.isCosmosWallet = isCosmosWallet;
|
|
385
|
-
exports.isEip712V2OnlyWallet = isEip712V2OnlyWallet;
|
|
386
|
-
exports.isEvmBrowserWallet = isEvmBrowserWallet;
|
|
387
|
-
exports.isEvmWallet = isEvmWallet;
|
|
178
|
+
exports.isCosmosAminoOnlyWallet = require_base.isCosmosAminoOnlyWallet;
|
|
179
|
+
exports.isCosmosBrowserWallet = require_base.isCosmosBrowserWallet;
|
|
180
|
+
exports.isCosmosWallet = require_base.isCosmosWallet;
|
|
181
|
+
exports.isEip712V2OnlyWallet = require_base.isEip712V2OnlyWallet;
|
|
182
|
+
exports.isEvmBrowserWallet = require_base.isEvmBrowserWallet;
|
|
183
|
+
exports.isEvmWallet = require_base.isEvmWallet;
|