@0xtorch/evm 0.0.110 → 0.0.112
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/explorer/blockscout/create.js +10 -5
- package/_cjs/explorer/blockscout/create.js.map +1 -1
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js +44 -6
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js +4 -0
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/client.js +2 -1
- package/_cjs/explorer/etherscan/client.js.map +1 -1
- package/_cjs/explorer/etherscan/create.js +10 -5
- package/_cjs/explorer/etherscan/create.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +28 -6
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js +4 -0
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/moralis/create.js +16 -1
- package/_cjs/explorer/moralis/create.js.map +1 -1
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js +2 -0
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/allValue.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/allValue.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc1155Pattern.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/erc1155Pattern.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc20Pattern.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/erc20Pattern.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/join.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/join.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/schema.js +4 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/schema.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/simpleValue.js +3 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/simpleValue.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/transferGenerator.js +1 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/transferGenerator.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js +3 -0
- package/_cjs/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js.map +1 -1
- package/_cjs/logic/getAddressIndexData.js +2 -1
- package/_cjs/logic/getAddressIndexData.js.map +1 -1
- package/_cjs/logic/getTransactionDetail/index.js +10 -5
- package/_cjs/logic/getTransactionDetail/index.js.map +1 -1
- package/_cjs/types/transactionIndex.js +7 -1
- package/_cjs/types/transactionIndex.js.map +1 -1
- package/_esm/explorer/blockscout/create.js +10 -5
- package/_esm/explorer/blockscout/create.js.map +1 -1
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js +45 -7
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js +5 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/client.js +2 -1
- package/_esm/explorer/etherscan/client.js.map +1 -1
- package/_esm/explorer/etherscan/create.js +10 -5
- package/_esm/explorer/etherscan/create.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +29 -7
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js +5 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/moralis/create.js +16 -1
- package/_esm/explorer/moralis/create.js.map +1 -1
- package/_esm/explorer/moralis/getWalletTransactionHistory.js +2 -0
- package/_esm/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/allValue.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/allValue.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc1155Pattern.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/erc1155Pattern.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc20Pattern.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/erc20Pattern.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/join.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/join.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/schema.js +4 -0
- package/_esm/logic/analyzeTransaction/createActions/json/schema.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/simpleValue.js +3 -0
- package/_esm/logic/analyzeTransaction/createActions/json/simpleValue.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/transferGenerator.js +1 -0
- package/_esm/logic/analyzeTransaction/createActions/json/transferGenerator.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js +3 -0
- package/_esm/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js.map +1 -1
- package/_esm/logic/getAddressIndexData.js +2 -1
- package/_esm/logic/getAddressIndexData.js.map +1 -1
- package/_esm/logic/getTransactionDetail/index.js +10 -5
- package/_esm/logic/getTransactionDetail/index.js.map +1 -1
- package/_esm/types/transactionIndex.js +7 -1
- package/_esm/types/transactionIndex.js.map +1 -1
- package/_types/explorer/blockscout/create.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts +5 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/client.d.ts.map +1 -1
- package/_types/explorer/etherscan/create.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts +5 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/moralis/create.d.ts.map +1 -1
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts +2 -0
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts.map +1 -1
- package/_types/explorer/types.d.ts +5 -2
- package/_types/explorer/types.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/allValue.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/erc1155Pattern.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/erc20Pattern.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/join.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/schema.d.ts +11672 -0
- package/_types/logic/analyzeTransaction/createActions/json/schema.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/simpleValue.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/transferGenerator.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.d.ts.map +1 -1
- package/_types/logic/getAddressIndexData.d.ts +4 -2
- package/_types/logic/getAddressIndexData.d.ts.map +1 -1
- package/_types/logic/getTransactionDetail/index.d.ts +3 -1
- package/_types/logic/getTransactionDetail/index.d.ts.map +1 -1
- package/_types/types/transactionIndex.d.ts +9 -2
- package/_types/types/transactionIndex.d.ts.map +1 -1
- package/explorer/blockscout/create.ts +20 -12
- package/explorer/blockscout/getTokenTransferEventsByAddress.ts +52 -10
- package/explorer/blockscout/getTransactionsByAddress.ts +5 -1
- package/explorer/etherscan/client.ts +6 -1
- package/explorer/etherscan/create.ts +21 -13
- package/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.ts +34 -10
- package/explorer/etherscan/getListOfNormalTransactionsByAddress.ts +5 -1
- package/explorer/moralis/create.ts +19 -2
- package/explorer/moralis/getWalletTransactionHistory.ts +2 -0
- package/explorer/types.ts +5 -2
- package/logic/analyzeTransaction/createActions/json/allValue.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/erc1155Pattern.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/erc20Pattern.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/internalTransferGenerator.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/join.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/schema.ts +5 -0
- package/logic/analyzeTransaction/createActions/json/simpleValue.ts +3 -0
- package/logic/analyzeTransaction/createActions/json/transferGenerator.ts +1 -0
- package/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.ts +3 -0
- package/logic/getAddressIndexData.ts +26 -20
- package/logic/getTransactionDetail/index.ts +13 -4
- package/package.json +1 -1
- package/types/transactionIndex.ts +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleValue.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/simpleValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,eAAO,MAAM,cAAc,+CAIxB;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzC,KAAG,
|
|
1
|
+
{"version":3,"file":"simpleValue.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/simpleValue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,eAAO,MAAM,cAAc,+CAIxB;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;IAClD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzC,KAAG,MAuXH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferGenerator.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/transferGenerator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAU1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,eAAO,MAAM,iBAAiB,gGAQ3B;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;IACxD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;CAC9C,KAAG,SAAS,QAAQ,
|
|
1
|
+
{"version":3,"file":"transferGenerator.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/transferGenerator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAU1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,eAAO,MAAM,iBAAiB,gGAQ3B;IACD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;IACxD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;CAC9C,KAAG,SAAS,QAAQ,EAiMpB,CAAA"}
|
package/_types/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyTxSatisfiesCondition.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAiB1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,KAAK,oCAAoC,GAAG;IAC1C,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACxC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,0BAA0B,kDAIpC,oCAAoC,KAAG,
|
|
1
|
+
{"version":3,"file":"verifyTxSatisfiesCondition.d.ts","sourceRoot":"","sources":["../../../../../logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,QAAQ,EACR,kBAAkB,EACnB,MAAM,mBAAmB,CAAA;AAiB1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,KAAK,oCAAoC,GAAG;IAC1C,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;IACxC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,0BAA0B,kDAIpC,oCAAoC,KAAG,OA6RzC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Chain } from '../chain';
|
|
2
|
+
import type { Erc20Transfer } from '../types';
|
|
2
3
|
import type { LowerHex } from '../types/hex';
|
|
3
4
|
import type { InternalTransaction } from '../types/internalTransaction';
|
|
4
5
|
import type { TransactionIndex } from '../types/transactionIndex';
|
|
@@ -9,8 +10,9 @@ type GetAddressIndexDataParameters = {
|
|
|
9
10
|
toBlock?: number;
|
|
10
11
|
};
|
|
11
12
|
type GetAddressIndexDataReturnTypes = {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
transactionIndexes: readonly TransactionIndex[];
|
|
14
|
+
internalTransactions: readonly InternalTransaction[];
|
|
15
|
+
erc20Transfers: readonly Erc20Transfer[];
|
|
14
16
|
};
|
|
15
17
|
export declare const getAddressIndexData: ({ chain, address, fromBlock, toBlock, }: GetAddressIndexDataParameters) => Promise<GetAddressIndexDataReturnTypes>;
|
|
16
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAddressIndexData.d.ts","sourceRoot":"","sources":["../../logic/getAddressIndexData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,KAAK,6BAA6B,GAAG;IACnC,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,QAAQ,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,8BAA8B,GAAG;IACpC,
|
|
1
|
+
{"version":3,"file":"getAddressIndexData.d.ts","sourceRoot":"","sources":["../../logic/getAddressIndexData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjE,KAAK,6BAA6B,GAAG;IACnC,KAAK,EAAE,KAAK,CAAA;IACZ,OAAO,EAAE,QAAQ,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,8BAA8B,GAAG;IACpC,kBAAkB,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAC/C,oBAAoB,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACpD,cAAc,EAAE,SAAS,aAAa,EAAE,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,mBAAmB,4CAK7B,6BAA6B,KAAG,OAAO,CAAC,8BAA8B,CAiDxE,CAAA"}
|
|
@@ -7,7 +7,9 @@ type GetTransactionDetailParameters = {
|
|
|
7
7
|
timestamp?: number;
|
|
8
8
|
internalTransactions?: readonly InternalTransaction[];
|
|
9
9
|
timeout?: number;
|
|
10
|
+
input?: LowerHex;
|
|
11
|
+
value?: bigint;
|
|
10
12
|
};
|
|
11
|
-
export declare const getTransactionDetail: ({ chain, hash, timestamp: optionalTimestamp, internalTransactions, timeout, }: GetTransactionDetailParameters) => Promise<TransactionDetail>;
|
|
13
|
+
export declare const getTransactionDetail: ({ chain, hash, timestamp: optionalTimestamp, internalTransactions, timeout, input, value, }: GetTransactionDetailParameters) => Promise<TransactionDetail>;
|
|
12
14
|
export {};
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../logic/getTransactionDetail/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAGtE,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oBAAoB,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../logic/getTransactionDetail/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAGtE,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oBAAoB,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACrD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,oBAAoB,gGAQ9B,8BAA8B,KAAG,OAAO,CAAC,iBAAiB,CAsD5D,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
declare const transactionIndexSchema: z.ZodObject<Pick<{
|
|
2
|
+
declare const transactionIndexSchema: z.ZodObject<z.objectUtil.extendShape<Pick<{
|
|
3
3
|
blockNumber: z.ZodNumber;
|
|
4
4
|
chainId: z.ZodNumber;
|
|
5
5
|
contractAddress: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${Lowercase<string>}`, string>>;
|
|
@@ -147,14 +147,21 @@ declare const transactionIndexSchema: z.ZodObject<Pick<{
|
|
|
147
147
|
timestamp: z.ZodNumber;
|
|
148
148
|
to: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${Lowercase<string>}`, string>>;
|
|
149
149
|
value: z.ZodEffects<z.ZodString, bigint, string>;
|
|
150
|
-
}, "hash" | "blockNumber" | "timestamp">,
|
|
150
|
+
}, "hash" | "blockNumber" | "timestamp">, {
|
|
151
|
+
input: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${Lowercase<string>}`, string>>;
|
|
152
|
+
value: z.ZodOptional<z.ZodEffects<z.ZodString, bigint, string>>;
|
|
153
|
+
}>, "strip", z.ZodTypeAny, {
|
|
151
154
|
hash: `0x${Lowercase<string>}`;
|
|
152
155
|
blockNumber: number;
|
|
153
156
|
timestamp: number;
|
|
157
|
+
value?: bigint | undefined;
|
|
158
|
+
input?: `0x${Lowercase<string>}` | undefined;
|
|
154
159
|
}, {
|
|
155
160
|
hash: string;
|
|
156
161
|
blockNumber: number;
|
|
157
162
|
timestamp: number;
|
|
163
|
+
value?: string | undefined;
|
|
164
|
+
input?: string | undefined;
|
|
158
165
|
}>;
|
|
159
166
|
export type TransactionIndex = z.infer<typeof transactionIndexSchema>;
|
|
160
167
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionIndex.d.ts","sourceRoot":"","sources":["../../types/transactionIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"transactionIndex.d.ts","sourceRoot":"","sources":["../../types/transactionIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAI5B,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxB,CAAA;AAEJ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LowerHex } from '../../types'
|
|
1
|
+
import type { Erc20Transfer, LowerHex } from '../../types'
|
|
2
2
|
import type { InternalTransactionWithIndex } from '../../types/internalTransaction'
|
|
3
3
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
4
4
|
import { createInternalTransactionId } from '../../utils/createInternalTransactionId'
|
|
@@ -104,29 +104,37 @@ export const createBlockscout = ({
|
|
|
104
104
|
headers,
|
|
105
105
|
}) => {
|
|
106
106
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
107
|
+
const erc20Transfers: Erc20Transfer[] = []
|
|
107
108
|
let startblock = fromBlock
|
|
108
109
|
const endblock = toBlock
|
|
109
110
|
const maxPageSize = 10_000
|
|
110
111
|
while (true) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
const { indexes: resultIndexes, erc20Transfers: resultErc20Transfers } =
|
|
113
|
+
await getTokenTransferEventsByAddress({
|
|
114
|
+
client,
|
|
115
|
+
address,
|
|
116
|
+
startblock,
|
|
117
|
+
endblock,
|
|
118
|
+
headers,
|
|
119
|
+
})
|
|
120
|
+
for (const index of resultIndexes) {
|
|
119
121
|
if (!indexes.has(index.hash)) {
|
|
120
122
|
indexes.set(index.hash, index)
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
|
-
|
|
125
|
+
erc20Transfers.push(...resultErc20Transfers)
|
|
126
|
+
if (resultIndexes.length < maxPageSize) {
|
|
124
127
|
break
|
|
125
128
|
}
|
|
126
|
-
const maxBlockNumber = Math.max(
|
|
129
|
+
const maxBlockNumber = Math.max(
|
|
130
|
+
...resultIndexes.map((x) => x.blockNumber),
|
|
131
|
+
)
|
|
127
132
|
startblock = maxBlockNumber
|
|
128
133
|
}
|
|
129
|
-
return
|
|
134
|
+
return {
|
|
135
|
+
indexes: [...indexes.values()],
|
|
136
|
+
erc20Transfers,
|
|
137
|
+
}
|
|
130
138
|
},
|
|
131
139
|
getBlockNumberOfTimestamp: ({ timestamp, headers }) =>
|
|
132
140
|
getBlockNumberByTimestamp({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import {
|
|
2
|
+
import type { Erc20Transfer } from '../../types'
|
|
3
|
+
import { bigintTextSchema, lowerHexSchema } from '../../types/primitive'
|
|
3
4
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
4
5
|
import type { BlockscoutClient } from './client'
|
|
5
6
|
|
|
@@ -18,6 +19,21 @@ const transferSchema = z.object({
|
|
|
18
19
|
blockNumber: z.string().regex(/^\d+$/).transform(Number),
|
|
19
20
|
hash: lowerHexSchema,
|
|
20
21
|
timeStamp: z.string().regex(/^\d+$/).transform(Number),
|
|
22
|
+
contractAddress: lowerHexSchema,
|
|
23
|
+
from: lowerHexSchema,
|
|
24
|
+
to: lowerHexSchema,
|
|
25
|
+
logIndex: z.string().regex(/^\d+$/).transform(Number),
|
|
26
|
+
tokenDecimal: z
|
|
27
|
+
.union([
|
|
28
|
+
z.literal('').transform(() => undefined),
|
|
29
|
+
z.string().regex(/^\d+$/).transform(Number),
|
|
30
|
+
])
|
|
31
|
+
.nullable()
|
|
32
|
+
.optional(),
|
|
33
|
+
value: z
|
|
34
|
+
.union([z.literal('').transform(() => undefined), bigintTextSchema])
|
|
35
|
+
.nullable()
|
|
36
|
+
.optional(),
|
|
21
37
|
})
|
|
22
38
|
const resultSchema = z.array(transferSchema)
|
|
23
39
|
|
|
@@ -31,9 +47,10 @@ export const getTokenTransferEventsByAddress = async ({
|
|
|
31
47
|
offset = 10_000,
|
|
32
48
|
sort = 'asc',
|
|
33
49
|
headers,
|
|
34
|
-
}: GetTokenTransferEventsByAddressParameters): Promise<
|
|
35
|
-
readonly TransactionIndex[]
|
|
36
|
-
|
|
50
|
+
}: GetTokenTransferEventsByAddressParameters): Promise<{
|
|
51
|
+
indexes: readonly TransactionIndex[]
|
|
52
|
+
erc20Transfers: readonly Erc20Transfer[]
|
|
53
|
+
}> => {
|
|
37
54
|
try {
|
|
38
55
|
const result = await client.get({
|
|
39
56
|
path: '',
|
|
@@ -54,17 +71,42 @@ export const getTokenTransferEventsByAddress = async ({
|
|
|
54
71
|
resultSchema,
|
|
55
72
|
headers,
|
|
56
73
|
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
const indexes: TransactionIndex[] = []
|
|
75
|
+
const transfers: Erc20Transfer[] = []
|
|
76
|
+
for (const data of result) {
|
|
77
|
+
indexes.push({
|
|
78
|
+
blockNumber: data.blockNumber,
|
|
79
|
+
hash: data.hash,
|
|
80
|
+
timestamp: data.timeStamp * 1000,
|
|
81
|
+
})
|
|
82
|
+
if (
|
|
83
|
+
data.tokenDecimal !== null &&
|
|
84
|
+
data.tokenDecimal !== undefined &&
|
|
85
|
+
data.value !== null &&
|
|
86
|
+
data.value !== undefined
|
|
87
|
+
) {
|
|
88
|
+
transfers.push({
|
|
89
|
+
address: data.contractAddress,
|
|
90
|
+
from: data.from,
|
|
91
|
+
logIndex: data.logIndex,
|
|
92
|
+
to: data.to,
|
|
93
|
+
value: data.value,
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
indexes,
|
|
99
|
+
erc20Transfers: transfers,
|
|
100
|
+
}
|
|
62
101
|
} catch (error) {
|
|
63
102
|
if (
|
|
64
103
|
error instanceof Error &&
|
|
65
104
|
error.message === 'No token transfers found'
|
|
66
105
|
) {
|
|
67
|
-
return
|
|
106
|
+
return {
|
|
107
|
+
indexes: [],
|
|
108
|
+
erc20Transfers: [],
|
|
109
|
+
}
|
|
68
110
|
}
|
|
69
111
|
throw error
|
|
70
112
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
2
|
import type { Hex } from '../../types'
|
|
3
|
-
import { lowerHexSchema } from '../../types/primitive'
|
|
3
|
+
import { bigintTextSchema, lowerHexSchema } from '../../types/primitive'
|
|
4
4
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
5
5
|
import type { BlockscoutClient } from './client'
|
|
6
6
|
|
|
@@ -19,6 +19,8 @@ const transactionSchema = z.object({
|
|
|
19
19
|
blockNumber: z.string().regex(/^\d+$/).transform(Number),
|
|
20
20
|
hash: lowerHexSchema,
|
|
21
21
|
timeStamp: z.string().regex(/^\d+$/).transform(Number),
|
|
22
|
+
input: lowerHexSchema,
|
|
23
|
+
value: bigintTextSchema,
|
|
22
24
|
})
|
|
23
25
|
const resultSchema = z.array(transactionSchema)
|
|
24
26
|
|
|
@@ -57,6 +59,8 @@ export const getTransactionsByAddress = async ({
|
|
|
57
59
|
blockNumber: v.blockNumber,
|
|
58
60
|
hash: v.hash,
|
|
59
61
|
timestamp: v.timeStamp * 1000,
|
|
62
|
+
input: v.input,
|
|
63
|
+
value: v.value,
|
|
60
64
|
}))
|
|
61
65
|
} catch (error) {
|
|
62
66
|
if (error instanceof Error && error.message === 'No transactions found') {
|
|
@@ -130,7 +130,12 @@ export const createEtherscanClient = ({
|
|
|
130
130
|
await new Promise((resolve) => setTimeout(resolve, 5000))
|
|
131
131
|
return get({ path, query, resultSchema }, repeat + 1)
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
133
|
+
if (
|
|
134
|
+
error.message.includes('429') ||
|
|
135
|
+
error.message.includes(
|
|
136
|
+
'Unexpected error, timeout or server too busy. Please try again later',
|
|
137
|
+
)
|
|
138
|
+
) {
|
|
134
139
|
console.debug(error)
|
|
135
140
|
await new Promise((resolve) => setTimeout(resolve, 10_000))
|
|
136
141
|
return await get({ path, query, resultSchema }, repeat + 1)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LowerHex } from '../../types'
|
|
1
|
+
import type { Erc20Transfer, LowerHex } from '../../types'
|
|
2
2
|
import type { InternalTransactionWithIndex } from '../../types/internalTransaction'
|
|
3
3
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
4
4
|
import { createInternalTransactionId } from '../../utils/createInternalTransactionId'
|
|
@@ -114,28 +114,33 @@ export const createEtherscan = ({
|
|
|
114
114
|
headers,
|
|
115
115
|
}) => {
|
|
116
116
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
117
|
+
const erc20Transfers: Erc20Transfer[] = []
|
|
117
118
|
const endblock = toBlock
|
|
118
119
|
|
|
119
120
|
// ERC20
|
|
120
121
|
let startblock = fromBlock
|
|
121
122
|
while (true) {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
const { indexes: resultIndexes, erc20Transfers: resultErc20Transfers } =
|
|
124
|
+
await getListOfErc20TokenTransferEventsByAddress({
|
|
125
|
+
client,
|
|
126
|
+
address,
|
|
127
|
+
startblock,
|
|
128
|
+
endblock,
|
|
129
|
+
offset: pageSize,
|
|
130
|
+
headers,
|
|
131
|
+
})
|
|
132
|
+
for (const index of resultIndexes) {
|
|
131
133
|
if (!indexes.has(index.hash)) {
|
|
132
134
|
indexes.set(index.hash, index)
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
|
-
|
|
137
|
+
erc20Transfers.push(...resultErc20Transfers)
|
|
138
|
+
if (resultIndexes.length < pageSize) {
|
|
136
139
|
break
|
|
137
140
|
}
|
|
138
|
-
const maxBlockNumber = Math.max(
|
|
141
|
+
const maxBlockNumber = Math.max(
|
|
142
|
+
...resultIndexes.map((x) => x.blockNumber),
|
|
143
|
+
)
|
|
139
144
|
startblock = maxBlockNumber
|
|
140
145
|
}
|
|
141
146
|
|
|
@@ -185,7 +190,10 @@ export const createEtherscan = ({
|
|
|
185
190
|
startblock = maxBlockNumber
|
|
186
191
|
}
|
|
187
192
|
|
|
188
|
-
return
|
|
193
|
+
return {
|
|
194
|
+
indexes: [...indexes.values()],
|
|
195
|
+
erc20Transfers,
|
|
196
|
+
}
|
|
189
197
|
},
|
|
190
198
|
getBlockNumberOfTimestamp: ({ timestamp, headers }): Promise<number> =>
|
|
191
199
|
getBlockNumberByTimestamp({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import {
|
|
2
|
+
import type { Erc20Transfer } from '../../types'
|
|
3
|
+
import { bigintTextSchema, lowerHexSchema } from '../../types/primitive'
|
|
3
4
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
4
5
|
import type { EtherscanClient } from './client'
|
|
5
6
|
|
|
@@ -18,6 +19,10 @@ const transferSchema = z.object({
|
|
|
18
19
|
blockNumber: z.string().regex(/^\d+$/).transform(Number),
|
|
19
20
|
hash: lowerHexSchema,
|
|
20
21
|
timeStamp: z.string().regex(/^\d+$/).transform(Number),
|
|
22
|
+
contractAddress: lowerHexSchema,
|
|
23
|
+
from: lowerHexSchema,
|
|
24
|
+
to: lowerHexSchema,
|
|
25
|
+
value: bigintTextSchema,
|
|
21
26
|
})
|
|
22
27
|
const resultSchema = z.array(transferSchema)
|
|
23
28
|
|
|
@@ -31,9 +36,10 @@ export const getListOfErc20TokenTransferEventsByAddress = async ({
|
|
|
31
36
|
offset = 10_000,
|
|
32
37
|
sort = 'asc',
|
|
33
38
|
headers,
|
|
34
|
-
}: GetListOfErc20TokenTransferEventsByAddressParameters): Promise<
|
|
35
|
-
TransactionIndex[]
|
|
36
|
-
|
|
39
|
+
}: GetListOfErc20TokenTransferEventsByAddressParameters): Promise<{
|
|
40
|
+
indexes: readonly TransactionIndex[]
|
|
41
|
+
erc20Transfers: readonly Erc20Transfer[]
|
|
42
|
+
}> => {
|
|
37
43
|
try {
|
|
38
44
|
const result = await client.get({
|
|
39
45
|
path: '',
|
|
@@ -54,14 +60,32 @@ export const getListOfErc20TokenTransferEventsByAddress = async ({
|
|
|
54
60
|
resultSchema,
|
|
55
61
|
headers,
|
|
56
62
|
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
const indexes: TransactionIndex[] = []
|
|
64
|
+
const transfers: Erc20Transfer[] = []
|
|
65
|
+
for (const data of result) {
|
|
66
|
+
indexes.push({
|
|
67
|
+
blockNumber: data.blockNumber,
|
|
68
|
+
hash: data.hash,
|
|
69
|
+
timestamp: data.timeStamp * 1000,
|
|
70
|
+
})
|
|
71
|
+
transfers.push({
|
|
72
|
+
address: data.contractAddress,
|
|
73
|
+
from: data.from,
|
|
74
|
+
logIndex: 0,
|
|
75
|
+
to: data.to,
|
|
76
|
+
value: data.value,
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
indexes,
|
|
81
|
+
erc20Transfers: transfers,
|
|
82
|
+
}
|
|
62
83
|
} catch (error) {
|
|
63
84
|
if (error instanceof Error && error.message === 'No transactions found') {
|
|
64
|
-
return
|
|
85
|
+
return {
|
|
86
|
+
indexes: [],
|
|
87
|
+
erc20Transfers: [],
|
|
88
|
+
}
|
|
65
89
|
}
|
|
66
90
|
throw error
|
|
67
91
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
2
|
import type { Hex } from '../../types'
|
|
3
|
-
import { lowerHexSchema } from '../../types/primitive'
|
|
3
|
+
import { bigintTextSchema, lowerHexSchema } from '../../types/primitive'
|
|
4
4
|
import type { TransactionIndex } from '../../types/transactionIndex'
|
|
5
5
|
import type { EtherscanClient } from './client'
|
|
6
6
|
|
|
@@ -19,6 +19,8 @@ const transactionSchema = z.object({
|
|
|
19
19
|
blockNumber: z.string().regex(/^\d+$/).transform(Number),
|
|
20
20
|
hash: lowerHexSchema,
|
|
21
21
|
timeStamp: z.string().regex(/^\d+$/).transform(Number),
|
|
22
|
+
input: lowerHexSchema,
|
|
23
|
+
value: bigintTextSchema,
|
|
22
24
|
})
|
|
23
25
|
const resultSchema = z.array(transactionSchema)
|
|
24
26
|
|
|
@@ -59,6 +61,8 @@ export const getListOfNormalTransactionsByAddress = async ({
|
|
|
59
61
|
blockNumber: v.blockNumber,
|
|
60
62
|
hash: v.hash,
|
|
61
63
|
timestamp: v.timeStamp * 1000,
|
|
64
|
+
input: v.input,
|
|
65
|
+
value: v.value,
|
|
62
66
|
}))
|
|
63
67
|
} catch (error) {
|
|
64
68
|
if (error instanceof Error && error.message === 'No transactions found') {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type Erc20Transfer,
|
|
2
3
|
type InternalTransactionWithIndex,
|
|
3
4
|
type LowerHex,
|
|
4
5
|
type TransactionIndex,
|
|
@@ -123,6 +124,7 @@ export const createMoralisExplorer = ({
|
|
|
123
124
|
hash: transaction.hash,
|
|
124
125
|
blockNumber: transaction.block_number,
|
|
125
126
|
timestamp: transaction.block_timestamp,
|
|
127
|
+
value: transaction.value,
|
|
126
128
|
}
|
|
127
129
|
indexes.set(data.hash, data)
|
|
128
130
|
}
|
|
@@ -140,9 +142,10 @@ export const createMoralisExplorer = ({
|
|
|
140
142
|
fromBlock,
|
|
141
143
|
toBlock,
|
|
142
144
|
headers,
|
|
143
|
-
})
|
|
145
|
+
}) => {
|
|
144
146
|
const lowerAddress = toLowerHex(address)
|
|
145
147
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
148
|
+
const erc20Transfers: Erc20Transfer[] = []
|
|
146
149
|
|
|
147
150
|
let count = 0
|
|
148
151
|
let cursor: string | undefined = undefined
|
|
@@ -165,9 +168,20 @@ export const createMoralisExplorer = ({
|
|
|
165
168
|
hash: transaction.hash,
|
|
166
169
|
blockNumber: transaction.block_number,
|
|
167
170
|
timestamp: transaction.block_timestamp,
|
|
171
|
+
value: transaction.value,
|
|
168
172
|
}
|
|
169
173
|
indexes.set(data.hash, data)
|
|
170
174
|
}
|
|
175
|
+
|
|
176
|
+
for (const transfer of transaction.erc20_transfers) {
|
|
177
|
+
erc20Transfers.push({
|
|
178
|
+
address: transfer.address,
|
|
179
|
+
from: transfer.from_address,
|
|
180
|
+
logIndex: transfer.log_index,
|
|
181
|
+
to: transfer.to_address,
|
|
182
|
+
value: transfer.value,
|
|
183
|
+
})
|
|
184
|
+
}
|
|
171
185
|
}
|
|
172
186
|
|
|
173
187
|
if (result.result.length < limit) {
|
|
@@ -175,7 +189,10 @@ export const createMoralisExplorer = ({
|
|
|
175
189
|
}
|
|
176
190
|
}
|
|
177
191
|
|
|
178
|
-
return
|
|
192
|
+
return {
|
|
193
|
+
indexes: [...indexes.values()],
|
|
194
|
+
erc20Transfers,
|
|
195
|
+
}
|
|
179
196
|
},
|
|
180
197
|
getBlockNumberOfTimestamp: (): Promise<number> => {
|
|
181
198
|
throw new Error('Function not implemented.')
|
|
@@ -80,7 +80,9 @@ const transactionSchema = z.object({
|
|
|
80
80
|
to_address: lowerHexSchema,
|
|
81
81
|
// "to_address_label": null,
|
|
82
82
|
// "address": "0xc99a6a985ed2cac1ef41640596c5a5f9f4e19ef5",
|
|
83
|
+
address: lowerHexSchema,
|
|
83
84
|
// "log_index": 37,
|
|
85
|
+
log_index: z.number().int(),
|
|
84
86
|
// "value": "6851147569444444",
|
|
85
87
|
value: bigintTextSchema,
|
|
86
88
|
// "possible_spam": false,
|
package/explorer/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Hex, LowerHex } from '../types'
|
|
1
|
+
import type { Erc20Transfer, Hex, LowerHex } from '../types'
|
|
2
2
|
import type { InternalTransactionWithIndex } from '../types/internalTransaction'
|
|
3
3
|
import type { Log } from '../types/log'
|
|
4
4
|
import type { TransactionIndex } from '../types/transactionIndex'
|
|
@@ -50,7 +50,10 @@ type FunctionGetAddressTokenTransferIndexes = (parameters: {
|
|
|
50
50
|
fromBlock?: number
|
|
51
51
|
toBlock?: number
|
|
52
52
|
headers?: Record<string, string>
|
|
53
|
-
}) => Promise<
|
|
53
|
+
}) => Promise<{
|
|
54
|
+
indexes: TransactionIndex[]
|
|
55
|
+
erc20Transfers: Erc20Transfer[]
|
|
56
|
+
}>
|
|
54
57
|
|
|
55
58
|
type FunctionGetBlockNumberOfTimestamp = (parameters: {
|
|
56
59
|
/** Unix timestamp in milliseconds */
|
|
@@ -40,6 +40,10 @@ const chainIdValueSchema = z.object({
|
|
|
40
40
|
type: z.literal('chain-id'),
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
+
const txHashValueSchema = z.object({
|
|
44
|
+
type: z.literal('tx-hash'),
|
|
45
|
+
})
|
|
46
|
+
|
|
43
47
|
const fromValueSchema = z.object({
|
|
44
48
|
type: z.literal('from'),
|
|
45
49
|
})
|
|
@@ -141,6 +145,7 @@ const erc1155ValueSchema = z.object({
|
|
|
141
145
|
export const simpleValueSchema = z.union([
|
|
142
146
|
z.string(),
|
|
143
147
|
chainIdValueSchema,
|
|
148
|
+
txHashValueSchema,
|
|
144
149
|
fromValueSchema,
|
|
145
150
|
toValueSchema,
|
|
146
151
|
valueValueSchema,
|
|
@@ -167,6 +167,7 @@ export const verifyTxSatisfiesCondition = ({
|
|
|
167
167
|
case 'slice':
|
|
168
168
|
case 'join':
|
|
169
169
|
case 'chain-id':
|
|
170
|
+
case 'tx-hash':
|
|
170
171
|
case 'log':
|
|
171
172
|
case 'erc20':
|
|
172
173
|
case 'erc721':
|
|
@@ -409,6 +410,7 @@ const verifyLogsSatisfiesExactCondition = ({
|
|
|
409
410
|
case 'join':
|
|
410
411
|
case 'slice':
|
|
411
412
|
case 'chain-id':
|
|
413
|
+
case 'tx-hash':
|
|
412
414
|
case 'log':
|
|
413
415
|
case 'erc20':
|
|
414
416
|
case 'erc721':
|
|
@@ -520,6 +522,7 @@ const verifyLogsSatisfiesSomeCondition = ({
|
|
|
520
522
|
case 'join':
|
|
521
523
|
case 'slice':
|
|
522
524
|
case 'chain-id':
|
|
525
|
+
case 'tx-hash':
|
|
523
526
|
case 'log':
|
|
524
527
|
case 'erc20':
|
|
525
528
|
case 'erc721':
|