@superfluid-finance/sdk-core 0.1.1-dev.e0742d5.0 → 0.2.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 (440) hide show
  1. package/README.md +75 -28
  2. package/dist/index.umd.js +63560 -0
  3. package/dist/main/BatchCall.d.ts +2 -2
  4. package/dist/main/BatchCall.d.ts.map +1 -0
  5. package/dist/main/BatchCall.js +128 -0
  6. package/dist/main/BatchCall.js.map +1 -0
  7. package/dist/main/ConstantFlowAgreementV1.d.ts +7 -3
  8. package/dist/main/ConstantFlowAgreementV1.d.ts.map +1 -0
  9. package/dist/main/ConstantFlowAgreementV1.js +178 -0
  10. package/dist/main/ConstantFlowAgreementV1.js.map +1 -0
  11. package/dist/main/Framework.d.ts +7 -2
  12. package/dist/main/Framework.d.ts.map +1 -0
  13. package/dist/main/Framework.js +181 -0
  14. package/dist/main/Framework.js.map +1 -0
  15. package/dist/main/Host.d.ts +6 -1
  16. package/dist/main/Host.d.ts.map +1 -0
  17. package/dist/main/Host.js +31 -0
  18. package/dist/main/Host.js.map +1 -0
  19. package/dist/main/InstantDistributionAgreementV1.d.ts +18 -9
  20. package/dist/main/InstantDistributionAgreementV1.d.ts.map +1 -0
  21. package/dist/main/InstantDistributionAgreementV1.js +249 -0
  22. package/dist/main/InstantDistributionAgreementV1.js.map +1 -0
  23. package/dist/main/Operation.d.ts +1 -0
  24. package/dist/main/Operation.d.ts.map +1 -0
  25. package/dist/main/Operation.js +86 -0
  26. package/dist/main/Operation.js.map +1 -0
  27. package/dist/main/Query.d.ts +1 -0
  28. package/dist/main/Query.d.ts.map +1 -0
  29. package/dist/main/Query.js +311 -0
  30. package/dist/main/Query.js.map +1 -0
  31. package/dist/main/SFError.d.ts +3 -2
  32. package/dist/main/SFError.d.ts.map +1 -0
  33. package/dist/main/SFError.js +36 -0
  34. package/dist/main/SFError.js.map +1 -0
  35. package/dist/main/SuperToken.d.ts +34 -14
  36. package/dist/main/SuperToken.d.ts.map +1 -0
  37. package/dist/main/SuperToken.js +398 -0
  38. package/dist/main/SuperToken.js.map +1 -0
  39. package/dist/main/Token.d.ts +7 -3
  40. package/dist/main/Token.d.ts.map +1 -0
  41. package/dist/main/Token.js +166 -0
  42. package/dist/main/Token.js.map +1 -0
  43. package/dist/main/abi/ERC20WithTokenInfo.json +224 -0
  44. package/dist/main/abi/IConstantFlowAgreementV1.json +406 -0
  45. package/dist/main/abi/IInstantDistributionAgreementV1.json +947 -0
  46. package/dist/main/abi/IResolver.json +58 -0
  47. package/dist/main/abi/SuperToken.json +1549 -0
  48. package/dist/main/abi/Superfluid.json +1159 -0
  49. package/dist/main/abi/SuperfluidLoader.json +54 -0
  50. package/dist/main/constants.d.ts +3 -2
  51. package/dist/main/constants.d.ts.map +1 -0
  52. package/dist/main/constants.js +134 -0
  53. package/dist/main/constants.js.map +1 -0
  54. package/dist/main/events.d.ts +1 -0
  55. package/dist/main/events.d.ts.map +1 -0
  56. package/dist/main/events.js +3 -0
  57. package/dist/main/events.js.map +1 -0
  58. package/dist/main/frameworkHelpers.d.ts +1 -0
  59. package/dist/main/frameworkHelpers.d.ts.map +1 -0
  60. package/dist/main/frameworkHelpers.js +90 -0
  61. package/dist/main/frameworkHelpers.js.map +1 -0
  62. package/dist/main/index.d.ts +6 -0
  63. package/dist/main/index.d.ts.map +1 -0
  64. package/dist/main/index.js +38 -7597
  65. package/dist/main/index.js.map +1 -0
  66. package/dist/main/interfaces.d.ts +100 -11
  67. package/dist/main/interfaces.d.ts.map +1 -0
  68. package/dist/main/interfaces.js +3 -0
  69. package/dist/main/interfaces.js.map +1 -0
  70. package/dist/main/mapGetAllEventsQueryEvents.d.ts +1 -0
  71. package/dist/main/mapGetAllEventsQueryEvents.d.ts.map +1 -0
  72. package/dist/main/mapGetAllEventsQueryEvents.js +432 -0
  73. package/dist/main/mapGetAllEventsQueryEvents.js.map +1 -0
  74. package/dist/main/ordering.d.ts +1 -0
  75. package/dist/main/ordering.d.ts.map +1 -0
  76. package/dist/main/ordering.js +3 -0
  77. package/dist/main/ordering.js.map +1 -0
  78. package/dist/main/pagination.d.ts +1 -0
  79. package/dist/main/pagination.d.ts.map +1 -0
  80. package/dist/main/pagination.js +60 -0
  81. package/dist/main/pagination.js.map +1 -0
  82. package/dist/main/subgraph/SubgraphClient.d.ts +1 -0
  83. package/dist/main/subgraph/SubgraphClient.d.ts.map +1 -0
  84. package/dist/main/subgraph/SubgraphClient.js +51 -0
  85. package/dist/main/subgraph/SubgraphClient.js.map +1 -0
  86. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
  87. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -0
  88. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js +5 -0
  89. package/dist/main/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -0
  90. package/dist/main/subgraph/queries/getAllEvents.generated.d.ts +1 -0
  91. package/dist/main/subgraph/queries/getAllEvents.generated.d.ts.map +1 -0
  92. package/dist/main/subgraph/queries/getAllEvents.generated.js +6 -0
  93. package/dist/main/subgraph/queries/getAllEvents.generated.js.map +1 -0
  94. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
  95. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -0
  96. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js +5 -0
  97. package/dist/main/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -0
  98. package/dist/main/subgraph/queries/getIndexes.generated.d.ts +1 -0
  99. package/dist/main/subgraph/queries/getIndexes.generated.d.ts.map +1 -0
  100. package/dist/main/subgraph/queries/getIndexes.generated.js +5 -0
  101. package/dist/main/subgraph/queries/getIndexes.generated.js.map +1 -0
  102. package/dist/main/subgraph/queries/getStreams.generated.d.ts +1 -0
  103. package/dist/main/subgraph/queries/getStreams.generated.d.ts.map +1 -0
  104. package/dist/main/subgraph/queries/getStreams.generated.js +5 -0
  105. package/dist/main/subgraph/queries/getStreams.generated.js.map +1 -0
  106. package/dist/main/subgraph/queries/getTokens.generated.d.ts +1 -0
  107. package/dist/main/subgraph/queries/getTokens.generated.d.ts.map +1 -0
  108. package/dist/main/subgraph/queries/getTokens.generated.js +5 -0
  109. package/dist/main/subgraph/queries/getTokens.generated.js.map +1 -0
  110. package/dist/main/subgraph/schema.generated.d.ts +1 -0
  111. package/dist/main/subgraph/schema.generated.d.ts.map +1 -0
  112. package/dist/main/subgraph/schema.generated.js +3 -0
  113. package/dist/main/subgraph/schema.generated.js.map +1 -0
  114. package/dist/main/typechain/ERC20WithTokenInfo.d.ts +1 -0
  115. package/dist/main/typechain/ERC20WithTokenInfo.d.ts.map +1 -0
  116. package/dist/main/typechain/ERC20WithTokenInfo.js +3 -0
  117. package/dist/main/typechain/ERC20WithTokenInfo.js.map +1 -0
  118. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts +1 -0
  119. package/dist/main/typechain/IConstantFlowAgreementV1.d.ts.map +1 -0
  120. package/dist/main/typechain/IConstantFlowAgreementV1.js +3 -0
  121. package/dist/main/typechain/IConstantFlowAgreementV1.js.map +1 -0
  122. package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts +1 -0
  123. package/dist/main/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -0
  124. package/dist/main/typechain/IInstantDistributionAgreementV1.js +3 -0
  125. package/dist/main/typechain/IInstantDistributionAgreementV1.js.map +1 -0
  126. package/dist/main/typechain/IResolver.d.ts +1 -0
  127. package/dist/main/typechain/IResolver.d.ts.map +1 -0
  128. package/dist/main/typechain/IResolver.js +3 -0
  129. package/dist/main/typechain/IResolver.js.map +1 -0
  130. package/dist/main/typechain/SuperToken.d.ts +1 -0
  131. package/dist/main/typechain/SuperToken.d.ts.map +1 -0
  132. package/dist/main/typechain/SuperToken.js +3 -0
  133. package/dist/main/typechain/SuperToken.js.map +1 -0
  134. package/dist/main/typechain/Superfluid.d.ts +1 -0
  135. package/dist/main/typechain/Superfluid.d.ts.map +1 -0
  136. package/dist/main/typechain/Superfluid.js +3 -0
  137. package/dist/main/typechain/Superfluid.js.map +1 -0
  138. package/dist/main/typechain/SuperfluidLoader.d.ts +1 -0
  139. package/dist/main/typechain/SuperfluidLoader.d.ts.map +1 -0
  140. package/dist/main/typechain/SuperfluidLoader.js +3 -0
  141. package/dist/main/typechain/SuperfluidLoader.js.map +1 -0
  142. package/dist/main/typechain/TestToken.d.ts +1 -0
  143. package/dist/main/typechain/TestToken.d.ts.map +1 -0
  144. package/dist/main/typechain/TestToken.js +3 -0
  145. package/dist/main/typechain/TestToken.js.map +1 -0
  146. package/dist/main/typechain/common.d.ts +1 -0
  147. package/dist/main/typechain/common.d.ts.map +1 -0
  148. package/dist/main/typechain/common.js +3 -0
  149. package/dist/main/typechain/common.js.map +1 -0
  150. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -0
  151. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -0
  152. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.js +242 -0
  153. package/dist/main/typechain/factories/ERC20WithTokenInfo__factory.js.map +1 -0
  154. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -0
  155. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -0
  156. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js +424 -0
  157. package/dist/main/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -0
  158. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -0
  159. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -0
  160. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js +965 -0
  161. package/dist/main/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -0
  162. package/dist/main/typechain/factories/IResolver__factory.d.ts +1 -0
  163. package/dist/main/typechain/factories/IResolver__factory.d.ts.map +1 -0
  164. package/dist/main/typechain/factories/IResolver__factory.js +76 -0
  165. package/dist/main/typechain/factories/IResolver__factory.js.map +1 -0
  166. package/dist/main/typechain/factories/SuperToken__factory.d.ts +1 -0
  167. package/dist/main/typechain/factories/SuperToken__factory.d.ts.map +1 -0
  168. package/dist/main/typechain/factories/SuperToken__factory.js +1567 -0
  169. package/dist/main/typechain/factories/SuperToken__factory.js.map +1 -0
  170. package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts +1 -0
  171. package/dist/main/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -0
  172. package/dist/main/typechain/factories/SuperfluidLoader__factory.js +72 -0
  173. package/dist/main/typechain/factories/SuperfluidLoader__factory.js.map +1 -0
  174. package/dist/main/typechain/factories/Superfluid__factory.d.ts +1 -0
  175. package/dist/main/typechain/factories/Superfluid__factory.d.ts.map +1 -0
  176. package/dist/main/typechain/factories/Superfluid__factory.js +1177 -0
  177. package/dist/main/typechain/factories/Superfluid__factory.js.map +1 -0
  178. package/dist/main/typechain/factories/TestToken__factory.d.ts +1 -0
  179. package/dist/main/typechain/factories/TestToken__factory.d.ts.map +1 -0
  180. package/dist/main/typechain/factories/TestToken__factory.js +348 -0
  181. package/dist/main/typechain/factories/TestToken__factory.js.map +1 -0
  182. package/dist/main/typechain/index.d.ts +1 -0
  183. package/dist/main/typechain/index.d.ts.map +1 -0
  184. package/dist/main/typechain/index.js +20 -0
  185. package/dist/main/typechain/index.js.map +1 -0
  186. package/dist/main/types.d.ts +1 -0
  187. package/dist/main/types.d.ts.map +1 -0
  188. package/dist/main/types.js +3 -0
  189. package/dist/main/types.js.map +1 -0
  190. package/dist/main/utils.d.ts +6 -0
  191. package/dist/main/utils.d.ts.map +1 -0
  192. package/dist/main/utils.js +178 -0
  193. package/dist/main/utils.js.map +1 -0
  194. package/dist/main/validation.d.ts +1 -0
  195. package/dist/main/validation.d.ts.map +1 -0
  196. package/dist/main/validation.js +98 -0
  197. package/dist/main/validation.js.map +1 -0
  198. package/dist/module/BatchCall.d.ts +2 -2
  199. package/dist/module/BatchCall.d.ts.map +1 -0
  200. package/dist/module/BatchCall.js +122 -0
  201. package/dist/module/BatchCall.js.map +1 -0
  202. package/dist/module/ConstantFlowAgreementV1.d.ts +7 -3
  203. package/dist/module/ConstantFlowAgreementV1.d.ts.map +1 -0
  204. package/dist/module/ConstantFlowAgreementV1.js +172 -0
  205. package/dist/module/ConstantFlowAgreementV1.js.map +1 -0
  206. package/dist/module/Framework.d.ts +7 -2
  207. package/dist/module/Framework.d.ts.map +1 -0
  208. package/dist/module/Framework.js +175 -0
  209. package/dist/module/Framework.js.map +1 -0
  210. package/dist/module/Host.d.ts +6 -1
  211. package/dist/module/Host.d.ts.map +1 -0
  212. package/dist/module/Host.js +25 -0
  213. package/dist/module/Host.js.map +1 -0
  214. package/dist/module/InstantDistributionAgreementV1.d.ts +18 -9
  215. package/dist/module/InstantDistributionAgreementV1.d.ts.map +1 -0
  216. package/dist/module/InstantDistributionAgreementV1.js +243 -0
  217. package/dist/module/InstantDistributionAgreementV1.js.map +1 -0
  218. package/dist/module/Operation.d.ts +1 -0
  219. package/dist/module/Operation.d.ts.map +1 -0
  220. package/dist/module/Operation.js +80 -0
  221. package/dist/module/Operation.js.map +1 -0
  222. package/dist/module/Query.d.ts +1 -0
  223. package/dist/module/Query.d.ts.map +1 -0
  224. package/dist/module/Query.js +305 -0
  225. package/dist/module/Query.js.map +1 -0
  226. package/dist/module/SFError.d.ts +3 -2
  227. package/dist/module/SFError.d.ts.map +1 -0
  228. package/dist/module/SFError.js +33 -0
  229. package/dist/module/SFError.js.map +1 -0
  230. package/dist/module/SuperToken.d.ts +34 -14
  231. package/dist/module/SuperToken.d.ts.map +1 -0
  232. package/dist/module/SuperToken.js +392 -0
  233. package/dist/module/SuperToken.js.map +1 -0
  234. package/dist/module/Token.d.ts +7 -3
  235. package/dist/module/Token.d.ts.map +1 -0
  236. package/dist/module/Token.js +160 -0
  237. package/dist/module/Token.js.map +1 -0
  238. package/dist/module/abi/ERC20WithTokenInfo.json +224 -0
  239. package/dist/module/abi/IConstantFlowAgreementV1.json +406 -0
  240. package/dist/module/abi/IInstantDistributionAgreementV1.json +947 -0
  241. package/dist/module/abi/IResolver.json +58 -0
  242. package/dist/module/abi/SuperToken.json +1549 -0
  243. package/dist/module/abi/Superfluid.json +1159 -0
  244. package/dist/module/abi/SuperfluidLoader.json +54 -0
  245. package/dist/module/constants.d.ts +3 -2
  246. package/dist/module/constants.d.ts.map +1 -0
  247. package/dist/module/constants.js +131 -0
  248. package/dist/module/constants.js.map +1 -0
  249. package/dist/module/events.d.ts +1 -0
  250. package/dist/module/events.d.ts.map +1 -0
  251. package/dist/module/events.js +2 -0
  252. package/dist/module/events.js.map +1 -0
  253. package/dist/module/frameworkHelpers.d.ts +1 -0
  254. package/dist/module/frameworkHelpers.d.ts.map +1 -0
  255. package/dist/module/frameworkHelpers.js +81 -0
  256. package/dist/module/frameworkHelpers.js.map +1 -0
  257. package/dist/module/index.d.ts +6 -0
  258. package/dist/module/index.d.ts.map +1 -0
  259. package/dist/module/index.js +25 -7561
  260. package/dist/module/index.js.map +1 -0
  261. package/dist/module/interfaces.d.ts +100 -11
  262. package/dist/module/interfaces.d.ts.map +1 -0
  263. package/dist/module/interfaces.js +2 -0
  264. package/dist/module/interfaces.js.map +1 -0
  265. package/dist/module/mapGetAllEventsQueryEvents.d.ts +1 -0
  266. package/dist/module/mapGetAllEventsQueryEvents.d.ts.map +1 -0
  267. package/dist/module/mapGetAllEventsQueryEvents.js +428 -0
  268. package/dist/module/mapGetAllEventsQueryEvents.js.map +1 -0
  269. package/dist/module/ordering.d.ts +1 -0
  270. package/dist/module/ordering.d.ts.map +1 -0
  271. package/dist/module/ordering.js +2 -0
  272. package/dist/module/ordering.js.map +1 -0
  273. package/dist/module/pagination.d.ts +1 -0
  274. package/dist/module/pagination.d.ts.map +1 -0
  275. package/dist/module/pagination.js +51 -0
  276. package/dist/module/pagination.js.map +1 -0
  277. package/dist/module/subgraph/SubgraphClient.d.ts +1 -0
  278. package/dist/module/subgraph/SubgraphClient.d.ts.map +1 -0
  279. package/dist/module/subgraph/SubgraphClient.js +44 -0
  280. package/dist/module/subgraph/SubgraphClient.js.map +1 -0
  281. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +1 -0
  282. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.d.ts.map +1 -0
  283. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js +2 -0
  284. package/dist/module/subgraph/queries/getAccountTokenSnapshots.generated.js.map +1 -0
  285. package/dist/module/subgraph/queries/getAllEvents.generated.d.ts +1 -0
  286. package/dist/module/subgraph/queries/getAllEvents.generated.d.ts.map +1 -0
  287. package/dist/module/subgraph/queries/getAllEvents.generated.js +3 -0
  288. package/dist/module/subgraph/queries/getAllEvents.generated.js.map +1 -0
  289. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts +1 -0
  290. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.d.ts.map +1 -0
  291. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js +2 -0
  292. package/dist/module/subgraph/queries/getIndexSubscriptions.generated.js.map +1 -0
  293. package/dist/module/subgraph/queries/getIndexes.generated.d.ts +1 -0
  294. package/dist/module/subgraph/queries/getIndexes.generated.d.ts.map +1 -0
  295. package/dist/module/subgraph/queries/getIndexes.generated.js +2 -0
  296. package/dist/module/subgraph/queries/getIndexes.generated.js.map +1 -0
  297. package/dist/module/subgraph/queries/getStreams.generated.d.ts +1 -0
  298. package/dist/module/subgraph/queries/getStreams.generated.d.ts.map +1 -0
  299. package/dist/module/subgraph/queries/getStreams.generated.js +2 -0
  300. package/dist/module/subgraph/queries/getStreams.generated.js.map +1 -0
  301. package/dist/module/subgraph/queries/getTokens.generated.d.ts +1 -0
  302. package/dist/module/subgraph/queries/getTokens.generated.d.ts.map +1 -0
  303. package/dist/module/subgraph/queries/getTokens.generated.js +2 -0
  304. package/dist/module/subgraph/queries/getTokens.generated.js.map +1 -0
  305. package/dist/module/subgraph/schema.generated.d.ts +1 -0
  306. package/dist/module/subgraph/schema.generated.d.ts.map +1 -0
  307. package/dist/module/subgraph/schema.generated.js +2 -0
  308. package/dist/module/subgraph/schema.generated.js.map +1 -0
  309. package/dist/module/typechain/ERC20WithTokenInfo.d.ts +1 -0
  310. package/dist/module/typechain/ERC20WithTokenInfo.d.ts.map +1 -0
  311. package/dist/module/typechain/ERC20WithTokenInfo.js +2 -0
  312. package/dist/module/typechain/ERC20WithTokenInfo.js.map +1 -0
  313. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts +1 -0
  314. package/dist/module/typechain/IConstantFlowAgreementV1.d.ts.map +1 -0
  315. package/dist/module/typechain/IConstantFlowAgreementV1.js +2 -0
  316. package/dist/module/typechain/IConstantFlowAgreementV1.js.map +1 -0
  317. package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts +1 -0
  318. package/dist/module/typechain/IInstantDistributionAgreementV1.d.ts.map +1 -0
  319. package/dist/module/typechain/IInstantDistributionAgreementV1.js +2 -0
  320. package/dist/module/typechain/IInstantDistributionAgreementV1.js.map +1 -0
  321. package/dist/module/typechain/IResolver.d.ts +1 -0
  322. package/dist/module/typechain/IResolver.d.ts.map +1 -0
  323. package/dist/module/typechain/IResolver.js +2 -0
  324. package/dist/module/typechain/IResolver.js.map +1 -0
  325. package/dist/module/typechain/SuperToken.d.ts +1 -0
  326. package/dist/module/typechain/SuperToken.d.ts.map +1 -0
  327. package/dist/module/typechain/SuperToken.js +2 -0
  328. package/dist/module/typechain/SuperToken.js.map +1 -0
  329. package/dist/module/typechain/Superfluid.d.ts +1 -0
  330. package/dist/module/typechain/Superfluid.d.ts.map +1 -0
  331. package/dist/module/typechain/Superfluid.js +2 -0
  332. package/dist/module/typechain/Superfluid.js.map +1 -0
  333. package/dist/module/typechain/SuperfluidLoader.d.ts +1 -0
  334. package/dist/module/typechain/SuperfluidLoader.d.ts.map +1 -0
  335. package/dist/module/typechain/SuperfluidLoader.js +2 -0
  336. package/dist/module/typechain/SuperfluidLoader.js.map +1 -0
  337. package/dist/module/typechain/TestToken.d.ts +1 -0
  338. package/dist/module/typechain/TestToken.d.ts.map +1 -0
  339. package/dist/module/typechain/TestToken.js +2 -0
  340. package/dist/module/typechain/TestToken.js.map +1 -0
  341. package/dist/module/typechain/common.d.ts +1 -0
  342. package/dist/module/typechain/common.d.ts.map +1 -0
  343. package/dist/module/typechain/common.js +2 -0
  344. package/dist/module/typechain/common.js.map +1 -0
  345. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts +1 -0
  346. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.d.ts.map +1 -0
  347. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.js +238 -0
  348. package/dist/module/typechain/factories/ERC20WithTokenInfo__factory.js.map +1 -0
  349. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +1 -0
  350. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.d.ts.map +1 -0
  351. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js +420 -0
  352. package/dist/module/typechain/factories/IConstantFlowAgreementV1__factory.js.map +1 -0
  353. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +1 -0
  354. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts.map +1 -0
  355. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js +961 -0
  356. package/dist/module/typechain/factories/IInstantDistributionAgreementV1__factory.js.map +1 -0
  357. package/dist/module/typechain/factories/IResolver__factory.d.ts +1 -0
  358. package/dist/module/typechain/factories/IResolver__factory.d.ts.map +1 -0
  359. package/dist/module/typechain/factories/IResolver__factory.js +72 -0
  360. package/dist/module/typechain/factories/IResolver__factory.js.map +1 -0
  361. package/dist/module/typechain/factories/SuperToken__factory.d.ts +1 -0
  362. package/dist/module/typechain/factories/SuperToken__factory.d.ts.map +1 -0
  363. package/dist/module/typechain/factories/SuperToken__factory.js +1563 -0
  364. package/dist/module/typechain/factories/SuperToken__factory.js.map +1 -0
  365. package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts +1 -0
  366. package/dist/module/typechain/factories/SuperfluidLoader__factory.d.ts.map +1 -0
  367. package/dist/module/typechain/factories/SuperfluidLoader__factory.js +68 -0
  368. package/dist/module/typechain/factories/SuperfluidLoader__factory.js.map +1 -0
  369. package/dist/module/typechain/factories/Superfluid__factory.d.ts +1 -0
  370. package/dist/module/typechain/factories/Superfluid__factory.d.ts.map +1 -0
  371. package/dist/module/typechain/factories/Superfluid__factory.js +1173 -0
  372. package/dist/module/typechain/factories/Superfluid__factory.js.map +1 -0
  373. package/dist/module/typechain/factories/TestToken__factory.d.ts +1 -0
  374. package/dist/module/typechain/factories/TestToken__factory.d.ts.map +1 -0
  375. package/dist/module/typechain/factories/TestToken__factory.js +344 -0
  376. package/dist/module/typechain/factories/TestToken__factory.js.map +1 -0
  377. package/dist/module/typechain/index.d.ts +1 -0
  378. package/dist/module/typechain/index.d.ts.map +1 -0
  379. package/dist/{umd/typechain/index.d.ts → module/typechain/index.js} +1 -8
  380. package/dist/module/typechain/index.js.map +1 -0
  381. package/dist/module/types.d.ts +1 -0
  382. package/dist/module/types.d.ts.map +1 -0
  383. package/dist/module/types.js +2 -0
  384. package/dist/module/types.js.map +1 -0
  385. package/dist/module/utils.d.ts +6 -0
  386. package/dist/module/utils.d.ts.map +1 -0
  387. package/dist/module/utils.js +153 -0
  388. package/dist/module/utils.js.map +1 -0
  389. package/dist/module/validation.d.ts +1 -0
  390. package/dist/module/validation.d.ts.map +1 -0
  391. package/dist/module/validation.js +92 -0
  392. package/dist/module/validation.js.map +1 -0
  393. package/package.json +48 -34
  394. package/dist/umd/BatchCall.d.ts +0 -53
  395. package/dist/umd/ConstantFlowAgreementV1.d.ts +0 -74
  396. package/dist/umd/Framework.d.ts +0 -75
  397. package/dist/umd/Host.d.ts +0 -18
  398. package/dist/umd/InstantDistributionAgreementV1.d.ts +0 -107
  399. package/dist/umd/Operation.d.ts +0 -38
  400. package/dist/umd/Query.d.ts +0 -31
  401. package/dist/umd/SFError.d.ts +0 -13
  402. package/dist/umd/SuperToken.d.ts +0 -191
  403. package/dist/umd/Token.d.ts +0 -76
  404. package/dist/umd/constants.d.ts +0 -17
  405. package/dist/umd/events.d.ts +0 -255
  406. package/dist/umd/frameworkHelpers.d.ts +0 -20
  407. package/dist/umd/index.d.ts +0 -19
  408. package/dist/umd/index.js +0 -7599
  409. package/dist/umd/interfaces.d.ts +0 -304
  410. package/dist/umd/mapGetAllEventsQueryEvents.d.ts +0 -3
  411. package/dist/umd/ordering.d.ts +0 -13
  412. package/dist/umd/pagination.d.ts +0 -65
  413. package/dist/umd/subgraph/SubgraphClient.d.ts +0 -16
  414. package/dist/umd/subgraph/queries/getAccountTokenSnapshots.generated.d.ts +0 -45
  415. package/dist/umd/subgraph/queries/getAllEvents.generated.d.ts +0 -651
  416. package/dist/umd/subgraph/queries/getIndexSubscriptions.generated.d.ts +0 -46
  417. package/dist/umd/subgraph/queries/getIndexes.generated.d.ts +0 -44
  418. package/dist/umd/subgraph/queries/getStreams.generated.d.ts +0 -58
  419. package/dist/umd/subgraph/queries/getTokens.generated.d.ts +0 -27
  420. package/dist/umd/subgraph/schema.generated.d.ts +0 -6478
  421. package/dist/umd/typechain/ERC20WithTokenInfo.d.ts +0 -159
  422. package/dist/umd/typechain/IConstantFlowAgreementV1.d.ts +0 -305
  423. package/dist/umd/typechain/IInstantDistributionAgreementV1.d.ts +0 -585
  424. package/dist/umd/typechain/IResolver.d.ts +0 -71
  425. package/dist/umd/typechain/SuperToken.d.ts +0 -1011
  426. package/dist/umd/typechain/Superfluid.d.ts +0 -780
  427. package/dist/umd/typechain/SuperfluidLoader.d.ts +0 -55
  428. package/dist/umd/typechain/TestToken.d.ts +0 -215
  429. package/dist/umd/typechain/common.d.ts +0 -21
  430. package/dist/umd/typechain/factories/ERC20WithTokenInfo__factory.d.ts +0 -35
  431. package/dist/umd/typechain/factories/IConstantFlowAgreementV1__factory.d.ts +0 -35
  432. package/dist/umd/typechain/factories/IInstantDistributionAgreementV1__factory.d.ts +0 -35
  433. package/dist/umd/typechain/factories/IResolver__factory.d.ts +0 -35
  434. package/dist/umd/typechain/factories/SuperToken__factory.d.ts +0 -46
  435. package/dist/umd/typechain/factories/SuperfluidLoader__factory.d.ts +0 -37
  436. package/dist/umd/typechain/factories/Superfluid__factory.d.ts +0 -82
  437. package/dist/umd/typechain/factories/TestToken__factory.d.ts +0 -46
  438. package/dist/umd/types.d.ts +0 -2
  439. package/dist/umd/utils.d.ts +0 -106
  440. package/dist/umd/validation.d.ts +0 -8
package/README.md CHANGED
@@ -23,6 +23,30 @@
23
23
 
24
24
  ### 📖 [Docs](https://docs.superfluid.finance)
25
25
 
26
+ # Introduction
27
+ SDK-Core is an application framework for interacting with the Superfluid Protocol without Solidity knowledge.
28
+
29
+ More specifically, SDK-Core is a wrapper library around `@superfluid-finance/ethereum-contracts` which allows web developers to interact with the Superfluid contracts.
30
+ Under the hood, SDK-Core leverages TypeScript, ethers.js and The Graph and GraphQL.
31
+
32
+ ## Important Disclaimer
33
+ SDK-Core is in early active development and can have breaking releases without warning and without consideration for semantic versioning.
34
+
35
+ # Features
36
+ * Minimal Framework initialization (`networkName` or `chainId` and `provider`)
37
+ * New Operation syntax for transactions
38
+ * Create/Update/Delete Agreement Operations (Constant Flow Agreement and Instant Distribution Agreement)
39
+ * SuperToken Operations
40
+ * Subgraph-powered GraphQL querying with ordering and pagination
41
+ * Event subscription
42
+ * CFA/IDA/SuperToken Web3 Getters
43
+ * Batch Call functionality for batching multiple Superfluid Operations in one transaction
44
+
45
+ # Notable Used Technologies
46
+ * TypeScript
47
+ * Ethers
48
+ * GraphQL
49
+
26
50
  # Prerequisites
27
51
 
28
52
  To get the package up and running you'll need to install the necessary dependencies and build the project:
@@ -31,8 +55,10 @@ To get the package up and running you'll need to install the necessary dependenc
31
55
  yarn install && yarn build
32
56
  ```
33
57
 
34
- # Usage
58
+ # Tutorial
35
59
 
60
+ For the best and most immersive experience of learning how to use the main sdk-core features, I would highly recommend heading over to our [interactive tutorials](https://docs.superfluid.finance/superfluid/protocol-tutorials/interactive-tutorials).
61
+ # Getting Started
36
62
  ## Framework Initialization
37
63
 
38
64
  Here is a quick look at initializing the SDK in different environments:
@@ -73,11 +99,39 @@ const web3jsSf = await Framework.create({
73
99
  provider: web3jsProvider
74
100
  });
75
101
 
102
+ // injected web3.js initialization (Hardhat)
103
+ // most likely to be used on backend for testing
104
+ // NOTE: if you're using truffle, you should be able to
105
+ // omit the (global as any) as this should be
106
+ // exposed already (in JS at least)
107
+ const injectedWeb3jsSf = await Framework.create({
108
+ networkName: "custom",
109
+ provider: (global as any).web3,
110
+ dataMode: "WEB3_ONLY",
111
+ resolverAddress: <RESOLVER_ADDRESS>,
112
+ protocolReleaseVersion: "test",
113
+ });
114
+
115
+ // injected hardhat ethers initialization
116
+ // most likely to be used on backend for testing
117
+ import hardhat from "hardhat";
118
+ const injectedHardhatEthersSf = await Framework.create({
119
+ networkName: "custom",
120
+ provider: hardhat.ethers,
121
+ dataMode: "WEB3_ONLY",
122
+ resolverAddress: <RESOLVER_ADDRESS>,
123
+ protocolReleaseVersion: "test",
124
+ })
125
+
76
126
  // ethers.js + hardhat provider initialization (in testing environment w/ hardhat-ethers)
127
+ import { ethers } from "hardhat";
77
128
  const [deployer] = await ethers.getSigners();
78
129
  const ethersProvider = deployer.provider;
79
130
  const ethersjsSf = await Framework.create({
80
- networkName: "matic",
131
+ networkName: "custom",
132
+ dataMode: "WEB3_ONLY",
133
+ resolverAddress: <RESOLVER_ADDRESS>,
134
+ protocolReleaseVersion: "test",
81
135
  provider: ethersProvider
82
136
  });
83
137
 
@@ -89,6 +143,11 @@ const mmSf = await Framework.create({
89
143
  });
90
144
 
91
145
  // web3modal
146
+ import Web3Modal from "web3modal";
147
+ const web3Modal = new Web3Modal({
148
+ cacheProvider: false,
149
+ providerOptions: {}
150
+ });
92
151
  const web3ModalRawProvider = await web3Modal.connect();
93
152
  const web3ModalProvider = new ethers.providers.Web3Provider(web3ModalRawProvider);
94
153
  const web3ModalSf = await Framework.create({
@@ -115,7 +174,7 @@ await onboard.walletSelect();
115
174
 
116
175
  > Note: You specify your project type in `package.json` - `"type": "module"` or `"type": "commonjs"`.
117
176
 
118
- This is the absolute minimum you need to provide the constructor (`chainId` or `networkName` and a `provider` object) if all you want to do are read operations. It is also important to note that the provider does not need to be an InfuraProvider - it just needs to satisfy the `ethers.Provider` interface.
177
+ The absolute minimum you need to provide the constructor is `chainId` or `networkName` and a `provider` object if all you want to do are read operations. It is also important to note that the provider does not need to be an InfuraProvider - it just needs to satisfy the `SupportedProvider` interface: `ethers.providers.Provider | (typeof ethers & HardhatEthersHelpers) | Web3`.
119
178
 
120
179
  ## Helper Classes
121
180
 
@@ -145,8 +204,6 @@ const sf = await Framework.create({
145
204
  type Paging = { take: number, skip?: number, lastId?: string };
146
205
 
147
206
  const pageResult = await sf.query.
148
- listAllResults(paging: Paging);
149
-
150
207
  // The different queries can take different order by properties
151
208
  // given the properties that exist on the entity itself.
152
209
  listAllSuperTokens({ isListed?: boolean },
@@ -331,10 +388,10 @@ const sf = await Framework.create({
331
388
  const signer = sf.createSigner({ privateKey: "<TEST_ACCOUNT_PRIVATE_KEY>", provider });
332
389
 
333
390
  // load the usdcx SuperToken via the Framework
334
- const usdcx = sf.loadToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
391
+ const usdcx = sf.loadSuperToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
335
392
 
336
393
  // create an approve operation
337
- const approveOperation = usdcx.approve("0xab...", ethers.utils.parseUnits("100"));
394
+ const approveOperation = usdcx.approve({ receiver: "0xab...", amount: ethers.utils.parseUnits("100").toString() });
338
395
 
339
396
  // execute the approve operation, passing in a signer
340
397
  const txn = await approveOperation.exec(signer);
@@ -343,7 +400,7 @@ const txn = await approveOperation.exec(signer);
343
400
  const receipt = await txn.wait();
344
401
 
345
402
  // or you can create and execute the transaction in a single line
346
- const approveTxn = await usdcx.approve("0xab...", ethers.utils.parseUnits("100")).exec(signer);
403
+ const approveTxn = await usdcx.approve({ receiver: "0xab...", amount: ethers.utils.parseUnits("100").toString() }).exec(signer);
347
404
  const approveTxnReceipt = await approveTxn.wait();
348
405
  ```
349
406
 
@@ -358,7 +415,6 @@ import { ConstantFlowAgreementV1 } from "@superfluid-finance/sdk-core";
358
415
 
359
416
  const config = {
360
417
  hostAddress: "0x3E14dC1b13c488a8d5D310918780c983bD5982E7",
361
- superTokenFactoryAddress: "0x2C90719f25B10Fc5646c82DA3240C76Fa5BcCF34",
362
418
  cfaV1Address: "0x6EeE6060f715257b970700bc2656De21dEdF074C",
363
419
  idaV1Address: "0xB0aABBA4B2783A72C52956CDEF62d438ecA2d7a1"
364
420
  };
@@ -393,7 +449,7 @@ await sf.cfaV1.getNetFlow({
393
449
  sf.cfaV1.createFlow({
394
450
  sender: string,
395
451
  receiver: string,
396
- token: string,
452
+ superToken: string,
397
453
  flowRate: string,
398
454
  userData?: string
399
455
  });
@@ -401,7 +457,7 @@ sf.cfaV1.createFlow({
401
457
  sf.cfaV1.updateFlow({
402
458
  sender: string,
403
459
  receiver: string,
404
- token: string,
460
+ superToken: string,
405
461
  flowRate: string,
406
462
  userData?: string
407
463
  });
@@ -409,7 +465,7 @@ sf.cfaV1.updateFlow({
409
465
  sf.cfaV1.deleteFlow({
410
466
  sender: string,
411
467
  receiver: string,
412
- token: string,
468
+ superToken: string,
413
469
  userData?: string
414
470
  });
415
471
  ```
@@ -444,7 +500,7 @@ const signer = sf.createSigner({ privateKey: "<TEST_ACCOUNT_PRIVATE_KEY>", provi
444
500
  const createFlowOperation = sf.cfaV1.createFlow({
445
501
  sender: "0x...",
446
502
  receiver: "0x...",
447
- token: "0x...",
503
+ superToken: "0x...",
448
504
  flowRate: "1000000000"
449
505
  });
450
506
  const txnResponse = await createFlowOperation.exec(signer);
@@ -463,8 +519,7 @@ import { InstantDistributionAgreementV1 } from "@superfluid-finance/sdk-core";
463
519
 
464
520
  const config = {
465
521
  hostAddress: "0x3E14dC1b13c488a8d5D310918780c983bD5982E7",
466
- superTokenFactoryAddress: "0x2C90719f25B10Fc5646c82DA3240C76Fa5BcCF34",
467
- idaV1Address: "0x6EeE6060f715257b970700bc2656De21dEdF074C",
522
+ cfaV1Address: "0x6EeE6060f715257b970700bc2656De21dEdF074C",
468
523
  idaV1Address: "0xB0aABBA4B2783A72C52956CDEF62d438ecA2d7a1"
469
524
  };
470
525
 
@@ -599,7 +654,7 @@ const sf = await Framework.create({
599
654
  provider
600
655
  });
601
656
 
602
- const usdcx = sf.loadToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
657
+ const usdcx = sf.loadSuperToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
603
658
  ```
604
659
 
605
660
  #### Direct Initialization
@@ -615,7 +670,6 @@ const provider = new ethers.providers.InfuraProvider(
615
670
 
616
671
  const config = {
617
672
  hostAddress: "0x3E14dC1b13c488a8d5D310918780c983bD5982E7",
618
- superTokenFactoryAddress: "0x2C90719f25B10Fc5646c82DA3240C76Fa5BcCF34",
619
673
  cfaV1Address: "0x6EeE6060f715257b970700bc2656De21dEdF074C",
620
674
  idaV1Address: "0xB0aABBA4B2783A72C52956CDEF62d438ecA2d7a1"
621
675
  };
@@ -623,7 +677,7 @@ const config = {
623
677
  const usdcx = await SuperToken.create({
624
678
  address: "0xCAa7349CEA390F89641fe306D93591f87595dc1F",
625
679
  config,
626
- networkName: "matic",
680
+ networkName: "matic", // you can also pass in chainId instead (e.g. chainId: 137)
627
681
  provider
628
682
  });
629
683
  ```
@@ -631,7 +685,7 @@ const usdcx = await SuperToken.create({
631
685
  #### SuperToken Functions
632
686
 
633
687
  ```ts
634
- const usdcx = sf.loadToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
688
+ const usdcx = sf.loadSuperToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
635
689
 
636
690
  // ERC20 `Token`
637
691
  // Read functions
@@ -716,7 +770,7 @@ const sf = await Framework.create({
716
770
  provider
717
771
  });
718
772
 
719
- const usdcx = sf.loadToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
773
+ const usdcx = sf.loadSuperToken("0xCAa7349CEA390F89641fe306D93591f87595dc1F");
720
774
 
721
775
  // Read example
722
776
  const name = await usdcx.name();
@@ -781,15 +835,8 @@ const batchCall = sf.batchCall([<OPERATION_A>, <OPERATION_B>, ...]);
781
835
  ```ts
782
836
  import { SuperToken } from "@superfluid-finance/sdk-core";
783
837
 
784
- const config = {
785
- hostAddress: "0x3E14dC1b13c488a8d5D310918780c983bD5982E7",
786
- superTokenFactoryAddress: "0x2C90719f25B10Fc5646c82DA3240C76Fa5BcCF34",
787
- cfaV1Address: "0x6EeE6060f715257b970700bc2656De21dEdF074C",
788
- idaV1Address: "0xB0aABBA4B2783A72C52956CDEF62d438ecA2d7a1"
789
- };
790
-
791
838
  const batchCall = new BatchCall({
792
- config,
839
+ hostAddress: "0x3E14dC1b13c488a8d5D310918780c983bD5982E7",
793
840
  operations: [<OPERATION_A>, <OPERATION_B>, ...],
794
841
  });
795
842
  ```