@toruslabs/ethereum-controllers 5.6.4 → 5.7.0

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.
@@ -0,0 +1,22 @@
1
+ import { JRPCRequest, Json } from "@toruslabs/openlogin-jrpc";
2
+ export declare enum CacheStrategy {
3
+ /**
4
+ * Cache per-block.
5
+ */
6
+ Block = "block",
7
+ /**
8
+ * Cache until a chain reorganization occurs.
9
+ */
10
+ Fork = "fork",
11
+ /**
12
+ * Never cache.
13
+ */
14
+ Never = "never",
15
+ /**
16
+ * Permanently cache.
17
+ */
18
+ Permanent = "perma"
19
+ }
20
+ export declare function blockTagParamIndex(method: string): number | undefined;
21
+ export declare function cacheTypeForMethod(method: string): CacheStrategy;
22
+ export declare function cacheIdentifierForRequest(request: JRPCRequest<Json>, skipBlockRef?: boolean): string | null;
@@ -48,6 +48,7 @@ export default class PreferencesController extends BasePreferencesController<Ext
48
48
  id: number | null;
49
49
  }): Promise<boolean>;
50
50
  private getChainOptions;
51
+ private getBlockExplorerUrl;
51
52
  private calculatePastTx;
52
53
  private cancelTxCalculate;
53
54
  }
@@ -2,7 +2,11 @@ import { TransactionStatus } from "@toruslabs/base-controllers";
2
2
  import { SafeEventEmitterProvider } from "@toruslabs/openlogin-jrpc";
3
3
  import { EtherscanTransaction, FormattedTransactionActivity, TransactionPayload } from "./interfaces";
4
4
  export declare function getEtherScanHashLink(txHash: string, chainId: string): string;
5
- export declare const formatPastTx: (x: TransactionPayload, lowerCaseSelectedAddress?: string) => FormattedTransactionActivity;
5
+ export declare const formatPastTx: (params: {
6
+ transaction: TransactionPayload;
7
+ blockExplorerUrl: string;
8
+ lowerCaseSelectedAddress?: string;
9
+ }) => FormattedTransactionActivity;
6
10
  /**
7
11
  * Ref - https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt
8
12
  */
@@ -22,4 +26,10 @@ export declare function bnLessThan(a: string | number, b: string | number): bool
22
26
  export declare const getIpfsEndpoint: (path: string) => string;
23
27
  export declare function sanitizeNftMetdataUrl(url: string): string;
24
28
  export declare function getChainType(chainId: string): "mainnet" | "testnet" | "custom";
25
- export declare const addEtherscanTransactions: (txn: EtherscanTransaction[], lowerCaseSelectedAddress: string, provider: SafeEventEmitterProvider, chainId: string) => Promise<any[]>;
29
+ export declare const addEtherscanTransactions: (params: {
30
+ txn: EtherscanTransaction[];
31
+ lowerCaseSelectedAddress: string;
32
+ provider: SafeEventEmitterProvider;
33
+ chainId: string;
34
+ blockExplorerUrl: string;
35
+ }) => Promise<any[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toruslabs/ethereum-controllers",
3
- "version": "5.6.4",
3
+ "version": "5.7.0",
4
4
  "homepage": "https://github.com/torusresearch/controllers#readme",
5
5
  "license": "ISC",
6
6
  "main": "dist/ethereumControllers.cjs.js",
@@ -22,16 +22,17 @@
22
22
  "@ethereumjs/common": "^4.3.0",
23
23
  "@ethereumjs/tx": "^5.3.0",
24
24
  "@ethereumjs/util": "^9.0.3",
25
- "@metamask/eth-sig-util": "^7.0.1",
25
+ "@metamask/eth-sig-util": "^7.0.2",
26
26
  "@metamask/rpc-errors": "^6.2.1",
27
- "@toruslabs/base-controllers": "^5.6.3",
27
+ "@toruslabs/base-controllers": "^5.7.0",
28
28
  "@toruslabs/http-helpers": "^6.1.1",
29
- "@toruslabs/openlogin-jrpc": "^8.1.0",
29
+ "@toruslabs/openlogin-jrpc": "^8.1.1",
30
30
  "async-mutex": "^0.5.0",
31
31
  "bignumber.js": "^9.1.2",
32
32
  "bn.js": "^5.2.1",
33
- "ethers": "^6.11.1",
33
+ "ethers": "^6.12.1",
34
34
  "fast-json-patch": "^3.1.1",
35
+ "fast-safe-stringify": "^2.1.1",
35
36
  "jsonschema": "^1.4.1",
36
37
  "lodash": "^4.17.21",
37
38
  "loglevel": "^1.9.1"
@@ -63,9 +64,9 @@
63
64
  "publishConfig": {
64
65
  "access": "public"
65
66
  },
66
- "gitHead": "b872ee32f830eb8aefd9aa735fe4064dda0c1678",
67
+ "gitHead": "0e3caaeb3d97154dca98c833620aa77972c938c8",
67
68
  "devDependencies": {
68
69
  "@nomicfoundation/hardhat-toolbox": "^5.0.0",
69
- "hardhat": "^2.22.2"
70
+ "hardhat": "^2.22.4"
70
71
  }
71
72
  }