@keplr-wallet/types 0.12.96-rc.0 → 0.12.96

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,7 +1,6 @@
1
1
  import { Currency, AppCurrency, FeeCurrency } from "./currency";
2
2
  import { BIP44 } from "./bip44";
3
3
  import { Bech32Config } from "./bech32";
4
- import { EVMInfo } from "./ethereum";
5
4
  export interface ChainInfo {
6
5
  readonly rpc: string;
7
6
  readonly rest: string;
@@ -40,13 +39,13 @@ export interface ChainInfo {
40
39
  readonly beta?: boolean;
41
40
  readonly chainSymbolImageUrl?: string;
42
41
  readonly hideInUI?: boolean;
43
- readonly evm?: EVMInfo;
42
+ readonly evm?: {
43
+ chainId: number;
44
+ rpc: string;
45
+ };
44
46
  }
45
47
  export type ChainInfoWithoutEndpoints = Omit<ChainInfo, "rest" | "rpc" | "nodeProvider" | "evm"> & {
46
- readonly rest: undefined;
47
- readonly rpc: undefined;
48
- readonly nodeProvider: undefined;
49
- readonly evm?: Omit<EVMInfo, "rpc"> & {
50
- readonly rpc: undefined;
48
+ evm?: {
49
+ chainId: number;
51
50
  };
52
51
  };
@@ -37,11 +37,3 @@ export interface EthTxReceipt {
37
37
  type: number;
38
38
  status?: EthTxStatus;
39
39
  }
40
- export interface EVMInfo {
41
- chainId: number;
42
- rpc: string;
43
- }
44
- export interface EthereumSignResponse {
45
- signingData: Uint8Array;
46
- signature: Uint8Array;
47
- }
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { ChainInfo, ChainInfoWithoutEndpoints } from "../chain-info";
3
2
  import { EthSignType } from "../ethereum";
4
3
  import { BroadcastMode, AminoSignResponse, StdSignDoc, OfflineAminoSigner, StdSignature, DirectSignResponse, OfflineDirectSigner } from "../cosmjs";
@@ -6,14 +5,12 @@ import { SecretUtils } from "../secretjs";
6
5
  import Long from "long";
7
6
  import { SettledResponses } from "../settled";
8
7
  import { DirectAuxSignResponse } from "../cosmjs-alt";
9
- import EventEmitter from "events";
10
8
  export interface Key {
11
9
  readonly name: string;
12
10
  readonly algo: string;
13
11
  readonly pubKey: Uint8Array;
14
12
  readonly address: Uint8Array;
15
13
  readonly bech32Address: string;
16
- readonly ethereumHexAddress: string;
17
14
  readonly isNanoLedger: boolean;
18
15
  readonly isKeystone: boolean;
19
16
  }
@@ -122,7 +119,6 @@ export interface Keplr {
122
119
  primaryType: string;
123
120
  }, signDoc: StdSignDoc, signOptions?: KeplrSignOptions): Promise<AminoSignResponse>;
124
121
  getChainInfosWithoutEndpoints(): Promise<ChainInfoWithoutEndpoints[]>;
125
- getChainInfoWithoutEndpoints(chainId: string): Promise<ChainInfoWithoutEndpoints>;
126
122
  /** Change wallet extension user name **/
127
123
  changeKeyRingName(opts: {
128
124
  defaultName: string;
@@ -130,19 +126,4 @@ export interface Keplr {
130
126
  }): Promise<string>;
131
127
  sendEthereumTx(chainId: string, tx: Uint8Array): Promise<string>;
132
128
  suggestERC20(chainId: string, contractAddress: string): Promise<void>;
133
- readonly ethereum: IEthereumProvider;
134
- }
135
- export interface IEthereumProvider extends EventEmitter {
136
- readonly chainId: string | null;
137
- readonly networkVersion: string | null;
138
- readonly selectedAddress: string | null;
139
- readonly isKeplr: boolean;
140
- readonly isMetaMask: boolean;
141
- isConnected(): boolean;
142
- request<T>({ method, params, }: {
143
- method: string;
144
- params?: unknown[] | Record<string, unknown>;
145
- }): Promise<T>;
146
- enable(): Promise<string[]>;
147
- net_version(): Promise<string>;
148
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keplr-wallet/types",
3
- "version": "0.12.96-rc.0",
3
+ "version": "0.12.96",
4
4
  "main": "build/index.js",
5
5
  "author": "chainapsis",
6
6
  "license": "Apache-2.0",
@@ -18,5 +18,5 @@
18
18
  "dependencies": {
19
19
  "long": "^4.0.0"
20
20
  },
21
- "gitHead": "fd75378ce2efcef63dd94874c219f84b689d95e6"
21
+ "gitHead": "b0a96c2c713d8163ce840fcd5abbac4eb612607c"
22
22
  }
package/src/chain-info.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Currency, AppCurrency, FeeCurrency } from "./currency";
2
2
  import { BIP44 } from "./bip44";
3
3
  import { Bech32Config } from "./bech32";
4
- import { EVMInfo } from "./ethereum";
5
4
 
6
5
  export interface ChainInfo {
7
6
  readonly rpc: string;
@@ -47,17 +46,17 @@ export interface ChainInfo {
47
46
 
48
47
  readonly hideInUI?: boolean;
49
48
 
50
- readonly evm?: EVMInfo;
49
+ readonly evm?: {
50
+ chainId: number;
51
+ rpc: string;
52
+ };
51
53
  }
52
54
 
53
55
  export type ChainInfoWithoutEndpoints = Omit<
54
56
  ChainInfo,
55
57
  "rest" | "rpc" | "nodeProvider" | "evm"
56
58
  > & {
57
- readonly rest: undefined;
58
- readonly rpc: undefined;
59
- readonly nodeProvider: undefined;
60
- readonly evm?: Omit<EVMInfo, "rpc"> & {
61
- readonly rpc: undefined;
59
+ evm?: {
60
+ chainId: number;
62
61
  };
63
62
  };
package/src/ethereum.ts CHANGED
@@ -40,13 +40,3 @@ export interface EthTxReceipt {
40
40
  type: number;
41
41
  status?: EthTxStatus;
42
42
  }
43
-
44
- export interface EVMInfo {
45
- chainId: number;
46
- rpc: string;
47
- }
48
-
49
- export interface EthereumSignResponse {
50
- signingData: Uint8Array;
51
- signature: Uint8Array;
52
- }
@@ -13,7 +13,6 @@ import { SecretUtils } from "../secretjs";
13
13
  import Long from "long";
14
14
  import { SettledResponses } from "../settled";
15
15
  import { DirectAuxSignResponse } from "../cosmjs-alt";
16
- import EventEmitter from "events";
17
16
 
18
17
  export interface Key {
19
18
  // Name of the selected key store.
@@ -22,7 +21,6 @@ export interface Key {
22
21
  readonly pubKey: Uint8Array;
23
22
  readonly address: Uint8Array;
24
23
  readonly bech32Address: string;
25
- readonly ethereumHexAddress: string;
26
24
  // Indicate whether the selected account is from the nano ledger.
27
25
  // Because current cosmos app in the nano ledger doesn't support the direct (proto) format msgs,
28
26
  // this can be used to select the amino or direct signer.
@@ -229,9 +227,6 @@ export interface Keplr {
229
227
  ): Promise<AminoSignResponse>;
230
228
 
231
229
  getChainInfosWithoutEndpoints(): Promise<ChainInfoWithoutEndpoints[]>;
232
- getChainInfoWithoutEndpoints(
233
- chainId: string
234
- ): Promise<ChainInfoWithoutEndpoints>;
235
230
 
236
231
  /** Change wallet extension user name **/
237
232
  changeKeyRingName(opts: {
@@ -242,31 +237,4 @@ export interface Keplr {
242
237
  sendEthereumTx(chainId: string, tx: Uint8Array): Promise<string>;
243
238
 
244
239
  suggestERC20(chainId: string, contractAddress: string): Promise<void>;
245
-
246
- readonly ethereum: IEthereumProvider;
247
- }
248
-
249
- export interface IEthereumProvider extends EventEmitter {
250
- // It must be in the hexadecimal format used in EVM-based chains, not the format used in Tendermint nodes.
251
- readonly chainId: string | null;
252
- // It must be in the decimal format of chainId.
253
- readonly networkVersion: string | null;
254
-
255
- readonly selectedAddress: string | null;
256
-
257
- readonly isKeplr: boolean;
258
- readonly isMetaMask: boolean;
259
-
260
- isConnected(): boolean;
261
-
262
- request<T>({
263
- method,
264
- params,
265
- }: {
266
- method: string;
267
- params?: unknown[] | Record<string, unknown>;
268
- }): Promise<T>;
269
-
270
- enable(): Promise<string[]>;
271
- net_version(): Promise<string>;
272
240
  }