@toruslabs/ethereum-controllers 5.2.1 → 5.2.3
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/dist/ethereumControllers.cjs.js +9 -7
- package/dist/ethereumControllers.cjs.js.map +1 -1
- package/dist/ethereumControllers.esm.js +9 -7
- package/dist/ethereumControllers.esm.js.map +1 -1
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/ethereumControllers.umd.min.js.map +1 -1
- package/dist/types/utils/abis.d.ts +1 -1
- package/package.json +3 -3
- package/src/Tokens/TokenHandler.ts +2 -2
- package/src/Transaction/TransactionUtils.ts +2 -2
- package/src/utils/abis.ts +1 -1
- package/src/utils/helpers.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toruslabs/ethereum-controllers",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"homepage": "https://github.com/torusresearch/controllers#readme",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/ethereumControllers.cjs.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@ethereumjs/util": "^9.0.1",
|
|
25
25
|
"@metamask/eth-sig-util": "^7.0.1",
|
|
26
26
|
"@metamask/rpc-errors": "^6.1.0",
|
|
27
|
-
"@toruslabs/base-controllers": "^5.2.
|
|
27
|
+
"@toruslabs/base-controllers": "^5.2.3",
|
|
28
28
|
"@toruslabs/http-helpers": "^6.0.0",
|
|
29
29
|
"@toruslabs/openlogin-jrpc": "^6.1.0",
|
|
30
30
|
"async-mutex": "^0.4.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "058a00410c045268e91be28493dcaf70f30e5acf",
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
|
|
70
70
|
"hardhat": "^2.19.3"
|
|
@@ -2,7 +2,7 @@ import BigNumber from "bignumber.js";
|
|
|
2
2
|
import { BrowserProvider, Contract } from "ethers";
|
|
3
3
|
import log from "loglevel";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { erc20Abi } from "../utils/abis";
|
|
6
6
|
|
|
7
7
|
export interface ITokenOptions {
|
|
8
8
|
address: string;
|
|
@@ -26,7 +26,7 @@ export class TokenHandler {
|
|
|
26
26
|
constructor({ address, symbol, decimals, name, provider }: ITokenOptions) {
|
|
27
27
|
this.address = address;
|
|
28
28
|
|
|
29
|
-
this.contract = new Contract(address,
|
|
29
|
+
this.contract = new Contract(address, erc20Abi, provider);
|
|
30
30
|
this.symbol = symbol;
|
|
31
31
|
this.decimals = decimals;
|
|
32
32
|
this.name = name;
|
|
@@ -5,7 +5,7 @@ import { SafeEventEmitterProvider } from "@toruslabs/openlogin-jrpc";
|
|
|
5
5
|
import { Interface } from "ethers";
|
|
6
6
|
import log from "loglevel";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { erc20Abi, erc721Abi, erc1155Abi } from "../utils/abis";
|
|
9
9
|
import {
|
|
10
10
|
CONTRACT_TYPE_ERC20,
|
|
11
11
|
CONTRACT_TYPE_ERC721,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "../utils/constants";
|
|
17
17
|
import { EthereumTransactionMeta, TRANSACTION_ENVELOPE_TYPES_TYPE, TransactionParams } from "../utils/interfaces";
|
|
18
18
|
|
|
19
|
-
const erc20Interface = new Interface(
|
|
19
|
+
const erc20Interface = new Interface(erc20Abi);
|
|
20
20
|
const erc721Interface = new Interface(erc721Abi);
|
|
21
21
|
const erc1155Interface = new Interface(erc1155Abi);
|
|
22
22
|
|
package/src/utils/abis.ts
CHANGED
package/src/utils/helpers.ts
CHANGED
|
@@ -119,9 +119,11 @@ export const idleTimeTracker = ((activityThresholdTime: number): { checkIfIdle:
|
|
|
119
119
|
}, activityThresholdTime * 1000);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
window
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
123
|
+
window.addEventListener("load", resetTimer);
|
|
124
|
+
document.addEventListener("mousemove", resetTimer);
|
|
125
|
+
document.addEventListener("keydown", resetTimer);
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
function checkIfIdle() {
|
|
127
129
|
return isIdle;
|