@injectivelabs/wallet-core 1.15.6 → 1.15.7
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,16 +1,21 @@
|
|
|
1
1
|
import { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
2
|
import { ChainId, AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction,
|
|
3
|
+
import { Wallet, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, type WalletMetadata, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
|
|
4
4
|
import { StdSignDoc } from '@keplr-wallet/types';
|
|
5
5
|
export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
6
6
|
strategies: ConcreteStrategiesArg;
|
|
7
7
|
wallet: Wallet;
|
|
8
8
|
args: WalletStrategyArguments;
|
|
9
|
+
metadata?: WalletMetadata;
|
|
9
10
|
wallets?: Wallet[];
|
|
10
11
|
constructor(args: WalletStrategyArguments);
|
|
11
12
|
getWallet(): Wallet;
|
|
12
13
|
setWallet(wallet: Wallet): void;
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* When we use setMetadata, we are usually updating the metadata of the
|
|
16
|
+
* existing strategy.
|
|
17
|
+
*/
|
|
18
|
+
setMetadata(metadata?: WalletMetadata): void;
|
|
14
19
|
getStrategy(): ConcreteWalletStrategy;
|
|
15
20
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
16
21
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
@@ -22,11 +22,13 @@ class BaseWalletStrategy {
|
|
|
22
22
|
strategies;
|
|
23
23
|
wallet;
|
|
24
24
|
args;
|
|
25
|
+
metadata;
|
|
25
26
|
wallets;
|
|
26
27
|
constructor(args) {
|
|
27
28
|
this.args = args;
|
|
28
29
|
this.strategies = args.strategies;
|
|
29
30
|
this.wallet = getInitialWallet(args);
|
|
31
|
+
this.metadata = args.metadata;
|
|
30
32
|
}
|
|
31
33
|
getWallet() {
|
|
32
34
|
return this.wallet;
|
|
@@ -34,8 +36,13 @@ class BaseWalletStrategy {
|
|
|
34
36
|
setWallet(wallet) {
|
|
35
37
|
this.wallet = wallet;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
/**
|
|
40
|
+
* When we use setMetadata, we are usually updating the metadata of the
|
|
41
|
+
* existing strategy.
|
|
42
|
+
*/
|
|
43
|
+
setMetadata(metadata) {
|
|
44
|
+
this.metadata = metadata;
|
|
45
|
+
this.getStrategy().setMetadata?.(metadata);
|
|
39
46
|
}
|
|
40
47
|
getStrategy() {
|
|
41
48
|
if (!this.strategies[this.wallet]) {
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
|
|
2
2
|
import { ChainId, AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction,
|
|
3
|
+
import { Wallet, WalletDeviceType, ConcreteStrategiesArg, SendTransactionOptions, ConcreteWalletStrategy, type WalletMetadata, onAccountChangeCallback, onChainIdChangeCallback, WalletStrategyArguments, CosmosWalletAbstraction, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
|
|
4
4
|
import { StdSignDoc } from '@keplr-wallet/types';
|
|
5
5
|
export default class BaseWalletStrategy implements WalletStrategyInterface {
|
|
6
6
|
strategies: ConcreteStrategiesArg;
|
|
7
7
|
wallet: Wallet;
|
|
8
8
|
args: WalletStrategyArguments;
|
|
9
|
+
metadata?: WalletMetadata;
|
|
9
10
|
wallets?: Wallet[];
|
|
10
11
|
constructor(args: WalletStrategyArguments);
|
|
11
12
|
getWallet(): Wallet;
|
|
12
13
|
setWallet(wallet: Wallet): void;
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* When we use setMetadata, we are usually updating the metadata of the
|
|
16
|
+
* existing strategy.
|
|
17
|
+
*/
|
|
18
|
+
setMetadata(metadata?: WalletMetadata): void;
|
|
14
19
|
getStrategy(): ConcreteWalletStrategy;
|
|
15
20
|
getAddresses(args?: unknown): Promise<AccountAddress[]>;
|
|
16
21
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
@@ -20,11 +20,13 @@ export default class BaseWalletStrategy {
|
|
|
20
20
|
strategies;
|
|
21
21
|
wallet;
|
|
22
22
|
args;
|
|
23
|
+
metadata;
|
|
23
24
|
wallets;
|
|
24
25
|
constructor(args) {
|
|
25
26
|
this.args = args;
|
|
26
27
|
this.strategies = args.strategies;
|
|
27
28
|
this.wallet = getInitialWallet(args);
|
|
29
|
+
this.metadata = args.metadata;
|
|
28
30
|
}
|
|
29
31
|
getWallet() {
|
|
30
32
|
return this.wallet;
|
|
@@ -32,8 +34,13 @@ export default class BaseWalletStrategy {
|
|
|
32
34
|
setWallet(wallet) {
|
|
33
35
|
this.wallet = wallet;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
* When we use setMetadata, we are usually updating the metadata of the
|
|
39
|
+
* existing strategy.
|
|
40
|
+
*/
|
|
41
|
+
setMetadata(metadata) {
|
|
42
|
+
this.metadata = metadata;
|
|
43
|
+
this.getStrategy().setMetadata?.(metadata);
|
|
37
44
|
}
|
|
38
45
|
getStrategy() {
|
|
39
46
|
if (!this.strategies[this.wallet]) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-core",
|
|
3
3
|
"description": "Core wallet strategy",
|
|
4
|
-
"version": "1.15.
|
|
4
|
+
"version": "1.15.7",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
"start": "node dist/index.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@injectivelabs/exceptions": "^1.15.
|
|
60
|
-
"@injectivelabs/networks": "^1.15.
|
|
61
|
-
"@injectivelabs/sdk-ts": "^1.15.
|
|
62
|
-
"@injectivelabs/ts-types": "^1.15.
|
|
63
|
-
"@injectivelabs/utils": "^1.15.
|
|
64
|
-
"@injectivelabs/wallet-base": "^1.15.
|
|
59
|
+
"@injectivelabs/exceptions": "^1.15.4",
|
|
60
|
+
"@injectivelabs/networks": "^1.15.5",
|
|
61
|
+
"@injectivelabs/sdk-ts": "^1.15.7",
|
|
62
|
+
"@injectivelabs/ts-types": "^1.15.5",
|
|
63
|
+
"@injectivelabs/utils": "^1.15.5",
|
|
64
|
+
"@injectivelabs/wallet-base": "^1.15.7",
|
|
65
65
|
"@keplr-wallet/types": "^0.12.159"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"shx": "^0.3.3"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "9beac4caf49a97d0d64bde184c4fc603696b81c0"
|
|
71
71
|
}
|