@0xtorch/evm 0.0.65 → 0.0.67
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/_cjs/client/create.js +9 -28
- package/_cjs/client/create.js.map +1 -1
- package/_cjs/client/rpcManager.js +2 -7
- package/_cjs/client/rpcManager.js.map +1 -1
- package/_cjs/explorer/blockscout/client.js +2 -7
- package/_cjs/explorer/blockscout/client.js.map +1 -1
- package/_cjs/explorer/etherscan/client.js +2 -7
- package/_cjs/explorer/etherscan/client.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/decodeTransaction/decodeInput.js +4 -13
- package/_cjs/logic/analyzeTransaction/decodeTransaction/decodeInput.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/decodeTransaction/decodeLog.js +4 -13
- package/_cjs/logic/analyzeTransaction/decodeTransaction/decodeLog.js.map +1 -1
- package/_cjs/logic/getTransactionDetail/decodeTokenTransferLogs.js +1 -4
- package/_cjs/logic/getTransactionDetail/decodeTokenTransferLogs.js.map +1 -1
- package/_esm/client/create.js +9 -28
- package/_esm/client/create.js.map +1 -1
- package/_esm/client/rpcManager.js +2 -7
- package/_esm/client/rpcManager.js.map +1 -1
- package/_esm/explorer/blockscout/client.js +2 -7
- package/_esm/explorer/blockscout/client.js.map +1 -1
- package/_esm/explorer/etherscan/client.js +2 -7
- package/_esm/explorer/etherscan/client.js.map +1 -1
- package/_esm/logic/analyzeTransaction/decodeTransaction/decodeInput.js +4 -13
- package/_esm/logic/analyzeTransaction/decodeTransaction/decodeInput.js.map +1 -1
- package/_esm/logic/analyzeTransaction/decodeTransaction/decodeLog.js +4 -13
- package/_esm/logic/analyzeTransaction/decodeTransaction/decodeLog.js.map +1 -1
- package/_esm/logic/getTransactionDetail/decodeTokenTransferLogs.js +1 -4
- package/_esm/logic/getTransactionDetail/decodeTokenTransferLogs.js.map +1 -1
- package/_types/client/create.d.ts.map +1 -1
- package/_types/client/rpcManager.d.ts.map +1 -1
- package/_types/explorer/blockscout/client.d.ts.map +1 -1
- package/_types/explorer/etherscan/client.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/decodeTransaction/decodeInput.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/decodeTransaction/decodeLog.d.ts.map +1 -1
- package/_types/logic/getTransactionDetail/decodeTokenTransferLogs.d.ts.map +1 -1
- package/client/create.ts +9 -28
- package/client/rpcManager.ts +2 -7
- package/explorer/blockscout/client.ts +2 -7
- package/explorer/etherscan/client.ts +2 -7
- package/logic/analyzeTransaction/decodeTransaction/decodeInput.ts +4 -13
- package/logic/analyzeTransaction/decodeTransaction/decodeLog.ts +4 -13
- package/logic/getTransactionDetail/decodeTokenTransferLogs.ts +1 -4
- package/package.json +2 -2
- package/tests.ts +4 -10
- package/.DS_Store +0 -0
- package/_cjs/tests.js +0 -10
- package/_cjs/tests.js.map +0 -1
- package/_esm/tests.js +0 -7
- package/_esm/tests.js.map +0 -1
- package/_types/tests.d.ts +0 -7
- package/_types/tests.d.ts.map +0 -1
- package/analyzer/.DS_Store +0 -0
- package/chain/.DS_Store +0 -0
- package/client/.DS_Store +0 -0
- package/explorer/.DS_Store +0 -0
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
decodeFunctionData,
|
|
5
5
|
getAbiItem,
|
|
6
6
|
} from 'viem'
|
|
7
|
-
import { IS_DEBUG } from '../../../tests'
|
|
8
7
|
import type { LowerHex } from '../../../types'
|
|
9
8
|
import type { TransactionFunction } from '../../../types/transactionDecoded'
|
|
10
9
|
|
|
@@ -46,9 +45,7 @@ const decodeInputByAddressAbi = (
|
|
|
46
45
|
try {
|
|
47
46
|
const parsedAbi = Abi.safeParse(JSON.parse(abiText))
|
|
48
47
|
if (!parsedAbi.success) {
|
|
49
|
-
|
|
50
|
-
console.debug(parsedAbi.error)
|
|
51
|
-
}
|
|
48
|
+
console.debug(parsedAbi.error)
|
|
52
49
|
return undefined
|
|
53
50
|
}
|
|
54
51
|
const abi = parsedAbi.data
|
|
@@ -67,9 +64,7 @@ const decodeInputByAddressAbi = (
|
|
|
67
64
|
interface: createInterface({ name: functionName, args: functionArgs }),
|
|
68
65
|
}
|
|
69
66
|
} catch (error) {
|
|
70
|
-
|
|
71
|
-
console.debug(error)
|
|
72
|
-
}
|
|
67
|
+
console.debug(error)
|
|
73
68
|
return undefined
|
|
74
69
|
}
|
|
75
70
|
}
|
|
@@ -81,9 +76,7 @@ const decodeInputByFunctionAbi = (
|
|
|
81
76
|
try {
|
|
82
77
|
const parsedAbi = AbiFunction.safeParse(JSON.parse(abiText))
|
|
83
78
|
if (!parsedAbi.success) {
|
|
84
|
-
|
|
85
|
-
console.debug(parsedAbi.error)
|
|
86
|
-
}
|
|
79
|
+
console.debug(parsedAbi.error)
|
|
87
80
|
return undefined
|
|
88
81
|
}
|
|
89
82
|
const abiItem = parsedAbi.data
|
|
@@ -101,9 +94,7 @@ const decodeInputByFunctionAbi = (
|
|
|
101
94
|
interface: createInterface({ name: functionName, args: functionArgs }),
|
|
102
95
|
}
|
|
103
96
|
} catch (error) {
|
|
104
|
-
|
|
105
|
-
console.debug(error)
|
|
106
|
-
}
|
|
97
|
+
console.debug(error)
|
|
107
98
|
return undefined
|
|
108
99
|
}
|
|
109
100
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Abi, AbiEvent } from 'abitype/zod'
|
|
2
2
|
import { type AbiEvent as AbiEventType, decodeEventLog, getAbiItem } from 'viem'
|
|
3
|
-
import { IS_DEBUG } from '../../../tests'
|
|
4
3
|
import type { Hex } from '../../../types'
|
|
5
4
|
import type { Log } from '../../../types/log'
|
|
6
5
|
|
|
@@ -42,9 +41,7 @@ export const decodeLogByAddressAbi = (
|
|
|
42
41
|
try {
|
|
43
42
|
const parsedAbi = Abi.safeParse(JSON.parse(abiText))
|
|
44
43
|
if (!parsedAbi.success) {
|
|
45
|
-
|
|
46
|
-
console.debug(parsedAbi.error)
|
|
47
|
-
}
|
|
44
|
+
console.debug(parsedAbi.error)
|
|
48
45
|
return undefined
|
|
49
46
|
}
|
|
50
47
|
const abi = parsedAbi.data
|
|
@@ -66,9 +63,7 @@ export const decodeLogByAddressAbi = (
|
|
|
66
63
|
args: createLogArgs(decodedLog.args, abiItem),
|
|
67
64
|
}
|
|
68
65
|
} catch (error) {
|
|
69
|
-
|
|
70
|
-
console.debug(error)
|
|
71
|
-
}
|
|
66
|
+
console.debug(error)
|
|
72
67
|
return undefined
|
|
73
68
|
}
|
|
74
69
|
}
|
|
@@ -77,9 +72,7 @@ const decodeInputByEventAbi = (log: Log, abiText: string): Log | undefined => {
|
|
|
77
72
|
try {
|
|
78
73
|
const parsedAbi = AbiEvent.safeParse(JSON.parse(abiText))
|
|
79
74
|
if (!parsedAbi.success) {
|
|
80
|
-
|
|
81
|
-
console.debug(parsedAbi.error)
|
|
82
|
-
}
|
|
75
|
+
console.debug(parsedAbi.error)
|
|
83
76
|
return undefined
|
|
84
77
|
}
|
|
85
78
|
const abiItem = parsedAbi.data
|
|
@@ -94,9 +87,7 @@ const decodeInputByEventAbi = (log: Log, abiText: string): Log | undefined => {
|
|
|
94
87
|
args: createLogArgs(decodedLog.args, abiItem),
|
|
95
88
|
}
|
|
96
89
|
} catch (error) {
|
|
97
|
-
|
|
98
|
-
console.debug(error)
|
|
99
|
-
}
|
|
90
|
+
console.debug(error)
|
|
100
91
|
return undefined
|
|
101
92
|
}
|
|
102
93
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { decodeEventLog, zeroAddress } from 'viem'
|
|
2
|
-
import { IS_DEBUG } from '../../tests'
|
|
3
2
|
import {
|
|
4
3
|
type Erc20Transfer,
|
|
5
4
|
type Erc721Transfer,
|
|
@@ -479,9 +478,7 @@ const decodeErc1155TransferBatchLog = (
|
|
|
479
478
|
})),
|
|
480
479
|
}
|
|
481
480
|
} catch (error) {
|
|
482
|
-
|
|
483
|
-
console.debug(error)
|
|
484
|
-
}
|
|
481
|
+
console.debug(error)
|
|
485
482
|
return undefined
|
|
486
483
|
}
|
|
487
484
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xtorch/evm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"description": "Cryptorch EVM extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cryptorch",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@0xtorch/big-decimal": "^0.0.10",
|
|
41
|
-
"@0xtorch/core": "^0.0.
|
|
41
|
+
"@0xtorch/core": "^0.0.44",
|
|
42
42
|
"abitype": "^1.0.6",
|
|
43
43
|
"viem": "^2.21.7",
|
|
44
44
|
"zod": "^3.23.8"
|
package/tests.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
export const IS_SMALL_TEST =
|
|
2
|
-
|
|
2
|
+
(process.env.TEST_SIZE ?? '').includes('S')
|
|
3
3
|
|
|
4
4
|
export const IS_MEDIUM_TEST =
|
|
5
|
-
|
|
5
|
+
(process.env.TEST_SIZE ?? '').includes('M')
|
|
6
6
|
|
|
7
7
|
export const IS_LARGE_TEST =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export const IS_END_TO_END_TEST =
|
|
11
|
-
process !== undefined && (process.env.TEST_SIZE ?? '').includes('E')
|
|
8
|
+
(process.env.TEST_SIZE ?? '').includes('L')
|
|
12
9
|
|
|
13
10
|
export const IS_RPC_TEST =
|
|
14
|
-
process
|
|
15
|
-
|
|
16
|
-
export const IS_DEBUG =
|
|
17
|
-
process !== undefined && (process.env.DEBUG ?? '').length > 0
|
|
11
|
+
process.env.TEST_TARGET === 'RPC'
|
package/.DS_Store
DELETED
|
Binary file
|
package/_cjs/tests.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IS_DEBUG = exports.IS_RPC_TEST = exports.IS_END_TO_END_TEST = exports.IS_LARGE_TEST = exports.IS_MEDIUM_TEST = exports.IS_SMALL_TEST = void 0;
|
|
4
|
-
exports.IS_SMALL_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('S');
|
|
5
|
-
exports.IS_MEDIUM_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('M');
|
|
6
|
-
exports.IS_LARGE_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('L');
|
|
7
|
-
exports.IS_END_TO_END_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('E');
|
|
8
|
-
exports.IS_RPC_TEST = process !== undefined && process.env.TEST_TARGET === 'RPC';
|
|
9
|
-
exports.IS_DEBUG = process !== undefined && (process.env.DEBUG ?? '').length > 0;
|
|
10
|
-
//# sourceMappingURL=tests.js.map
|
package/_cjs/tests.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../tests.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GACxB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEzD,QAAA,cAAc,GACzB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEzD,QAAA,aAAa,GACxB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEzD,QAAA,kBAAkB,GAC7B,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEzD,QAAA,WAAW,GACtB,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,KAAK,CAAA;AAE/C,QAAA,QAAQ,GACnB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA"}
|
package/_esm/tests.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const IS_SMALL_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('S');
|
|
2
|
-
export const IS_MEDIUM_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('M');
|
|
3
|
-
export const IS_LARGE_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('L');
|
|
4
|
-
export const IS_END_TO_END_TEST = process !== undefined && (process.env.TEST_SIZE ?? '').includes('E');
|
|
5
|
-
export const IS_RPC_TEST = process !== undefined && process.env.TEST_TARGET === 'RPC';
|
|
6
|
-
export const IS_DEBUG = process !== undefined && (process.env.DEBUG ?? '').length > 0;
|
|
7
|
-
//# sourceMappingURL=tests.js.map
|
package/_esm/tests.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../tests.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GACxB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEtE,MAAM,CAAC,MAAM,cAAc,GACzB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEtE,MAAM,CAAC,MAAM,aAAa,GACxB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAC7B,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAEtE,MAAM,CAAC,MAAM,WAAW,GACtB,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,KAAK,CAAA;AAE5D,MAAM,CAAC,MAAM,QAAQ,GACnB,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA"}
|
package/_types/tests.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const IS_SMALL_TEST: boolean;
|
|
2
|
-
export declare const IS_MEDIUM_TEST: boolean;
|
|
3
|
-
export declare const IS_LARGE_TEST: boolean;
|
|
4
|
-
export declare const IS_END_TO_END_TEST: boolean;
|
|
5
|
-
export declare const IS_RPC_TEST: boolean;
|
|
6
|
-
export declare const IS_DEBUG: boolean;
|
|
7
|
-
//# sourceMappingURL=tests.d.ts.map
|
package/_types/tests.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../tests.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,SAC4C,CAAA;AAEtE,eAAO,MAAM,cAAc,SAC2C,CAAA;AAEtE,eAAO,MAAM,aAAa,SAC4C,CAAA;AAEtE,eAAO,MAAM,kBAAkB,SACuC,CAAA;AAEtE,eAAO,MAAM,WAAW,SACoC,CAAA;AAE5D,eAAO,MAAM,QAAQ,SAC0C,CAAA"}
|
package/analyzer/.DS_Store
DELETED
|
Binary file
|
package/chain/.DS_Store
DELETED
|
Binary file
|
package/client/.DS_Store
DELETED
|
Binary file
|
package/explorer/.DS_Store
DELETED
|
Binary file
|