@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,25 +1,28 @@
1
1
  var _a;
2
2
  import { ethers } from "ethers";
3
3
  import ConstantFlowAgreementV1 from "./ConstantFlowAgreementV1";
4
+ import ERC20Token from "./ERC20Token";
5
+ import Governance from "./Governance";
4
6
  import InstantDistributionAgreementV1 from "./InstantDistributionAgreementV1";
5
7
  import Operation from "./Operation";
6
8
  import { SFError } from "./SFError";
7
- import Token from "./Token";
9
+ import ISETHABI from "./abi/ISETH.json";
8
10
  import SuperTokenABI from "./abi/SuperToken.json";
9
- import { networkNameToChainIdMap } from "./constants";
11
+ import { chainIdToResolverDataMap, networkNameToChainIdMap } from "./constants";
10
12
  import { getNetworkName } from "./frameworkHelpers";
11
13
  import { getSanitizedTimestamp, getStringCurrentTimeInSeconds, normalizeAddress, } from "./utils";
12
14
  /**
13
- * @dev SuperToken Helper Class
15
+ * SuperToken Helper Class
14
16
  * @description A helper class to create `SuperToken` objects which can interact with the `SuperToken` contract as well as the CFAV1 and IDAV1 contracts of the desired `SuperToken`.
17
+ * @see https://www.notion.so/superfluidhq/Classification-of-Super-Tokens-5beace780b5c4d09a5752a3677da3dc0 for further details on naming classification and underlying implementation.
15
18
  */
16
- export default class SuperToken extends Token {
19
+ export default class SuperToken extends ERC20Token {
17
20
  constructor(options, settings) {
18
21
  // initialize ERC20 token functions here
19
22
  super(settings.address);
20
- // SuperToken Contract Read Functions
23
+ /** ### SuperToken Contract Read Functions ### */
21
24
  /**
22
- * @dev Returns the real time balance of `address`.
25
+ * Returns the real time balance of `address`.
23
26
  * @param account the target address
24
27
  * @param timestamp the timestamp you'd like to see the data
25
28
  * @param providerOrSigner a provider or signer for executing a web3 call
@@ -28,7 +31,7 @@ export default class SuperToken extends Token {
28
31
  this.realtimeBalanceOf = async ({ providerOrSigner, account, timestamp = getStringCurrentTimeInSeconds(), }) => {
29
32
  const normalizedAccount = normalizeAddress(account);
30
33
  try {
31
- const realtimeBalanceOf = await this.superTokenContract
34
+ const realtimeBalanceOf = await this.contract
32
35
  .connect(providerOrSigner)
33
36
  .realtimeBalanceOf(normalizedAccount, timestamp);
34
37
  return {
@@ -46,193 +49,223 @@ export default class SuperToken extends Token {
46
49
  });
47
50
  }
48
51
  };
49
- // SuperToken Contract Write Functions
52
+ /** ### CFA Read Functions ### */
50
53
  /**
51
- * @dev Downgrade `amount` SuperToken's.
52
- * @param amount The amount to be downgraded.
53
- * @param overrides ethers overrides object for more control over the transaction sent.
54
- * @returns {Operation} An instance of Operation which can be executed or batched.
55
- */
56
- this.downgrade = ({ amount, overrides, }) => {
57
- const txn = this.superTokenContract.populateTransaction.downgrade(amount, overrides || {});
58
- return new Operation(txn, "SUPERTOKEN_DOWNGRADE");
59
- };
60
- /**
61
- * @dev Upgrade `amount` SuperToken's.
62
- * @param amount The amount to be upgraded.
63
- * @param overrides ethers overrides object for more control over the transaction sent.
64
- * @returns {Operation} An instance of Operation which can be executed or batched.
65
- */
66
- this.upgrade = ({ amount, overrides, }) => {
67
- const txn = this.superTokenContract.populateTransaction.upgrade(amount, overrides || {});
68
- return new Operation(txn, "SUPERTOKEN_UPGRADE");
69
- };
70
- // CFA Read Functions
71
- /**
72
- * @dev Get the details of a flow.
54
+ * Get the details of a flow.
73
55
  * @param sender the sender of the flow
74
56
  * @param receiver the receiver of the flow
75
57
  * @param providerOrSigner a provider or signer object
76
58
  * @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
77
59
  */
78
- this.getFlow = async ({ sender, receiver, providerOrSigner, }) => {
60
+ this.getFlow = async (params) => {
79
61
  return await this.cfaV1.getFlow({
80
62
  superToken: this.settings.address,
81
- sender,
82
- receiver,
83
- providerOrSigner,
63
+ sender: params.sender,
64
+ receiver: params.receiver,
65
+ providerOrSigner: params.providerOrSigner,
84
66
  });
85
67
  };
86
68
  /**
87
- * @dev Get the flow info of an account (net flow).
69
+ * Get the flow info of an account (net flow).
88
70
  * @param account the account we're querying
89
71
  * @param providerOrSigner a provider or signer object
90
72
  * @returns {Promise<IWeb3FlowInfo>} Web3 Flow info object
91
73
  */
92
- this.getAccountFlowInfo = async ({ account, providerOrSigner, }) => {
74
+ this.getAccountFlowInfo = async (params) => {
93
75
  return await this.cfaV1.getAccountFlowInfo({
94
76
  superToken: this.settings.address,
95
- account,
96
- providerOrSigner,
77
+ account: params.account,
78
+ providerOrSigner: params.providerOrSigner,
97
79
  });
98
80
  };
99
81
  /**
100
- * @dev Get the net flow of an account.
82
+ * Get the net flow of an account.
101
83
  * @param account the account we're querying
102
84
  * @param providerOrSigner a provider or signer object
103
85
  * @returns {Promise<string>} Web3 Flow info object
104
86
  */
105
- this.getNetFlow = async ({ account, providerOrSigner, }) => {
87
+ this.getNetFlow = async (params) => {
106
88
  return await this.cfaV1.getNetFlow({
107
89
  superToken: this.settings.address,
108
- account,
109
- providerOrSigner,
90
+ account: params.account,
91
+ providerOrSigner: params.providerOrSigner,
110
92
  });
111
93
  };
112
- // CFA Write Functions
113
94
  /**
114
- * @dev Create a flow of the token of this class.
115
- * @param sender The sender of the flow.
95
+ * Get flow operator data.
96
+ * @param sender the sender
97
+ * @param flowOperator the flowOperator
98
+ * @param providerOrSigner a provider or signer object
99
+ * @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
100
+ */
101
+ this.getFlowOperatorData = async (params) => {
102
+ const normalizedSender = normalizeAddress(params.sender);
103
+ const normalizedFlowOperator = normalizeAddress(params.flowOperator);
104
+ return await this.cfaV1.getFlowOperatorData({
105
+ superToken: this.settings.address,
106
+ sender: normalizedSender,
107
+ flowOperator: normalizedFlowOperator,
108
+ providerOrSigner: params.providerOrSigner,
109
+ });
110
+ };
111
+ /**
112
+ * Get flow operator data using the flowOperatorId.
113
+ * @param flowOperatorId The keccak256 hash of encoded string "flowOperator", sender and flowOperator
114
+ * @param providerOrSigner a provider or signer object
115
+ * @returns {Promise<IWeb3FlowOperatorData>} Web3 Flow info object
116
+ */
117
+ this.getFlowOperatorDataByID = async (params) => {
118
+ return await this.cfaV1.getFlowOperatorDataByID({
119
+ superToken: this.settings.address,
120
+ flowOperatorId: params.flowOperatorId,
121
+ providerOrSigner: params.providerOrSigner,
122
+ });
123
+ };
124
+ /** ### CFA Write Functions ### */
125
+ /**
126
+ * Create a flow of the token of this class.
116
127
  * @param receiver The receiver of the flow.
117
128
  * @param flowRate The specified flow rate.
118
129
  * @param userData Extra user data provided.
119
130
  * @param overrides ethers overrides object for more control over the transaction sent.
120
131
  * @returns {Operation} An instance of Operation which can be executed or batched.
121
132
  */
122
- this.createFlow = ({ sender, receiver, flowRate, userData, overrides, }) => {
133
+ this.createFlow = (params) => {
123
134
  return this.cfaV1.createFlow({
124
- flowRate,
125
- receiver,
126
- sender,
127
135
  superToken: this.settings.address,
128
- userData,
129
- overrides,
136
+ ...params,
130
137
  });
131
138
  };
132
139
  /**
133
- * @dev Update a flow of the token of this class.
134
- * @param sender The sender of the flow.
140
+ * Update a flow of the token of this class.
135
141
  * @param receiver The receiver of the flow.
136
142
  * @param flowRate The specified flow rate.
137
143
  * @param userData Extra user data provided.
138
144
  * @param overrides ethers overrides object for more control over the transaction sent.
139
145
  * @returns {Operation} An instance of Operation which can be executed or batched.
140
146
  */
141
- this.updateFlow = ({ sender, receiver, flowRate, userData, overrides, }) => {
147
+ this.updateFlow = (params) => {
142
148
  return this.cfaV1.updateFlow({
143
- flowRate,
144
- receiver,
145
- sender,
146
149
  superToken: this.settings.address,
147
- userData,
148
- overrides,
150
+ ...params,
149
151
  });
150
152
  };
151
153
  /**
152
- * @dev Delete a flow of the token of this class.
154
+ * Delete a flow of the token of this class.
153
155
  * @param sender The sender of the flow.
154
156
  * @param receiver The receiver of the flow.
155
157
  * @param userData Extra user data provided.
156
158
  * @param overrides ethers overrides object for more control over the transaction sent.
157
159
  * @returns {Operation} An instance of Operation which can be executed or batched.
158
160
  */
159
- this.deleteFlow = ({ sender, receiver, userData, overrides, }) => {
161
+ this.deleteFlow = (params) => {
160
162
  return this.cfaV1.deleteFlow({
161
163
  superToken: this.settings.address,
162
- sender,
163
- receiver,
164
- userData,
165
- overrides,
164
+ ...params,
165
+ });
166
+ };
167
+ /**
168
+ * Create a flow as an operator
169
+ * @param flowRate The specified flow rate.
170
+ * @param sender The sender of the flow.
171
+ * @param receiver The receiver of the flow.
172
+ * @param userData Extra user data provided.
173
+ * @param overrides ethers overrides object for more control over the transaction sent.
174
+ * @returns {Operation} An instance of Operation which can be executed or batched.
175
+ */
176
+ this.createFlowByOperator = (params) => {
177
+ return this.cfaV1.createFlowByOperator({
178
+ superToken: this.settings.address,
179
+ ...params,
180
+ });
181
+ };
182
+ /**
183
+ * Update a flow as an operator.
184
+ * @param flowRate The specified flow rate.
185
+ * @param sender The sender of the flow.
186
+ * @param receiver The receiver of the flow.
187
+ * @param userData Extra user data provided.
188
+ * @param overrides ethers overrides object for more control over the transaction sent.
189
+ * @returns {Operation} An instance of Operation which can be executed or batched.
190
+ */
191
+ this.updateFlowByOperator = (params) => {
192
+ return this.cfaV1.updateFlowByOperator({
193
+ superToken: this.settings.address,
194
+ ...params,
166
195
  });
167
196
  };
168
- // IDA Read Functions
169
197
  /**
170
- * @dev Get the details of a `Subscription`.
198
+ * Delete a flow as an operator.
199
+ * @param sender The sender of the flow.
200
+ * @param receiver The receiver of the flow.
201
+ * @param userData Extra user data provided.
202
+ * @param overrides ethers overrides object for more control over the transaction sent.
203
+ * @returns {Operation} An instance of Operation which can be executed or batched.
204
+ */
205
+ this.deleteFlowByOperator = (params) => {
206
+ return this.cfaV1.deleteFlowByOperator({
207
+ superToken: this.settings.address,
208
+ ...params,
209
+ });
210
+ };
211
+ /** ### IDA Read Functions ### */
212
+ /**
213
+ * Get the details of a `Subscription`.
171
214
  * @param publisher the address of the publisher of the index
172
215
  * @param indexId the index id
173
216
  * @param subscriber the subscriber's address
174
217
  * @param providerOrSigner a provider or signer object
175
218
  * @returns {Promise<IWeb3Subscription>} Web3 Subscription object
176
219
  */
177
- this.getSubscription = async ({ publisher, indexId, subscriber, providerOrSigner, }) => {
220
+ this.getSubscription = async (params) => {
178
221
  return await this.idaV1.getSubscription({
179
222
  superToken: this.settings.address,
180
- publisher,
181
- indexId,
182
- subscriber,
183
- providerOrSigner,
223
+ ...params,
184
224
  });
185
225
  };
186
226
  /**
187
- * @dev Get the details of an `Index`.
227
+ * Get the details of an `Index`.
188
228
  * @param publisher the address of the publisher of the index
189
229
  * @param indexId the index id
190
230
  * @param providerOrSigner a provider or signer object
191
231
  * @returns {Promise<IWeb3Index>} Web3 Index object
192
232
  */
193
- this.getIndex = async ({ publisher, indexId, providerOrSigner, }) => {
233
+ this.getIndex = async (params) => {
194
234
  return await this.idaV1.getIndex({
195
235
  superToken: this.settings.address,
196
- publisher,
197
- indexId,
198
- providerOrSigner,
236
+ ...params,
199
237
  });
200
238
  };
201
- // IDA Write Functions
239
+ /** ### IDA Write Functions ### */
202
240
  /**
203
- * @dev Creates an IDA Index.
241
+ * Creates an IDA Index.
204
242
  * @param indexId The id of the index.
205
243
  * @param userData Extra user data provided.
206
244
  * @param overrides ethers overrides object for more control over the transaction sent.
207
245
  * @returns {Operation} An instance of Operation which can be executed or batched.
208
246
  */
209
- this.createIndex = ({ indexId, userData, overrides, }) => {
247
+ this.createIndex = (params) => {
210
248
  return this.idaV1.createIndex({
211
- indexId,
212
249
  superToken: this.settings.address,
213
- userData,
214
- overrides,
250
+ ...params,
215
251
  });
216
252
  };
217
253
  /**
218
- * @dev Distributes `amount` of token to an index
254
+ * Distributes `amount` of token to an index
219
255
  * @param indexId The id of the index.
220
256
  * @param amount The amount of tokens to be distributed.
221
257
  * @param userData Extra user data provided.
222
258
  * @param overrides ethers overrides object for more control over the transaction sent.
223
259
  * @returns {Operation} An instance of Operation which can be executed or batched.
224
260
  */
225
- this.distribute = ({ indexId, amount, userData, overrides, }) => {
261
+ this.distribute = (params) => {
226
262
  return this.idaV1.distribute({
227
- indexId,
228
- amount,
229
263
  superToken: this.settings.address,
230
- userData,
231
- overrides,
264
+ ...params,
232
265
  });
233
266
  };
234
267
  /**
235
- * @dev Updates the `IndexValue` field of an index.
268
+ * Updates the `IndexValue` field of an index.
236
269
  * @param indexId The id of the index.
237
270
  * @param indexValue The new indexValue.
238
271
  * @param userData Extra user data provided.
@@ -241,17 +274,14 @@ export default class SuperToken extends Token {
241
274
  *
242
275
  * NOTE: It has the same effect as `distribute`, but is closer to the low level data structure of the index.
243
276
  */
244
- this.updateIndexValue = ({ indexId, indexValue, userData, overrides, }) => {
277
+ this.updateIndexValue = (params) => {
245
278
  return this.idaV1.updateIndexValue({
246
- indexId,
247
- indexValue,
248
279
  superToken: this.settings.address,
249
- userData,
250
- overrides,
280
+ ...params,
251
281
  });
252
282
  };
253
283
  /**
254
- * @dev Updates the `units` allocated to a Subscription.
284
+ * Updates the `units` allocated to a Subscription.
255
285
  * @param indexId The id of the index.
256
286
  * @param subscriber The subscriber address whose units you want to update.
257
287
  * @param units The amount of units you want to update to.
@@ -259,52 +289,42 @@ export default class SuperToken extends Token {
259
289
  * @param overrides ethers overrides object for more control over the transaction sent.
260
290
  * @returns {Operation} An instance of Operation which can be executed or batched.
261
291
  */
262
- this.updateSubscriptionUnits = ({ indexId, subscriber, units, userData, overrides, }) => {
292
+ this.updateSubscriptionUnits = (params) => {
263
293
  return this.idaV1.updateSubscriptionUnits({
264
- indexId,
265
294
  superToken: this.settings.address,
266
- subscriber,
267
- units,
268
- userData,
269
- overrides,
295
+ ...params,
270
296
  });
271
297
  };
272
298
  /**
273
- * @dev Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
299
+ * Approves a Subscription, so the Subscriber won't need to claim tokens when the Publisher distributes.
274
300
  * @param indexId The id of the index.
275
301
  * @param publisher The publisher address whose subscription you want to approve.
276
302
  * @param userData Extra user data provided.
277
303
  * @param overrides ethers overrides object for more control over the transaction sent.
278
304
  * @returns {Operation} An instance of Operation which can be executed or batched.
279
305
  */
280
- this.approveSubscription = ({ indexId, publisher, userData, overrides, }) => {
306
+ this.approveSubscription = (params) => {
281
307
  return this.idaV1.approveSubscription({
282
- indexId,
283
308
  superToken: this.settings.address,
284
- publisher,
285
- userData,
286
- overrides,
309
+ ...params,
287
310
  });
288
311
  };
289
312
  /**
290
- * @dev Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
313
+ * Revokes a Subscription, so the Subscriber will need to claim tokens when the Publisher distributes.
291
314
  * @param indexId The id of the index.
292
315
  * @param publisher The index publisher address you want to revoke for the subscriber.
293
316
  * @param userData Extra user data provided.
294
317
  * @param overrides ethers overrides object for more control over the transaction sent.
295
318
  * @returns {Operation} An instance of Operation which can be executed or batched.
296
319
  */
297
- this.revokeSubscription = ({ indexId, publisher, userData, overrides, }) => {
320
+ this.revokeSubscription = (params) => {
298
321
  return this.idaV1.revokeSubscription({
299
- indexId,
300
322
  superToken: this.settings.address,
301
- publisher,
302
- userData,
303
- overrides,
323
+ ...params,
304
324
  });
305
325
  };
306
326
  /**
307
- * @dev Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
327
+ * Deletes a Subscription by setting the `units` allocated to the Subscriber to 0.
308
328
  * @param indexId The id of the index.
309
329
  * @param subscriber The subscriber address whose subscription you want to delete.
310
330
  * @param publisher The publisher address of the index you are targeting.
@@ -312,18 +332,14 @@ export default class SuperToken extends Token {
312
332
  * @param overrides ethers overrides object for more control over the transaction sent.
313
333
  * @returns {Operation} An instance of Operation which can be executed or batched.
314
334
  */
315
- this.deleteSubscription = ({ indexId, subscriber, publisher, userData, overrides, }) => {
335
+ this.deleteSubscription = (params) => {
316
336
  return this.idaV1.deleteSubscription({
317
- indexId,
318
337
  superToken: this.settings.address,
319
- subscriber,
320
- publisher,
321
- userData,
322
- overrides,
338
+ ...params,
323
339
  });
324
340
  };
325
341
  /**
326
- * @dev Claims any pending tokens allocated to the Subscription (unapproved).
342
+ * Claims any pending tokens allocated to the Subscription (unapproved).
327
343
  * @param indexId The id of the index.
328
344
  * @param subscriber The subscriber address who you are claiming for.
329
345
  * @param publisher The publisher address of the index you are targeting.
@@ -331,14 +347,17 @@ export default class SuperToken extends Token {
331
347
  * @param overrides ethers overrides object for more control over the transaction sent.
332
348
  * @returns {Operation} An instance of Operation which can be executed or batched.
333
349
  */
334
- this.claim = ({ indexId, subscriber, publisher, userData, overrides, }) => {
350
+ this.claim = (params) => {
335
351
  return this.idaV1.claim({
336
- indexId,
337
352
  superToken: this.settings.address,
338
- subscriber,
339
- publisher,
340
- userData,
341
- overrides,
353
+ ...params,
354
+ });
355
+ };
356
+ /** ### Governance Read Functions ### */
357
+ this.getGovernanceParameters = async (providerOrSigner) => {
358
+ return this.governance.getGovernanceParameters({
359
+ providerOrSigner,
360
+ token: this.settings.address,
342
361
  });
343
362
  };
344
363
  this.options = options;
@@ -349,10 +368,51 @@ export default class SuperToken extends Token {
349
368
  this.idaV1 = new InstantDistributionAgreementV1({
350
369
  config: this.settings.config,
351
370
  });
352
- this.underlyingToken = new Token(settings.underlyingTokenAddress);
371
+ this.governance = new Governance(this.settings.config.governanceAddress, this.settings.config.hostAddress);
372
+ this.contract = new ethers.Contract(this.settings.address, SuperTokenABI.abi);
353
373
  }
354
- get superTokenContract() {
355
- return new ethers.Contract(this.settings.address, SuperTokenABI.abi);
374
+ /** ### CFA ACL Write Functions (byOperator) ### */
375
+ /**
376
+ * Update permissions for a flow operator as a sender.
377
+ * @param sender The sender of the flow.
378
+ * @param flowOperator The permission grantee address
379
+ * @param permission The permissions to set.
380
+ * @param flowRateAllowance The flowRateAllowance granted to the flow operator.
381
+ * @param userData Extra user data provided.
382
+ * @param overrides ethers overrides object for more control over the transaction sent.
383
+ * @returns {Operation} An instance of Operation which can be executed or batched.
384
+ */
385
+ updateFlowOperatorPermissions(params) {
386
+ return this.cfaV1.updateFlowOperatorPermissions({
387
+ superToken: this.settings.address,
388
+ ...params,
389
+ });
390
+ }
391
+ /**
392
+ * Give flow operator full control - max flow rate and create/update/delete permissions.
393
+ * @param sender The sender of the flow.
394
+ * @param flowOperator The permission grantee address
395
+ * @param userData Extra user data provided.
396
+ * @param overrides ethers overrides object for more control over the transaction sent.
397
+ */
398
+ authorizeFlowOperatorWithFullControl(params) {
399
+ return this.cfaV1.authorizeFlowOperatorWithFullControl({
400
+ superToken: this.settings.address,
401
+ ...params,
402
+ });
403
+ }
404
+ /**
405
+ * Revoke flow operator control - set flow rate to 0 with no permissions.
406
+ * @param sender The sender of the flow.
407
+ * @param flowOperator The permission grantee address
408
+ * @param userData Extra user data provided.
409
+ * @param overrides ethers overrides object for more control over the transaction sent.
410
+ */
411
+ revokeFlowOperatorWithFullControl(params) {
412
+ return this.cfaV1.revokeFlowOperatorWithFullControl({
413
+ superToken: this.settings.address,
414
+ ...params,
415
+ });
356
416
  }
357
417
  }
358
418
  _a = SuperToken;
@@ -375,9 +435,28 @@ SuperToken.create = async (options) => {
375
435
  config: options.config,
376
436
  chainId,
377
437
  networkName,
378
- underlyingTokenAddress,
379
438
  };
380
- return new SuperToken(options, settings);
439
+ const tokenSymbol = await superToken
440
+ .connect(options.provider)
441
+ .symbol();
442
+ const resolverData = chainIdToResolverDataMap.get(chainId) || {
443
+ subgraphAPIEndpoint: "",
444
+ resolverAddress: "",
445
+ networkName: "",
446
+ nativeTokenSymbol: "",
447
+ };
448
+ const nativeTokenSymbol = resolverData.nativeTokenSymbol || "ETH";
449
+ const nativeSuperTokenSymbol = nativeTokenSymbol + "x";
450
+ if (nativeSuperTokenSymbol === tokenSymbol) {
451
+ return new NativeAssetSuperToken(options, settings, nativeTokenSymbol);
452
+ }
453
+ if (underlyingTokenAddress !== ethers.constants.AddressZero) {
454
+ return new WrapperSuperToken(options, {
455
+ ...settings,
456
+ underlyingTokenAddress,
457
+ });
458
+ }
459
+ return new PureSuperToken(options, settings);
381
460
  }
382
461
  catch (err) {
383
462
  throw new SFError({
@@ -387,4 +466,107 @@ SuperToken.create = async (options) => {
387
466
  });
388
467
  }
389
468
  };
469
+ /**
470
+ * WrapperSuperToken has an underlying ERC20 token.
471
+ */
472
+ export class WrapperSuperToken extends SuperToken {
473
+ constructor(options, settings) {
474
+ super(options, settings);
475
+ /** ### WrapperSuperToken Contract Write Functions ### */
476
+ /**
477
+ * Downgrade `amount` SuperToken's.
478
+ * @param amount The amount to be downgraded.
479
+ * @param overrides ethers overrides object for more control over the transaction sent.
480
+ * @returns {Operation} An instance of Operation which can be executed or batched.
481
+ */
482
+ this.downgrade = ({ amount, overrides, }) => {
483
+ const txn = this.contract.populateTransaction.downgrade(amount, overrides || {});
484
+ return new Operation(txn, "SUPERTOKEN_DOWNGRADE");
485
+ };
486
+ /**
487
+ * Upgrade `amount` SuperToken's.
488
+ * @param amount The amount to be upgraded.
489
+ * @param overrides ethers overrides object for more control over the transaction sent.
490
+ * @returns {Operation} An instance of Operation which can be executed or batched.
491
+ */
492
+ this.upgrade = ({ amount, overrides, }) => {
493
+ const txn = this.contract.populateTransaction.upgrade(amount, overrides || {});
494
+ return new Operation(txn, "SUPERTOKEN_UPGRADE");
495
+ };
496
+ /**
497
+ * Upgrade `amount` of an ERC20 token to its SuperToken to `to` address.
498
+ * @param amount The amount to be upgraded.
499
+ * @param to The destination of the upgraded native asset super tokens.
500
+ * @param data Bytes operatorData
501
+ * @param overrides ethers overrides object for more control over the transaction sent.
502
+ * @returns {Operation} An instance of Operation which can be executed.
503
+ */
504
+ this.upgradeTo = ({ amount, to, data = "0x", overrides, }) => {
505
+ const txn = this.contract.populateTransaction.upgradeTo(to, amount, data, {
506
+ ...overrides,
507
+ });
508
+ return new Operation(txn, "UNSUPPORTED");
509
+ };
510
+ this.underlyingToken = new ERC20Token(settings.underlyingTokenAddress);
511
+ }
512
+ }
513
+ /**
514
+ * PureSuperToken doesn't have any underlying ERC20 token.
515
+ */
516
+ export class PureSuperToken extends SuperToken {
517
+ constructor(options, settings) {
518
+ super(options, settings);
519
+ }
520
+ }
521
+ /**
522
+ * NativeAssetSuperToken wraps the native asset of the network.
523
+ */
524
+ export class NativeAssetSuperToken extends SuperToken {
525
+ constructor(options, settings, nativeTokenSymbol) {
526
+ super(options, settings);
527
+ /**
528
+ * Upgrade `amount` of a network's native asset to its SuperToken.
529
+ * @param amount The amount to be upgraded.
530
+ * @param overrides ethers overrides object for more control over the transaction sent.
531
+ * @returns {Operation} An instance of Operation which can be executed.
532
+ */
533
+ this.upgrade = ({ amount, overrides, }) => {
534
+ const txn = this.nativeAssetContract.populateTransaction.upgradeByETH({
535
+ ...overrides,
536
+ value: amount,
537
+ });
538
+ return new Operation(txn, "UNSUPPORTED");
539
+ };
540
+ /**
541
+ * Upgrade `amount` of a network's native asset to its SuperToken to `to` address.
542
+ * @param amount The amount to be upgraded.
543
+ * @param to The destination of the upgraded native asset super tokens.
544
+ * @param overrides ethers overrides object for more control over the transaction sent.
545
+ * @returns {Operation} An instance of Operation which can be executed.
546
+ */
547
+ this.upgradeTo = ({ amount, to, overrides, }) => {
548
+ const txn = this.nativeAssetContract.populateTransaction.upgradeByETHTo(to, {
549
+ ...overrides,
550
+ value: amount,
551
+ });
552
+ return new Operation(txn, "UNSUPPORTED");
553
+ };
554
+ /**
555
+ * Downgrade `amount` of a native asset super token to the underlying native asset.
556
+ * @param amount The amount to be upgraded.
557
+ * @param overrides ethers overrides object for more control over the transaction sent.
558
+ * @returns {Operation} An instance of Operation which can be executed.
559
+ */
560
+ this.downgrade = ({ amount, overrides, }) => {
561
+ const txn = this.nativeAssetContract.populateTransaction.downgradeToETH(amount, {
562
+ ...overrides,
563
+ });
564
+ return new Operation(txn, "UNSUPPORTED");
565
+ };
566
+ this.nativeTokenSymbol = nativeTokenSymbol;
567
+ }
568
+ get nativeAssetContract() {
569
+ return new ethers.Contract(this.settings.address, ISETHABI.abi);
570
+ }
571
+ }
390
572
  //# sourceMappingURL=SuperToken.js.map