@injectivelabs/wallet-base 1.16.38-alpha.3 → 1.16.38-alpha.4
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 +2 -2
- package/dist/cjs/index.d.cts +23 -1
- package/dist/esm/index.d.ts +23 -1
- package/dist/esm/index.js +2 -2
- package/package.json +5 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -97,7 +97,7 @@ const TurnkeyProvider = {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
//#endregion
|
|
100
|
-
//#region ../../../node_modules/.pnpm/bignumber.js@9.1
|
|
100
|
+
//#region ../../../node_modules/.pnpm/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.mjs
|
|
101
101
|
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 0x5af3107a4000, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [
|
|
102
102
|
1,
|
|
103
103
|
10,
|
|
@@ -619,7 +619,7 @@ function clone(configObject) {
|
|
|
619
619
|
for (; len < i; str += "0", len++);
|
|
620
620
|
str = toExponential(str, e);
|
|
621
621
|
} else {
|
|
622
|
-
i -= ne;
|
|
622
|
+
i -= ne + (id === 2 && e > ne);
|
|
623
623
|
str = toFixedPoint(str, e, "0");
|
|
624
624
|
if (e + 1 > len) {
|
|
625
625
|
if (--i > 0) for (str += "."; i--; str += "0");
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -7,7 +7,6 @@ import { EIP1193Provider } from "eip1193-provider";
|
|
|
7
7
|
import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
|
|
8
8
|
import { Account, Chain, LocalAccount, PublicClient, WalletClient } from "viem";
|
|
9
9
|
import { CosmosTxV1Beta1TxPb } from "@injectivelabs/sdk-ts";
|
|
10
|
-
import { BigNumber } from "@injectivelabs/utils";
|
|
11
10
|
|
|
12
11
|
//#region src/types/enums.d.ts
|
|
13
12
|
declare const BroadcastMode: {
|
|
@@ -151,6 +150,8 @@ interface WalletMetadata {
|
|
|
151
150
|
turnkey?: Partial<TurnkeyMetadata>;
|
|
152
151
|
walletConnect?: WalletConnectMetadata;
|
|
153
152
|
privateKey?: PrivateKeyMetadata;
|
|
153
|
+
derivationPath?: string;
|
|
154
|
+
baseDerivationPath?: string;
|
|
154
155
|
}
|
|
155
156
|
interface ConcreteWalletStrategyArgs {
|
|
156
157
|
chainId: ChainId;
|
|
@@ -169,6 +170,14 @@ interface ConcreteCosmosWalletStrategy {
|
|
|
169
170
|
* The accounts from the wallet (addresses)
|
|
170
171
|
*/
|
|
171
172
|
getAddresses(args?: unknown): Promise<string[]>;
|
|
173
|
+
/**
|
|
174
|
+
* The accounts from the wallet with derivation path info (for hardware wallets)
|
|
175
|
+
*/
|
|
176
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
177
|
+
address: string;
|
|
178
|
+
derivationPath: string;
|
|
179
|
+
baseDerivationPath: string;
|
|
180
|
+
}[]>;
|
|
172
181
|
/**
|
|
173
182
|
* Return the WalletDeviceType connected on the
|
|
174
183
|
* wallet provider (extension, mobile, hardware wallet)
|
|
@@ -211,6 +220,14 @@ interface WalletStrategyArguments {
|
|
|
211
220
|
strategies: ConcreteStrategiesArg;
|
|
212
221
|
}
|
|
213
222
|
interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrategy, 'sendTransaction' | 'isChainIdSupported' | 'signAminoTransaction'> {
|
|
223
|
+
/**
|
|
224
|
+
* The accounts from the wallet with derivation path info (for hardware wallets)
|
|
225
|
+
*/
|
|
226
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
227
|
+
address: string;
|
|
228
|
+
derivationPath: string;
|
|
229
|
+
baseDerivationPath: string;
|
|
230
|
+
}[]>;
|
|
214
231
|
/**
|
|
215
232
|
* Sends Cosmos transaction. Returns a transaction hash
|
|
216
233
|
* @param transaction should implement TransactionConfig
|
|
@@ -292,6 +309,11 @@ interface WalletStrategy {
|
|
|
292
309
|
setMetadata(metadata?: WalletMetadata): void;
|
|
293
310
|
getStrategy(): ConcreteWalletStrategy;
|
|
294
311
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
312
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
313
|
+
address: string;
|
|
314
|
+
derivationPath: string;
|
|
315
|
+
baseDerivationPath: string;
|
|
316
|
+
}[]>;
|
|
295
317
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
296
318
|
getPubKey(address?: string): Promise<string>;
|
|
297
319
|
enable(args?: unknown): Promise<boolean>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
|
7
7
|
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
|
|
8
8
|
import { EIP1193Provider } from "eip1193-provider";
|
|
9
9
|
import { Msgs } from "@injectivelabs/sdk-ts/core/modules";
|
|
10
|
-
import { BigNumber } from "@injectivelabs/utils";
|
|
11
10
|
|
|
12
11
|
//#region src/types/enums.d.ts
|
|
13
12
|
declare const BroadcastMode: {
|
|
@@ -151,6 +150,8 @@ interface WalletMetadata {
|
|
|
151
150
|
turnkey?: Partial<TurnkeyMetadata>;
|
|
152
151
|
walletConnect?: WalletConnectMetadata;
|
|
153
152
|
privateKey?: PrivateKeyMetadata;
|
|
153
|
+
derivationPath?: string;
|
|
154
|
+
baseDerivationPath?: string;
|
|
154
155
|
}
|
|
155
156
|
interface ConcreteWalletStrategyArgs {
|
|
156
157
|
chainId: ChainId;
|
|
@@ -169,6 +170,14 @@ interface ConcreteCosmosWalletStrategy {
|
|
|
169
170
|
* The accounts from the wallet (addresses)
|
|
170
171
|
*/
|
|
171
172
|
getAddresses(args?: unknown): Promise<string[]>;
|
|
173
|
+
/**
|
|
174
|
+
* The accounts from the wallet with derivation path info (for hardware wallets)
|
|
175
|
+
*/
|
|
176
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
177
|
+
address: string;
|
|
178
|
+
derivationPath: string;
|
|
179
|
+
baseDerivationPath: string;
|
|
180
|
+
}[]>;
|
|
172
181
|
/**
|
|
173
182
|
* Return the WalletDeviceType connected on the
|
|
174
183
|
* wallet provider (extension, mobile, hardware wallet)
|
|
@@ -211,6 +220,14 @@ interface WalletStrategyArguments {
|
|
|
211
220
|
strategies: ConcreteStrategiesArg;
|
|
212
221
|
}
|
|
213
222
|
interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrategy, 'sendTransaction' | 'isChainIdSupported' | 'signAminoTransaction'> {
|
|
223
|
+
/**
|
|
224
|
+
* The accounts from the wallet with derivation path info (for hardware wallets)
|
|
225
|
+
*/
|
|
226
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
227
|
+
address: string;
|
|
228
|
+
derivationPath: string;
|
|
229
|
+
baseDerivationPath: string;
|
|
230
|
+
}[]>;
|
|
214
231
|
/**
|
|
215
232
|
* Sends Cosmos transaction. Returns a transaction hash
|
|
216
233
|
* @param transaction should implement TransactionConfig
|
|
@@ -292,6 +309,11 @@ interface WalletStrategy {
|
|
|
292
309
|
setMetadata(metadata?: WalletMetadata): void;
|
|
293
310
|
getStrategy(): ConcreteWalletStrategy;
|
|
294
311
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
312
|
+
getAddressesInfo(args?: unknown): Promise<{
|
|
313
|
+
address: string;
|
|
314
|
+
derivationPath: string;
|
|
315
|
+
baseDerivationPath: string;
|
|
316
|
+
}[]>;
|
|
295
317
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
296
318
|
getPubKey(address?: string): Promise<string>;
|
|
297
319
|
enable(args?: unknown): Promise<boolean>;
|
package/dist/esm/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const TurnkeyProvider = {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region ../../../node_modules/.pnpm/bignumber.js@9.1
|
|
72
|
+
//#region ../../../node_modules/.pnpm/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.mjs
|
|
73
73
|
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 0x5af3107a4000, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [
|
|
74
74
|
1,
|
|
75
75
|
10,
|
|
@@ -591,7 +591,7 @@ function clone(configObject) {
|
|
|
591
591
|
for (; len < i; str += "0", len++);
|
|
592
592
|
str = toExponential(str, e);
|
|
593
593
|
} else {
|
|
594
|
-
i -= ne;
|
|
594
|
+
i -= ne + (id === 2 && e > ne);
|
|
595
595
|
str = toFixedPoint(str, e, "0");
|
|
596
596
|
if (e + 1 > len) {
|
|
597
597
|
if (--i > 0) for (str += "."; i--; str += "0");
|
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.4",
|
|
4
4
|
"description": "Base wallet strategy for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -39,11 +39,10 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"eip1193-provider": "^1.0.1",
|
|
42
|
-
"viem": "^2.
|
|
43
|
-
"@injectivelabs/
|
|
44
|
-
"@injectivelabs/
|
|
45
|
-
"@injectivelabs/
|
|
46
|
-
"@injectivelabs/ts-types": "1.16.38-alpha.1"
|
|
42
|
+
"viem": "^2.41.2",
|
|
43
|
+
"@injectivelabs/ts-types": "1.16.38-alpha.2",
|
|
44
|
+
"@injectivelabs/sdk-ts": "1.16.38-alpha.4",
|
|
45
|
+
"@injectivelabs/exceptions": "1.16.38-alpha.3"
|
|
47
46
|
},
|
|
48
47
|
"publishConfig": {
|
|
49
48
|
"access": "public"
|