@instadapp/interop-x 0.0.0-dev.a9cd1d2 → 0.0.0-dev.acc4865

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. package/.github/workflows/ci.yml +19 -0
  2. package/dist/package.json +3 -2
  3. package/dist/src/abi/connectors/index.js +36 -0
  4. package/dist/src/abi/connectors/v1/aave.js +148 -0
  5. package/dist/src/abi/connectors/v1/aave_claim.js +4 -0
  6. package/dist/src/abi/connectors/v1/aave_migrate.js +109 -0
  7. package/dist/src/abi/connectors/v1/aave_polygon_migrate.js +110 -0
  8. package/dist/src/abi/connectors/v1/aave_stake.js +4 -0
  9. package/dist/src/abi/connectors/v1/aave_v1_import.js +54 -0
  10. package/dist/src/abi/connectors/v1/aave_v2.js +230 -0
  11. package/dist/src/abi/connectors/v1/aave_v2_import.js +59 -0
  12. package/dist/src/abi/connectors/v1/authority.js +100 -0
  13. package/dist/src/abi/connectors/v1/basic.js +136 -0
  14. package/dist/src/abi/connectors/v1/chi.js +36 -0
  15. package/dist/src/abi/connectors/v1/comp.js +4 -0
  16. package/dist/src/abi/connectors/v1/compound.js +4 -0
  17. package/dist/src/abi/connectors/v1/compoundImport.js +69 -0
  18. package/dist/src/abi/connectors/v1/compoundImport_v2.js +4 -0
  19. package/dist/src/abi/connectors/v1/compound_old.js +448 -0
  20. package/dist/src/abi/connectors/v1/curve.js +140 -0
  21. package/dist/src/abi/connectors/v1/curve_claim.js +63 -0
  22. package/dist/src/abi/connectors/v1/curve_gauge.js +158 -0
  23. package/dist/src/abi/connectors/v1/curve_sbtc.js +140 -0
  24. package/dist/src/abi/connectors/v1/curve_susd.js +140 -0
  25. package/dist/src/abi/connectors/v1/curve_three.js +79 -0
  26. package/dist/src/abi/connectors/v1/curve_y.js +140 -0
  27. package/dist/src/abi/connectors/v1/dsa_migrate_v1_to_v2.js +4 -0
  28. package/dist/src/abi/connectors/v1/dydx.js +148 -0
  29. package/dist/src/abi/connectors/v1/dydx_flash.js +52 -0
  30. package/dist/src/abi/connectors/v1/fee.js +50 -0
  31. package/dist/src/abi/connectors/v1/gelato.js +1138 -0
  32. package/dist/src/abi/connectors/v1/index.js +58 -0
  33. package/dist/src/abi/connectors/v1/instapool.js +439 -0
  34. package/dist/src/abi/connectors/v1/instapool_v2.js +126 -0
  35. package/dist/src/abi/connectors/v1/kyber.js +117 -0
  36. package/dist/src/abi/connectors/v1/maker.js +480 -0
  37. package/dist/src/abi/connectors/v1/maker_old.js +300 -0
  38. package/dist/src/abi/connectors/v1/math.js +43 -0
  39. package/dist/src/abi/connectors/v1/migrate.js +46 -0
  40. package/dist/src/abi/connectors/v1/oasis.js +198 -0
  41. package/dist/src/abi/connectors/v1/oneInch.js +160 -0
  42. package/dist/src/abi/connectors/v1/polygon_bridge.js +4 -0
  43. package/dist/src/abi/connectors/v1/refinance.js +4 -0
  44. package/dist/src/abi/connectors/v1/staking.js +220 -0
  45. package/dist/src/abi/connectors/v1/swerve.js +179 -0
  46. package/dist/src/abi/connectors/v1/uniswap.js +297 -0
  47. package/dist/src/abi/connectors/v2/1INCH-A.js +4 -0
  48. package/dist/src/abi/connectors/v2/1INCH-B.js +4 -0
  49. package/dist/src/abi/connectors/v2/AAVE-CLAIM-A.js +4 -0
  50. package/dist/src/abi/connectors/v2/AAVE-CLAIM-B.js +166 -0
  51. package/dist/src/abi/connectors/v2/AAVE-STAKE-A.js +4 -0
  52. package/dist/src/abi/connectors/v2/AAVE-V1-A.js +130 -0
  53. package/dist/src/abi/connectors/v2/AAVE-V1-IMPORT-A.js +4 -0
  54. package/dist/src/abi/connectors/v2/AAVE-V2-A.js +230 -0
  55. package/dist/src/abi/connectors/v2/AAVE-V2-IMPORT-A.js +4 -0
  56. package/dist/src/abi/connectors/v2/AAVE-V2-IMPORT-B.js +225 -0
  57. package/dist/src/abi/connectors/v2/AUTHORITY-A.js +100 -0
  58. package/dist/src/abi/connectors/v2/B-COMPOUND-A.js +4 -0
  59. package/dist/src/abi/connectors/v2/B-LIQUITY-A.js +4 -0
  60. package/dist/src/abi/connectors/v2/B-MAKERDAO-A.js +4 -0
  61. package/dist/src/abi/connectors/v2/BASIC-A.js +136 -0
  62. package/dist/src/abi/connectors/v2/BASIC-B.js +4 -0
  63. package/dist/src/abi/connectors/v2/BASIC-C.js +4 -0
  64. package/dist/src/abi/connectors/v2/COMP-A.js +4 -0
  65. package/dist/src/abi/connectors/v2/COMPOUND-A.js +4 -0
  66. package/dist/src/abi/connectors/v2/COMPOUND-IMPORT-A.js +4 -0
  67. package/dist/src/abi/connectors/v2/COMPOUND-IMPORT-B.js +195 -0
  68. package/dist/src/abi/connectors/v2/G-UNISWAP-A.js +4 -0
  69. package/dist/src/abi/connectors/v2/GELATO-AAVE-A.js +4 -0
  70. package/dist/src/abi/connectors/v2/INST-A.js +4 -0
  71. package/dist/src/abi/connectors/v2/INST-LM-A.js +4 -0
  72. package/dist/src/abi/connectors/v2/INST-STAKING-A.js +4 -0
  73. package/dist/src/abi/connectors/v2/INST-STAKING-B.js +4 -0
  74. package/dist/src/abi/connectors/v2/INSTAPOOL-A.js +4 -0
  75. package/dist/src/abi/connectors/v2/LIQUITY-A.js +4 -0
  76. package/dist/src/abi/connectors/v2/MAKERDAO-A.js +4 -0
  77. package/dist/src/abi/connectors/v2/MAKERDAO-CLAIM-A.js +136 -0
  78. package/dist/src/abi/connectors/v2/PARASWAP-A.js +4 -0
  79. package/dist/src/abi/connectors/v2/POLYGON-BRIDGE-A.js +4 -0
  80. package/dist/src/abi/connectors/v2/REFINANCE-A.js +4 -0
  81. package/dist/src/abi/connectors/v2/REFLEXER-A.js +4 -0
  82. package/dist/src/abi/connectors/v2/STAKE-ERC20-A.js +4 -0
  83. package/dist/src/abi/connectors/v2/UNISWAP-A.js +297 -0
  84. package/dist/src/abi/connectors/v2/UNISWAP-V2-A.js +4 -0
  85. package/dist/src/abi/connectors/v2/UNISWAP-V3-A.js +4 -0
  86. package/dist/src/abi/connectors/v2/UNISWAP-V3-STAKE-A.js +4 -0
  87. package/dist/src/abi/connectors/v2/WETH-A.js +4 -0
  88. package/dist/src/abi/connectors/v2/YEARN-VAULT-A.js +4 -0
  89. package/dist/src/abi/connectors/v2/index.js +89 -0
  90. package/dist/src/abi/index.js +2 -0
  91. package/dist/src/constants/addresses.js +2 -0
  92. package/dist/src/constants/blockConfirmations.js +8 -0
  93. package/dist/src/constants/index.js +1 -0
  94. package/dist/src/db/models/transaction.js +2 -2
  95. package/dist/src/gnosis/actions/aaveV2/index.js +11 -0
  96. package/dist/src/gnosis/actions/aaveV2/source.js +62 -0
  97. package/dist/src/gnosis/actions/aaveV2/target.js +8 -0
  98. package/dist/src/gnosis/actions/index.js +2 -2
  99. package/dist/src/index.js +1 -1
  100. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +2 -2
  101. package/dist/src/tasks/InteropX/ProcessSubmitSubmitEvents.js +168 -0
  102. package/dist/src/tasks/InteropX/SyncLogSubmitEvents.js +5 -3
  103. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +4 -3
  104. package/dist/src/tasks/index.js +5 -0
  105. package/dist/src/utils/index.js +57 -30
  106. package/package.json +3 -2
  107. package/src/abi/connectors/index.ts +14 -0
  108. package/src/abi/connectors/v1/aave.ts +147 -0
  109. package/src/abi/connectors/v1/aave_claim.ts +3 -0
  110. package/src/abi/connectors/v1/aave_migrate.ts +108 -0
  111. package/src/abi/connectors/v1/aave_polygon_migrate.ts +109 -0
  112. package/src/abi/connectors/v1/aave_stake.ts +3 -0
  113. package/src/abi/connectors/v1/aave_v1_import.ts +53 -0
  114. package/src/abi/connectors/v1/aave_v2.ts +229 -0
  115. package/src/abi/connectors/v1/aave_v2_import.ts +58 -0
  116. package/src/abi/connectors/v1/authority.ts +99 -0
  117. package/src/abi/connectors/v1/basic.ts +135 -0
  118. package/src/abi/connectors/v1/chi.ts +35 -0
  119. package/src/abi/connectors/v1/comp.ts +3 -0
  120. package/src/abi/connectors/v1/compound.ts +3 -0
  121. package/src/abi/connectors/v1/compoundImport.ts +68 -0
  122. package/src/abi/connectors/v1/compoundImport_v2.ts +3 -0
  123. package/src/abi/connectors/v1/compound_old.ts +447 -0
  124. package/src/abi/connectors/v1/curve.ts +139 -0
  125. package/src/abi/connectors/v1/curve_claim.ts +62 -0
  126. package/src/abi/connectors/v1/curve_gauge.ts +157 -0
  127. package/src/abi/connectors/v1/curve_sbtc.ts +139 -0
  128. package/src/abi/connectors/v1/curve_susd.ts +139 -0
  129. package/src/abi/connectors/v1/curve_three.ts +78 -0
  130. package/src/abi/connectors/v1/curve_y.ts +139 -0
  131. package/src/abi/connectors/v1/dsa_migrate_v1_to_v2.ts +3 -0
  132. package/src/abi/connectors/v1/dydx.ts +147 -0
  133. package/src/abi/connectors/v1/dydx_flash.ts +51 -0
  134. package/src/abi/connectors/v1/fee.ts +49 -0
  135. package/src/abi/connectors/v1/gelato.ts +1137 -0
  136. package/src/abi/connectors/v1/index.ts +42 -0
  137. package/src/abi/connectors/v1/instapool.ts +438 -0
  138. package/src/abi/connectors/v1/instapool_v2.ts +125 -0
  139. package/src/abi/connectors/v1/kyber.ts +116 -0
  140. package/src/abi/connectors/v1/maker.ts +479 -0
  141. package/src/abi/connectors/v1/maker_old.ts +299 -0
  142. package/src/abi/connectors/v1/math.ts +42 -0
  143. package/src/abi/connectors/v1/migrate.ts +45 -0
  144. package/src/abi/connectors/v1/oasis.ts +197 -0
  145. package/src/abi/connectors/v1/oneInch.ts +159 -0
  146. package/src/abi/connectors/v1/polygon_bridge.ts +3 -0
  147. package/src/abi/connectors/v1/refinance.ts +3 -0
  148. package/src/abi/connectors/v1/staking.ts +219 -0
  149. package/src/abi/connectors/v1/swerve.ts +178 -0
  150. package/src/abi/connectors/v1/uniswap.ts +297 -0
  151. package/src/abi/connectors/v2/1INCH-A.ts +3 -0
  152. package/src/abi/connectors/v2/1INCH-B.ts +3 -0
  153. package/src/abi/connectors/v2/AAVE-CLAIM-A.ts +3 -0
  154. package/src/abi/connectors/v2/AAVE-CLAIM-B.ts +165 -0
  155. package/src/abi/connectors/v2/AAVE-STAKE-A.ts +3 -0
  156. package/src/abi/connectors/v2/AAVE-V1-A.ts +130 -0
  157. package/src/abi/connectors/v2/AAVE-V1-IMPORT-A.ts +3 -0
  158. package/src/abi/connectors/v2/AAVE-V2-A.ts +229 -0
  159. package/src/abi/connectors/v2/AAVE-V2-IMPORT-A.ts +3 -0
  160. package/src/abi/connectors/v2/AAVE-V2-IMPORT-B.ts +224 -0
  161. package/src/abi/connectors/v2/AUTHORITY-A.ts +99 -0
  162. package/src/abi/connectors/v2/B-COMPOUND-A.ts +3 -0
  163. package/src/abi/connectors/v2/B-LIQUITY-A.ts +3 -0
  164. package/src/abi/connectors/v2/B-MAKERDAO-A.ts +3 -0
  165. package/src/abi/connectors/v2/BASIC-A.ts +135 -0
  166. package/src/abi/connectors/v2/BASIC-B.ts +3 -0
  167. package/src/abi/connectors/v2/BASIC-C.ts +3 -0
  168. package/src/abi/connectors/v2/COMP-A.ts +3 -0
  169. package/src/abi/connectors/v2/COMPOUND-A.ts +3 -0
  170. package/src/abi/connectors/v2/COMPOUND-IMPORT-A.ts +3 -0
  171. package/src/abi/connectors/v2/COMPOUND-IMPORT-B.ts +194 -0
  172. package/src/abi/connectors/v2/G-UNISWAP-A.ts +3 -0
  173. package/src/abi/connectors/v2/GELATO-AAVE-A.ts +3 -0
  174. package/src/abi/connectors/v2/INST-A.ts +3 -0
  175. package/src/abi/connectors/v2/INST-LM-A.ts +3 -0
  176. package/src/abi/connectors/v2/INST-STAKING-A.ts +3 -0
  177. package/src/abi/connectors/v2/INST-STAKING-B.ts +3 -0
  178. package/src/abi/connectors/v2/INSTAPOOL-A.ts +3 -0
  179. package/src/abi/connectors/v2/LIQUITY-A.ts +3 -0
  180. package/src/abi/connectors/v2/MAKERDAO-A.ts +3 -0
  181. package/src/abi/connectors/v2/MAKERDAO-CLAIM-A.ts +135 -0
  182. package/src/abi/connectors/v2/PARASWAP-A.ts +3 -0
  183. package/src/abi/connectors/v2/POLYGON-BRIDGE-A.ts +3 -0
  184. package/src/abi/connectors/v2/REFINANCE-A.ts +3 -0
  185. package/src/abi/connectors/v2/REFLEXER-A.ts +3 -0
  186. package/src/abi/connectors/v2/STAKE-ERC20-A.ts +3 -0
  187. package/src/abi/connectors/v2/UNISWAP-A.ts +297 -0
  188. package/src/abi/connectors/v2/UNISWAP-V2-A.ts +3 -0
  189. package/src/abi/connectors/v2/UNISWAP-V3-A.ts +3 -0
  190. package/src/abi/connectors/v2/UNISWAP-V3-STAKE-A.ts +3 -0
  191. package/src/abi/connectors/v2/WETH-A.ts +3 -0
  192. package/src/abi/connectors/v2/YEARN-VAULT-A.ts +3 -0
  193. package/src/abi/connectors/v2/index.ts +87 -0
  194. package/src/abi/index.ts +6 -4
  195. package/src/constants/addresses.ts +3 -1
  196. package/src/constants/blockConfirmations.ts +5 -0
  197. package/src/constants/index.ts +1 -0
  198. package/src/db/models/transaction.ts +2 -2
  199. package/src/gnosis/actions/aaveV2/index.ts +9 -0
  200. package/src/gnosis/actions/aaveV2/source.ts +104 -0
  201. package/src/gnosis/actions/aaveV2/target.ts +13 -0
  202. package/src/gnosis/actions/index.ts +2 -2
  203. package/src/net/protocol/dial/SignatureDialProtocol.ts +3 -2
  204. package/src/tasks/InteropX/ProcessSubmitSubmitEvents.ts +252 -0
  205. package/src/tasks/InteropX/SyncLogSubmitEvents.ts +118 -116
  206. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +4 -3
  207. package/src/tasks/index.ts +6 -1
  208. package/src/utils/index.ts +169 -93
  209. package/dist/src/gnosis/actions/withdraw/index.js +0 -114
  210. package/src/gnosis/actions/withdraw/index.ts +0 -155
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNISWAP_V2_A = void 0;
4
+ exports.UNISWAP_V2_A = [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "buyToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sellToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "buyAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "sellAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogBuy", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "tokenA", "type": "address" }, { "indexed": true, "internalType": "address", "name": "tokenB", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amtA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amtB", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "uniAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogDepositLiquidity", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "buyToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sellToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "buyAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "sellAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogSell", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "tokenA", "type": "address" }, { "indexed": true, "internalType": "address", "name": "tokenB", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amountA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountB", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "uniAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256[]", "name": "setId", "type": "uint256[]" }], "name": "LogWithdrawLiquidity", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "buyAddr", "type": "address" }, { "internalType": "address", "name": "sellAddr", "type": "address" }, { "internalType": "uint256", "name": "buyAmt", "type": "uint256" }, { "internalType": "uint256", "name": "unitAmt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "buy", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" }, { "internalType": "uint256", "name": "amtA", "type": "uint256" }, { "internalType": "uint256", "name": "unitAmt", "type": "uint256" }, { "internalType": "uint256", "name": "slippage", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "deposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "buyAddr", "type": "address" }, { "internalType": "address", "name": "sellAddr", "type": "address" }, { "internalType": "uint256", "name": "sellAmt", "type": "uint256" }, { "internalType": "uint256", "name": "unitAmt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "sell", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" }, { "internalType": "uint256", "name": "uniAmt", "type": "uint256" }, { "internalType": "uint256", "name": "unitAmtA", "type": "uint256" }, { "internalType": "uint256", "name": "unitAmtB", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256[]", "name": "setIds", "type": "uint256[]" }], "name": "withdraw", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNISWAP_V3_A = void 0;
4
+ exports.UNISWAP_V3_A = [{ "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "LogBurnPosition", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountB", "type": "uint256" }], "name": "LogCollect", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountB", "type": "uint256" }], "name": "LogDeposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amtA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amtB", "type": "uint256" }, { "indexed": false, "internalType": "int24", "name": "tickLower", "type": "int24" }, { "indexed": false, "internalType": "int24", "name": "tickUpper", "type": "int24" }], "name": "LogMint", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountA", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountB", "type": "uint256" }], "name": "LogWithdraw", "type": "event" }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "burn", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amount0Max", "type": "uint256" }, { "internalType": "uint256", "name": "amount1Max", "type": "uint256" }, { "internalType": "uint256[]", "name": "getIds", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "setIds", "type": "uint256[]" }], "name": "collect", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "amountA", "type": "uint256" }, { "internalType": "uint256", "name": "amountB", "type": "uint256" }, { "internalType": "uint256", "name": "slippage", "type": "uint256" }, { "internalType": "uint256[]", "name": "getIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "deposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "tokenA", "type": "address" }, { "internalType": "address", "name": "tokenB", "type": "address" }, { "internalType": "uint24", "name": "fee", "type": "uint24" }, { "internalType": "int24", "name": "tickLower", "type": "int24" }, { "internalType": "int24", "name": "tickUpper", "type": "int24" }, { "internalType": "uint256", "name": "amtA", "type": "uint256" }, { "internalType": "uint256", "name": "amtB", "type": "uint256" }, { "internalType": "uint256", "name": "slippage", "type": "uint256" }, { "internalType": "uint256[]", "name": "getIds", "type": "uint256[]" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "mint", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "internalType": "uint256", "name": "amountAMin", "type": "uint256" }, { "internalType": "uint256", "name": "amountBMin", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256[]", "name": "setIds", "type": "uint256[]" }], "name": "withdraw", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNISWAP_V3_STAKE_A = void 0;
4
+ exports.UNISWAP_V3_STAKE_A = [{ "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "LogDeposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "incentiveId", "type": "bytes32" }], "name": "LogDepositAndStake", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "to", "type": "address" }], "name": "LogDepositTransfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "bytes32", "name": "incentiveId", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "poolAddr", "type": "address" }, { "indexed": false, "internalType": "address", "name": "refundee", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "startTime", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "endTime", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" }], "name": "LogIncentiveCreated", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "LogRewardClaimed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "incentiveId", "type": "bytes32" }], "name": "LogStake", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "incentiveId", "type": "bytes32" }], "name": "LogUnstake", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }], "name": "LogWithdraw", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "_rewardToken", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }], "name": "claimRewards", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_rewardToken", "type": "address" }, { "internalType": "uint256", "name": "_length", "type": "uint256" }, { "internalType": "address", "name": "_refundee", "type": "address" }, { "internalType": "address", "name": "_poolAddr", "type": "address" }, { "internalType": "uint256", "name": "_reward", "type": "uint256" }], "name": "createIncentive", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_tokenId", "type": "uint256" }], "name": "deposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_rewardToken", "type": "address" }, { "internalType": "uint256", "name": "_startTime", "type": "uint256" }, { "internalType": "uint256", "name": "_endTime", "type": "uint256" }, { "internalType": "address", "name": "_refundee", "type": "address" }, { "internalType": "uint256", "name": "_tokenId", "type": "uint256" }], "name": "depositAndStake", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_rewardToken", "type": "address" }, { "internalType": "uint256", "name": "_startTime", "type": "uint256" }, { "internalType": "uint256", "name": "_endTime", "type": "uint256" }, { "internalType": "address", "name": "_refundee", "type": "address" }, { "internalType": "uint256", "name": "_tokenId", "type": "uint256" }], "name": "stake", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_tokenId", "type": "uint256" }, { "internalType": "address", "name": "_to", "type": "address" }], "name": "transferDeposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_rewardToken", "type": "address" }, { "internalType": "uint256", "name": "_startTime", "type": "uint256" }, { "internalType": "uint256", "name": "_endTime", "type": "uint256" }, { "internalType": "address", "name": "_refundee", "type": "address" }, { "internalType": "uint256", "name": "_tokenId", "type": "uint256" }], "name": "unstake", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_tokenId", "type": "uint256" }], "name": "withdraw", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WETH_A = void 0;
4
+ exports.WETH_A = [{ "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogDeposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "tokenAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogWithdraw", "type": "event" }, { "inputs": [{ "internalType": "uint256", "name": "amt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "deposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "withdraw", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YEARN_VAULT_A = void 0;
4
+ exports.YEARN_VAULT_A = [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "vault", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "shareAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "depositAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogDeposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "shareAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "withdrawAmt", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "getId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "LogWithdraw", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "amt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "deposit", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "vault", "type": "address" }, { "internalType": "uint256", "name": "amt", "type": "uint256" }, { "internalType": "uint256", "name": "getId", "type": "uint256" }, { "internalType": "uint256", "name": "setId", "type": "uint256" }], "name": "withdraw", "outputs": [{ "internalType": "string", "name": "_eventName", "type": "string" }, { "internalType": "bytes", "name": "_eventParam", "type": "bytes" }], "stateMutability": "payable", "type": "function" }];
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectorsV2_M1 = void 0;
4
+ const _1INCH_A_1 = require("./1INCH-A");
5
+ const AAVE_CLAIM_A_1 = require("./AAVE-CLAIM-A");
6
+ const AAVE_CLAIM_B_1 = require("./AAVE-CLAIM-B");
7
+ const AAVE_STAKE_A_1 = require("./AAVE-STAKE-A");
8
+ const AAVE_V1_A_1 = require("./AAVE-V1-A");
9
+ const AAVE_V2_A_1 = require("./AAVE-V2-A");
10
+ const AUTHORITY_A_1 = require("./AUTHORITY-A");
11
+ const BASIC_A_1 = require("./BASIC-A");
12
+ const COMP_A_1 = require("./COMP-A");
13
+ const COMPOUND_A_1 = require("./COMPOUND-A");
14
+ const MAKERDAO_A_1 = require("./MAKERDAO-A");
15
+ const POLYGON_BRIDGE_A_1 = require("./POLYGON-BRIDGE-A");
16
+ const UNISWAP_A_1 = require("./UNISWAP-A");
17
+ const AAVE_V1_IMPORT_A_1 = require("./AAVE-V1-IMPORT-A");
18
+ const AAVE_V2_IMPORT_A_1 = require("./AAVE-V2-IMPORT-A");
19
+ const COMPOUND_IMPORT_A_1 = require("./COMPOUND-IMPORT-A");
20
+ const INSTAPOOL_A_1 = require("./INSTAPOOL-A");
21
+ const PARASWAP_A_1 = require("./PARASWAP-A");
22
+ const AAVE_V2_IMPORT_B_1 = require("./AAVE-V2-IMPORT-B");
23
+ const COMPOUND_IMPORT_B_1 = require("./COMPOUND-IMPORT-B");
24
+ const MAKERDAO_CLAIM_A_1 = require("./MAKERDAO-CLAIM-A");
25
+ const G_UNISWAP_A_1 = require("./G-UNISWAP-A");
26
+ const STAKE_ERC20_A_1 = require("./STAKE-ERC20-A");
27
+ const INST_STAKING_A_1 = require("./INST-STAKING-A");
28
+ const _1INCH_B_1 = require("./1INCH-B");
29
+ const WETH_A_1 = require("./WETH-A");
30
+ const INST_A_1 = require("./INST-A");
31
+ const REFINANCE_A_1 = require("./REFINANCE-A");
32
+ const INST_LM_A_1 = require("./INST-LM-A");
33
+ const UNISWAP_V2_A_1 = require("./UNISWAP-V2-A");
34
+ const LIQUITY_A_1 = require("./LIQUITY-A");
35
+ const REFLEXER_A_1 = require("./REFLEXER-A");
36
+ const UNISWAP_V3_A_1 = require("./UNISWAP-V3-A");
37
+ const B_COMPOUND_A_1 = require("./B-COMPOUND-A");
38
+ const B_MAKERDAO_A_1 = require("./B-MAKERDAO-A");
39
+ const B_LIQUITY_A_1 = require("./B-LIQUITY-A");
40
+ const BASIC_B_1 = require("./BASIC-B");
41
+ const BASIC_C_1 = require("./BASIC-C");
42
+ const UNISWAP_V3_STAKE_A_1 = require("./UNISWAP-V3-STAKE-A");
43
+ const YEARN_VAULT_A_1 = require("./YEARN-VAULT-A");
44
+ const INST_STAKING_B_1 = require("./INST-STAKING-B");
45
+ const GELATO_AAVE_A_1 = require("./GELATO-AAVE-A");
46
+ exports.connectorsV2_M1 = {
47
+ "GELATO-AAVE-A": GELATO_AAVE_A_1.GELATO_AAVE_A,
48
+ "INST-STAKING-B": INST_STAKING_B_1.INST_STAKING_B,
49
+ "YEARN-VAULT-A": YEARN_VAULT_A_1.YEARN_VAULT_A,
50
+ "UNISWAP-V3-STAKE-A": UNISWAP_V3_STAKE_A_1.UNISWAP_V3_STAKE_A,
51
+ "BASIC-C": BASIC_C_1.BASIC_C,
52
+ "BASIC-B": BASIC_B_1.BASIC_B,
53
+ "B-LIQUITY-A": B_LIQUITY_A_1.B_LIQUITY_A,
54
+ "B-MAKERDAO-A": B_MAKERDAO_A_1.B_MAKERDAO_A,
55
+ "B-COMPOUND-A": B_COMPOUND_A_1.B_COMPOUND_A,
56
+ "UNISWAP-V3-A": UNISWAP_V3_A_1.UNISWAP_V3_A,
57
+ "REFLEXER-A": REFLEXER_A_1.REFLEXER_A,
58
+ "LIQUITY-A": LIQUITY_A_1.LIQUITY_A,
59
+ "UNISWAP-V2-A": UNISWAP_V2_A_1.UNISWAP_V2_A,
60
+ "INST-LM-A": INST_LM_A_1.INST_LM_A,
61
+ "REFINANCE-A": REFINANCE_A_1.REFINANCE_A,
62
+ "INST-A": INST_A_1.INST_A,
63
+ "WETH-A": WETH_A_1.WETH_A,
64
+ "1INCH-B": _1INCH_B_1.ONEINCH_B,
65
+ "INST-STAKING-A": INST_STAKING_A_1.INST_STAKING_A,
66
+ "STAKE-ERC20-A": STAKE_ERC20_A_1.STAKE_ERC20_A,
67
+ "G-UNISWAP-A": G_UNISWAP_A_1.G_UNISWAP_A,
68
+ "INSTAPOOL-A": INSTAPOOL_A_1.INSTAPOOL_A,
69
+ "COMPOUND-IMPORT-A": COMPOUND_IMPORT_A_1.COMPOUND_IMPORT_A,
70
+ "AAVE-V2-IMPORT-A": AAVE_V2_IMPORT_A_1.AAVE_V2_IMPORT_A,
71
+ "AAVE-V1-IMPORT-A": AAVE_V1_IMPORT_A_1.AAVE_V1_IMPORT_A,
72
+ "1INCH-A": _1INCH_A_1.ONEINCH_A,
73
+ "AAVE-CLAIM-A": AAVE_CLAIM_A_1.AAVE_CLAIM_A,
74
+ "AAVE-CLAIM-B": AAVE_CLAIM_B_1.AAVE_CLAIM_B,
75
+ "AAVE-V1-A": AAVE_V1_A_1.AAVE_V1,
76
+ "AAVE-V2-A": AAVE_V2_A_1.AAVE_V2,
77
+ "AUTHORITY-A": AUTHORITY_A_1.AUTHORITY_A,
78
+ "BASIC-A": BASIC_A_1.BASIC_A,
79
+ "COMP-A": COMP_A_1.COMP_A,
80
+ "COMPOUND-A": COMPOUND_A_1.COMPOUND_A,
81
+ "MAKERDAO-A": MAKERDAO_A_1.MAKERDAO_A,
82
+ "UNISWAP-A": UNISWAP_A_1.UNISWAP_A,
83
+ "POLYGON-BRIDGE-A": POLYGON_BRIDGE_A_1.POLYGON_BRIDGE_A,
84
+ "AAVE-STAKE-A": AAVE_STAKE_A_1.AAVE_STAKE_A,
85
+ "PARASWAP-A": PARASWAP_A_1.PARASWAP_A,
86
+ "COMPOUND-IMPORT-B": COMPOUND_IMPORT_B_1.COMPOUND_IMPORT_B,
87
+ "AAVE-V2-IMPORT-B": AAVE_V2_IMPORT_B_1.AAVE_V2_IMPORT_B,
88
+ "MAKERDAO-CLAIM-A": MAKERDAO_CLAIM_A_1.MAKERDAO_CLAIM_A,
89
+ };
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const gnosisSafe_json_1 = __importDefault(require("./gnosisSafe.json"));
7
7
  const erc20_json_1 = __importDefault(require("./erc20.json"));
8
8
  const interopX_json_1 = __importDefault(require("./interopX.json"));
9
+ const connectors_1 = require("./connectors");
9
10
  exports.default = {
10
11
  gnosisSafe: gnosisSafe_json_1.default,
11
12
  erc20: erc20_json_1.default,
12
13
  interopX: interopX_json_1.default,
14
+ connectors: connectors_1.connectors,
13
15
  };
@@ -6,10 +6,12 @@ exports.addresses = {
6
6
  gnosisSafe: '0x5635d2910e51da33d9DC0422c893CF4F28B69A25',
7
7
  multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
8
8
  interopX: '0xDB6083df37C5F224a3dF84A4B5f9fB60b6c8670a',
9
+ dsaAddress: '0x9Fbd453a8e7a158510fBae5D9935958507cf4b19',
9
10
  },
10
11
  43114: {
11
12
  gnosisSafe: '0x31d7a5194Fe60AC209Cf1Ce2d539C9A60662Ed6b',
12
13
  multisend: '0x998739BFdAAdde7C933B942a68053933098f9EDa',
13
14
  interopX: '0xd61f55C6d9deD35B9d13243b816c4BcC1d78592b',
15
+ dsaAddress: '0xFcB7d826E32081c4799de2f83b47b49df600dc8c',
14
16
  }
15
17
  };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.blockConfirmations = void 0;
4
+ exports.blockConfirmations = {
5
+ "1": 12,
6
+ "137": 32,
7
+ "43114": 12,
8
+ };
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./addresses"), exports);
18
18
  __exportStar(require("./tokens"), exports);
19
+ __exportStar(require("./blockConfirmations"), exports);
@@ -26,7 +26,7 @@ Transaction.init({
26
26
  sourceBlockNumber: sequelize_2.DataTypes.NUMBER,
27
27
  sourceStatus: {
28
28
  type: sequelize_2.DataTypes.STRING,
29
- defaultValue: 'uninitialised'
29
+ defaultValue: 'pending'
30
30
  },
31
31
  sourceErrors: {
32
32
  type: sequelize_2.DataTypes.JSON,
@@ -47,7 +47,7 @@ Transaction.init({
47
47
  targetBlockNumber: sequelize_2.DataTypes.NUMBER,
48
48
  targetStatus: {
49
49
  type: sequelize_2.DataTypes.STRING,
50
- defaultValue: 'uninitialised'
50
+ defaultValue: 'pending'
51
51
  },
52
52
  targetErrors: {
53
53
  type: sequelize_2.DataTypes.JSON,
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const source_1 = __importDefault(require("./source"));
7
+ const target_1 = __importDefault(require("./target"));
8
+ async function default_1(transaction, type) {
9
+ return type === 'source' ? (0, source_1.default)(transaction) : (0, target_1.default)(transaction);
10
+ }
11
+ exports.default = default_1;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const abi_1 = __importDefault(require("@/abi"));
7
+ const config_1 = __importDefault(require("@/config"));
8
+ const constants_1 = require("@/constants");
9
+ const utils_1 = require("@/utils");
10
+ const ethers_1 = require("ethers");
11
+ const ethers_multisend_1 = require("ethers-multisend");
12
+ async function default_1(transaction) {
13
+ const transactions = [];
14
+ const logs = [];
15
+ const { position, actionId, actionIdHashHash, sourceSender, sourceDsaId, targetDsaId, sourceChainId, targetChainId, vnonce, metadata, } = transaction.submitEvent;
16
+ const sourceChainProvider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(sourceChainId));
17
+ const sourceWallet = new ethers_1.ethers.Wallet(config_1.default.privateKey, sourceChainProvider);
18
+ const interopAddress = constants_1.addresses[sourceChainId].interopX;
19
+ const contract = (0, utils_1.getContract)(interopAddress, abi_1.default.interopX, sourceWallet);
20
+ const sourceSpells = [];
21
+ const commonSpells = [];
22
+ for (const withdraw of position.withdraw) {
23
+ let spellData = {
24
+ connector: "AAVE-V2-A",
25
+ method: "payback",
26
+ args: [withdraw.sourceToken, withdraw.amount, "2", "0", "0"],
27
+ };
28
+ sourceSpells.push({
29
+ connector: spellData.method,
30
+ data: (0, utils_1.encodeConnectorMethod)(spellData),
31
+ });
32
+ }
33
+ for (const supply of position.supply) {
34
+ let spellDataWithdraw = {
35
+ connector: "AAVE-V2-A",
36
+ method: "withdraw",
37
+ args: [supply.sourceToken, supply.amount, "0", "0"],
38
+ };
39
+ sourceSpells.push({
40
+ connector: spellDataWithdraw.method,
41
+ data: (0, utils_1.encodeConnectorMethod)(spellDataWithdraw),
42
+ });
43
+ let spellDataBasicWithdraw = {
44
+ connector: "BASIC-A",
45
+ method: "withdraw",
46
+ args: [supply.sourceToken, supply.amount, interopAddress, "0", "0"],
47
+ };
48
+ sourceSpells.push({
49
+ connector: spellDataBasicWithdraw.method,
50
+ data: (0, utils_1.encodeConnectorMethod)(spellDataBasicWithdraw),
51
+ });
52
+ }
53
+ const { data } = await contract.populateTransaction.sourceAction(sourceSpells, commonSpells, position, actionId, sourceSender, sourceDsaId, targetDsaId, sourceChainId, targetChainId, vnonce, metadata);
54
+ transactions.push({
55
+ to: interopAddress,
56
+ data: data,
57
+ value: "0",
58
+ operation: ethers_multisend_1.OperationType.Call,
59
+ });
60
+ return { transactions, logs };
61
+ }
62
+ exports.default = default_1;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ async function default_1(transaction) {
4
+ const transactions = [];
5
+ const logs = [];
6
+ return { transactions, logs };
7
+ }
8
+ exports.default = default_1;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const withdraw_1 = __importDefault(require("./withdraw"));
6
+ const aaveV2_1 = __importDefault(require("./aaveV2"));
7
7
  exports.default = {
8
- withdraw: withdraw_1.default,
8
+ 'A:AAVE-V2:AAVE-V2': aaveV2_1.default,
9
9
  };
package/dist/src/index.js CHANGED
@@ -13,7 +13,7 @@ const package_json_1 = __importDefault(require("../package.json"));
13
13
  dotenv_1.default.config();
14
14
  const logger_1 = __importDefault(require("@/logger"));
15
15
  const logger = new logger_1.default('Process');
16
- const GIT_SHORT_HASH = 'a9cd1d2';
16
+ const GIT_SHORT_HASH = 'acc4865';
17
17
  const printUsage = () => {
18
18
  console.log();
19
19
  console.log(`Interop X Node (v${package_json_1.default.version} - rev.${GIT_SHORT_HASH})`);
@@ -40,9 +40,9 @@ class SignatureDialProtocol extends BaseDialProtocol_1.BaseDialProtocol {
40
40
  }
41
41
  const { data: gnosisData } = await (0, gnosis_1.buildGnosisAction)(transaction, data.type);
42
42
  const signedData = await (0, utils_1.signGnosisSafeTx)({
43
- to: constants_1.addresses[transaction.sourceChainId].multisend,
43
+ to: constants_1.addresses[data.chainId].multisend,
44
44
  data: gnosisData,
45
- chainId: transaction.sourceChainId,
45
+ chainId: data.chainId,
46
46
  safeTxGas: data.safeTxGas,
47
47
  nonce: data.safeNonce,
48
48
  }, { signer });
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseTask_1 = require("../BaseTask");
7
+ const logger_1 = __importDefault(require("@/logger"));
8
+ const ethers_1 = require("ethers");
9
+ const abi_1 = __importDefault(require("@/abi"));
10
+ const db_1 = require("@/db");
11
+ const utils_1 = require("@/utils");
12
+ const constants_1 = require("@/constants");
13
+ const config_1 = __importDefault(require("@/config"));
14
+ const moment_1 = __importDefault(require("moment"));
15
+ const sequelize_1 = require("sequelize");
16
+ const gnosis_1 = require("@/gnosis");
17
+ const net_1 = require("@/net");
18
+ const waait_1 = __importDefault(require("waait"));
19
+ class ProcessSubmitSubmitEvents extends BaseTask_1.BaseTask {
20
+ constructor({ chainId }) {
21
+ super({
22
+ logger: new logger_1.default("InteropX::ProcessSubmitSubmitEvents"),
23
+ });
24
+ this.leadNodeOnly = true;
25
+ this.blockConfirmationsCount = 12;
26
+ this.chainId = chainId;
27
+ }
28
+ async pollHandler() {
29
+ var _a;
30
+ const currentBlockNumber = await this.sourceProvider.getBlockNumber();
31
+ const transaction = await db_1.Transaction.findOne({
32
+ where: {
33
+ status: "pending",
34
+ sourceStatus: "pending",
35
+ sourceChainId: this.chainId,
36
+ submitBlockNumber: {
37
+ [sequelize_1.Op.lt]: currentBlockNumber - this.blockConfirmationsCount,
38
+ },
39
+ sourceDelayUntil: {
40
+ [sequelize_1.Op.or]: {
41
+ [sequelize_1.Op.is]: null,
42
+ [sequelize_1.Op.lt]: new Date(),
43
+ },
44
+ },
45
+ submitEvent: { $ne: null },
46
+ createdAt: {
47
+ [sequelize_1.Op.gt]: (0, moment_1.default)().subtract({ hours: 12 }).toDate(),
48
+ },
49
+ },
50
+ });
51
+ if (!transaction) {
52
+ return;
53
+ }
54
+ transaction.sourceStatus = "proccessing";
55
+ await transaction.save();
56
+ const ownersThreshold = await this.sourceGnosisContract.getThreshold();
57
+ await (0, waait_1.default)(10000);
58
+ let data, logs = [];
59
+ try {
60
+ ({ data, logs } = await (0, gnosis_1.buildGnosisAction)(transaction, "source"));
61
+ }
62
+ catch (error) {
63
+ if (error instanceof utils_1.LiquidityError) {
64
+ await transaction.save();
65
+ transaction.sourceDelayUntil = new Date(Date.now() + 60 * 5 * 1000);
66
+ transaction.sourceStatus = "pending";
67
+ await transaction.save();
68
+ throw error;
69
+ return;
70
+ }
71
+ transaction.sourceStatus = "failed";
72
+ transaction.sourceErrors = [error.message];
73
+ transaction.targetStatus = "failed";
74
+ transaction.status = "failed";
75
+ await transaction.save();
76
+ net_1.protocol.sendTransaction(transaction);
77
+ return;
78
+ }
79
+ let gnosisTx = await (0, utils_1.generateGnosisTransaction)({
80
+ baseGas: "0",
81
+ data,
82
+ gasPrice: "0",
83
+ gasToken: "0x0000000000000000000000000000000000000000",
84
+ nonce: "0",
85
+ operation: "1",
86
+ refundReceiver: "0x0000000000000000000000000000000000000000",
87
+ safeAddress: this.sourceGnosisContract.address,
88
+ safeTxGas: "79668",
89
+ to: constants_1.addresses[transaction.sourceChainId].multisend,
90
+ value: "0",
91
+ }, this.sourceGnosisContract);
92
+ const owners = await this.sourceGnosisContract
93
+ .getOwners()
94
+ .then((owners) => owners.map((owner) => owner.toLowerCase()));
95
+ const ownerPeerIds = net_1.peerPool.activePeers
96
+ .filter((peer) => owners.includes(peer.publicAddress.toLowerCase()))
97
+ .map((peer) => peer.id);
98
+ console.log(`Collecting signatures for execution ${transaction.transactionHash}`);
99
+ console.log(ownerPeerIds);
100
+ const signatures = await net_1.protocol.requestSignatures({
101
+ type: "source",
102
+ transactionHash: transaction.transactionHash,
103
+ safeTxGas: gnosisTx.safeTxGas,
104
+ safeNonce: gnosisTx.nonce,
105
+ chainId: this.chainId,
106
+ }, ownerPeerIds);
107
+ const validSignatures = signatures.filter((s) => !!s.data && s.data !== "0x");
108
+ console.log({
109
+ signatures,
110
+ validSignatures,
111
+ ownersThreshold: ownersThreshold.toString(),
112
+ });
113
+ if (validSignatures.length === 0 ||
114
+ ownersThreshold.gt(validSignatures.length)) {
115
+ await transaction.save();
116
+ transaction.sourceDelayUntil = new Date(Date.now() + 30 * 1000);
117
+ transaction.sourceStatus = "pending";
118
+ await transaction.save();
119
+ const errorMessage = (_a = signatures.find((s) => !!s.error)) === null || _a === void 0 ? void 0 : _a.error;
120
+ throw new Error(`Not enough signatures` + (errorMessage ? `: ${errorMessage}` : ""));
121
+ }
122
+ console.log(`Executing transaction for execution ${transaction.transactionHash}`);
123
+ const { data: txData } = await this.sourceGnosisContract.populateTransaction.execTransaction(gnosisTx.to, gnosisTx.value, gnosisTx.data, gnosisTx.operation, gnosisTx.safeTxGas, gnosisTx.baseGas, gnosisTx.gasPrice, gnosisTx.gasToken, gnosisTx.refundReceiver, (0, utils_1.buildSignatureBytes)(validSignatures));
124
+ const txSent = await this.sourceWallet.sendTransaction({
125
+ from: this.sourceWallet.address,
126
+ gasPrice: ethers_1.ethers.BigNumber.from(120 * 10 ** 9),
127
+ to: this.sourceGnosisContract.address,
128
+ data: txData,
129
+ });
130
+ console.log(txSent);
131
+ const receipt = await txSent.wait();
132
+ const parsedLogs = [];
133
+ receipt.logs.forEach((log) => {
134
+ try {
135
+ parsedLogs.push(this.sourceGnosisContract.interface.parseLog(log));
136
+ }
137
+ catch (e) { }
138
+ });
139
+ if (parsedLogs.find((e) => e.name === "ExecutionSuccess")) {
140
+ console.log("ExecutionSuccess");
141
+ transaction.sourceStatus = "success";
142
+ if (txSent.blockNumber)
143
+ transaction.sourceBlockNumber = txSent.blockNumber;
144
+ transaction.sourceTransactionHash = txSent.hash;
145
+ transaction.sourceLogs = logs;
146
+ await transaction.save();
147
+ }
148
+ else {
149
+ console.log("ExecutionFailure");
150
+ transaction.sourceStatus = "failed";
151
+ if (txSent.blockNumber)
152
+ transaction.sourceBlockNumber = txSent.blockNumber;
153
+ transaction.sourceTransactionHash = txSent.hash;
154
+ transaction.sourceTransactionHash = txSent.hash;
155
+ transaction.status = "failed";
156
+ await transaction.save();
157
+ }
158
+ net_1.protocol.sendTransaction(transaction);
159
+ }
160
+ async start() {
161
+ this.blockConfirmationsCount = constants_1.blockConfirmations[this.chainId] + 1;
162
+ this.sourceProvider = new ethers_1.ethers.providers.JsonRpcProvider((0, utils_1.getRpcProviderUrl)(this.chainId));
163
+ this.sourceWallet = new ethers_1.ethers.Wallet(config_1.default.privateKey, this.sourceProvider);
164
+ this.sourceGnosisContract = (0, utils_1.getContract)(constants_1.addresses[this.chainId].gnosisSafe, abi_1.default.interopX, this.sourceWallet);
165
+ await super.start();
166
+ }
167
+ }
168
+ exports.default = ProcessSubmitSubmitEvents;
@@ -38,7 +38,9 @@ class SyncLogSubmitEvents extends BaseTask_1.BaseTask {
38
38
  targetDsaId: targetDsaId.toString(),
39
39
  };
40
40
  let transactionHash = (0, utils_1.generateInteropTransactionHash)(uniqueIdentifier);
41
- const transaction = await db_1.Transaction.findOne({ where: { transactionHash } });
41
+ const transaction = await db_1.Transaction.findOne({
42
+ where: { transactionHash },
43
+ });
42
44
  if (transaction) {
43
45
  continue;
44
46
  }
@@ -50,12 +52,12 @@ class SyncLogSubmitEvents extends BaseTask_1.BaseTask {
50
52
  withdraw: position.withdraw.map((v) => ({
51
53
  sourceToken: v.sourceToken,
52
54
  targetToken: v.targetToken,
53
- amount: v.amount.toString()
55
+ amount: v.amount.toString(),
54
56
  })),
55
57
  supply: position.supply.map((v) => ({
56
58
  sourceToken: v.sourceToken,
57
59
  targetToken: v.targetToken,
58
- amount: v.amount.toString()
60
+ amount: v.amount.toString(),
59
61
  })),
60
62
  },
61
63
  sourceChainId: sourceChainId.toNumber(),
@@ -20,15 +20,16 @@ class SyncTransactionStatusTask extends BaseTask_1.BaseTask {
20
20
  // if transaction is pending for more than 1 hour, check lead node for status
21
21
  const leadNode = net_1.peerPool.getLeadPeer();
22
22
  if (!leadNode) {
23
+ console.log("No lead node found");
23
24
  return;
24
25
  }
25
26
  const transaction = await db_1.Transaction.findOne({
26
27
  where: {
27
- sourceStatus: {
28
+ status: {
28
29
  [sequelize_1.Op.notIn]: ['success', 'failed'],
29
30
  },
30
- sourceCreatedAt: {
31
- [sequelize_1.Op.gte]: new Date(Date.now() - 15 * 60 * 1000),
31
+ createdAt: {
32
+ [sequelize_1.Op.lt]: new Date(Date.now() - 15 * 60 * 1000),
32
33
  },
33
34
  }
34
35
  });
@@ -5,8 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Tasks = void 0;
7
7
  const waait_1 = __importDefault(require("waait"));
8
+ const SyncTransactionStatusTask_1 = __importDefault(require("./Transactions/SyncTransactionStatusTask"));
8
9
  const AutoUpdateTask_1 = __importDefault(require("./AutoUpdateTask"));
9
10
  const SyncLogSubmitEvents_1 = __importDefault(require("./InteropX/SyncLogSubmitEvents"));
11
+ const ProcessSubmitSubmitEvents_1 = __importDefault(require("./InteropX/ProcessSubmitSubmitEvents"));
10
12
  class Tasks {
11
13
  constructor() {
12
14
  this.tasks = [
@@ -15,6 +17,9 @@ class Tasks {
15
17
  // InteropX
16
18
  new SyncLogSubmitEvents_1.default({ chainId: 137 }),
17
19
  new SyncLogSubmitEvents_1.default({ chainId: 43114 }),
20
+ new ProcessSubmitSubmitEvents_1.default({ chainId: 137 }),
21
+ new ProcessSubmitSubmitEvents_1.default({ chainId: 43114 }),
22
+ new SyncTransactionStatusTask_1.default(),
18
23
  ];
19
24
  }
20
25
  async start() {