@sidhujag/sysweb3-keyring 1.0.509 → 1.0.511

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,8 +1,6 @@
1
1
  import { Networkish } from '@ethersproject/networks';
2
- import { ethers } from 'ethers';
3
- import { ConnectionInfo } from 'ethers/lib/utils';
4
- import { Provider } from 'zksync-ethers';
5
- declare class BaseProvider extends ethers.providers.JsonRpcProvider {
2
+ import { JsonRpcProvider } from '@ethersproject/providers';
3
+ declare class BaseProvider extends JsonRpcProvider {
6
4
  private isPossibleGetChainId;
7
5
  private cooldownTime;
8
6
  private rateLimit;
@@ -25,7 +23,9 @@ declare class BaseProvider extends ethers.providers.JsonRpcProvider {
25
23
  };
26
24
  resolve: (result: any) => void;
27
25
  }> | null;
28
- constructor(signal: AbortSignal, url?: ConnectionInfo | string, network?: Networkish);
26
+ constructor(signal: AbortSignal, url?: string | {
27
+ url: string;
28
+ }, network?: Networkish);
29
29
  private bindMethods;
30
30
  private throttledRequest;
31
31
  private canMakeRequest;
@@ -35,13 +35,16 @@ declare class BaseProvider extends ethers.providers.JsonRpcProvider {
35
35
  sendBatch(method: string, params: Array<any[]>): Promise<any[]>;
36
36
  }
37
37
  export declare class CustomJsonRpcProvider extends BaseProvider {
38
- constructor(signal: AbortSignal, url?: ConnectionInfo | string, network?: Networkish);
38
+ constructor(signal: AbortSignal, url?: string | {
39
+ url: string;
40
+ }, network?: Networkish);
39
41
  }
40
- export declare class CustomL2JsonRpcProvider extends Provider {
41
- private baseProvider;
42
- constructor(signal: AbortSignal, url?: ConnectionInfo | string, network?: ethers.providers.Networkish);
42
+ export declare class CustomL2JsonRpcProvider extends BaseProvider {
43
+ private zkSyncProvider;
44
+ constructor(signal: AbortSignal, url?: string | {
45
+ url: string;
46
+ }, network?: Networkish);
47
+ private initializeZkSyncProvider;
43
48
  perform(method: string, params: any): Promise<any>;
44
- send(method: string, params: any[]): Promise<any>;
45
- sendBatch(method: string, params: Array<any[]>): Promise<any[]>;
46
49
  }
47
50
  export {};
@@ -1,7 +1,8 @@
1
1
  import { TransactionResponse } from '@ethersproject/abstract-provider';
2
+ import { BigNumber } from '@ethersproject/bignumber';
3
+ import { Wallet } from '@ethersproject/wallet';
4
+ import { TypedMessage, SignTypedDataVersion, TypedDataV1 } from '@metamask/eth-sig-util';
2
5
  import { INetwork } from '@sidhujag/sysweb3-network';
3
- import { TypedMessage, Version, TypedData } from 'eth-sig-util';
4
- import { BigNumber, ethers } from 'ethers';
5
6
  import { LedgerKeyring } from '../ledger';
6
7
  import { CustomJsonRpcProvider, CustomL2JsonRpcProvider } from '../providers';
7
8
  import { TrezorKeyring } from '../trezor';
@@ -31,8 +32,8 @@ export declare class EthereumTransactions implements IEthereumTransactions {
31
32
  get web3Provider(): CustomJsonRpcProvider | CustomL2JsonRpcProvider;
32
33
  private ensureProvidersInitialized;
33
34
  private isUtxoNetwork;
34
- signTypedData: (addr: string, typedData: TypedData | TypedMessage<any>, version: Version) => Promise<any>;
35
- verifyTypedSignature: (data: TypedData | TypedMessage<any>, signature: string, version: Version) => string;
35
+ signTypedData: (addr: string, typedData: TypedDataV1 | TypedMessage<any>, version: SignTypedDataVersion) => Promise<any>;
36
+ verifyTypedSignature: (data: TypedDataV1 | TypedMessage<any>, signature: string, version: SignTypedDataVersion) => string;
36
37
  ethSign: (params: string[]) => Promise<string>;
37
38
  signPersonalMessage: (params: string[]) => Promise<string>;
38
39
  parsePersonalMessage: (hexMsg: string) => string;
@@ -76,5 +77,5 @@ export declare class EthereumTransactions implements IEthereumTransactions {
76
77
  getBalance: (address: string) => Promise<number>;
77
78
  private getTransactionTimestamp;
78
79
  setWeb3Provider(network: INetwork): void;
79
- importAccount: (mnemonicOrPrivKey: string) => ethers.Wallet;
80
+ importAccount: (mnemonicOrPrivKey: string) => Wallet;
80
81
  }
@@ -1,6 +1,6 @@
1
+ import { TypedMessage, SignTypedDataVersion, TypedDataV1 } from '@metamask/eth-sig-util';
1
2
  import { AccountInfo, EthereumTransaction, EthereumTransactionEIP1559 } from '@trezor/connect-webextension';
2
3
  import { Buffer } from 'buffer';
3
- import { Version } from 'eth-sig-util';
4
4
  export interface TrezorControllerState {
5
5
  hdPath: string;
6
6
  paths: Record<string, number>;
@@ -142,9 +142,9 @@ export declare class TrezorKeyring {
142
142
  */
143
143
  signTypedData({ version, address, data, index, }: {
144
144
  address: string;
145
- data: any;
145
+ data: TypedMessage<any> | TypedDataV1;
146
146
  index: number;
147
- version: Version;
147
+ version: SignTypedDataVersion;
148
148
  }): Promise<any>;
149
149
  /**
150
150
  * Verify UTXO address by displaying it on the Trezor device
package/types/types.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  import { TransactionResponse } from '@ethersproject/abstract-provider';
2
+ import { BigNumber, BigNumberish } from '@ethersproject/bignumber';
3
+ import { BytesLike } from '@ethersproject/bytes';
4
+ import { AccessListish } from '@ethersproject/transactions';
5
+ import { Wallet } from '@ethersproject/wallet';
6
+ import { TypedDataV1, TypedMessage, SignTypedDataVersion } from '@metamask/eth-sig-util';
2
7
  import { INetwork, INetworkType } from '@sidhujag/sysweb3-network';
3
8
  import { ITxid } from '@sidhujag/sysweb3-utils';
4
- import { TypedData, TypedMessage } from 'eth-sig-util';
5
- import { ethers, BigNumber, BigNumberish } from 'ethers';
6
9
  import { CustomJsonRpcProvider, CustomL2JsonRpcProvider } from 'providers';
7
10
  import { LedgerKeyring } from './ledger';
8
11
  import { SyscoinHDSigner } from './signers';
@@ -16,25 +19,24 @@ export interface ISendTransaction {
16
19
  token?: any;
17
20
  }
18
21
  export type SimpleTransactionRequest = {
19
- accessList?: ethers.utils.AccessListish;
22
+ accessList?: AccessListish;
20
23
  ccipReadEnabled?: boolean;
21
24
  chainId: number;
22
25
  customData?: Record<string, any>;
23
- data?: ethers.BytesLike;
26
+ data?: BytesLike;
24
27
  from: string;
25
- gasLimit?: ethers.BigNumberish;
26
- gasPrice?: ethers.BigNumberish;
27
- maxFeePerGas: ethers.BigNumberish;
28
- maxPriorityFeePerGas: ethers.BigNumberish;
29
- nonce?: ethers.BigNumberish;
28
+ gasLimit?: BigNumberish;
29
+ gasPrice?: BigNumberish;
30
+ maxFeePerGas: BigNumberish;
31
+ maxPriorityFeePerGas: BigNumberish;
32
+ nonce?: BigNumberish;
30
33
  r?: string;
31
34
  s?: string;
32
35
  to: string;
33
36
  type?: number;
34
37
  v?: string;
35
- value?: ethers.BigNumberish;
38
+ value?: BigNumberish;
36
39
  };
37
- export declare type Version = 'V1' | 'V2' | 'V3' | 'V4';
38
40
  export interface IEthereumTransactions {
39
41
  cancelSentTransaction: (txHash: string, isLegacy?: boolean) => Promise<{
40
42
  error?: boolean;
@@ -51,14 +53,14 @@ export interface IEthereumTransactions {
51
53
  getGasLimit: (toAddress: string) => Promise<number>;
52
54
  getGasOracle?: () => Promise<any>;
53
55
  getRecommendedNonce: (address: string) => Promise<number>;
54
- signTypedData: (addr: string, typedData: TypedData | TypedMessage<any>, version: Version) => Promise<string>;
56
+ signTypedData: (addr: string, typedData: TypedDataV1 | TypedMessage<any>, version: SignTypedDataVersion) => Promise<string>;
55
57
  sendTransaction: (data: ISendTransaction) => Promise<TransactionResponse>;
56
- importAccount: (mnemonicOrPrivKey: string) => ethers.Wallet;
58
+ importAccount: (mnemonicOrPrivKey: string) => Wallet;
57
59
  parsePersonalMessage: (hexMsg: string) => string;
58
60
  sendFormattedTransaction: (params: SimpleTransactionRequest, isLegacy?: boolean) => Promise<TransactionResponse>;
59
61
  sendSignedErc1155Transaction: ({ receiver, tokenAddress, tokenId, isLegacy, gasPrice, gasLimit, maxFeePerGas, maxPriorityFeePerGas, }: ISendSignedErcTransactionProps) => Promise<IResponseFromSendErcSignedTransaction>;
60
62
  verifyPersonalMessage: (msg: string, sign: string) => string;
61
- toBigNumber: (aBigNumberish: string | number) => ethers.BigNumber;
63
+ toBigNumber: (aBigNumberish: string | number) => BigNumber;
62
64
  sendSignedErc20Transaction: ({ networkUrl, receiver, tokenAddress, tokenAmount, }: ISendSignedErcTransactionProps) => Promise<IResponseFromSendErcSignedTransaction>;
63
65
  sendSignedErc721Transaction: ({ networkUrl, receiver, tokenAddress, tokenId, }: ISendSignedErcTransactionProps) => Promise<IResponseFromSendErcSignedTransaction>;
64
66
  sendTransactionWithEditedFee: (txHash: string, isLegacy?: boolean) => Promise<{
@@ -67,14 +69,14 @@ export interface IEthereumTransactions {
67
69
  error?: boolean;
68
70
  }>;
69
71
  signPersonalMessage: (params: string[]) => Promise<string>;
70
- verifyTypedSignature: (data: TypedData | TypedMessage<any>, signature: string, version: Version) => string;
72
+ verifyTypedSignature: (data: TypedDataV1 | TypedMessage<any>, signature: string, version: SignTypedDataVersion) => string;
71
73
  setWeb3Provider: (network: INetwork) => void;
72
74
  getRecommendedGasPrice: (formatted?: boolean) => Promise<string | {
73
75
  ethers: string;
74
76
  gwei: string;
75
77
  }>;
76
78
  web3Provider: CustomJsonRpcProvider | CustomL2JsonRpcProvider;
77
- getTxGasLimit: (tx: SimpleTransactionRequest) => Promise<ethers.BigNumber>;
79
+ getTxGasLimit: (tx: SimpleTransactionRequest) => Promise<BigNumber>;
78
80
  }
79
81
  export interface ISyscoinTransactions {
80
82
  getEstimateSysTransactionFee: ({ txOptions, amount, receivingAddress, feeRate, token, isMax, }: {