@injectivelabs/wallet-core 1.15.6 → 1.15.8

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,17 @@
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, ConcreteWalletStrategyOptions, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
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
- setOptions(_options?: ConcreteWalletStrategyOptions): void;
14
+ setMetadata(metadata?: WalletMetadata): void;
14
15
  getStrategy(): ConcreteWalletStrategy;
15
16
  getAddresses(args?: unknown): Promise<AccountAddress[]>;
16
17
  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,9 @@ class BaseWalletStrategy {
34
36
  setWallet(wallet) {
35
37
  this.wallet = wallet;
36
38
  }
37
- setOptions(_options) {
38
- //
39
+ setMetadata(metadata) {
40
+ this.metadata = metadata;
41
+ this.getStrategy().setMetadata?.(metadata);
39
42
  }
40
43
  getStrategy() {
41
44
  if (!this.strategies[this.wallet]) {
@@ -1,16 +1,17 @@
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, ConcreteWalletStrategyOptions, WalletStrategy as WalletStrategyInterface } from '@injectivelabs/wallet-base';
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
- setOptions(_options?: ConcreteWalletStrategyOptions): void;
14
+ setMetadata(metadata?: WalletMetadata): void;
14
15
  getStrategy(): ConcreteWalletStrategy;
15
16
  getAddresses(args?: unknown): Promise<AccountAddress[]>;
16
17
  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,9 @@ export default class BaseWalletStrategy {
32
34
  setWallet(wallet) {
33
35
  this.wallet = wallet;
34
36
  }
35
- setOptions(_options) {
36
- //
37
+ setMetadata(metadata) {
38
+ this.metadata = metadata;
39
+ this.getStrategy().setMetadata?.(metadata);
37
40
  }
38
41
  getStrategy() {
39
42
  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.6",
4
+ "version": "1.15.8",
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.3",
60
- "@injectivelabs/networks": "^1.15.4",
61
- "@injectivelabs/sdk-ts": "^1.15.6",
62
- "@injectivelabs/ts-types": "^1.15.4",
63
- "@injectivelabs/utils": "^1.15.4",
64
- "@injectivelabs/wallet-base": "^1.15.6",
59
+ "@injectivelabs/exceptions": "^1.15.5",
60
+ "@injectivelabs/networks": "^1.15.6",
61
+ "@injectivelabs/sdk-ts": "^1.15.8",
62
+ "@injectivelabs/ts-types": "^1.15.6",
63
+ "@injectivelabs/utils": "^1.15.6",
64
+ "@injectivelabs/wallet-base": "^1.15.8",
65
65
  "@keplr-wallet/types": "^0.12.159"
66
66
  },
67
67
  "devDependencies": {
68
68
  "shx": "^0.3.3"
69
69
  },
70
- "gitHead": "de7c94dbd9f169649cab7bcc66d16fa73a2bd8a3"
70
+ "gitHead": "2be8934e197cb79cafd9c4e1ba04dfadbbcc5fa0"
71
71
  }