@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
@@ -1,12 +1,14 @@
1
1
  import { ethers } from "ethers";
2
2
  import Operation from "./Operation";
3
3
  import { IBaseSuperTokenParams, ITransferFromParams } from "./interfaces";
4
- export default class Token {
4
+ import { ERC20WithTokenInfo } from "./typechain/ERC20WithTokenInfo";
5
+ export default class ERC20Token {
5
6
  readonly address: string;
7
+ readonly contract: ERC20WithTokenInfo;
6
8
  constructor(address: string);
7
- private get tokenContract();
9
+ /** ### ERC20 Token Contract Read Functions ### */
8
10
  /**
9
- * @dev Returns the allowance the `owner` has granted the `spender`.
11
+ * Returns the allowance the `owner` has granted the `spender`.
10
12
  * @param owner the owner who has allotted the allowance
11
13
  * @param spender the spender who has received the allowance
12
14
  * @param providerOrSigner a provider or signer for executing a web3 call
@@ -18,7 +20,7 @@ export default class Token {
18
20
  providerOrSigner: ethers.providers.Provider | ethers.Signer;
19
21
  }) => Promise<string>;
20
22
  /**
21
- * @dev Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
23
+ * Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
22
24
  * @param account the account you would like to query
23
25
  * @param providerOrSigner a provider or signer for executing a web3 call
24
26
  * @returns {Promise<string>} the token balance of `account`
@@ -28,7 +30,7 @@ export default class Token {
28
30
  providerOrSigner: ethers.providers.Provider | ethers.Signer;
29
31
  }) => Promise<string>;
30
32
  /**
31
- * @dev Returns the token name
33
+ * Returns the token name
32
34
  * @param providerOrSigner a provider or signer for executing a web3 call
33
35
  * @returns {string} the token name
34
36
  */
@@ -36,7 +38,7 @@ export default class Token {
36
38
  providerOrSigner: ethers.providers.Provider | ethers.Signer;
37
39
  }) => Promise<string>;
38
40
  /**
39
- * @dev Returns the token symbol
41
+ * Returns the token symbol
40
42
  * @param providerOrSigner a provider or signer for executing a web3 call
41
43
  * @returns {string} the token symbol
42
44
  */
@@ -44,37 +46,38 @@ export default class Token {
44
46
  providerOrSigner: ethers.providers.Provider | ethers.Signer;
45
47
  }) => Promise<string>;
46
48
  /**
47
- * @dev Returns the total supply of the token.
49
+ * Returns the total supply of the token.
48
50
  * @param providerOrSigner a provider or signer for executing a web3 call
49
51
  * @returns {Promise<string>} the total supply of the token
50
52
  */
51
53
  totalSupply: ({ providerOrSigner, }: {
52
54
  providerOrSigner: ethers.providers.Provider | ethers.Signer;
53
55
  }) => Promise<string>;
56
+ /** ### ERC20 Token Contract Write Functions ### */
54
57
  /**
55
- * @dev Approve `receiver` to spend `amount` tokens.
58
+ * Approve `receiver` to spend `amount` tokens.
56
59
  * @param receiver The receiver approved.
57
60
  * @param amount The amount approved.
58
61
  * @param overrides ethers overrides object for more control over the transaction sent.
59
62
  * @returns {Operation} An instance of Operation which can be executed or batched.
60
63
  */
61
- approve: ({ receiver, amount, overrides, }: IBaseSuperTokenParams) => Operation;
64
+ approve: (params: IBaseSuperTokenParams) => Operation;
62
65
  /**
63
- * @dev Transfer `receiver` `amount` tokens.
66
+ * Transfer `receiver` `amount` tokens.
64
67
  * @param receiver The receiver of the transfer.
65
68
  * @param amount The amount to be transferred.
66
69
  * @param overrides ethers overrides object for more control over the transaction sent.
67
70
  * @returns {Operation} An instance of Operation which can be executed or batched.
68
71
  */
69
- transfer: ({ receiver, amount, overrides, }: IBaseSuperTokenParams) => Operation;
72
+ transfer: (params: IBaseSuperTokenParams) => Operation;
70
73
  /**
71
- * @dev Transfer from `sender` to `receiver` `amount` tokens.
74
+ * Transfer from `sender` to `receiver` `amount` tokens.
72
75
  * @param sender The sender of the transfer.
73
76
  * @param receiver The receiver of the transfer.
74
77
  * @param amount The amount to be transferred.
75
78
  * @param overrides ethers overrides object for more control over the transaction sent.
76
79
  * @returns {Operation} An instance of Operation which can be executed or batched.
77
80
  */
78
- transferFrom: ({ sender, receiver, amount, overrides, }: ITransferFromParams) => Operation;
81
+ transferFrom: (params: ITransferFromParams) => Operation;
79
82
  }
80
- //# sourceMappingURL=Token.d.ts.map
83
+ //# sourceMappingURL=ERC20Token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20Token.d.ts","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;gBAE1B,OAAO,EAAE,MAAM;IAQ3B,kDAAkD;IAElD;;;;;;OAMG;IACH,SAAS;eAKE,MAAM;iBACJ,MAAM;0BACG,OAAO,SAAS,CAAC,QAAQ,GAAG,OAAO,MAAM;UAC3D,QAAQ,MAAM,CAAC,CAejB;IAEF;;;;;OAKG;IACH,SAAS;iBAII,MAAM;0BACG,OAAO,SAAS,CAAC,QAAQ,GAAG,OAAO,MAAM;UAC3D,QAAQ,MAAM,CAAC,CAcjB;IAEF;;;;OAIG;IACH,IAAI;0BAGkB,OAAO,SAAS,CAAC,QAAQ,GAAG,OAAO,MAAM;UAC3D,QAAQ,MAAM,CAAC,CAWjB;IAEF;;;;OAIG;IACH,MAAM;0BAGgB,OAAO,SAAS,CAAC,QAAQ,GAAG,OAAO,MAAM;UAC3D,QAAQ,MAAM,CAAC,CAajB;IAEF;;;;OAIG;IACH,WAAW;0BAGW,OAAO,SAAS,CAAC,QAAQ,GAAG,OAAO,MAAM;UAC3D,QAAQ,MAAM,CAAC,CAajB;IAEF,mDAAmD;IAEnD;;;;;;OAMG;IACH,OAAO,WAAY,qBAAqB,KAAG,SAAS,CAQlD;IAEF;;;;;;OAMG;IACH,QAAQ,WAAY,qBAAqB,KAAG,SAAS,CAQnD;IAEF;;;;;;;OAOG;IACH,YAAY,WAAY,mBAAmB,KAAG,SAAS,CAUrD;CACL"}
@@ -3,11 +3,11 @@ import Operation from "./Operation";
3
3
  import { SFError } from "./SFError";
4
4
  import ERC20WithTokenInfoABI from "./abi/ERC20WithTokenInfo.json";
5
5
  import { normalizeAddress } from "./utils";
6
- export default class Token {
6
+ export default class ERC20Token {
7
7
  constructor(address) {
8
- // ERC20 Token Contract Read Functions
8
+ /** ### ERC20 Token Contract Read Functions ### */
9
9
  /**
10
- * @dev Returns the allowance the `owner` has granted the `spender`.
10
+ * Returns the allowance the `owner` has granted the `spender`.
11
11
  * @param owner the owner who has allotted the allowance
12
12
  * @param spender the spender who has received the allowance
13
13
  * @param providerOrSigner a provider or signer for executing a web3 call
@@ -17,7 +17,7 @@ export default class Token {
17
17
  const normalizedOwner = normalizeAddress(owner);
18
18
  const normalizedSpender = normalizeAddress(spender);
19
19
  try {
20
- const allowance = await this.tokenContract
20
+ const allowance = await this.contract
21
21
  .connect(providerOrSigner)
22
22
  .allowance(normalizedOwner, normalizedSpender);
23
23
  return allowance.toString();
@@ -31,7 +31,7 @@ export default class Token {
31
31
  }
32
32
  };
33
33
  /**
34
- * @dev Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
34
+ * Returns the ERC20 balanceOf the `account`, this can't be negative and will just display 0.
35
35
  * @param account the account you would like to query
36
36
  * @param providerOrSigner a provider or signer for executing a web3 call
37
37
  * @returns {Promise<string>} the token balance of `account`
@@ -39,7 +39,7 @@ export default class Token {
39
39
  this.balanceOf = async ({ account, providerOrSigner, }) => {
40
40
  try {
41
41
  const normalizedAccount = normalizeAddress(account);
42
- const balanceOf = await this.tokenContract
42
+ const balanceOf = await this.contract
43
43
  .connect(providerOrSigner)
44
44
  .balanceOf(normalizedAccount);
45
45
  return balanceOf.toString();
@@ -53,15 +53,13 @@ export default class Token {
53
53
  }
54
54
  };
55
55
  /**
56
- * @dev Returns the token name
56
+ * Returns the token name
57
57
  * @param providerOrSigner a provider or signer for executing a web3 call
58
58
  * @returns {string} the token name
59
59
  */
60
60
  this.name = async ({ providerOrSigner, }) => {
61
61
  try {
62
- const name = await this.tokenContract
63
- .connect(providerOrSigner)
64
- .name();
62
+ const name = await this.contract.connect(providerOrSigner).name();
65
63
  return name;
66
64
  }
67
65
  catch (err) {
@@ -73,13 +71,13 @@ export default class Token {
73
71
  }
74
72
  };
75
73
  /**
76
- * @dev Returns the token symbol
74
+ * Returns the token symbol
77
75
  * @param providerOrSigner a provider or signer for executing a web3 call
78
76
  * @returns {string} the token symbol
79
77
  */
80
78
  this.symbol = async ({ providerOrSigner, }) => {
81
79
  try {
82
- const symbol = await this.tokenContract
80
+ const symbol = await this.contract
83
81
  .connect(providerOrSigner)
84
82
  .symbol();
85
83
  return symbol;
@@ -93,13 +91,13 @@ export default class Token {
93
91
  }
94
92
  };
95
93
  /**
96
- * @dev Returns the total supply of the token.
94
+ * Returns the total supply of the token.
97
95
  * @param providerOrSigner a provider or signer for executing a web3 call
98
96
  * @returns {Promise<string>} the total supply of the token
99
97
  */
100
98
  this.totalSupply = async ({ providerOrSigner, }) => {
101
99
  try {
102
- const totalSupply = await this.tokenContract
100
+ const totalSupply = await this.contract
103
101
  .connect(providerOrSigner)
104
102
  .totalSupply();
105
103
  return totalSupply.toString();
@@ -112,49 +110,47 @@ export default class Token {
112
110
  });
113
111
  }
114
112
  };
115
- // ERC20 Token Contract Write Functions
113
+ /** ### ERC20 Token Contract Write Functions ### */
116
114
  /**
117
- * @dev Approve `receiver` to spend `amount` tokens.
115
+ * Approve `receiver` to spend `amount` tokens.
118
116
  * @param receiver The receiver approved.
119
117
  * @param amount The amount approved.
120
118
  * @param overrides ethers overrides object for more control over the transaction sent.
121
119
  * @returns {Operation} An instance of Operation which can be executed or batched.
122
120
  */
123
- this.approve = ({ receiver, amount, overrides, }) => {
124
- const normalizedReceiver = normalizeAddress(receiver);
125
- const txn = this.tokenContract.populateTransaction.approve(normalizedReceiver, amount, overrides || {});
121
+ this.approve = (params) => {
122
+ const normalizedReceiver = normalizeAddress(params.receiver);
123
+ const txn = this.contract.populateTransaction.approve(normalizedReceiver, params.amount, params.overrides || {});
126
124
  return new Operation(txn, "ERC20_APPROVE");
127
125
  };
128
126
  /**
129
- * @dev Transfer `receiver` `amount` tokens.
127
+ * Transfer `receiver` `amount` tokens.
130
128
  * @param receiver The receiver of the transfer.
131
129
  * @param amount The amount to be transferred.
132
130
  * @param overrides ethers overrides object for more control over the transaction sent.
133
131
  * @returns {Operation} An instance of Operation which can be executed or batched.
134
132
  */
135
- this.transfer = ({ receiver, amount, overrides, }) => {
136
- const normalizedReceiver = normalizeAddress(receiver);
137
- const txn = this.tokenContract.populateTransaction.transfer(normalizedReceiver, amount, overrides || {});
133
+ this.transfer = (params) => {
134
+ const normalizedReceiver = normalizeAddress(params.receiver);
135
+ const txn = this.contract.populateTransaction.transfer(normalizedReceiver, params.amount, params.overrides || {});
138
136
  return new Operation(txn, "UNSUPPORTED");
139
137
  };
140
138
  /**
141
- * @dev Transfer from `sender` to `receiver` `amount` tokens.
139
+ * Transfer from `sender` to `receiver` `amount` tokens.
142
140
  * @param sender The sender of the transfer.
143
141
  * @param receiver The receiver of the transfer.
144
142
  * @param amount The amount to be transferred.
145
143
  * @param overrides ethers overrides object for more control over the transaction sent.
146
144
  * @returns {Operation} An instance of Operation which can be executed or batched.
147
145
  */
148
- this.transferFrom = ({ sender, receiver, amount, overrides, }) => {
149
- const normalizedSender = normalizeAddress(sender);
150
- const normalizedReceiver = normalizeAddress(receiver);
151
- const txn = this.tokenContract.populateTransaction.transferFrom(normalizedSender, normalizedReceiver, amount, overrides || {});
146
+ this.transferFrom = (params) => {
147
+ const normalizedSender = normalizeAddress(params.sender);
148
+ const normalizedReceiver = normalizeAddress(params.receiver);
149
+ const txn = this.contract.populateTransaction.transferFrom(normalizedSender, normalizedReceiver, params.amount, params.overrides || {});
152
150
  return new Operation(txn, "ERC20_TRANSFER_FROM");
153
151
  };
154
152
  this.address = address;
155
- }
156
- get tokenContract() {
157
- return new ethers.Contract(this.address, ERC20WithTokenInfoABI.abi);
153
+ this.contract = new ethers.Contract(this.address, ERC20WithTokenInfoABI.abi);
158
154
  }
159
155
  }
160
- //# sourceMappingURL=Token.js.map
156
+ //# sourceMappingURL=ERC20Token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ERC20Token.js","sourceRoot":"","sources":["../../src/ERC20Token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,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,gBAAgB,CAAC,KAAK,CA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ementV1";
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":"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;;;;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"}
@@ -2,6 +2,7 @@ var _a;
2
2
  import { ethers } from "ethers";
3
3
  import BatchCall from "./BatchCall";
4
4
  import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
5
+ import Governance from "./Governance";
5
6
  import Host from "./Host";
6
7
  import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
7
8
  import Query from "./Query";
@@ -13,13 +14,13 @@ import { chainIdToResolverDataMap, networkNameToChainIdMap } from "./constants";
13
14
  import { getNetworkName, getSubgraphQueriesEndpoint, validateFrameworkConstructorOptions, } from "./frameworkHelpers";
14
15
  import { isEthersProvider, isInjectedWeb3 } from "./utils";
15
16
  /**
16
- * @dev Superfluid Framework Class
17
+ * Superfluid Framework Class
17
18
  * @description The entrypoint for the SDK-core, `create` an instance of this for full functionality.
18
19
  */
19
20
  export default class Framework {
20
21
  constructor(options, settings) {
21
22
  /**
22
- * @dev Create a signer which can be used to sign transactions.
23
+ * Create a signer which can be used to sign transactions.
23
24
  * @param options.web3Provider a Web3Provider object (e.g. client side - metamask, web3modal)
24
25
  * @param options.provider an ethers Provider object (e.g. via Hardhat ethers)
25
26
  * @param options.privateKey a test account private key
@@ -60,7 +61,7 @@ export default class Framework {
60
61
  });
61
62
  };
62
63
  /**
63
- * @dev Create a `BatchCall` class from the `Framework`.
64
+ * Create a `BatchCall` class from the `Framework`.
64
65
  * @param operations the list of operations to execute
65
66
  * @returns `BatchCall` class
66
67
  */
@@ -71,15 +72,78 @@ export default class Framework {
71
72
  });
72
73
  };
73
74
  /**
74
- * @dev Load a `SuperToken` class from the `Framework`.
75
+ * Loads `NativeAssetSuperToken` class from the `Framework`. Will throw if token is not NativeAssetSuperToken.
76
+ * @param tokenAddressOrSymbol
77
+ * @returns `NativeAssetSuperToken` class
78
+ */
79
+ this.loadNativeAssetSuperToken = async (tokenAddressOrSymbol) => {
80
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
81
+ // The NativeAssetSuperToken class should have the nativeTokenSymbol property
82
+ const isNativeAssetSuperToken = !!superToken.nativeTokenSymbol;
83
+ if (!isNativeAssetSuperToken) {
84
+ throw new SFError({
85
+ type: "SUPERTOKEN_INITIALIZATION",
86
+ customMessage: "The token is not a native asset supertoken.",
87
+ });
88
+ }
89
+ return superToken;
90
+ };
91
+ /**
92
+ * Loads `PureSuperToken` class from the `Framework`. Will throw if token is not PureSuperToken.
93
+ * @param tokenAddressOrSymbol
94
+ * @returns `PureSuperToken` class
95
+ */
96
+ this.loadPureSuperToken = async (tokenAddressOrSymbol) => {
97
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
98
+ // The PureSuperToken class should not have the downgrade (and upgrade) function
99
+ // we can just check if downgrade doesn't exist
100
+ const isPureSuperToken = !!superToken.downgrade === false;
101
+ if (!isPureSuperToken) {
102
+ throw new SFError({
103
+ type: "SUPERTOKEN_INITIALIZATION",
104
+ customMessage: "The token is not a pure supertoken.",
105
+ });
106
+ }
107
+ return superToken;
108
+ };
109
+ /**
110
+ * Loads `WrapperSuperToken` class from the `Framework`. Will throw if token is not WrapperSuperToken.
111
+ * @param tokenAddressOrSymbol
112
+ * @returns `WrapperSuperToken` class
113
+ */
114
+ this.loadWrapperSuperToken = async (tokenAddressOrSymbol) => {
115
+ const superToken = await this.loadSuperToken(tokenAddressOrSymbol);
116
+ // The WrapperSuperToken class should have the underlyingToken property
117
+ const isWrapperSuperToken = !!superToken.underlyingToken;
118
+ if (!isWrapperSuperToken) {
119
+ throw new SFError({
120
+ type: "SUPERTOKEN_INITIALIZATION",
121
+ customMessage: "The token is not a wrapper supertoken.",
122
+ });
123
+ }
124
+ return superToken;
125
+ };
126
+ /**
127
+ * Loads `SuperToken` class from the `Framework`. Use this when you're unsure of the token type.
75
128
  * @param tokenAddressOrSymbol the `SuperToken` address or symbol (if symbol, it must be on the resolver)
76
129
  * @returns `SuperToken` class
77
130
  */
78
131
  this.loadSuperToken = async (tokenAddressOrSymbol) => {
79
- let address;
80
- const isValidAddress = ethers.utils.isAddress(tokenAddressOrSymbol);
81
- if (isValidAddress) {
82
- address = tokenAddressOrSymbol;
132
+ const address = await this._tryGetTokenAddress(tokenAddressOrSymbol);
133
+ return await SuperToken.create({
134
+ ...this.settings,
135
+ address,
136
+ });
137
+ };
138
+ /**
139
+ * Try to get the token address given an address (returns if valid) or the token symbol via the resolver.
140
+ * @param tokenAddressOrSymbol
141
+ * @returns token address
142
+ */
143
+ this._tryGetTokenAddress = async (tokenAddressOrSymbol) => {
144
+ const isInputValidAddress = ethers.utils.isAddress(tokenAddressOrSymbol);
145
+ if (isInputValidAddress) {
146
+ return tokenAddressOrSymbol;
83
147
  }
84
148
  else {
85
149
  try {
@@ -88,8 +152,7 @@ export default class Framework {
88
152
  "." +
89
153
  tokenAddressOrSymbol;
90
154
  const resolver = new ethers.Contract(this.settings.config.resolverAddress, IResolverABI.abi, this.settings.provider);
91
- const tokenAddress = await resolver.get(superTokenKey);
92
- address = tokenAddress;
155
+ return await resolver.get(superTokenKey);
93
156
  }
94
157
  catch (err) {
95
158
  throw new SFError({
@@ -101,26 +164,31 @@ export default class Framework {
101
164
  });
102
165
  }
103
166
  }
104
- return await SuperToken.create({
105
- ...this.settings,
106
- address,
107
- });
108
167
  };
109
168
  this.userInputOptions = options;
110
169
  this.settings = settings;
111
170
  this.cfaV1 = new ConstantFlowAgreementV1({
112
171
  config: this.settings.config,
113
172
  });
173
+ this.governance = new Governance(this.settings.config.governanceAddress, this.settings.config.hostAddress);
114
174
  this.host = new Host(this.settings.config.hostAddress);
115
175
  this.idaV1 = new InstantDistributionAgreementV1({
116
176
  config: this.settings.config,
117
177
  });
118
178
  this.query = new Query(this.settings);
179
+ const resolver = new ethers.Contract(this.settings.config.resolverAddress, IResolverABI.abi);
180
+ this.contracts = {
181
+ cfaV1: this.cfaV1.contract,
182
+ governance: this.governance.contract,
183
+ host: this.host.contract,
184
+ idaV1: this.idaV1.contract,
185
+ resolver,
186
+ };
119
187
  }
120
188
  }
121
189
  _a = Framework;
122
190
  /**
123
- * @dev Creates the Framework object based on user provided `options`.
191
+ * Creates the Framework object based on user provided `options`.
124
192
  * @param options.chainId the chainId of your desired network (e.g. 137 = matic)
125
193
  * @param options.customSubgraphQueriesEndpoint your custom subgraph endpoint
126
194
  * @param options.dataMode the data mode you'd like the framework to use (SUBGRAPH_ONLY, SUBGRAPH_WEB3, WEB3_ONLY)
@@ -167,6 +235,7 @@ Framework.create = async (options) => {
167
235
  subgraphAPIEndpoint: "",
168
236
  resolverAddress: "",
169
237
  networkName: "",
238
+ nativeTokenSymbol: "",
170
239
  };
171
240
  const resolverAddress = options.resolverAddress
172
241
  ? options.resolverAddress
@@ -175,6 +244,9 @@ Framework.create = async (options) => {
175
244
  const superfluidLoaderAddress = await resolver.get("SuperfluidLoader-v1");
176
245
  const superfluidLoader = new ethers.Contract(superfluidLoaderAddress, SuperfluidLoaderABI.abi, provider);
177
246
  const framework = await superfluidLoader.loadFramework(releaseVersion);
247
+ const governanceAddress = await new Host(framework.superfluid).contract
248
+ .connect(provider)
249
+ .getGovernance();
178
250
  const settings = {
179
251
  chainId,
180
252
  customSubgraphQueriesEndpoint,
@@ -187,6 +259,7 @@ Framework.create = async (options) => {
187
259
  hostAddress: framework.superfluid,
188
260
  cfaV1Address: framework.agreementCFAv1,
189
261
  idaV1Address: framework.agreementIDAv1,
262
+ governanceAddress,
190
263
  },
191
264
  };
192
265
  return new Framework(options, settings);
@@ -1 +1 @@
1
- {"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EACH,cAAc,EACd,0BAA0B,EAC1B,mCAAmC,GACtC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA6B3D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,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,OAAO,CAAC;oBACd,IAAI,EAAE,eAAe;oBACrB,aAAa,EACT,qDAAqD;iBAC5D,CAAC,CAAC;aACN;YAED,2BAA2B;YAC3B,IAAI,OAAO,CAAC,UAAU,EAAE;gBACp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;YAC7C,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,IAAI,IAAI;YAC9D,QAAQ;YACR,WAAW;YACX,MAAM,EAAE;gBACJ,eAAe;gBACf,WAAW,EAAE,SAAS,CAAC,UAAU;gBACjC,YAAY,EAAE,SAAS,CAAC,cAAc;gBACtC,YAAY,EAAE,SAAS,CAAC,cAAc;gBACtC,iBAAiB;aACpB;SACJ,CAAC;QAEF,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3C;IAAC,OAAO,GAAG,EAAE;QACV,MAAM,IAAI,OAAO,CAAC;YACd,IAAI,EAAE,0BAA0B;YAChC,aAAa,EAAE,+CAA+C;YAC9D,WAAW,EAAE,GAAG;SACnB,CAAC,CAAC;KACN;AACL,CAAE,CAAA"}
@@ -0,0 +1,40 @@
1
+ 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"}