@superfluid-finance/sdk-core 0.3.3-dev.a92870f.0 → 0.3.3-dev.bd59c6c.0

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 (382) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.md +2 -0
  3. package/dist/index.umd.js +6034 -2012
  4. package/dist/main/BatchCall.d.ts +6 -6
  5. package/dist/main/BatchCall.js +8 -8
  6. package/dist/main/BatchCall.js.map +1 -1
  7. package/dist/main/ConstantFlowAgreementV1.d.ts +106 -17
  8. package/dist/main/ConstantFlowAgreementV1.d.ts.map +1 -1
  9. package/dist/main/ConstantFlowAgreementV1.js +238 -50
  10. package/dist/main/ConstantFlowAgreementV1.js.map +1 -1
  11. package/dist/main/{Token.d.ts → ERC20Token.d.ts} +17 -14
  12. package/dist/main/ERC20Token.d.ts.map +1 -0
  13. package/dist/main/{Token.js → ERC20Token.js} +29 -33
  14. package/dist/main/ERC20Token.js.map +1 -0
  15. package/dist/main/Framework.d.ts +34 -7
  16. package/dist/main/Framework.d.ts.map +1 -1
  17. package/dist/main/Framework.js +88 -15
  18. package/dist/main/Framework.js.map +1 -1
  19. package/dist/main/Governance.d.ts +40 -0
  20. package/dist/main/Governance.d.ts.map +1 -0
  21. package/dist/main/Governance.js +82 -0
  22. package/dist/main/Governance.js.map +1 -0
  23. package/dist/main/Host.d.ts +3 -3
  24. package/dist/main/Host.d.ts.map +1 -1
  25. package/dist/main/Host.js +4 -4
  26. package/dist/main/Host.js.map +1 -1
  27. package/dist/main/InstantDistributionAgreementV1.d.ts +25 -22
  28. package/dist/main/InstantDistributionAgreementV1.d.ts.map +1 -1
  29. package/dist/main/InstantDistributionAgreementV1.js +69 -71
  30. package/dist/main/InstantDistributionAgreementV1.js.map +1 -1
  31. package/dist/main/Operation.d.ts +5 -5
  32. package/dist/main/Operation.js +5 -5
  33. package/dist/main/Query.d.ts +6 -6
  34. package/dist/main/Query.d.ts.map +1 -1
  35. package/dist/main/Query.js +18 -16
  36. package/dist/main/Query.js.map +1 -1
  37. package/dist/main/SFError.d.ts +1 -1
  38. package/dist/main/SFError.d.ts.map +1 -1
  39. package/dist/main/SFError.js +2 -0
  40. package/dist/main/SFError.js.map +1 -1
  41. package/dist/main/SuperToken.d.ts +226 -67
  42. package/dist/main/SuperToken.d.ts.map +1 -1
  43. package/dist/main/SuperToken.js +318 -132
  44. package/dist/main/SuperToken.js.map +1 -1
  45. package/dist/main/abi/IConstantFlowAgreementV1.json +335 -2
  46. package/dist/main/abi/ISETH.json +1604 -0
  47. package/dist/main/abi/SuperfluidGovernanceII.json +921 -0
  48. package/dist/main/constants.d.ts +4 -0
  49. package/dist/main/constants.d.ts.map +1 -1
  50. package/dist/main/constants.js +36 -13
  51. package/dist/main/constants.js.map +1 -1
  52. package/dist/main/defaultSubgraphReleaseTag.json +3 -0
  53. package/dist/main/events.d.ts +14 -2
  54. package/dist/main/events.d.ts.map +1 -1
  55. package/dist/main/frameworkHelpers.d.ts +2 -2
  56. package/dist/main/frameworkHelpers.js +2 -2
  57. package/dist/main/index.d.ts +16 -5
  58. package/dist/main/index.d.ts.map +1 -1
  59. package/dist/main/index.js +12 -1
  60. package/dist/main/index.js.map +1 -1
  61. package/dist/main/interfaces.d.ts +81 -8
  62. package/dist/main/interfaces.d.ts.map +1 -1
  63. package/dist/main/mapGetAllEventsQueryEvents.d.ts.map +1 -1
  64. package/dist/main/mapGetAllEventsQueryEvents.js +22 -1
  65. package/dist/main/mapGetAllEventsQueryEvents.js.map +1 -1
  66. package/dist/main/pagination.d.ts +42 -4
  67. package/dist/main/pagination.d.ts.map +1 -1
  68. package/dist/main/pagination.js +36 -5
  69. package/dist/main/pagination.js.map +1 -1
  70. package/dist/main/subgraph/SubgraphClient.d.ts +2 -2
  71. package/dist/main/subgraph/SubgraphClient.d.ts.map +1 -1
  72. package/dist/main/subgraph/SubgraphClient.js +0 -12
  73. package/dist/main/subgraph/SubgraphClient.js.map +1 -1
  74. package/dist/main/subgraph/entities/account/account.d.ts +1 -0
  75. package/dist/main/subgraph/entities/account/account.d.ts.map +1 -1
  76. package/dist/main/subgraph/entities/account/accounts.generated.d.ts +2 -0
  77. package/dist/main/subgraph/entities/account/accounts.generated.d.ts.map +1 -1
  78. package/dist/main/subgraph/entities/account/accounts.generated.js +1 -1
  79. package/dist/main/subgraph/entities/account/accounts.generated.js.map +1 -1
  80. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts +2 -0
  81. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts.map +1 -1
  82. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js +1 -0
  83. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js.map +1 -1
  84. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts +3 -0
  85. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts.map +1 -1
  86. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js +1 -1
  87. package/dist/main/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js.map +1 -1
  88. package/dist/main/subgraph/entities/index/index.d.ts +2 -0
  89. package/dist/main/subgraph/entities/index/index.d.ts.map +1 -1
  90. package/dist/main/subgraph/entities/index/index.js +1 -0
  91. package/dist/main/subgraph/entities/index/index.js.map +1 -1
  92. package/dist/main/subgraph/entities/index/indexes.generated.d.ts +3 -0
  93. package/dist/main/subgraph/entities/index/indexes.generated.d.ts.map +1 -1
  94. package/dist/main/subgraph/entities/index/indexes.generated.js +1 -1
  95. package/dist/main/subgraph/entities/index/indexes.generated.js.map +1 -1
  96. package/dist/main/subgraph/entities/indexSubscription/indexSubscription.d.ts +2 -0
  97. package/dist/main/subgraph/entities/indexSubscription/indexSubscription.d.ts.map +1 -1
  98. package/dist/main/subgraph/entities/indexSubscription/indexSubscription.js +1 -0
  99. package/dist/main/subgraph/entities/indexSubscription/indexSubscription.js.map +1 -1
  100. package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts +3 -0
  101. package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts.map +1 -1
  102. package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.js +1 -1
  103. package/dist/main/subgraph/entities/indexSubscription/indexSubscriptions.generated.js.map +1 -1
  104. package/dist/main/subgraph/entities/stream/stream.d.ts +2 -0
  105. package/dist/main/subgraph/entities/stream/stream.d.ts.map +1 -1
  106. package/dist/main/subgraph/entities/stream/stream.js +1 -0
  107. package/dist/main/subgraph/entities/stream/stream.js.map +1 -1
  108. package/dist/main/subgraph/entities/stream/streams.generated.d.ts +3 -0
  109. package/dist/main/subgraph/entities/stream/streams.generated.d.ts.map +1 -1
  110. package/dist/main/subgraph/entities/stream/streams.generated.js +1 -1
  111. package/dist/main/subgraph/entities/stream/streams.generated.js.map +1 -1
  112. package/dist/main/subgraph/entities/streamPeriod/streamPeriod.d.ts +2 -0
  113. package/dist/main/subgraph/entities/streamPeriod/streamPeriod.d.ts.map +1 -1
  114. package/dist/main/subgraph/entities/streamPeriod/streamPeriod.js +1 -0
  115. package/dist/main/subgraph/entities/streamPeriod/streamPeriod.js.map +1 -1
  116. package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts +3 -0
  117. package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts.map +1 -1
  118. package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.js +1 -1
  119. package/dist/main/subgraph/entities/streamPeriod/streamPeriods.generated.js.map +1 -1
  120. package/dist/main/subgraph/entities/token/token.d.ts +1 -0
  121. package/dist/main/subgraph/entities/token/token.d.ts.map +1 -1
  122. package/dist/main/subgraph/entities/token/tokens.generated.d.ts +2 -0
  123. package/dist/main/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
  124. package/dist/main/subgraph/entities/token/tokens.generated.js +1 -1
  125. package/dist/main/subgraph/entities/token/tokens.generated.js.map +1 -1
  126. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistic.d.ts +1 -0
  127. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistic.d.ts.map +1 -1
  128. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts +2 -0
  129. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts.map +1 -1
  130. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.js +1 -1
  131. package/dist/main/subgraph/entities/tokenStatistic/tokenStatistics.generated.js.map +1 -1
  132. package/dist/main/subgraph/events/events.d.ts +1 -0
  133. package/dist/main/subgraph/events/events.d.ts.map +1 -1
  134. package/dist/main/subgraph/events/events.generated.d.ts +118 -3
  135. package/dist/main/subgraph/events/events.generated.d.ts.map +1 -1
  136. package/dist/main/subgraph/events/events.generated.js +38 -37
  137. package/dist/main/subgraph/events/events.generated.js.map +1 -1
  138. package/dist/main/subgraph/events/flowUpdatedEvent.d.ts +1 -0
  139. package/dist/main/subgraph/events/flowUpdatedEvent.d.ts.map +1 -1
  140. package/dist/main/subgraph/events/indexUpdatedEvent.d.ts +1 -0
  141. package/dist/main/subgraph/events/indexUpdatedEvent.d.ts.map +1 -1
  142. package/dist/main/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts +1 -0
  143. package/dist/main/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts.map +1 -1
  144. package/dist/main/subgraph/meta/meta.d.ts +15 -0
  145. package/dist/main/subgraph/meta/meta.d.ts.map +1 -0
  146. package/dist/main/subgraph/meta/meta.generated.d.ts +19 -0
  147. package/dist/main/subgraph/meta/meta.generated.d.ts.map +1 -0
  148. package/dist/main/subgraph/meta/meta.generated.js +5 -0
  149. package/dist/main/subgraph/meta/meta.generated.js.map +1 -0
  150. package/dist/main/subgraph/meta/meta.js +20 -0
  151. package/dist/main/subgraph/meta/meta.js.map +1 -0
  152. package/dist/main/subgraph/queries/getAllEvents.generated.d.ts +12 -0
  153. package/dist/main/subgraph/queries/getAllEvents.generated.d.ts.map +1 -1
  154. package/dist/main/subgraph/queries/getAllEvents.generated.js +1 -1
  155. package/dist/main/subgraph/queries/getAllEvents.generated.js.map +1 -1
  156. package/dist/main/subgraph/schema.generated.d.ts +817 -5
  157. package/dist/main/subgraph/schema.generated.d.ts.map +1 -1
  158. package/dist/main/subgraph/subgraphQueryHandler.d.ts +6 -3
  159. package/dist/main/subgraph/subgraphQueryHandler.d.ts.map +1 -1
  160. package/dist/main/subgraph/subgraphQueryHandler.js +30 -16
  161. package/dist/main/subgraph/subgraphQueryHandler.js.map +1 -1
  162. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +187 -5
  163. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
  164. package/dist/main/typechain/ISETH.d.ts +1068 -0
  165. package/dist/main/typechain/ISETH.d.ts.map +1 -0
  166. package/dist/main/typechain/ISETH.js +3 -0
  167. package/dist/main/typechain/ISETH.js.map +1 -0
  168. package/dist/main/typechain/SuperfluidGovernanceII.d.ts +617 -0
  169. package/dist/main/typechain/SuperfluidGovernanceII.d.ts.map +1 -0
  170. package/dist/main/typechain/SuperfluidGovernanceII.js +3 -0
  171. package/dist/main/typechain/SuperfluidGovernanceII.js.map +1 -0
  172. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  173. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js +335 -2
  174. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  175. package/dist/main/typechain/factories/ISETH__factory.d.ts +36 -0
  176. package/dist/main/typechain/factories/ISETH__factory.d.ts.map +1 -0
  177. package/dist/main/typechain/factories/ISETH__factory.js +1622 -0
  178. package/dist/main/typechain/factories/ISETH__factory.js.map +1 -0
  179. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts +36 -0
  180. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -0
  181. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js +939 -0
  182. package/dist/main/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
  183. package/dist/main/typechain/index.d.ts +4 -0
  184. package/dist/main/typechain/index.d.ts.map +1 -1
  185. package/dist/main/typechain/index.js +5 -1
  186. package/dist/main/typechain/index.js.map +1 -1
  187. package/dist/main/utils.d.ts +15 -13
  188. package/dist/main/utils.d.ts.map +1 -1
  189. package/dist/main/utils.js +29 -15
  190. package/dist/main/utils.js.map +1 -1
  191. package/dist/module/BatchCall.d.ts +6 -6
  192. package/dist/module/BatchCall.js +8 -8
  193. package/dist/module/BatchCall.js.map +1 -1
  194. package/dist/module/ConstantFlowAgreementV1.d.ts +106 -17
  195. package/dist/module/ConstantFlowAgreementV1.d.ts.map +1 -1
  196. package/dist/module/ConstantFlowAgreementV1.js +239 -51
  197. package/dist/module/ConstantFlowAgreementV1.js.map +1 -1
  198. package/dist/module/{Token.d.ts → ERC20Token.d.ts} +17 -14
  199. package/dist/module/ERC20Token.d.ts.map +1 -0
  200. package/dist/module/{Token.js → ERC20Token.js} +28 -32
  201. package/dist/module/ERC20Token.js.map +1 -0
  202. package/dist/module/Framework.d.ts +34 -7
  203. package/dist/module/Framework.d.ts.map +1 -1
  204. package/dist/module/Framework.js +88 -15
  205. package/dist/module/Framework.js.map +1 -1
  206. package/dist/module/Governance.d.ts +40 -0
  207. package/dist/module/Governance.d.ts.map +1 -0
  208. package/dist/module/Governance.js +76 -0
  209. package/dist/module/Governance.js.map +1 -0
  210. package/dist/module/Host.d.ts +3 -3
  211. package/dist/module/Host.d.ts.map +1 -1
  212. package/dist/module/Host.js +4 -4
  213. package/dist/module/Host.js.map +1 -1
  214. package/dist/module/InstantDistributionAgreementV1.d.ts +25 -22
  215. package/dist/module/InstantDistributionAgreementV1.d.ts.map +1 -1
  216. package/dist/module/InstantDistributionAgreementV1.js +69 -71
  217. package/dist/module/InstantDistributionAgreementV1.js.map +1 -1
  218. package/dist/module/Operation.d.ts +5 -5
  219. package/dist/module/Operation.js +5 -5
  220. package/dist/module/Query.d.ts +6 -6
  221. package/dist/module/Query.d.ts.map +1 -1
  222. package/dist/module/Query.js +16 -16
  223. package/dist/module/Query.js.map +1 -1
  224. package/dist/module/SFError.d.ts +1 -1
  225. package/dist/module/SFError.d.ts.map +1 -1
  226. package/dist/module/SFError.js +2 -0
  227. package/dist/module/SFError.js.map +1 -1
  228. package/dist/module/SuperToken.d.ts +226 -67
  229. package/dist/module/SuperToken.d.ts.map +1 -1
  230. package/dist/module/SuperToken.js +315 -133
  231. package/dist/module/SuperToken.js.map +1 -1
  232. package/dist/module/abi/IConstantFlowAgreementV1.json +335 -2
  233. package/dist/module/abi/ISETH.json +1604 -0
  234. package/dist/module/abi/SuperfluidGovernanceII.json +921 -0
  235. package/dist/module/constants.d.ts +4 -0
  236. package/dist/module/constants.d.ts.map +1 -1
  237. package/dist/module/constants.js +32 -12
  238. package/dist/module/constants.js.map +1 -1
  239. package/dist/module/defaultSubgraphReleaseTag.json +3 -0
  240. package/dist/module/events.d.ts +14 -2
  241. package/dist/module/events.d.ts.map +1 -1
  242. package/dist/module/frameworkHelpers.d.ts +2 -2
  243. package/dist/module/frameworkHelpers.js +2 -2
  244. package/dist/module/index.d.ts +16 -5
  245. package/dist/module/index.d.ts.map +1 -1
  246. package/dist/module/index.js +16 -5
  247. package/dist/module/index.js.map +1 -1
  248. package/dist/module/interfaces.d.ts +81 -8
  249. package/dist/module/interfaces.d.ts.map +1 -1
  250. package/dist/module/mapGetAllEventsQueryEvents.d.ts.map +1 -1
  251. package/dist/module/mapGetAllEventsQueryEvents.js +22 -1
  252. package/dist/module/mapGetAllEventsQueryEvents.js.map +1 -1
  253. package/dist/module/pagination.d.ts +42 -4
  254. package/dist/module/pagination.d.ts.map +1 -1
  255. package/dist/module/pagination.js +30 -5
  256. package/dist/module/pagination.js.map +1 -1
  257. package/dist/module/subgraph/SubgraphClient.d.ts +2 -2
  258. package/dist/module/subgraph/SubgraphClient.d.ts.map +1 -1
  259. package/dist/module/subgraph/SubgraphClient.js +1 -13
  260. package/dist/module/subgraph/SubgraphClient.js.map +1 -1
  261. package/dist/module/subgraph/entities/account/account.d.ts +1 -0
  262. package/dist/module/subgraph/entities/account/account.d.ts.map +1 -1
  263. package/dist/module/subgraph/entities/account/accounts.generated.d.ts +2 -0
  264. package/dist/module/subgraph/entities/account/accounts.generated.d.ts.map +1 -1
  265. package/dist/module/subgraph/entities/account/accounts.generated.js +1 -1
  266. package/dist/module/subgraph/entities/account/accounts.generated.js.map +1 -1
  267. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts +2 -0
  268. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.d.ts.map +1 -1
  269. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js +1 -0
  270. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshot.js.map +1 -1
  271. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts +3 -0
  272. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.d.ts.map +1 -1
  273. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js +1 -1
  274. package/dist/module/subgraph/entities/accountTokenSnapshot/accountTokenSnapshots.generated.js.map +1 -1
  275. package/dist/module/subgraph/entities/index/index.d.ts +2 -0
  276. package/dist/module/subgraph/entities/index/index.d.ts.map +1 -1
  277. package/dist/module/subgraph/entities/index/index.js +1 -0
  278. package/dist/module/subgraph/entities/index/index.js.map +1 -1
  279. package/dist/module/subgraph/entities/index/indexes.generated.d.ts +3 -0
  280. package/dist/module/subgraph/entities/index/indexes.generated.d.ts.map +1 -1
  281. package/dist/module/subgraph/entities/index/indexes.generated.js +1 -1
  282. package/dist/module/subgraph/entities/index/indexes.generated.js.map +1 -1
  283. package/dist/module/subgraph/entities/indexSubscription/indexSubscription.d.ts +2 -0
  284. package/dist/module/subgraph/entities/indexSubscription/indexSubscription.d.ts.map +1 -1
  285. package/dist/module/subgraph/entities/indexSubscription/indexSubscription.js +1 -0
  286. package/dist/module/subgraph/entities/indexSubscription/indexSubscription.js.map +1 -1
  287. package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts +3 -0
  288. package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.d.ts.map +1 -1
  289. package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.js +1 -1
  290. package/dist/module/subgraph/entities/indexSubscription/indexSubscriptions.generated.js.map +1 -1
  291. package/dist/module/subgraph/entities/stream/stream.d.ts +2 -0
  292. package/dist/module/subgraph/entities/stream/stream.d.ts.map +1 -1
  293. package/dist/module/subgraph/entities/stream/stream.js +1 -0
  294. package/dist/module/subgraph/entities/stream/stream.js.map +1 -1
  295. package/dist/module/subgraph/entities/stream/streams.generated.d.ts +3 -0
  296. package/dist/module/subgraph/entities/stream/streams.generated.d.ts.map +1 -1
  297. package/dist/module/subgraph/entities/stream/streams.generated.js +1 -1
  298. package/dist/module/subgraph/entities/stream/streams.generated.js.map +1 -1
  299. package/dist/module/subgraph/entities/streamPeriod/streamPeriod.d.ts +2 -0
  300. package/dist/module/subgraph/entities/streamPeriod/streamPeriod.d.ts.map +1 -1
  301. package/dist/module/subgraph/entities/streamPeriod/streamPeriod.js +1 -0
  302. package/dist/module/subgraph/entities/streamPeriod/streamPeriod.js.map +1 -1
  303. package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts +3 -0
  304. package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.d.ts.map +1 -1
  305. package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.js +1 -1
  306. package/dist/module/subgraph/entities/streamPeriod/streamPeriods.generated.js.map +1 -1
  307. package/dist/module/subgraph/entities/token/token.d.ts +1 -0
  308. package/dist/module/subgraph/entities/token/token.d.ts.map +1 -1
  309. package/dist/module/subgraph/entities/token/tokens.generated.d.ts +2 -0
  310. package/dist/module/subgraph/entities/token/tokens.generated.d.ts.map +1 -1
  311. package/dist/module/subgraph/entities/token/tokens.generated.js +1 -1
  312. package/dist/module/subgraph/entities/token/tokens.generated.js.map +1 -1
  313. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistic.d.ts +1 -0
  314. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistic.d.ts.map +1 -1
  315. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts +2 -0
  316. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.d.ts.map +1 -1
  317. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.js +1 -1
  318. package/dist/module/subgraph/entities/tokenStatistic/tokenStatistics.generated.js.map +1 -1
  319. package/dist/module/subgraph/events/events.d.ts +1 -0
  320. package/dist/module/subgraph/events/events.d.ts.map +1 -1
  321. package/dist/module/subgraph/events/events.generated.d.ts +118 -3
  322. package/dist/module/subgraph/events/events.generated.d.ts.map +1 -1
  323. package/dist/module/subgraph/events/events.generated.js +37 -36
  324. package/dist/module/subgraph/events/events.generated.js.map +1 -1
  325. package/dist/module/subgraph/events/flowUpdatedEvent.d.ts +1 -0
  326. package/dist/module/subgraph/events/flowUpdatedEvent.d.ts.map +1 -1
  327. package/dist/module/subgraph/events/indexUpdatedEvent.d.ts +1 -0
  328. package/dist/module/subgraph/events/indexUpdatedEvent.d.ts.map +1 -1
  329. package/dist/module/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts +1 -0
  330. package/dist/module/subgraph/events/subscriptionUnitsUpdatedEvents.d.ts.map +1 -1
  331. package/dist/module/subgraph/meta/meta.d.ts +15 -0
  332. package/dist/module/subgraph/meta/meta.d.ts.map +1 -0
  333. package/dist/module/subgraph/meta/meta.generated.d.ts +19 -0
  334. package/dist/module/subgraph/meta/meta.generated.d.ts.map +1 -0
  335. package/dist/module/subgraph/meta/meta.generated.js +2 -0
  336. package/dist/module/subgraph/meta/meta.generated.js.map +1 -0
  337. package/dist/module/subgraph/meta/meta.js +16 -0
  338. package/dist/module/subgraph/meta/meta.js.map +1 -0
  339. package/dist/module/subgraph/queries/getAllEvents.generated.d.ts +12 -0
  340. package/dist/module/subgraph/queries/getAllEvents.generated.d.ts.map +1 -1
  341. package/dist/module/subgraph/queries/getAllEvents.generated.js +1 -1
  342. package/dist/module/subgraph/queries/getAllEvents.generated.js.map +1 -1
  343. package/dist/module/subgraph/schema.generated.d.ts +817 -5
  344. package/dist/module/subgraph/schema.generated.d.ts.map +1 -1
  345. package/dist/module/subgraph/subgraphQueryHandler.d.ts +6 -3
  346. package/dist/module/subgraph/subgraphQueryHandler.d.ts.map +1 -1
  347. package/dist/module/subgraph/subgraphQueryHandler.js +31 -17
  348. package/dist/module/subgraph/subgraphQueryHandler.js.map +1 -1
  349. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +187 -5
  350. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts.map +1 -1
  351. package/dist/module/typechain/ISETH.d.ts +1068 -0
  352. package/dist/module/typechain/ISETH.d.ts.map +1 -0
  353. package/dist/module/typechain/ISETH.js +2 -0
  354. package/dist/module/typechain/ISETH.js.map +1 -0
  355. package/dist/module/typechain/SuperfluidGovernanceII.d.ts +617 -0
  356. package/dist/module/typechain/SuperfluidGovernanceII.d.ts.map +1 -0
  357. package/dist/module/typechain/SuperfluidGovernanceII.js +2 -0
  358. package/dist/module/typechain/SuperfluidGovernanceII.js.map +1 -0
  359. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -1
  360. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js +335 -2
  361. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
  362. package/dist/module/typechain/factories/ISETH__factory.d.ts +36 -0
  363. package/dist/module/typechain/factories/ISETH__factory.d.ts.map +1 -0
  364. package/dist/module/typechain/factories/ISETH__factory.js +1618 -0
  365. package/dist/module/typechain/factories/ISETH__factory.js.map +1 -0
  366. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts +36 -0
  367. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.d.ts.map +1 -0
  368. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js +935 -0
  369. package/dist/module/typechain/factories/SuperfluidGovernanceII__factory.js.map +1 -0
  370. package/dist/module/typechain/index.d.ts +4 -0
  371. package/dist/module/typechain/index.d.ts.map +1 -1
  372. package/dist/module/typechain/index.js +2 -0
  373. package/dist/module/typechain/index.js.map +1 -1
  374. package/dist/module/utils.d.ts +15 -13
  375. package/dist/module/utils.d.ts.map +1 -1
  376. package/dist/module/utils.js +27 -15
  377. package/dist/module/utils.js.map +1 -1
  378. package/package.json +11 -41
  379. package/dist/main/Token.d.ts.map +0 -1
  380. package/dist/main/Token.js.map +0 -1
  381. package/dist/module/Token.d.ts.map +0 -1
  382. package/dist/module/Token.js.map +0 -1
@@ -8,11 +8,11 @@ const Operation_1 = __importDefault(require("./Operation"));
8
8
  const SFError_1 = require("./SFError");
9
9
  const ERC20WithTokenInfo_json_1 = __importDefault(require("./abi/ERC20WithTokenInfo.json"));
10
10
  const utils_1 = require("./utils");
11
- class Token {
11
+ class ERC20Token {
12
12
  constructor(address) {
13
- // ERC20 Token Contract Read Functions
13
+ /** ### ERC20 Token Contract Read Functions ### */
14
14
  /**
15
- * @dev Returns the allowance the `owner` has granted the `spender`.
15
+ * Returns the allowance the `owner` has granted the `spender`.
16
16
  * @param owner the owner who has allotted the allowance
17
17
  * @param spender the spender who has received the allowance
18
18
  * @param providerOrSigner a provider or signer for executing a web3 call
@@ -22,7 +22,7 @@ class Token {
22
22
  const normalizedOwner = (0, utils_1.normalizeAddress)(owner);
23
23
  const normalizedSpender = (0, utils_1.normalizeAddress)(spender);
24
24
  try {
25
- const allowance = await this.tokenContract
25
+ const allowance = await this.contract
26
26
  .connect(providerOrSigner)
27
27
  .allowance(normalizedOwner, normalizedSpender);
28
28
  return allowance.toString();
@@ -36,7 +36,7 @@ class Token {
36
36
  }
37
37
  };
38
38
  /**
39
- * @dev Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
39
+ * Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
40
40
  * @param account the account you would like to query
41
41
  * @param providerOrSigner a provider or signer for executing a web3 call
42
42
  * @returns {Promise<string>} the token balance of `account`
@@ -44,7 +44,7 @@ class Token {
44
44
  this.balanceOf = async ({ account, providerOrSigner, }) => {
45
45
  try {
46
46
  const normalizedAccount = (0, utils_1.normalizeAddress)(account);
47
- const balanceOf = await this.tokenContract
47
+ const balanceOf = await this.contract
48
48
  .connect(providerOrSigner)
49
49
  .balanceOf(normalizedAccount);
50
50
  return balanceOf.toString();
@@ -58,15 +58,13 @@ class Token {
58
58
  }
59
59
  };
60
60
  /**
61
- * @dev Returns the token name
61
+ * Returns the token name
62
62
  * @param providerOrSigner a provider or signer for executing a web3 call
63
63
  * @returns {string} the token name
64
64
  */
65
65
  this.name = async ({ providerOrSigner, }) => {
66
66
  try {
67
- const name = await this.tokenContract
68
- .connect(providerOrSigner)
69
- .name();
67
+ const name = await this.contract.connect(providerOrSigner).name();
70
68
  return name;
71
69
  }
72
70
  catch (err) {
@@ -78,13 +76,13 @@ class Token {
78
76
  }
79
77
  };
80
78
  /**
81
- * @dev Returns the token symbol
79
+ * Returns the token symbol
82
80
  * @param providerOrSigner a provider or signer for executing a web3 call
83
81
  * @returns {string} the token symbol
84
82
  */
85
83
  this.symbol = async ({ providerOrSigner, }) => {
86
84
  try {
87
- const symbol = await this.tokenContract
85
+ const symbol = await this.contract
88
86
  .connect(providerOrSigner)
89
87
  .symbol();
90
88
  return symbol;
@@ -98,13 +96,13 @@ class Token {
98
96
  }
99
97
  };
100
98
  /**
101
- * @dev Returns the total supply of the token.
99
+ * Returns the total supply of the token.
102
100
  * @param providerOrSigner a provider or signer for executing a web3 call
103
101
  * @returns {Promise<string>} the total supply of the token
104
102
  */
105
103
  this.totalSupply = async ({ providerOrSigner, }) => {
106
104
  try {
107
- const totalSupply = await this.tokenContract
105
+ const totalSupply = await this.contract
108
106
  .connect(providerOrSigner)
109
107
  .totalSupply();
110
108
  return totalSupply.toString();
@@ -117,50 +115,48 @@ class Token {
117
115
  });
118
116
  }
119
117
  };
120
- // ERC20 Token Contract Write Functions
118
+ /** ### ERC20 Token Contract Write Functions ### */
121
119
  /**
122
- * @dev Approve `receiver` to spend `amount` tokens.
120
+ * Approve `receiver` to spend `amount` tokens.
123
121
  * @param receiver The receiver approved.
124
122
  * @param amount The amount approved.
125
123
  * @param overrides ethers overrides object for more control over the transaction sent.
126
124
  * @returns {Operation} An instance of Operation which can be executed or batched.
127
125
  */
128
- this.approve = ({ receiver, amount, overrides, }) => {
129
- const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
130
- const txn = this.tokenContract.populateTransaction.approve(normalizedReceiver, amount, overrides || {});
126
+ this.approve = (params) => {
127
+ const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
128
+ const txn = this.contract.populateTransaction.approve(normalizedReceiver, params.amount, params.overrides || {});
131
129
  return new Operation_1.default(txn, "ERC20_APPROVE");
132
130
  };
133
131
  /**
134
- * @dev Transfer `receiver` `amount` tokens.
132
+ * Transfer `receiver` `amount` tokens.
135
133
  * @param receiver The receiver of the transfer.
136
134
  * @param amount The amount to be transferred.
137
135
  * @param overrides ethers overrides object for more control over the transaction sent.
138
136
  * @returns {Operation} An instance of Operation which can be executed or batched.
139
137
  */
140
- this.transfer = ({ receiver, amount, overrides, }) => {
141
- const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
142
- const txn = this.tokenContract.populateTransaction.transfer(normalizedReceiver, amount, overrides || {});
138
+ this.transfer = (params) => {
139
+ const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
140
+ const txn = this.contract.populateTransaction.transfer(normalizedReceiver, params.amount, params.overrides || {});
143
141
  return new Operation_1.default(txn, "UNSUPPORTED");
144
142
  };
145
143
  /**
146
- * @dev Transfer from `sender` to `receiver` `amount` tokens.
144
+ * Transfer from `sender` to `receiver` `amount` tokens.
147
145
  * @param sender The sender of the transfer.
148
146
  * @param receiver The receiver of the transfer.
149
147
  * @param amount The amount to be transferred.
150
148
  * @param overrides ethers overrides object for more control over the transaction sent.
151
149
  * @returns {Operation} An instance of Operation which can be executed or batched.
152
150
  */
153
- this.transferFrom = ({ sender, receiver, amount, overrides, }) => {
154
- const normalizedSender = (0, utils_1.normalizeAddress)(sender);
155
- const normalizedReceiver = (0, utils_1.normalizeAddress)(receiver);
156
- const txn = this.tokenContract.populateTransaction.transferFrom(normalizedSender, normalizedReceiver, amount, overrides || {});
151
+ this.transferFrom = (params) => {
152
+ const normalizedSender = (0, utils_1.normalizeAddress)(params.sender);
153
+ const normalizedReceiver = (0, utils_1.normalizeAddress)(params.receiver);
154
+ const txn = this.contract.populateTransaction.transferFrom(normalizedSender, normalizedReceiver, params.amount, params.overrides || {});
157
155
  return new Operation_1.default(txn, "ERC20_TRANSFER_FROM");
158
156
  };
159
157
  this.address = address;
160
- }
161
- get tokenContract() {
162
- return new ethers_1.ethers.Contract(this.address, ERC20WithTokenInfo_json_1.default.abi);
158
+ this.contract = new ethers_1.ethers.Contract(this.address, ERC20WithTokenInfo_json_1.default.abi);
163
159
  }
164
160
  }
165
- exports.default = Token;
166
- //# sourceMappingURL=Token.js.map
161
+ exports.default = ERC20Token;
162
+ //# sourceMappingURL=ERC20Token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20Token.js","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AAEhC,4DAAoC;AACpC,uCAAoC;AACpC,4FAAkE;AAGlE,mCAA2C;AAE3C,MAAqB,UAAU;IAI3B,YAAY,OAAe;QAQ3B,kDAAkD;QAElD;;;;;;WAMG;QACH,cAAS,GAAG,KAAK,EAAE,EACf,KAAK,EACL,OAAO,EACP,gBAAgB,GAKnB,EAAmB,EAAE;YAClB,MAAM,eAAe,GAAG,I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ethers";
4
4
  import Web3 from "web3";
5
5
  import BatchCall from "./BatchCall";
6
6
  import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
7
+ import Governance from "./Governance";
7
8
  import Host from "./Host";
8
9
  import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
9
10
  import Operation from "./Operation";
10
11
  import Query from "./Query";
11
- import SuperToken from "./SuperToken";
12
- import { IConfig, ISignerConstructorOptions } from "./interfaces";
12
+ import SuperToken, { NativeAssetSuperToken, PureSuperToken, WrapperSuperToken } from "./SuperToken";
13
+ import { IConfig, IContracts, ISignerConstructorOptions } from "./interfaces";
13
14
  import { DataMode } from "./types";
14
15
  declare type SupportedProvider = ethers.providers.Provider | (typeof ethers & HardhatEthersHelpers) | Web3;
15
16
  export interface IFrameworkOptions {
@@ -31,19 +32,21 @@ export interface IFrameworkSettings {
31
32
  config: IConfig;
32
33
  }
33
34
  /**
34
- * @dev Superfluid Framework Class
35
+ * Superfluid Framework Class
35
36
  * @description The entrypoint for the SDK-core, `create` an instance of this for full functionality.
36
37
  */
37
38
  export default class Framework {
38
39
  readonly userInputOptions: IFrameworkOptions;
39
40
  settings: IFrameworkSettings;
41
+ contracts: IContracts;
40
42
  cfaV1: ConstantFlowAgreementV1;
43
+ governance: Governance;
41
44
  host: Host;
42
45
  idaV1: InstantDistributionAgreementV1;
43
46
  query: Query;
44
47
  private constructor();
45
48
  /**
46
- * @dev Creates the Framework object based on user provided `options`.
49
+ * Creates the Framework object based on user provided `options`.
47
50
  * @param options.chainId the chainId of your desired network (e.g. 137 = matic)
48
51
  * @param options.customSubgraphQueriesEndpoint your custom subgraph endpoint
49
52
  * @param options.dataMode the data mode you'd like the framework to use (SUBGRAPH_ONLY, SUBGRAPH_WEB3, WEB3_ONLY)
@@ -55,7 +58,7 @@ export default class Framework {
55
58
  */
56
59
  static create: (options: IFrameworkOptions) => Promise<Framework>;
57
60
  /**
58
- * @dev Create a signer which can be used to sign transactions.
61
+ * Create a signer which can be used to sign transactions.
59
62
  * @param options.web3Provider a Web3Provider object (e.g. client side - metamask, web3modal)
60
63
  * @param options.provider an ethers Provider object (e.g. via Hardhat ethers)
61
64
  * @param options.privateKey a test account private key
@@ -64,17 +67,41 @@ export default class Framework {
64
67
  */
65
68
  createSigner: (options: ISignerConstructorOptions) => Signer;
66
69
  /**
67
- * @dev Create a `BatchCall` class from the `Framework`.
70
+ * Create a `BatchCall` class from the `Framework`.
68
71
  * @param operations the list of operations to execute
69
72
  * @returns `BatchCall` class
70
73
  */
71
74
  batchCall: (operations: Operation[]) => BatchCall;
72
75
  /**
73
- * @dev Load a `SuperToken` class from the `Framework`.
76
+ * Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
77
+ * @param tokenAddressOrSymbol
78
+ * @returns `NativeAssetSuperToken` class
79
+ */
80
+ loadNativeAssetSuperToken: (tokenAddressOrSymbol: string) => Promise<NativeAssetSuperToken>;
81
+ /**
82
+ * Loads `PureSuperToken` class from the `Framework`. Will throw if token is not PureSuperToken.
83
+ * @param tokenAddressOrSymbol
84
+ * @returns `PureSuperToken` class
85
+ */
86
+ loadPureSuperToken: (tokenAddressOrSymbol: string) => Promise<PureSuperToken>;
87
+ /**
88
+ * Loads `WrapperSuperToken` class from the `Framework`. Will throw if token is not WrapperSuperToken.
89
+ * @param tokenAddressOrSymbol
90
+ * @returns `WrapperSuperToken` class
91
+ */
92
+ loadWrapperSuperToken: (tokenAddressOrSymbol: string) => Promise<WrapperSuperToken>;
93
+ /**
94
+ * Loads `SuperToken` class from the `Framework`. Use this when you're unsure of the token type.
74
95
  * @param tokenAddressOrSymbol the `SuperToken` address or symbol (if symbol, it must be on the resolver)
75
96
  * @returns `SuperToken` class
76
97
  */
77
98
  loadSuperToken: (tokenAddressOrSymbol: string) => Promise<SuperToken>;
99
+ /**
100
+ * Try to get the token address given an address (returns if valid) or the token symbol via the resolver.
101
+ * @param tokenAddressOrSymbol
102
+ * @returns token address
103
+ */
104
+ private _tryGetTokenAddress;
78
105
  }
79
106
  export {};
80
107
  //# sourceMappingURL=Framework.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Framework.d.ts","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,UAAU,MAAM,cAAc,CAAC;AAStC,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,aAAK,iBAAiB,GAChB,MAAM,CAAC,SAAS,CAAC,QAAQ,GACzB,CAAC,OAAO,MAAM,GAAG,oBAAoB,CAAC,GACtC,IAAI,CAAC;AAIX,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,iBAAiB,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B,EAAE,MAAM,CAAC;IACtC,QAAQ,EAAE,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b,OAAO;IAiCP;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,YAAmB,iBAAiB,wBAwG/C;IAEF;;;;;;;OAOG;IACH,YAAY,YAAa,yBAAyB,KAAG,MAAM,CAqCzD;IAEF;;;;OAIG;IACH,SAAS,eAAgB,SAAS,EAAE,eAKlC;IAEF;;;;OAIG;IACH,yBAAyB,yBACC,MAAM,KAC7B,QAAQ,qBAAqB,CAAC,CAa/B;IAEF;;;;OAIG;IACH,kBAAkB,yBACQ,MAAM,KAC7B,QAAQ,cAAc,CAAC,CAaxB;IAEF;;;;OAIG;IACH,qBAAqB,yBACK,MAAM,KAC7B,QAAQ,iBAAiB,CAAC,CAY3B;IAEF;;;;OAIG;IACH,cAAc,yBACY,MAAM,KAC7B,QAAQ,UAAU,CAAC,CAMpB;IAEF;;;;OAIG;IACH,OAAO,CAAC,mBAAmB,CAiCzB;CACL"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const ethers_1 = require("ethers");
8
8
  const BatchCall_1 = __importDefault(require("./BatchCall"));
9
9
  const ConstantFlowAgreementV1_1 = __importDefault(require("./ConstantFlowAgreementV1"));
10
+ const Governance_1 = __importDefault(require("./Governance"));
10
11
  const Host_1 = __importDefault(require("./Host"));
11
12
  const InstantDistributionAgreementV1_1 = __importDefault(require("./InstantDistributionAgreementV1"));
12
13
  const Query_1 = __importDefault(require("./Query"));
@@ -18,13 +19,13 @@ const constants_1 = require("./constants");
18
19
  const frameworkHelpers_1 = require("./frameworkHelpers");
19
20
  const utils_1 = require("./utils");
20
21
  /**
21
- * @dev Superfluid Framework Class
22
+ * Superfluid Framework Class
22
23
  * @description The entrypoint for the SDK-core, `create` an instance of this for full functionality.
23
24
  */
24
25
  class Framework {
25
26
  constructor(options, settings) {
26
27
  /**
27
- * @dev Create a signer which can be used to sign transactions.
28
+ * Create a signer which can be used to sign transactions.
28
29
  * @param options.web3Provider a Web3Provider object (e.g. client side - metamask, web3modal)
29
30
  * @param options.provider an ethers Provider object (e.g. via Hardhat ethers)
30
31
  * @param options.privateKey a test account private key
@@ -65,7 +66,7 @@ class Framework {
65
66
  });
66
67
  };
67
68
  /**
68
- * @dev Create a `BatchCall` class from the `Framework`.
69
+ * Create a `BatchCall` class from the `Framework`.
69
70
  * @param operations the list of operations to execute
70
71
  * @returns `BatchCall` class
71
72
  */
@@ -76,15 +77,78 @@ class Framework {
76
77
  });
77
78
  };
78
79
  /**
79
- * @dev Load a `SuperToken` class from the `Framework`.
80
+ * Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
81
+ * @param tokenAddressOrSymbol
82
+ * @returns `NativeAssetSuperToken` class
83
+ */
84
+ this.loadNativeAssetSuperToken = async (tokenAddressOrSymbol) => {
85
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
86
+ // The NativeAssetSuperToken class should have the nativeTokenSymbol property
87
+ const isNativeAssetSuperToken = !!superToken.nativeTokenSymbol;
88
+ if (!isNativeAssetSuperToken) {
89
+ throw new SFError_1.SFError({
90
+ type: "SUPERTOKEN_INITIALIZATION",
91
+ customMessage: "The token is not a native asset supertoken.",
92
+ });
93
+ }
94
+ return superToken;
95
+ };
96
+ /**
97
+ * Loads `PureSuperToken` class from the `Framework`. Will throw if token is not PureSuperToken.
98
+ * @param tokenAddressOrSymbol
99
+ * @returns `PureSuperToken` class
100
+ */
101
+ this.loadPureSuperToken = async (tokenAddressOrSymbol) => {
102
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
103
+ // The PureSuperToken class should not have the downgrade (and upgrade) function
104
+ // we can just check if downgrade doesn't exist
105
+ const isPureSuperToken = !!superToken.downgrade === false;
106
+ if (!isPureSuperToken) {
107
+ throw new SFError_1.SFError({
108
+ type: "SUPERTOKEN_INITIALIZATION",
109
+ customMessage: "The token is not a pure supertoken.",
110
+ });
111
+ }
112
+ return superToken;
113
+ };
114
+ /**
115
+ * Loads `WrapperSuperToken` class from the `Framework`. Will throw if token is not WrapperSuperToken.
116
+ * @param tokenAddressOrSymbol
117
+ * @returns `WrapperSuperToken` class
118
+ */
119
+ this.loadWrapperSuperToken = async (tokenAddressOrSymbol) => {
120
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
121
+ // The WrapperSuperToken class should have the underlyingToken property
122
+ const isWrapperSuperToken = !!superToken.underlyingToken;
123
+ if (!isWrapperSuperToken) {
124
+ throw new SFError_1.SFError({
125
+ type: "SUPERTOKEN_INITIALIZATION",
126
+ customMessage: "The token is not a wrapper supertoken.",
127
+ });
128
+ }
129
+ return superToken;
130
+ };
131
+ /**
132
+ * Loads `SuperToken` class from the `Framework`. Use this when you're unsure of the token type.
80
133
  * @param tokenAddressOrSymbol the `SuperToken` address or symbol (if symbol, it must be on the resolver)
81
134
  * @returns `SuperToken` class
82
135
  */
83
136
  this.loadSuperToken = async (tokenAddressOrSymbol) => {
84
- let address;
85
- const isValidAddress = ethers_1.ethers.utils.isAddress(tokenAddressOrSymbol);
86
- if (isValidAddress) {
87
- address = tokenAddressOrSymbol;
137
+ const address = await this._tryGetTokenAddress(tokenAddressOrSymbol);
138
+ return await SuperToken_1.default.create({
139
+ ...this.settings,
140
+ address,
141
+ });
142
+ };
143
+ /**
144
+ * Try to get the token address given an address (returns if valid) or the token symbol via the resolver.
145
+ * @param tokenAddressOrSymbol
146
+ * @returns token address
147
+ */
148
+ this._tryGetTokenAddress = async (tokenAddressOrSymbol) => {
149
+ const isInputValidAddress = ethers_1.ethers.utils.isAddress(tokenAddressOrSymbol);
150
+ if (isInputValidAddress) {
151
+ return tokenAddressOrSymbol;
88
152
  }
89
153
  else {
90
154
  try {
@@ -93,8 +157,7 @@ class Framework {
93
157
  "." +
94
158
  tokenAddressOrSymbol;
95
159
  const resolver = new ethers_1.ethers.Contract(this.settings.config.resolverAddress, IResolver_json_1.default.abi, this.settings.provider);
96
- const tokenAddress = await resolver.get(superTokenKey);
97
- address = tokenAddress;
160
+ return await resolver.get(superTokenKey);
98
161
  }
99
162
  catch (err) {
100
163
  throw new SFError_1.SFError({
@@ -106,27 +169,32 @@ class Framework {
106
169
  });
107
170
  }
108
171
  }
109
- return await SuperToken_1.default.create({
110
- ...this.settings,
111
- address,
112
- });
113
172
  };
114
173
  this.userInputOptions = options;
115
174
  this.settings = settings;
116
175
  this.cfaV1 = new ConstantFlowAgreementV1_1.default({
117
176
  config: this.settings.config,
118
177
  });
178
+ this.governance = new Governance_1.default(this.settings.config.governanceAddress, this.settings.config.hostAddress);
119
179
  this.host = new Host_1.default(this.settings.config.hostAddress);
120
180
  this.idaV1 = new InstantDistributionAgreementV1_1.default({
121
181
  config: this.settings.config,
122
182
  });
123
183
  this.query = new Query_1.default(this.settings);
184
+ const resolver = new ethers_1.ethers.Contract(this.settings.config.resolverAddress, IResolver_json_1.default.abi);
185
+ this.contracts = {
186
+ cfaV1: this.cfaV1.contract,
187
+ governance: this.governance.contract,
188
+ host: this.host.contract,
189
+ idaV1: this.idaV1.contract,
190
+ resolver,
191
+ };
124
192
  }
125
193
  }
126
194
  exports.default = Framework;
127
195
  _a = Framework;
128
196
  /**
129
- * @dev Creates the Framework object based on user provided `options`.
197
+ * Creates the Framework object based on user provided `options`.
130
198
  * @param options.chainId the chainId of your desired network (e.g. 137 = matic)
131
199
  * @param options.customSubgraphQueriesEndpoint your custom subgraph endpoint
132
200
  * @param options.dataMode the data mode you'd like the framework to use (SUBGRAPH_ONLY, SUBGRAPH_WEB3, WEB3_ONLY)
@@ -173,6 +241,7 @@ Framework.create = async (options) => {
173
241
  subgraphAPIEndpoint: "",
174
242
  resolverAddress: "",
175
243
  networkName: "",
244
+ nativeTokenSymbol: "",
176
245
  };
177
246
  const resolverAddress = options.resolverAddress
178
247
  ? options.resolverAddress
@@ -181,6 +250,9 @@ Framework.create = async (options) => {
181
250
  const superfluidLoaderAddress = await resolver.get("SuperfluidLoader-v1");
182
251
  const superfluidLoader = new ethers_1.ethers.Contract(superfluidLoaderAddress, SuperfluidLoader_json_1.default.abi, provider);
183
252
  const framework = await superfluidLoader.loadFramework(releaseVersion);
253
+ const governanceAddress = await new Host_1.default(framework.superfluid).contract
254
+ .connect(provider)
255
+ .getGovernance();
184
256
  const settings = {
185
257
  chainId,
186
258
  customSubgraphQueriesEndpoint,
@@ -193,6 +265,7 @@ Framework.create = async (options) => {
193
265
  hostAddress: framework.superfluid,
194
266
  cfaV1Address: framework.agreementCFAv1,
195
267
  idaV1Address: framework.agreementIDAv1,
268
+ governanceAddress,
196
269
  },
197
270
  };
198
271
  return new Framework(options, settings);
@@ -1 +1 @@
1
- {"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":";;;;;;AAEA,mCAAgC;AAGhC,4DAAoC;AACpC,wFAAgE;AAChE,kDAA0B;AAC1B,sGAA8E;AAE9E,oDAA4B;AAC5B,uCAAoC;AACpC,8DAAsC;AACtC,0EAAgD;AAChD,wFAA8D;AAC9D,2CAAgF;AAChF,yDAI4B;AAI5B,mCAA2D;AA6B3D;;;GAGG;AACH,MAAqB,SAAS;IAS1B,YACI,OAA0B,EAC1B,QAA4B;QA2HhC;;;;;;;WAOG;QACH,iBAAY,GAAG,CAAC,OAAkC,EAAU,EAAE;YAC1D,IACI,CAAC,OAAO,CAAC,UAAU;gBACnB,CAAC,OAAO,CAAC,QAAQ;gBACjB,CAAC,OAAO,CAAC,MAAM;gBACf,CAAC,OAAO,CAAC,YAAY,EACvB;gBACE,MAAM,IAAI,iBAAO,CAAC;oBACd,IAAI,EAAE,eAAe;oBACrB,aAAa,EACT,qDAAqD;iBAC5D,CAAC,CAAC;aACN;YAED,2BAA2B;YAC3B,IAAI,OAAO,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;oBACnB,MAAM,IAAI,iBAAO,CAAC;wBACd,IAAI,EAAE,eAAe;wBACrB,aAAa,EACT,oDAAoD;qBAC3D,CAAC,CAAC;iBACN;gBACD,OAAO,IAAI,eAAM,CAAC,MAAM,CAAC,O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 import { IGetGovernanceParametersParams, IWeb3GovernanceParams } from "./interfaces";
2
+ import { SuperfluidGovernanceII } from "./typechain/SuperfluidGovernanceII";
3
+ export default class Governance {
4
+ contract: SuperfluidGovernanceII;
5
+ hostAddress: string;
6
+ constructor(govAddress: string, hostAddress: string);
7
+ /**
8
+ * Returns the 3Ps config for the specified token (or default) - the liquidation period and patrician period
9
+ * @see https://docs.superfluid.finance/superfluid/sentinels/liquidations-and-toga
10
+ * @param providerOrSigner a provider or signer for executing a web3 call
11
+ * @param token specified governance parameter token
12
+ * @returns {Object} liquidationPeriod and patricianPeriod as strings
13
+ */
14
+ getPPPConfig: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<{
15
+ liquidationPeriod: string;
16
+ patricianPeriod: string;
17
+ }>;
18
+ /**
19
+ * Returns the reward address for the specified token (or default)
20
+ * @param providerOrSigner a provider or signer for executing a web3 call
21
+ * @param token specified governance parameter token
22
+ * @returns {string} the reward address
23
+ */
24
+ getRewardAddress: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<string>;
25
+ /**
26
+ * Returns the minimum deposit for the specified token (or default)
27
+ * @param providerOrSigner a provider or signer for executing a web3 call
28
+ * @param token specified governance parameter token
29
+ * @returns {string} minimum deposit
30
+ */
31
+ getMinimumDeposit: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<string>;
32
+ /**
33
+ * Returns the relevant governance parameters
34
+ * @param providerOrSigner a provider or signer for executing a web3 call
35
+ * @param token specified governance parameter token
36
+ * @returns {Object} liquidationPeriod, patricianPeriod, rewardAddress and minimumDeposit
37
+ */
38
+ getGovernanceParameters: ({ providerOrSigner, token, }: IGetGovernanceParametersParams) => Promise<IWeb3GovernanceParams>;
39
+ }
40
+ //# sourceMappingURL=Governance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Governance.d.ts","sourceRoot":"","sources":["../../src/Governance.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;gBAER,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAQnD;;;;;;OAMG;IACH,YAAY,iCAGT,8BAA8B;;;OAQ/B;IAEF;;;;;OAKG;IACH,gBAAgB,iCAGb,8BAA8B,qBAI/B;IAEF;;;;;OAKG;IACH,iBAAiB,iCAGd,8BAA8B,qBAK/B;IAEF;;;;;OAKG;IACH,uBAAuB,iCAGpB,8BAA8B,KAAG,QAAQ,qBAAqB,CAAC,CAqBhE;CACL"}
@@ -0,0 +1,82 @@
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 ethers_1 = require("ethers");
7
+ const SuperfluidGovernanceII_json_1 = __importDefault(require("./abi/SuperfluidGovernanceII.json"));
8
+ class Governance {
9
+ constructor(govAddress, hostAddress) {
10
+ /**
11
+ * Returns the 3Ps config for the specified token (or default) - the liquidation period and patrician period
12
+ * @see https://docs.superfluid.finance/superfluid/sentinels/liquidations-and-toga
13
+ * @param providerOrSigner a provider or signer for executing a web3 call
14
+ * @param token specified governance parameter token
15
+ * @returns {Object} liquidationPeriod and patricianPeriod as strings
16
+ */
17
+ this.getPPPConfig = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
18
+ const { liquidationPeriod, patricianPeriod } = await this.contract
19
+ .connect(providerOrSigner)
20
+ .getPPPConfig(this.hostAddress, token);
21
+ return {
22
+ liquidationPeriod: liquidationPeriod.toString(),
23
+ patricianPeriod: patricianPeriod.toString(),
24
+ };
25
+ };
26
+ /**
27
+ * Returns the reward address for the specified token (or default)
28
+ * @param providerOrSigner a provider or signer for executing a web3 call
29
+ * @param token specified governance parameter token
30
+ * @returns {string} the reward address
31
+ */
32
+ this.getRewardAddress = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
33
+ return await this.contract
34
+ .connect(providerOrSigner)
35
+ .getRewardAddress(this.hostAddress, token);
36
+ };
37
+ /**
38
+ * Returns the minimum deposit for the specified token (or default)
39
+ * @param providerOrSigner a provider or signer for executing a web3 call
40
+ * @param token specified governance parameter token
41
+ * @returns {string} minimum deposit
42
+ */
43
+ this.getMinimumDeposit = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
44
+ const superTokenMinimumDeposit = await this.contract
45
+ .connect(providerOrSigner)
46
+ .getSuperTokenMinimumDeposit(this.hostAddress, token);
47
+ return superTokenMinimumDeposit.toString();
48
+ };
49
+ /**
50
+ * Returns the relevant governance parameters
51
+ * @param providerOrSigner a provider or signer for executing a web3 call
52
+ * @param token specified governance parameter token
53
+ * @returns {Object} liquidationPeriod, patricianPeriod, rewardAddress and minimumDeposit
54
+ */
55
+ this.getGovernanceParameters = async ({ providerOrSigner, token = ethers_1.ethers.constants.AddressZero, }) => {
56
+ const pppPromise = this.getPPPConfig({ providerOrSigner, token });
57
+ const rewardPromose = this.getRewardAddress({
58
+ providerOrSigner,
59
+ token,
60
+ });
61
+ const minimumDepositPromise = this.getMinimumDeposit({
62
+ providerOrSigner,
63
+ token,
64
+ });
65
+ const data = await Promise.all([
66
+ pppPromise,
67
+ rewardPromose,
68
+ minimumDepositPromise,
69
+ ]);
70
+ return {
71
+ liquidationPeriod: data[0].liquidationPeriod,
72
+ patricianPeriod: data[0].patricianPeriod,
73
+ rewardAddress: data[1],
74
+ minimumDeposit: data[2],
75
+ };
76
+ };
77
+ this.contract = new ethers_1.ethers.Contract(govAddress, SuperfluidGovernanceII_json_1.default.abi);
78
+ this.hostAddress = hostAddress;
79
+ }
80
+ }
81
+ exports.default = Governance;
82
+ //# sourceMappingURL=Governance.js.map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AAC;QAEF;;;;;WAKG;QACH,4BAAuB,GAAG,KAAK,EAAE,EAC7B,gBAAgB,EAChB,KAAK,GAAG,eAAM,CAAC,SAAS,CAAC,WAAW,GACP,EAAkC,EAAE;YACjE,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;YAClE,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC;gBACxC,gBAAgB;gBAChB,KAAK;aACR,CAAC,CAAC;YACH,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,CAAC;gBACjD,gBAAgB;gBAChB,KAAK;aACR,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC3B,UAAU;gBACV,aAAa;gBACb,qBAAqB;aACxB,CAAC,CAAC;YACH,OAAO;gBACH,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB;gBAC5C,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe;gBACxC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;gBACtB,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;aAC1B,CAAC;QACN,CAAC,CAAC;QAxFE,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAM,CAAC,QAAQ,CAC/B,UAAU,EACV,qCAAyB,CAAC,GAAG,CACN,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;CAoFJ;AA9FD,6BA8FC"}
@@ -2,14 +2,14 @@ import { ethers } from "ethers";
2
2
  import Operation from "./Operation";
3
3
  import { Superfluid } from "./typechain";
4
4
  /**
5
- * @dev Host Helper Class
5
+ * Host Helper Class
6
6
  * @description A helper class which can be used as a standalone class to populate call agreement transactions.
7
7
  */
8
8
  export default class Host {
9
- hostContract: Superfluid;
9
+ contract: Superfluid;
10
10
  constructor(hostAddress: string);
11
11
  /**
12
- * @dev Creates an Operation of the `callAgreement` function on the host contract.
12
+ * Creates an Operation of the `callAgreement` function on the host contract.
13
13
  * @param agreementAddress the agreement address (cfa or ida address)
14
14
  * @param callData the encoded callData for the function
15
15
  * @param userData any additional user data
@@ -1 +1 @@
1
- {"version":3,"file":"Host.d.ts","sourceRoot":"","sources":["../../src/Host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAE3C,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,YAAY,EAAE,UAAU,CAAC;gBAEb,WAAW,EAAE,MAAM;IAO/B;;;;;;;OAOG;IACH,0CAA0C,qBACpB,MAAM,YACd,MAAM,YACN,MAAM,GAAG,SAAS;;uBAE7B,SAAS,CAQV;CACL"}
1
+ {"version":3,"file":"Host.d.ts","sourceRoot":"","sources":["../../src/Host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAE3C,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,QAAQ,EAAE,UAAU,CAAC;gBAET,WAAW,EAAE,MAAM;IAO/B;;;;;;;OAOG;IACH,0CAA0C,qBACpB,MAAM,YACd,MAAM,YACN,MAAM,GAAG,SAAS;;uBAE7B,SAAS,CAQV;CACL"}