@injectivelabs/wallet-base 1.16.7 → 1.16.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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ _Base Package for the Wallet Strategy._
13
13
  ## 📚 Installation
14
14
 
15
15
  ```bash
16
- yarn add @injectivelabs/wallet-base
16
+ pnpm add @injectivelabs/wallet-base
17
17
  ```
18
18
 
19
19
  ---
@@ -1,9 +1,9 @@
1
- import { ChainId, CosmosChainId, EthereumChainId } from '@injectivelabs/ts-types';
2
- import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs, ConcreteEthereumWalletStrategyArgs } from './types/index.js';
1
+ import { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
+ import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
3
3
  export default abstract class BaseConcreteStrategy {
4
4
  protected chainId: ChainId | CosmosChainId;
5
- protected ethereumChainId?: EthereumChainId;
5
+ protected evmChainId?: EvmChainId;
6
6
  protected listeners: Partial<Record<WalletEventListener, any>>;
7
7
  metadata?: WalletMetadata;
8
- constructor(args: ConcreteWalletStrategyArgs | ConcreteEthereumWalletStrategyArgs | ConcreteCosmosWalletStrategyArgs);
8
+ constructor(args: ConcreteWalletStrategyArgs | ConcreteEvmWalletStrategyArgs | ConcreteCosmosWalletStrategyArgs);
9
9
  }
package/dist/cjs/base.js CHANGED
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class BaseConcreteStrategy {
4
4
  chainId;
5
- ethereumChainId;
5
+ evmChainId;
6
6
  listeners = {};
7
7
  metadata;
8
8
  constructor(args) {
9
- this.ethereumChainId =
10
- 'ethereumOptions' in args && args.ethereumOptions
11
- ? args.ethereumOptions.ethereumChainId
9
+ this.evmChainId =
10
+ 'evmOptions' in args && args.evmOptions
11
+ ? args.evmOptions.evmChainId
12
12
  : undefined;
13
13
  this.chainId = args.chainId;
14
14
  this.metadata = args.metadata;
@@ -12,6 +12,7 @@ export declare enum Wallet {
12
12
  Keplr = "keplr",
13
13
  Ninji = "ninji",
14
14
  Magic = "magic",
15
+ Rabby = "rabby",
15
16
  Ledger = "ledger",
16
17
  BitGet = "BitGet",
17
18
  OWallet = "owallet",
@@ -17,6 +17,7 @@ var Wallet;
17
17
  Wallet["Keplr"] = "keplr";
18
18
  Wallet["Ninji"] = "ninji";
19
19
  Wallet["Magic"] = "magic";
20
+ Wallet["Rabby"] = "rabby";
20
21
  Wallet["Ledger"] = "ledger";
21
22
  Wallet["BitGet"] = "BitGet";
22
23
  Wallet["OWallet"] = "owallet";
@@ -2,6 +2,7 @@ import { type EIP1193Provider } from 'eip1193-provider';
2
2
  export interface BrowserEip1993Provider extends EIP1193Provider {
3
3
  removeAllListeners(): void;
4
4
  isTrust: boolean;
5
+ isRabby: boolean;
5
6
  isRainbow: boolean;
6
7
  isPhantom: boolean;
7
8
  isMetaMask: boolean;
@@ -10,6 +11,7 @@ export interface BrowserEip1993Provider extends EIP1193Provider {
10
11
  }
11
12
  export interface WindowWithEip1193Provider extends Window {
12
13
  rainbow: BrowserEip1993Provider;
14
+ rabby: BrowserEip1993Provider;
13
15
  ethereum: BrowserEip1993Provider;
14
16
  okxwallet: BrowserEip1993Provider;
15
17
  providers: BrowserEip1993Provider[];
@@ -1,4 +1,4 @@
1
- import { ChainId, AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
1
+ import { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
2
2
  import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
3
  import { StdSignDoc } from '@keplr-wallet/types';
4
4
  import { WalletDeviceType, Wallet } from './enums.js';
@@ -22,10 +22,10 @@ export type PrivateKeyMetadata = {
22
22
  export type WalletConnectMetadata = {
23
23
  projectId?: string;
24
24
  };
25
- export interface WalletStrategyEthereumOptions {
26
- ethereumChainId: EthereumChainId;
25
+ export interface WalletStrategyEvmOptions {
26
+ evmChainId: EvmChainId;
27
27
  rpcUrl?: string;
28
- rpcUrls?: Partial<Record<EthereumChainId, string>>;
28
+ rpcUrls?: Partial<Record<EvmChainId, string>>;
29
29
  }
30
30
  export interface SendTransactionOptions {
31
31
  address: string;
@@ -51,16 +51,12 @@ export type TurnkeySession = {
51
51
  };
52
52
  export interface TurnkeyMetadata {
53
53
  apiBaseUrl: string;
54
- iframeUrl?: string;
55
54
  otpInitPath?: string;
56
- organizationId: string;
57
55
  otpVerifyPath?: string;
58
56
  googleClientId?: string;
59
57
  oauthLoginPath?: string;
60
58
  session?: TurnkeySession;
61
- iframeElementId?: string;
62
59
  apiServerEndpoint: string;
63
- iframeContainerId: string;
64
60
  credentialBundle?: string;
65
61
  googleRedirectUri?: string;
66
62
  expirationSeconds?: string;
@@ -76,12 +72,12 @@ export interface ConcreteWalletStrategyArgs {
76
72
  chainId: ChainId;
77
73
  metadata?: WalletMetadata;
78
74
  }
75
+ export interface ConcreteEvmWalletStrategyArgs extends ConcreteWalletStrategyArgs {
76
+ evmOptions: WalletStrategyEvmOptions;
77
+ }
79
78
  export interface ConcreteCosmosWalletStrategyArgs extends ConcreteWalletStrategyArgs {
80
79
  wallet?: Wallet;
81
80
  }
82
- export interface ConcreteEthereumWalletStrategyArgs extends ConcreteWalletStrategyArgs {
83
- ethereumOptions: WalletStrategyEthereumOptions;
84
- }
85
81
  export interface ConcreteCosmosWalletStrategy {
86
82
  metadata?: WalletMetadata;
87
83
  setMetadata?(metadata?: WalletMetadata): void;
@@ -127,7 +123,7 @@ export type ConcreteStrategiesArg = {
127
123
  export interface WalletStrategyArguments {
128
124
  chainId: ChainId;
129
125
  metadata?: WalletMetadata;
130
- ethereumOptions?: WalletStrategyEthereumOptions;
126
+ evmOptions?: WalletStrategyEvmOptions;
131
127
  disabledWallets?: Wallet[];
132
128
  wallet?: Wallet;
133
129
  strategies: ConcreteStrategiesArg;
@@ -160,7 +156,7 @@ export interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrateg
160
156
  */
161
157
  sendEvmTransaction(transaction: unknown, options: {
162
158
  address: string;
163
- ethereumChainId: EthereumChainId;
159
+ evmChainId: EvmChainId;
164
160
  }): Promise<string>;
165
161
  /**
166
162
  * Sign a cosmos transaction using the wallet provider
@@ -192,7 +188,7 @@ export interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrateg
192
188
  signEip712TypedData(eip712TypedData: string, address: string): Promise<string>;
193
189
  signArbitrary(signer: string, data: string | Uint8Array): Promise<string>;
194
190
  getEthereumChainId(): Promise<string>;
195
- getEvmTransactionReceipt(txHash: string, ethereumChainId?: EthereumChainId): void;
191
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): void;
196
192
  onAccountChange?(callback: onAccountChangeCallback): Promise<void> | void;
197
193
  onChainIdChange?(callback: onChainIdChangeCallback): Promise<void> | void;
198
194
  disconnect?(): Promise<void> | void;
@@ -215,12 +211,12 @@ export interface WalletStrategy {
215
211
  enable(args?: unknown): Promise<boolean>;
216
212
  enableAndGetAddresses(args?: unknown): Promise<AccountAddress[]>;
217
213
  getEthereumChainId(): Promise<string>;
218
- getEvmTransactionReceipt(txHash: string, ethereumChainId?: EthereumChainId): Promise<void>;
214
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<void>;
219
215
  getSessionOrConfirm(address?: AccountAddress): Promise<string>;
220
216
  sendTransaction(tx: DirectSignResponse | TxRaw, options: SendTransactionOptions): Promise<TxResponse>;
221
217
  sendEvmTransaction(tx: any, options: {
222
218
  address: AccountAddress;
223
- ethereumChainId: EthereumChainId;
219
+ evmChainId: EvmChainId;
224
220
  }): Promise<string>;
225
221
  signEip712TypedData(eip712TypedData: string, address: AccountAddress): Promise<string>;
226
222
  signAminoCosmosTransaction(transaction: {
@@ -4,6 +4,7 @@ exports.isCosmosAminoOnlyWallet = exports.isEip712V2OnlyWallet = exports.isCosmo
4
4
  const enums_js_1 = require("./../types/enums.js");
5
5
  const isEvmWallet = (wallet) => [
6
6
  enums_js_1.Wallet.Magic,
7
+ enums_js_1.Wallet.Rabby,
7
8
  enums_js_1.Wallet.BitGet,
8
9
  enums_js_1.Wallet.Ledger,
9
10
  enums_js_1.Wallet.Phantom,
@@ -23,6 +24,7 @@ exports.isEvmWallet = isEvmWallet;
23
24
  const isCosmosWallet = (wallet) => !(0, exports.isEvmWallet)(wallet);
24
25
  exports.isCosmosWallet = isCosmosWallet;
25
26
  const isEvmBrowserWallet = (wallet) => [
27
+ enums_js_1.Wallet.Rabby,
26
28
  enums_js_1.Wallet.BitGet,
27
29
  enums_js_1.Wallet.Rainbow,
28
30
  enums_js_1.Wallet.Phantom,
@@ -1,9 +1,9 @@
1
- import { ChainId, CosmosChainId, EthereumChainId } from '@injectivelabs/ts-types';
2
- import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs, ConcreteEthereumWalletStrategyArgs } from './types/index.js';
1
+ import { ChainId, EvmChainId, CosmosChainId } from '@injectivelabs/ts-types';
2
+ import { WalletMetadata, WalletEventListener, ConcreteWalletStrategyArgs, ConcreteEvmWalletStrategyArgs, ConcreteCosmosWalletStrategyArgs } from './types/index.js';
3
3
  export default abstract class BaseConcreteStrategy {
4
4
  protected chainId: ChainId | CosmosChainId;
5
- protected ethereumChainId?: EthereumChainId;
5
+ protected evmChainId?: EvmChainId;
6
6
  protected listeners: Partial<Record<WalletEventListener, any>>;
7
7
  metadata?: WalletMetadata;
8
- constructor(args: ConcreteWalletStrategyArgs | ConcreteEthereumWalletStrategyArgs | ConcreteCosmosWalletStrategyArgs);
8
+ constructor(args: ConcreteWalletStrategyArgs | ConcreteEvmWalletStrategyArgs | ConcreteCosmosWalletStrategyArgs);
9
9
  }
package/dist/esm/base.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export default class BaseConcreteStrategy {
2
2
  chainId;
3
- ethereumChainId;
3
+ evmChainId;
4
4
  listeners = {};
5
5
  metadata;
6
6
  constructor(args) {
7
- this.ethereumChainId =
8
- 'ethereumOptions' in args && args.ethereumOptions
9
- ? args.ethereumOptions.ethereumChainId
7
+ this.evmChainId =
8
+ 'evmOptions' in args && args.evmOptions
9
+ ? args.evmOptions.evmChainId
10
10
  : undefined;
11
11
  this.chainId = args.chainId;
12
12
  this.metadata = args.metadata;
@@ -12,6 +12,7 @@ export declare enum Wallet {
12
12
  Keplr = "keplr",
13
13
  Ninji = "ninji",
14
14
  Magic = "magic",
15
+ Rabby = "rabby",
15
16
  Ledger = "ledger",
16
17
  BitGet = "BitGet",
17
18
  OWallet = "owallet",
@@ -14,6 +14,7 @@ export var Wallet;
14
14
  Wallet["Keplr"] = "keplr";
15
15
  Wallet["Ninji"] = "ninji";
16
16
  Wallet["Magic"] = "magic";
17
+ Wallet["Rabby"] = "rabby";
17
18
  Wallet["Ledger"] = "ledger";
18
19
  Wallet["BitGet"] = "BitGet";
19
20
  Wallet["OWallet"] = "owallet";
@@ -2,6 +2,7 @@ import { type EIP1193Provider } from 'eip1193-provider';
2
2
  export interface BrowserEip1993Provider extends EIP1193Provider {
3
3
  removeAllListeners(): void;
4
4
  isTrust: boolean;
5
+ isRabby: boolean;
5
6
  isRainbow: boolean;
6
7
  isPhantom: boolean;
7
8
  isMetaMask: boolean;
@@ -10,6 +11,7 @@ export interface BrowserEip1993Provider extends EIP1193Provider {
10
11
  }
11
12
  export interface WindowWithEip1193Provider extends Window {
12
13
  rainbow: BrowserEip1993Provider;
14
+ rabby: BrowserEip1993Provider;
13
15
  ethereum: BrowserEip1993Provider;
14
16
  okxwallet: BrowserEip1993Provider;
15
17
  providers: BrowserEip1993Provider[];
@@ -1,4 +1,4 @@
1
- import { ChainId, AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
1
+ import { ChainId, EvmChainId, AccountAddress } from '@injectivelabs/ts-types';
2
2
  import type { TxRaw, TxResponse, AminoSignResponse, DirectSignResponse } from '@injectivelabs/sdk-ts';
3
3
  import { StdSignDoc } from '@keplr-wallet/types';
4
4
  import { WalletDeviceType, Wallet } from './enums.js';
@@ -22,10 +22,10 @@ export type PrivateKeyMetadata = {
22
22
  export type WalletConnectMetadata = {
23
23
  projectId?: string;
24
24
  };
25
- export interface WalletStrategyEthereumOptions {
26
- ethereumChainId: EthereumChainId;
25
+ export interface WalletStrategyEvmOptions {
26
+ evmChainId: EvmChainId;
27
27
  rpcUrl?: string;
28
- rpcUrls?: Partial<Record<EthereumChainId, string>>;
28
+ rpcUrls?: Partial<Record<EvmChainId, string>>;
29
29
  }
30
30
  export interface SendTransactionOptions {
31
31
  address: string;
@@ -51,16 +51,12 @@ export type TurnkeySession = {
51
51
  };
52
52
  export interface TurnkeyMetadata {
53
53
  apiBaseUrl: string;
54
- iframeUrl?: string;
55
54
  otpInitPath?: string;
56
- organizationId: string;
57
55
  otpVerifyPath?: string;
58
56
  googleClientId?: string;
59
57
  oauthLoginPath?: string;
60
58
  session?: TurnkeySession;
61
- iframeElementId?: string;
62
59
  apiServerEndpoint: string;
63
- iframeContainerId: string;
64
60
  credentialBundle?: string;
65
61
  googleRedirectUri?: string;
66
62
  expirationSeconds?: string;
@@ -76,12 +72,12 @@ export interface ConcreteWalletStrategyArgs {
76
72
  chainId: ChainId;
77
73
  metadata?: WalletMetadata;
78
74
  }
75
+ export interface ConcreteEvmWalletStrategyArgs extends ConcreteWalletStrategyArgs {
76
+ evmOptions: WalletStrategyEvmOptions;
77
+ }
79
78
  export interface ConcreteCosmosWalletStrategyArgs extends ConcreteWalletStrategyArgs {
80
79
  wallet?: Wallet;
81
80
  }
82
- export interface ConcreteEthereumWalletStrategyArgs extends ConcreteWalletStrategyArgs {
83
- ethereumOptions: WalletStrategyEthereumOptions;
84
- }
85
81
  export interface ConcreteCosmosWalletStrategy {
86
82
  metadata?: WalletMetadata;
87
83
  setMetadata?(metadata?: WalletMetadata): void;
@@ -127,7 +123,7 @@ export type ConcreteStrategiesArg = {
127
123
  export interface WalletStrategyArguments {
128
124
  chainId: ChainId;
129
125
  metadata?: WalletMetadata;
130
- ethereumOptions?: WalletStrategyEthereumOptions;
126
+ evmOptions?: WalletStrategyEvmOptions;
131
127
  disabledWallets?: Wallet[];
132
128
  wallet?: Wallet;
133
129
  strategies: ConcreteStrategiesArg;
@@ -160,7 +156,7 @@ export interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrateg
160
156
  */
161
157
  sendEvmTransaction(transaction: unknown, options: {
162
158
  address: string;
163
- ethereumChainId: EthereumChainId;
159
+ evmChainId: EvmChainId;
164
160
  }): Promise<string>;
165
161
  /**
166
162
  * Sign a cosmos transaction using the wallet provider
@@ -192,7 +188,7 @@ export interface ConcreteWalletStrategy extends Omit<ConcreteCosmosWalletStrateg
192
188
  signEip712TypedData(eip712TypedData: string, address: string): Promise<string>;
193
189
  signArbitrary(signer: string, data: string | Uint8Array): Promise<string>;
194
190
  getEthereumChainId(): Promise<string>;
195
- getEvmTransactionReceipt(txHash: string, ethereumChainId?: EthereumChainId): void;
191
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): void;
196
192
  onAccountChange?(callback: onAccountChangeCallback): Promise<void> | void;
197
193
  onChainIdChange?(callback: onChainIdChangeCallback): Promise<void> | void;
198
194
  disconnect?(): Promise<void> | void;
@@ -215,12 +211,12 @@ export interface WalletStrategy {
215
211
  enable(args?: unknown): Promise<boolean>;
216
212
  enableAndGetAddresses(args?: unknown): Promise<AccountAddress[]>;
217
213
  getEthereumChainId(): Promise<string>;
218
- getEvmTransactionReceipt(txHash: string, ethereumChainId?: EthereumChainId): Promise<void>;
214
+ getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<void>;
219
215
  getSessionOrConfirm(address?: AccountAddress): Promise<string>;
220
216
  sendTransaction(tx: DirectSignResponse | TxRaw, options: SendTransactionOptions): Promise<TxResponse>;
221
217
  sendEvmTransaction(tx: any, options: {
222
218
  address: AccountAddress;
223
- ethereumChainId: EthereumChainId;
219
+ evmChainId: EvmChainId;
224
220
  }): Promise<string>;
225
221
  signEip712TypedData(eip712TypedData: string, address: AccountAddress): Promise<string>;
226
222
  signAminoCosmosTransaction(transaction: {
@@ -1,6 +1,7 @@
1
1
  import { Wallet } from './../types/enums.js';
2
2
  export const isEvmWallet = (wallet) => [
3
3
  Wallet.Magic,
4
+ Wallet.Rabby,
4
5
  Wallet.BitGet,
5
6
  Wallet.Ledger,
6
7
  Wallet.Phantom,
@@ -18,6 +19,7 @@ export const isEvmWallet = (wallet) => [
18
19
  ].includes(wallet);
19
20
  export const isCosmosWallet = (wallet) => !isEvmWallet(wallet);
20
21
  export const isEvmBrowserWallet = (wallet) => [
22
+ Wallet.Rabby,
21
23
  Wallet.BitGet,
22
24
  Wallet.Rainbow,
23
25
  Wallet.Phantom,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-base",
3
3
  "description": "Base wallet strategy for use with @injectivelabs/wallet-core.",
4
- "version": "1.16.7",
4
+ "version": "1.16.8",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "author": {
@@ -41,10 +41,10 @@
41
41
  }
42
42
  },
43
43
  "scripts": {
44
- "build": "yarn build:cjs && yarn build:esm && yarn build:post",
44
+ "build": "pnpm build:cjs && pnpm build:esm && pnpm build:post",
45
45
  "build:cjs": "tsc --build --force tsconfig.build.json",
46
46
  "build:esm": "tsc --build --force tsconfig.build.esm.json",
47
- "build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json && yarn build:post",
47
+ "build:watch": "tsc --build -w tsconfig.build.json && tsc -w --build tsconfig.build.esm.json && pnpm build:post",
48
48
  "build:post": "shx cp ../../../etc/stub/package.json.stub dist/cjs/package.json && shx cp ../../../etc/stub/package.esm.json.stub dist/esm/package.json",
49
49
  "clean": "tsc --build tsconfig.build.json --clean && tsc --build tsconfig.build.esm.json --clean && shx rm -rf coverage *.log junit.xml dist && jest --clearCache && shx mkdir -p dist",
50
50
  "test": "jest",
@@ -56,14 +56,14 @@
56
56
  "start": "node dist/index.js"
57
57
  },
58
58
  "dependencies": {
59
- "@injectivelabs/exceptions": "^1.16.7",
60
- "@injectivelabs/networks": "^1.16.7",
61
- "@injectivelabs/sdk-ts": "^1.16.7",
62
- "@injectivelabs/ts-types": "^1.16.7",
59
+ "@injectivelabs/exceptions": "1.16.6",
60
+ "@injectivelabs/networks": "1.16.8",
61
+ "@injectivelabs/sdk-ts": "1.16.8",
62
+ "@injectivelabs/ts-types": "1.16.8",
63
63
  "eip1193-provider": "^1.0.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "shx": "^0.3.3"
67
67
  },
68
- "gitHead": "78f656ef404ef511dfe6e4cc9defcae0a7cbec76"
68
+ "gitHead": "8bdbbfff8a07053ec2cd91a7103bfe99975672b4"
69
69
  }