@0xtorch/evm 0.0.32 → 0.0.33

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.
Files changed (195) hide show
  1. package/_cjs/decoder/decode.js +1 -0
  2. package/_cjs/decoder/decode.js.map +1 -1
  3. package/_cjs/index.js +1 -7
  4. package/_cjs/index.js.map +1 -1
  5. package/_esm/decoder/decode.js +1 -0
  6. package/_esm/decoder/decode.js.map +1 -1
  7. package/_esm/index.js +0 -2
  8. package/_esm/index.js.map +1 -1
  9. package/_types/chains/definitions/arbitrumOne.d.ts +1 -0
  10. package/_types/chains/definitions/arbitrumOne.d.ts.map +1 -1
  11. package/_types/chains/definitions/astar.d.ts +1 -0
  12. package/_types/chains/definitions/astar.d.ts.map +1 -1
  13. package/_types/chains/definitions/avalancheC.d.ts +1 -0
  14. package/_types/chains/definitions/avalancheC.d.ts.map +1 -1
  15. package/_types/chains/definitions/base.d.ts +1 -0
  16. package/_types/chains/definitions/base.d.ts.map +1 -1
  17. package/_types/chains/definitions/bsc.d.ts +1 -0
  18. package/_types/chains/definitions/bsc.d.ts.map +1 -1
  19. package/_types/chains/definitions/ethereum.d.ts +1 -0
  20. package/_types/chains/definitions/ethereum.d.ts.map +1 -1
  21. package/_types/chains/definitions/fantom.d.ts +1 -0
  22. package/_types/chains/definitions/fantom.d.ts.map +1 -1
  23. package/_types/chains/definitions/linea.d.ts +1 -0
  24. package/_types/chains/definitions/linea.d.ts.map +1 -1
  25. package/_types/chains/definitions/mantle.d.ts +1 -0
  26. package/_types/chains/definitions/mantle.d.ts.map +1 -1
  27. package/_types/chains/definitions/metis.d.ts +1 -0
  28. package/_types/chains/definitions/metis.d.ts.map +1 -1
  29. package/_types/chains/definitions/moonbeam.d.ts +1 -0
  30. package/_types/chains/definitions/moonbeam.d.ts.map +1 -1
  31. package/_types/chains/definitions/moonriver.d.ts +1 -0
  32. package/_types/chains/definitions/moonriver.d.ts.map +1 -1
  33. package/_types/chains/definitions/oasys.d.ts +1 -0
  34. package/_types/chains/definitions/oasys.d.ts.map +1 -1
  35. package/_types/chains/definitions/optimism.d.ts +1 -0
  36. package/_types/chains/definitions/optimism.d.ts.map +1 -1
  37. package/_types/chains/definitions/polygonPos.d.ts +1 -0
  38. package/_types/chains/definitions/polygonPos.d.ts.map +1 -1
  39. package/_types/chains/definitions/ronin.d.ts +1 -0
  40. package/_types/chains/definitions/ronin.d.ts.map +1 -1
  41. package/_types/decoder/tests.d.ts +1 -0
  42. package/_types/decoder/tests.d.ts.map +1 -1
  43. package/_types/explorers/definitions/blockscout.d.ts +4 -0
  44. package/_types/explorers/definitions/blockscout.d.ts.map +1 -1
  45. package/_types/explorers/definitions/etherscan.d.ts +4 -0
  46. package/_types/explorers/definitions/etherscan.d.ts.map +1 -1
  47. package/_types/explorers/definitions/roninExplorer.d.ts +4 -0
  48. package/_types/explorers/definitions/roninExplorer.d.ts.map +1 -1
  49. package/_types/index.d.ts +0 -2
  50. package/_types/index.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/_cjs/getAccountsTransactionFulls/getAccountsTransactionFulls.js +0 -22
  53. package/_cjs/getAccountsTransactionFulls/getAccountsTransactionFulls.js.map +0 -1
  54. package/_cjs/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.js +0 -52
  55. package/_cjs/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.js.map +0 -1
  56. package/_cjs/getAccountsTransactionFulls/getDecodedTransactionsPrices.js +0 -55
  57. package/_cjs/getAccountsTransactionFulls/getDecodedTransactionsPrices.js.map +0 -1
  58. package/_cjs/getAccountsTransactionFulls/getHashesAndInternalTxs.js +0 -49
  59. package/_cjs/getAccountsTransactionFulls/getHashesAndInternalTxs.js.map +0 -1
  60. package/_cjs/getAccountsTransactionFulls/getTransactionDetails.js +0 -28
  61. package/_cjs/getAccountsTransactionFulls/getTransactionDetails.js.map +0 -1
  62. package/_cjs/getAccountsTransactionFulls/getTransactionsApps.js +0 -24
  63. package/_cjs/getAccountsTransactionFulls/getTransactionsApps.js.map +0 -1
  64. package/_cjs/getAccountsTransactionFulls/index.js +0 -8
  65. package/_cjs/getAccountsTransactionFulls/index.js.map +0 -1
  66. package/_cjs/getAccountsTransactionFulls/types.js +0 -3
  67. package/_cjs/getAccountsTransactionFulls/types.js.map +0 -1
  68. package/_cjs/getAccountsTransactionFulls/withD.js +0 -41
  69. package/_cjs/getAccountsTransactionFulls/withD.js.map +0 -1
  70. package/_cjs/getAccountsTransactionFulls/withDA.js +0 -59
  71. package/_cjs/getAccountsTransactionFulls/withDA.js.map +0 -1
  72. package/_cjs/getAccountsTransactionFulls/withP.js +0 -61
  73. package/_cjs/getAccountsTransactionFulls/withP.js.map +0 -1
  74. package/_cjs/getAccountsTransactionFulls/withPD.js +0 -73
  75. package/_cjs/getAccountsTransactionFulls/withPD.js.map +0 -1
  76. package/_cjs/getAccountsTransactionFulls/withPDA.js +0 -89
  77. package/_cjs/getAccountsTransactionFulls/withPDA.js.map +0 -1
  78. package/_cjs/getAccountsTransactionFulls/withUndefined.js +0 -46
  79. package/_cjs/getAccountsTransactionFulls/withUndefined.js.map +0 -1
  80. package/_cjs/getTransactionFull/getTransactionFull.js +0 -18
  81. package/_cjs/getTransactionFull/getTransactionFull.js.map +0 -1
  82. package/_cjs/getTransactionFull/getTransactionFullCustom.js +0 -52
  83. package/_cjs/getTransactionFull/getTransactionFullCustom.js.map +0 -1
  84. package/_cjs/getTransactionFull/index.js +0 -8
  85. package/_cjs/getTransactionFull/index.js.map +0 -1
  86. package/_cjs/getTransactionFull/types.js +0 -3
  87. package/_cjs/getTransactionFull/types.js.map +0 -1
  88. package/_cjs/getTransactionFull/withD.js +0 -34
  89. package/_cjs/getTransactionFull/withD.js.map +0 -1
  90. package/_cjs/getTransactionFull/withDA.js +0 -48
  91. package/_cjs/getTransactionFull/withDA.js.map +0 -1
  92. package/_cjs/getTransactionFull/withP.js +0 -46
  93. package/_cjs/getTransactionFull/withP.js.map +0 -1
  94. package/_cjs/getTransactionFull/withPD.js +0 -78
  95. package/_cjs/getTransactionFull/withPD.js.map +0 -1
  96. package/_cjs/getTransactionFull/withPDA.js +0 -92
  97. package/_cjs/getTransactionFull/withPDA.js.map +0 -1
  98. package/_cjs/getTransactionFull/withUndefined.js +0 -29
  99. package/_cjs/getTransactionFull/withUndefined.js.map +0 -1
  100. package/_esm/getAccountsTransactionFulls/getAccountsTransactionFulls.js +0 -18
  101. package/_esm/getAccountsTransactionFulls/getAccountsTransactionFulls.js.map +0 -1
  102. package/_esm/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.js +0 -48
  103. package/_esm/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.js.map +0 -1
  104. package/_esm/getAccountsTransactionFulls/getDecodedTransactionsPrices.js +0 -55
  105. package/_esm/getAccountsTransactionFulls/getDecodedTransactionsPrices.js.map +0 -1
  106. package/_esm/getAccountsTransactionFulls/getHashesAndInternalTxs.js +0 -45
  107. package/_esm/getAccountsTransactionFulls/getHashesAndInternalTxs.js.map +0 -1
  108. package/_esm/getAccountsTransactionFulls/getTransactionDetails.js +0 -24
  109. package/_esm/getAccountsTransactionFulls/getTransactionDetails.js.map +0 -1
  110. package/_esm/getAccountsTransactionFulls/getTransactionsApps.js +0 -21
  111. package/_esm/getAccountsTransactionFulls/getTransactionsApps.js.map +0 -1
  112. package/_esm/getAccountsTransactionFulls/index.js +0 -3
  113. package/_esm/getAccountsTransactionFulls/index.js.map +0 -1
  114. package/_esm/getAccountsTransactionFulls/types.js +0 -2
  115. package/_esm/getAccountsTransactionFulls/types.js.map +0 -1
  116. package/_esm/getAccountsTransactionFulls/withD.js +0 -41
  117. package/_esm/getAccountsTransactionFulls/withD.js.map +0 -1
  118. package/_esm/getAccountsTransactionFulls/withDA.js +0 -60
  119. package/_esm/getAccountsTransactionFulls/withDA.js.map +0 -1
  120. package/_esm/getAccountsTransactionFulls/withP.js +0 -62
  121. package/_esm/getAccountsTransactionFulls/withP.js.map +0 -1
  122. package/_esm/getAccountsTransactionFulls/withPD.js +0 -74
  123. package/_esm/getAccountsTransactionFulls/withPD.js.map +0 -1
  124. package/_esm/getAccountsTransactionFulls/withPDA.js +0 -91
  125. package/_esm/getAccountsTransactionFulls/withPDA.js.map +0 -1
  126. package/_esm/getAccountsTransactionFulls/withUndefined.js +0 -45
  127. package/_esm/getAccountsTransactionFulls/withUndefined.js.map +0 -1
  128. package/_esm/getTransactionFull/getTransactionFull.js +0 -14
  129. package/_esm/getTransactionFull/getTransactionFull.js.map +0 -1
  130. package/_esm/getTransactionFull/getTransactionFullCustom.js +0 -48
  131. package/_esm/getTransactionFull/getTransactionFullCustom.js.map +0 -1
  132. package/_esm/getTransactionFull/index.js +0 -3
  133. package/_esm/getTransactionFull/index.js.map +0 -1
  134. package/_esm/getTransactionFull/types.js +0 -2
  135. package/_esm/getTransactionFull/types.js.map +0 -1
  136. package/_esm/getTransactionFull/withD.js +0 -33
  137. package/_esm/getTransactionFull/withD.js.map +0 -1
  138. package/_esm/getTransactionFull/withDA.js +0 -48
  139. package/_esm/getTransactionFull/withDA.js.map +0 -1
  140. package/_esm/getTransactionFull/withP.js +0 -45
  141. package/_esm/getTransactionFull/withP.js.map +0 -1
  142. package/_esm/getTransactionFull/withPD.js +0 -78
  143. package/_esm/getTransactionFull/withPD.js.map +0 -1
  144. package/_esm/getTransactionFull/withPDA.js +0 -94
  145. package/_esm/getTransactionFull/withPDA.js.map +0 -1
  146. package/_esm/getTransactionFull/withUndefined.js +0 -25
  147. package/_esm/getTransactionFull/withUndefined.js.map +0 -1
  148. package/_types/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts +0 -23
  149. package/_types/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts.map +0 -1
  150. package/_types/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.d.ts +0 -4
  151. package/_types/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.d.ts.map +0 -1
  152. package/_types/getAccountsTransactionFulls/getDecodedTransactionsPrices.d.ts +0 -5
  153. package/_types/getAccountsTransactionFulls/getDecodedTransactionsPrices.d.ts.map +0 -1
  154. package/_types/getAccountsTransactionFulls/getHashesAndInternalTxs.d.ts +0 -8
  155. package/_types/getAccountsTransactionFulls/getHashesAndInternalTxs.d.ts.map +0 -1
  156. package/_types/getAccountsTransactionFulls/getTransactionDetails.d.ts +0 -5
  157. package/_types/getAccountsTransactionFulls/getTransactionDetails.d.ts.map +0 -1
  158. package/_types/getAccountsTransactionFulls/getTransactionsApps.d.ts +0 -8
  159. package/_types/getAccountsTransactionFulls/getTransactionsApps.d.ts.map +0 -1
  160. package/_types/getAccountsTransactionFulls/index.d.ts +0 -3
  161. package/_types/getAccountsTransactionFulls/index.d.ts.map +0 -1
  162. package/_types/getAccountsTransactionFulls/types.d.ts +0 -87
  163. package/_types/getAccountsTransactionFulls/types.d.ts.map +0 -1
  164. package/_types/getAccountsTransactionFulls/withD.d.ts +0 -4
  165. package/_types/getAccountsTransactionFulls/withD.d.ts.map +0 -1
  166. package/_types/getAccountsTransactionFulls/withDA.d.ts +0 -4
  167. package/_types/getAccountsTransactionFulls/withDA.d.ts.map +0 -1
  168. package/_types/getAccountsTransactionFulls/withP.d.ts +0 -4
  169. package/_types/getAccountsTransactionFulls/withP.d.ts.map +0 -1
  170. package/_types/getAccountsTransactionFulls/withPD.d.ts +0 -4
  171. package/_types/getAccountsTransactionFulls/withPD.d.ts.map +0 -1
  172. package/_types/getAccountsTransactionFulls/withPDA.d.ts +0 -4
  173. package/_types/getAccountsTransactionFulls/withPDA.d.ts.map +0 -1
  174. package/_types/getAccountsTransactionFulls/withUndefined.d.ts +0 -4
  175. package/_types/getAccountsTransactionFulls/withUndefined.d.ts.map +0 -1
  176. package/_types/getTransactionFull/getTransactionFull.d.ts +0 -19
  177. package/_types/getTransactionFull/getTransactionFull.d.ts.map +0 -1
  178. package/_types/getTransactionFull/getTransactionFullCustom.d.ts +0 -4
  179. package/_types/getTransactionFull/getTransactionFullCustom.d.ts.map +0 -1
  180. package/_types/getTransactionFull/index.d.ts +0 -3
  181. package/_types/getTransactionFull/index.d.ts.map +0 -1
  182. package/_types/getTransactionFull/types.d.ts +0 -63
  183. package/_types/getTransactionFull/types.d.ts.map +0 -1
  184. package/_types/getTransactionFull/withD.d.ts +0 -4
  185. package/_types/getTransactionFull/withD.d.ts.map +0 -1
  186. package/_types/getTransactionFull/withDA.d.ts +0 -4
  187. package/_types/getTransactionFull/withDA.d.ts.map +0 -1
  188. package/_types/getTransactionFull/withP.d.ts +0 -4
  189. package/_types/getTransactionFull/withP.d.ts.map +0 -1
  190. package/_types/getTransactionFull/withPD.d.ts +0 -4
  191. package/_types/getTransactionFull/withPD.d.ts.map +0 -1
  192. package/_types/getTransactionFull/withPDA.d.ts +0 -4
  193. package/_types/getTransactionFull/withPDA.d.ts.map +0 -1
  194. package/_types/getTransactionFull/withUndefined.d.ts +0 -4
  195. package/_types/getTransactionFull/withUndefined.d.ts.map +0 -1
@@ -1,18 +0,0 @@
1
- import { coingeckoCryptoCurrencyDataSource, usd } from '@0xtorch/core';
2
- import { analyzer } from '../analyzer';
3
- import { decoder } from '../decoder';
4
- import { getAccountsTransactionFullsCustom } from './getAccountsTransactionFullsCustom';
5
- export const getAccountsTransactionFulls = async ({ chain, addresses, fromBlock, toBlock, fiat = usd, onFetchHashes, onFetchTransaction, }, config) => await getAccountsTransactionFullsCustom({
6
- chain,
7
- addresses,
8
- fromBlock,
9
- toBlock,
10
- appDataSource: undefined,
11
- priceDataSource: coingeckoCryptoCurrencyDataSource,
12
- fiat,
13
- decoder,
14
- analyzer,
15
- onFetchHashes,
16
- onFetchTransaction,
17
- }, config);
18
- //# sourceMappingURL=getAccountsTransactionFulls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAccountsTransactionFulls.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getAccountsTransactionFulls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAA;AAYvF,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAC9C,EACE,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,GAAG,GAAG,EACV,aAAa,EACb,kBAAkB,GACoB,EACxC,MAAe,EACf,EAAE,CACF,MAAM,iCAAiC,CACrC;IACE,KAAK;IACL,SAAS;IACT,SAAS;IACT,OAAO;IACP,aAAa,EAAE,SAAS;IACxB,eAAe,EAAE,iCAAiC;IAClD,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,aAAa;IACb,kBAAkB;CACnB,EACD,MAAM,CACP,CAAA"}
@@ -1,48 +0,0 @@
1
- import { getAccountsTransactionFullsCustomWithD } from './withD';
2
- import { getAccountsTransactionFullsCustomWithDA } from './withDA';
3
- import { getAccountsTransactionFullsCustomWithP } from './withP';
4
- import { getAccountsTransactionFullsCustomWithPD } from './withPD';
5
- import { getAccountsTransactionFullsCustomWithPDA } from './withPDA';
6
- import { getAccountsTransactionFullsCustomWithAllUndefined } from './withUndefined';
7
- export const getAccountsTransactionFullsCustom = async (parameters, config) => {
8
- if (isParametersAllUndefined(parameters)) {
9
- const data = await getAccountsTransactionFullsCustomWithAllUndefined(parameters, config);
10
- return data;
11
- }
12
- if (isParametersP(parameters)) {
13
- const data = await getAccountsTransactionFullsCustomWithP(parameters, config);
14
- return data;
15
- }
16
- if (isParametersPD(parameters)) {
17
- const data = await getAccountsTransactionFullsCustomWithPD(parameters, config);
18
- return data;
19
- }
20
- if (isParametersPDA(parameters)) {
21
- const data = await getAccountsTransactionFullsCustomWithPDA(parameters, config);
22
- return data;
23
- }
24
- if (isParametersD(parameters)) {
25
- const data = await getAccountsTransactionFullsCustomWithD(parameters, config);
26
- return data;
27
- }
28
- if (isParametersDA(parameters)) {
29
- const data = await getAccountsTransactionFullsCustomWithDA(parameters, config);
30
- return data;
31
- }
32
- throw new Error('not implemented');
33
- };
34
- const isParametersAllUndefined = (parameters) => parameters.priceDataSource === undefined && parameters.decoder === undefined;
35
- const isParametersP = (parameters) => parameters.priceDataSource !== undefined && parameters.decoder === undefined;
36
- const isParametersPD = (parameters) => parameters.priceDataSource !== undefined &&
37
- parameters.decoder !== undefined &&
38
- parameters.analyzer === undefined;
39
- const isParametersPDA = (parameters) => parameters.priceDataSource !== undefined &&
40
- parameters.decoder !== undefined &&
41
- parameters.analyzer !== undefined;
42
- const isParametersD = (parameters) => parameters.priceDataSource === undefined &&
43
- parameters.decoder !== undefined &&
44
- parameters.analyzer === undefined;
45
- const isParametersDA = (parameters) => parameters.priceDataSource === undefined &&
46
- parameters.decoder !== undefined &&
47
- parameters.analyzer !== undefined;
48
- //# sourceMappingURL=getAccountsTransactionFullsCustom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAccountsTransactionFullsCustom.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getAccountsTransactionFullsCustom.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,sCAAsC,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAClE,OAAO,EAAE,sCAAsC,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,iDAAiD,EAAE,MAAM,iBAAiB,CAAA;AAEnF,MAAM,CAAC,MAAM,iCAAiC,GAAG,KAAK,EAGpD,UAAa,EACb,MAAe,EAC0C,EAAE;IAC3D,IAAI,wBAAwB,CAAC,UAAU,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,MAAM,iDAAiD,CAClE,UAAU,EACV,MAAM,CACP,CAAA;QACD,OAAO,IAAs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,CAAC,OAAO,KAAK,SAAS;IAChC,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAA;AAEnC,MAAM,eAAe,GAAG,CACtB,UAAuD,EACO,EAAE,CAChE,UAAU,CAAC,eAAe,KAAK,SAAS;IACxC,UAAU,CAAC,OAAO,KAAK,SAAS;IAChC,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAA;AAEnC,MAAM,aAAa,GAAG,CACpB,UAAuD,EACK,EAAE,CAC9D,UAAU,CAAC,eAAe,KAAK,SAAS;IACxC,UAAU,CAAC,OAAO,KAAK,SAAS;IAChC,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAA;AAEnC,MAAM,cAAc,GAAG,CACrB,UAAuD,EACM,EAAE,CAC/D,UAAU,CAAC,eAAe,KAAK,SAAS;IACxC,UAAU,CAAC,OAAO,KAAK,SAAS;IAChC,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAA"}
@@ -1,55 +0,0 @@
1
- export const getDecodedTransactionsPrices = async (chain, priceDataSource, fiat, transactions, config) => {
2
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
3
- // create currency timestamp range
4
- const mut_currencyTimestamps = [];
5
- for (const transaction of transactions) {
6
- const timestampMs = Number(transaction.block.timestamp) * 1000;
7
- // native token currency
8
- const mut_nativeCurrency = mut_currencyTimestamps.find(({ currency }) => currency.id === chain.nativeToken.currency.id);
9
- if (mut_nativeCurrency === undefined) {
10
- mut_currencyTimestamps.push({
11
- currency: chain.nativeToken.currency,
12
- minTimestamp: timestampMs,
13
- maxTimestamp: timestampMs,
14
- });
15
- }
16
- else {
17
- mut_nativeCurrency.minTimestamp = Math.min(mut_nativeCurrency.minTimestamp, timestampMs);
18
- mut_nativeCurrency.maxTimestamp = Math.max(mut_nativeCurrency.maxTimestamp, timestampMs);
19
- }
20
- // erc20 token currency
21
- for (const { token } of transaction.erc20Transfers) {
22
- if (token.currency.market.coingeckoId === undefined) {
23
- continue;
24
- }
25
- const mut_currency = mut_currencyTimestamps.find(({ currency }) => currency.id === token.currency.id);
26
- if (mut_currency === undefined) {
27
- mut_currencyTimestamps.push({
28
- currency: token.currency,
29
- minTimestamp: timestampMs,
30
- maxTimestamp: timestampMs,
31
- });
32
- }
33
- else {
34
- mut_currency.minTimestamp = Math.min(mut_currency.minTimestamp, timestampMs);
35
- mut_currency.maxTimestamp = Math.max(mut_currency.maxTimestamp, timestampMs);
36
- }
37
- }
38
- }
39
- // get token price
40
- const mut_prices = [];
41
- for (const currencyTimestamp of mut_currencyTimestamps) {
42
- const prices = await priceDataSource.getHistoricalPrices({
43
- targetCurrencies: [currencyTimestamp.currency],
44
- vsCurrency: fiat,
45
- from: currencyTimestamp.minTimestamp - 1000 * 60 * 60,
46
- to: currencyTimestamp.maxTimestamp + 1000 * 60 * 60,
47
- }, {
48
- timeout: timeoutTimestamp - Date.now(),
49
- logger: config?.logger,
50
- });
51
- mut_prices.push(...prices);
52
- }
53
- return mut_prices;
54
- };
55
- //# sourceMappingURL=getDecodedTransactionsPrices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDecodedTransactionsPrices.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getDecodedTransactionsPrices.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,KAAY,EACZ,eAAyC,EACzC,IAAkB,EAClB,YAAsD,EACtD,MAAe,EAC0B,EAAE;IAC3C,MAAM,gBAAgB,GACpB,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAExE,kCAAkC;IAClC,MAAM,sBAAsB,GAItB,EAAE,CAAA;IACR,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAA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IAAI,CAAC,GAAG,CAClC,YAAY,CAAC,YAAY,EACzB,WAAW,CACZ,CAAA;gBACD,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAClC,YAAY,CAAC,YAAY,EACzB,WAAW,CACZ,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,kBAAkB;IAClB,MAAM,UAAU,GAA0B,EAAE,CAAA;IAC5C,KAAK,MAAM,iBAAiB,IAAI,sBAAsB,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,mBAAmB,CACtD;YACE,gBAAgB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC;YAC9C,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,iBAAiB,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;YACrD,EAAE,EAAE,iBAAiB,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;SACpD,EACD;YACE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE;YACtC,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CACF,CAAA;QACD,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
@@ -1,45 +0,0 @@
1
- import { checkTimeout } from '../utils';
2
- export const getHashesAndInternalTxs = async (chain, addresses, fromBlock, toBlock, config) => {
3
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
4
- const mut_internalTransactions = [];
5
- const hashSet = new Set();
6
- for (const address of addresses) {
7
- const normalTxHashes = await chain.explorer.getAddressTransactionHashes({
8
- address,
9
- startBlock: fromBlock,
10
- endBlock: toBlock,
11
- logger: config?.logger,
12
- });
13
- checkTimeout(timeoutTimestamp);
14
- for (const hash of normalTxHashes) {
15
- hashSet.add(hash);
16
- }
17
- const transferTxHashes = await chain.explorer.getAddressTokenTransferHashes({
18
- address,
19
- startBlock: fromBlock,
20
- endBlock: toBlock,
21
- logger: config?.logger,
22
- });
23
- checkTimeout(timeoutTimestamp);
24
- for (const hash of transferTxHashes) {
25
- hashSet.add(hash);
26
- }
27
- const internalTransactions = await chain.explorer.getAddressInternalTransactions({
28
- address,
29
- startBlock: fromBlock,
30
- endBlock: toBlock,
31
- nativeCurrency: chain.nativeToken.currency,
32
- logger: config?.logger,
33
- });
34
- checkTimeout(timeoutTimestamp);
35
- for (const internalTransaction of internalTransactions) {
36
- mut_internalTransactions.push(internalTransaction);
37
- hashSet.add(internalTransaction.transactionHash);
38
- }
39
- }
40
- return {
41
- hashes: [...hashSet],
42
- internalTransactions: mut_internalTransactions,
43
- };
44
- };
45
- //# sourceMappingURL=getHashesAndInternalTxs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getHashesAndInternalTxs.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getHashesAndInternalTxs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,KAAY,EACZ,SAA8B,EAC9B,SAAiB,EACjB,OAAe,EACf,MAAe,EAId,EAAE;IACH,MAAM,gBAAgB,GACpB,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAExE,MAAM,wBAAwB,GAAqC,EAAE,CAAA;IACrE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAO,CAAA;IAC9B,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YACtE,OAAO;YACP,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CAAC,CAAA;QACF,YAAY,CAAC,gBAAgB,CAAC,CAAA;QAE9B,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACnB,CAAC;QACD,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,6BAA6B,CACzE;YACE,OAAO;YACP,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CACF,CAAA;QACD,YAAY,CAAC,gBAAgB,CAAC,CAAA;QAE9B,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACnB,CAAC;QACD,MAAM,oBAAoB,GACxB,MAAM,KAAK,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YAClD,OAAO;YACP,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,OAAO;YACjB,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ;YAC1C,MAAM,EAAE,MAAM,EAAE,MAAM;SACvB,CAAC,CAAA;QACJ,YAAY,CAAC,gBAAgB,CAAC,CAAA;QAE9B,KAAK,MAAM,mBAAmB,IAAI,oBAAoB,EAAE,CAAC;YACvD,wBAAwB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;YAClD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;IACD,OAAO;QACL,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC;QACpB,oBAAoB,EAAE,wBAAwB;KAC/C,CAAA;AACH,CAAC,CAAA"}
@@ -1,24 +0,0 @@
1
- import { PromisePool } from '@supercharge/promise-pool';
2
- import { getTransactionDetail } from '../getTransactionDetail';
3
- import { toLowerHex } from '../types';
4
- export const getTransactionDetails = async (chain, hashes, internalTransactions, onFetchTransaction, config) => {
5
- const mut_transactions = [];
6
- const { errors } = await PromisePool.for(hashes)
7
- .withConcurrency(chain.client.httpRpcCount)
8
- .process(async (hash) => {
9
- const transactionDetail = await getTransactionDetail({
10
- chain,
11
- hash,
12
- internalTransactions: internalTransactions.filter(({ transactionHash }) => transactionHash === hash),
13
- }, config);
14
- if (onFetchTransaction !== undefined) {
15
- onFetchTransaction(toLowerHex(hash));
16
- }
17
- mut_transactions.push(transactionDetail);
18
- });
19
- if (errors.length > 0) {
20
- throw errors[0];
21
- }
22
- return mut_transactions;
23
- };
24
- //# sourceMappingURL=getTransactionDetails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTransactionDetails.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getTransactionDetails.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,KAAY,EACZ,MAAsB,EACtB,oBAA+D,EAC/D,kBAA0E,EAC1E,MAAe,EACwB,EAAE;IACzC,MAAM,gBAAgB,GAAwB,EAAE,CAAA;IAEhD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC;SAC7C,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;SAC1C,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,iBAAiB,GAAG,MAAM,oBAAoB,CAClD;YACE,KAAK;YACL,IAAI;YACJ,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,CAC/C,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,eAAe,KAAK,IAAI,CAClD;SACF,EACD,MAAM,CACP,CAAA;QACD,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACrC,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;QACtC,CAAC;QACD,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEJ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,MAAM,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"}
@@ -1,21 +0,0 @@
1
- import { toLowerHex } from '../types';
2
- export const getTransactionsApps = async (appDataSource, transactionos, config) => {
3
- if (transactionos.length === 0) {
4
- return [];
5
- }
6
- const { chainId } = transactionos[0];
7
- // to addresses
8
- const toAddresses = [
9
- ...new Set(transactionos
10
- .map(({ to }) => (to === null ? undefined : toLowerHex(to)))
11
- .filter((toAddress) => toAddress !== undefined)),
12
- ];
13
- const apps = await Promise.all(toAddresses.map((toAddress) => appDataSource === undefined
14
- ? undefined
15
- : appDataSource.getApp(chainId, toAddress, config)));
16
- return toAddresses.map((address, index) => ({
17
- address,
18
- app: apps[index],
19
- }));
20
- };
21
- //# sourceMappingURL=getTransactionsApps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTransactionsApps.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/getTransactionsApps.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,aAAwC,EACxC,aAA2C,EAC3C,MAAe,EAMf,EAAE;IACF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;IAEpC,eAAe;IACf,MAAM,WAAW,GAAG;QAClB,GAAG,IAAI,GAAG,CACR,aAAa;aACV,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;aAC3D,MAAM,CAAC,CAAC,SAAS,EAAyB,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CACzE;KACF,CAAA;IAED,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAC5B,WAAW,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC5B,aAAa,KAAK,SAAS;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CACrD,CACF,CAAA;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1C,OAAO;QACP,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC;KACjB,CAAC,CAAC,CAAA;AACL,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export { getAccountsTransactionFulls } from './getAccountsTransactionFulls';
2
- export { getAccountsTransactionFullsCustom } from './getAccountsTransactionFullsCustom';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/types.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- import { toLowerHex } from '../types';
2
- import { getHashesAndInternalTxs } from './getHashesAndInternalTxs';
3
- import { getTransactionDetails } from './getTransactionDetails';
4
- import { getTransactionsApps } from './getTransactionsApps';
5
- export const getAccountsTransactionFullsCustomWithD = async ({ chain, addresses, fromBlock, toBlock, appDataSource, decoder, onFetchHashes, onFetchTransaction, }, config) => {
6
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
7
- // get transaction hash & internal transaction by explorer
8
- const { hashes, internalTransactions } = await getHashesAndInternalTxs(chain, addresses, fromBlock, toBlock, config);
9
- if (hashes.length === 0) {
10
- return [];
11
- }
12
- if (onFetchHashes !== undefined) {
13
- onFetchHashes(hashes.map((hash) => toLowerHex(hash)));
14
- }
15
- // get transaction detail of hashes
16
- const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now();
17
- const transactionDetails = await getTransactionDetails(chain, hashes, internalTransactions, onFetchTransaction, {
18
- timeout: timeoutForGetTransactionDetail,
19
- logger: config?.logger,
20
- });
21
- // decode
22
- const { transactions: transactionsDecoded } = await decoder.decode({
23
- chain,
24
- transactions: transactionDetails,
25
- });
26
- // get apps
27
- const apps = await getTransactionsApps(appDataSource, transactionDetails, {
28
- timeout: timeoutTimestamp - Date.now(),
29
- logger: config?.logger,
30
- });
31
- return transactionsDecoded.map((transaction) => {
32
- const lowerTo = transaction.to === null ? undefined : toLowerHex(transaction.to);
33
- const app = apps.find(({ address }) => address === lowerTo)?.app;
34
- return {
35
- ...transaction,
36
- app,
37
- nativeTokenPrice: undefined,
38
- };
39
- });
40
- };
41
- //# sourceMappingURL=withD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withD.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/withD.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBA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AAE;QACxE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE;QACtC,MAAM,EAAE,MAAM,EAAE,MAAM;KACvB,CAAC,CAAA;IAEF,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;QAC7C,MAAM,OAAO,GACX,WAAW,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QAClE,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,GAAG,CAAA;QAEhE,OAAO;YACL,GAAG,WAAW;YACd,GAAG;YACH,gBAAgB,EAAE,SAAS;SAC5B,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -1,60 +0,0 @@
1
- import { toLowerHex } from '../types';
2
- import { getHashesAndInternalTxs } from './getHashesAndInternalTxs';
3
- import { getTransactionDetails } from './getTransactionDetails';
4
- import { getTransactionsApps } from './getTransactionsApps';
5
- export const getAccountsTransactionFullsCustomWithDA = async ({ chain, addresses, fromBlock, toBlock, appDataSource, decoder, analyzer, onFetchHashes, onFetchTransaction, }, config) => {
6
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
7
- // get transaction hash & internal transaction by explorer
8
- const { hashes, internalTransactions } = await getHashesAndInternalTxs(chain, addresses, fromBlock, toBlock, config);
9
- if (hashes.length === 0) {
10
- return [];
11
- }
12
- if (onFetchHashes !== undefined) {
13
- onFetchHashes(hashes.map((hash) => toLowerHex(hash)));
14
- }
15
- // get transaction detail of hashes
16
- const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now();
17
- const transactionDetails = await getTransactionDetails(chain, hashes, internalTransactions, onFetchTransaction, {
18
- timeout: timeoutForGetTransactionDetail,
19
- logger: config?.logger,
20
- });
21
- // decode
22
- const { transactions: transactionsDecoded } = await decoder.decode({
23
- chain,
24
- transactions: transactionDetails,
25
- }, {
26
- timeout: timeoutTimestamp - Date.now(),
27
- logger: config?.logger,
28
- });
29
- // get apps
30
- const apps = await getTransactionsApps(appDataSource, transactionDetails, {
31
- timeout: timeoutTimestamp - Date.now(),
32
- logger: config?.logger,
33
- });
34
- const transactionsForAnalyzer = transactionsDecoded.map((transaction) => {
35
- const lowerTo = transaction.to === null ? undefined : toLowerHex(transaction.to);
36
- const app = apps.find(({ address }) => address === lowerTo)?.app;
37
- return {
38
- ...transaction,
39
- app,
40
- nativeTokenPrice: undefined,
41
- };
42
- });
43
- // analyze
44
- const timeoutForAnalyze = timeoutTimestamp - Date.now();
45
- const analyzedDatas = await Promise.all(transactionsForAnalyzer.map((transactionForAnalyzer) => analyzer.analyze({
46
- chain,
47
- transaction: transactionForAnalyzer,
48
- accountAddresses: addresses,
49
- }, {
50
- timeout: timeoutForAnalyze,
51
- logger: config?.logger,
52
- })));
53
- return transactionsForAnalyzer.map((transactionForAnalyzer, index) => ({
54
- ...transactionForAnalyzer,
55
- accountAddresses: addresses,
56
- actions: analyzedDatas[index].actions,
57
- accountActions: analyzedDatas[index].accountActions,
58
- }));
59
- };
60
- //# sourceMappingURL=withDA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withDA.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/withDA.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAM3D,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,EAC1D,EACE,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,EACb,OAAO,EACP,QAAQ,E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Hex } from '../types';
2
- import { getHashesAndInternalTxs } from './getHashesAndInternalTxs';
3
- import { getTransactionDetails } from './getTransactionDetails';
4
- import { getTransactionsApps } from './getTransactionsApps';
5
- export const getAccountsTransactionFullsCustomWithP = async ({ chain, addresses, fromBlock, toBlock, appDataSource, priceDataSource, fiat, onFetchHashes, onFetchTransaction, }, config) => {
6
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
7
- // get transaction hash & internal transaction by explorer
8
- const { hashes, internalTransactions } = await getHashesAndInternalTxs(chain, addresses, fromBlock, toBlock, config);
9
- if (hashes.length === 0) {
10
- return [];
11
- }
12
- if (onFetchHashes !== undefined) {
13
- onFetchHashes(hashes.map((hash) => toLowerHex(hash)));
14
- }
15
- // get transaction detail of hashes
16
- const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now();
17
- const transactionDetails = await getTransactionDetails(chain, hashes, internalTransactions, onFetchTransaction, {
18
- timeout: timeoutForGetTransactionDetail,
19
- logger: config?.logger,
20
- });
21
- // native token price timestamp range
22
- const minTimestamp = transactionDetails.reduce((minTimestamp, { block }) => Math.min(minTimestamp, Number(block.timestamp)), Number.MAX_SAFE_INTEGER);
23
- const maxTimestamp = transactionDetails.reduce((maxTimestamp, { block }) => Math.max(maxTimestamp, Number(block.timestamp)), 0);
24
- const from = minTimestamp * 1000 - 1000 * 60 * 60;
25
- const to = maxTimestamp * 1000 + 1000 * 60 * 60;
26
- const timeoutForDataSource = timeoutTimestamp - Date.now();
27
- const [apps, prices] = await Promise.all([
28
- // get apps
29
- getTransactionsApps(appDataSource, transactionDetails, {
30
- timeout: timeoutForDataSource,
31
- logger: config?.logger,
32
- }),
33
- // get native token prices
34
- priceDataSource.getHistoricalPrices({
35
- targetCurrencies: [chain.nativeToken.currency],
36
- vsCurrency: fiat,
37
- from,
38
- to,
39
- }, {
40
- timeout: timeoutForDataSource,
41
- logger: config?.logger,
42
- }),
43
- ]);
44
- return transactionDetails.map((transactionDetail) => {
45
- const lowerTo = transactionDetail.to === null
46
- ? undefined
47
- : toLowerHex(transactionDetail.to);
48
- const app = apps.find(({ address }) => address === lowerTo)?.app;
49
- const price = prices.reduce((closestPrice, price) => closestPrice === undefined ||
50
- Math.abs(price.timestamp - Number(transactionDetail.block.timestamp) * 1000) <
51
- Math.abs(closestPrice.timestamp -
52
- Number(transactionDetail.block.timestamp) * 1000)
53
- ? price
54
- : closestPrice, undefined);
55
- return {
56
- ...transactionDetail,
57
- app,
58
- nativeTokenPrice: price,
59
- };
60
- });
61
- };
62
- //# sourceMappingURL=withP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withP.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/withP.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAM3D,MAAM,CAAC,MAAM,sCAAsC,GAAG,KAAK,EACzD,EACE,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,EACb,eAAe,EACf,IAAI,EACJ,aAAa,EACb,kBAAkB,GAC2B,EAC/C,MAAe,EAGf,EAAE;IACF,MAAM,gBAAgB,GACpB,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAExE,0DAA0D;IAC1D,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,uBAAuB,CACpE,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,CACP,CAAA;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,CAAA;IAC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AC,CAAA"}
@@ -1,74 +0,0 @@
1
- import { toLowerHex } from '../types';
2
- import { getDecodedTransactionsPrices } from './getDecodedTransactionsPrices';
3
- import { getHashesAndInternalTxs } from './getHashesAndInternalTxs';
4
- import { getTransactionDetails } from './getTransactionDetails';
5
- import { getTransactionsApps } from './getTransactionsApps';
6
- export const getAccountsTransactionFullsCustomWithPD = async ({ chain, addresses, fromBlock, toBlock, appDataSource, priceDataSource, fiat, decoder, onFetchHashes, onFetchTransaction, }, config) => {
7
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
8
- // get transaction hash & internal transaction by explorer
9
- const { hashes, internalTransactions } = await getHashesAndInternalTxs(chain, addresses, fromBlock, toBlock, config);
10
- if (hashes.length === 0) {
11
- return [];
12
- }
13
- if (onFetchHashes !== undefined) {
14
- onFetchHashes(hashes.map((hash) => toLowerHex(hash)));
15
- }
16
- // get transaction detail of hashes
17
- const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now();
18
- const transactionDetails = await getTransactionDetails(chain, hashes, internalTransactions, onFetchTransaction, {
19
- timeout: timeoutForGetTransactionDetail,
20
- logger: config?.logger,
21
- });
22
- // decode
23
- const { transactions: transactionsDecoded } = await decoder.decode({
24
- chain,
25
- transactions: transactionDetails,
26
- }, {
27
- timeout: timeoutTimestamp - Date.now(),
28
- logger: config?.logger,
29
- });
30
- const timeoutForDataSources = timeoutTimestamp - Date.now();
31
- const [apps, prices] = await Promise.all([
32
- // get apps
33
- getTransactionsApps(appDataSource, transactionDetails, {
34
- timeout: timeoutForDataSources,
35
- logger: config?.logger,
36
- }),
37
- // get prices
38
- getDecodedTransactionsPrices(chain, priceDataSource, fiat, transactionsDecoded, {
39
- timeout: timeoutForDataSources,
40
- logger: config?.logger,
41
- }),
42
- ]);
43
- return transactionsDecoded.map((transaction) => {
44
- const lowerTo = transaction.to === null ? undefined : toLowerHex(transaction.to);
45
- const app = apps.find(({ address }) => address === lowerTo)?.app;
46
- const timestampMs = Number(transaction.block.timestamp) * 1000;
47
- const nativeTokenPrice = prices
48
- .filter(({ cryptoCurrencyId }) => cryptoCurrencyId === chain.nativeToken.currency.id)
49
- .reduce((closestPrice, price) => Math.abs(price.timestamp - timestampMs) <
50
- Math.abs(closestPrice.timestamp - timestampMs)
51
- ? price
52
- : closestPrice);
53
- return {
54
- ...transaction,
55
- app,
56
- nativeTokenPrice,
57
- internalTransactions: transaction.internalTransactions.map((internalTransaction) => ({
58
- ...internalTransaction,
59
- price: nativeTokenPrice,
60
- })),
61
- erc20Transfers: transaction.erc20Transfers.map((transfer) => ({
62
- ...transfer,
63
- price: prices
64
- .filter(({ cryptoCurrencyId }) => cryptoCurrencyId === transfer.token.currency.id)
65
- .reduce((closestPrice, price) => closestPrice === undefined ||
66
- Math.abs(price.timestamp - timestampMs) <
67
- Math.abs(closestPrice.timestamp - timestampMs)
68
- ? price
69
- : closestPrice, undefined),
70
- })),
71
- };
72
- });
73
- };
74
- //# sourceMappingURL=withPD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"withPD.js","sourceRoot":"","sources":["../../getAccountsTransactionFulls/withPD.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAM3D,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,EAC1D,EACE,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,EACb,eAAe,EACf,IAAI,EACJ,OAAO,EACP,aAAa,EACb,kBAAkB,GAC4B,EAChD,MAAe,EAGf,EAAE;IACF,MAAM,gBAAgB,GACpB,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,M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gBACtB,KAAK,EAAE,gBAAgB;aACxB,CAAC,CACH;YACD,cAAc,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAC5D,GAAG,QAAQ;gBACX,KAAK,EAAE,MAAM;qBACV,MAAM,CACL,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE,CACvB,gBAAgB,KAAK,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAClD;qBACA,MAAM,CACL,CAAC,YAA6C,EAAE,KAAK,EAAE,EAAE,CACvD,YAAY,KAAK,SAAS;oBAC1B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC;wBACrC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,GAAG,WAAW,CAAC;oBAC9C,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,YAAY,EAClB,SAAS,CACV;aACJ,CAAC,CAAC;SACJ,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -1,91 +0,0 @@
1
- import { toLowerHex } from '../types';
2
- import { getDecodedTransactionsPrices } from './getDecodedTransactionsPrices';
3
- import { getHashesAndInternalTxs } from './getHashesAndInternalTxs';
4
- import { getTransactionDetails } from './getTransactionDetails';
5
- import { getTransactionsApps } from './getTransactionsApps';
6
- export const getAccountsTransactionFullsCustomWithPDA = async ({ chain, addresses, fromBlock, toBlock, appDataSource, priceDataSource, fiat, decoder, analyzer, onFetchHashes, onFetchTransaction, }, config) => {
7
- const timeoutTimestamp = Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout);
8
- // get transaction hash & internal transaction by explorer
9
- const { hashes, internalTransactions } = await getHashesAndInternalTxs(chain, addresses, fromBlock, toBlock, config);
10
- if (hashes.length === 0) {
11
- return [];
12
- }
13
- if (onFetchHashes !== undefined) {
14
- onFetchHashes(hashes.map((hash) => toLowerHex(hash)));
15
- }
16
- // get transaction detail of hashes
17
- const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now();
18
- const transactionDetails = await getTransactionDetails(chain, hashes, internalTransactions, onFetchTransaction, {
19
- timeout: timeoutForGetTransactionDetail,
20
- logger: config?.logger,
21
- });
22
- // decode
23
- const { transactions: transactionsDecoded } = await decoder.decode({
24
- chain,
25
- transactions: transactionDetails,
26
- }, {
27
- timeout: timeoutTimestamp - Date.now(),
28
- logger: config?.logger,
29
- });
30
- const timeoutForDataSources = timeoutTimestamp - Date.now();
31
- const [apps, prices] = await Promise.all([
32
- // get apps
33
- getTransactionsApps(appDataSource, transactionDetails, {
34
- timeout: timeoutForDataSources,
35
- logger: config?.logger,
36
- }),
37
- // get prices
38
- getDecodedTransactionsPrices(chain, priceDataSource, fiat, transactionsDecoded, {
39
- timeout: timeoutForDataSources,
40
- logger: config?.logger,
41
- }),
42
- ]);
43
- const transactionsForAnalyzer = transactionsDecoded.map((transaction) => {
44
- const lowerTo = transaction.to === null ? undefined : toLowerHex(transaction.to);
45
- const app = apps.find(({ address }) => address === lowerTo)?.app;
46
- const timestampMs = Number(transaction.block.timestamp) * 1000;
47
- const nativeTokenPrice = prices
48
- .filter(({ cryptoCurrencyId }) => cryptoCurrencyId === chain.nativeToken.currency.id)
49
- .reduce((closestPrice, price) => closestPrice === undefined ||
50
- Math.abs(price.timestamp - timestampMs) <
51
- Math.abs(closestPrice.timestamp - timestampMs)
52
- ? price
53
- : closestPrice, undefined);
54
- return {
55
- ...transaction,
56
- app,
57
- nativeTokenPrice,
58
- internalTransactions: transaction.internalTransactions.map((internalTransaction) => ({
59
- ...internalTransaction,
60
- price: nativeTokenPrice,
61
- })),
62
- erc20Transfers: transaction.erc20Transfers.map((transfer) => ({
63
- ...transfer,
64
- price: prices
65
- .filter(({ cryptoCurrencyId }) => cryptoCurrencyId === transfer.token.currency.id)
66
- .reduce((closestPrice, price) => closestPrice === undefined ||
67
- Math.abs(price.timestamp - timestampMs) <
68
- Math.abs(closestPrice.timestamp - timestampMs)
69
- ? price
70
- : closestPrice, undefined),
71
- })),
72
- };
73
- });
74
- // analyze
75
- const timeoutForAnalyzer = timeoutTimestamp - Date.now();
76
- const analyzedDatas = await Promise.all(transactionsForAnalyzer.map((transactionForAnalyzer) => analyzer.analyze({
77
- chain,
78
- transaction: transactionForAnalyzer,
79
- accountAddresses: addresses,
80
- }, {
81
- timeout: timeoutForAnalyzer,
82
- logger: config?.logger,
83
- })));
84
- return transactionsForAnalyzer.map((transactionForAnalyzer, index) => ({
85
- ...transactionForAnalyzer,
86
- accountAddresses: addresses,
87
- actions: analyzedDatas[index].actions,
88
- accountActions: analyzedDatas[index].accountActions,
89
- }));
90
- };
91
- //# sourceMappingURL=withPDA.js.map