{"_id":"@superfluid-finance/js-sdk","_rev":"418-876d96d361d55db6726578b00452eca1","name":"@superfluid-finance/js-sdk","dist-tags":{"latest":"0.6.3","dev":"0.6.4-dev.e675dbc.0"},"versions":{"0.2.0-rc1":{"name":"@superfluid-finance/js-sdk","version":"0.2.0-rc1","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"0.2.0-rc1","@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.0-rc1","_nodeVersion":"12.20.1","_npmVersion":"6.14.7","dist":{"integrity":"sha512-yaOGI5K94WSlK0rf/yHBBD8b1cTkZ+VBn7yw+0hkreCNj6+BYFg3z1XmwuUSwfb6y/KfRkc77xpDTzIJbmX6CQ==","shasum":"30a75c5c90432efc1baa3c4ff373e947128aa305","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.0-rc1.tgz","fileCount":15,"unpackedSize":98318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgADp+CRA9TVsSAnZWagAAY/oQAJ1wNbOlIfE86rgZM/Ww\nxaytrafZKZ1a7P7ejUZ7HSswLKwH5/dVupVJwAAcEDSy/Xih3R063ZMgcPZv\nab8joXIjKCrFy3GUqxd1rQe6itlnNeWpQJB3gvYIhQ+HxR9I+k6hp83FzcgE\nXjfrExZXOf5odrx66iRo3Iq8HI2h+G9Ijys2DyLjJ+bDZmD50aE07dHnmqoB\nE0saXK866bbcVtjUerDGWNZlgwqshGbXI0VEGm1yTyAwp+s6+oyYSxSzNi5q\nNPnHg/r9tQkx8D2ezLJ+0md9SDyWyneSvr/3ckwyddXO2nEkno+jywrNhRhl\n+gZWk08pHLHlDB0NCCnCdROjVOgJd3/s6sueKsA9zn/JL+syO3M8r/hq+j6/\nobxfmdnOpVGhLc3SVj+2dflI8qcZWE+xnctzWZJzB8F4tHxIuAv0Iyg3QLtt\n28JIJlzKQrVUCKn24ED3B65PcKJZOWsTZQYD41NXxRWMH2xps4hQRKyLN5dL\nEBAswem70NCbDtck18/K/Xezzqjjx/RLj3d76p1/oHCEd+xNLC3SMMewpWxO\na4qMKInflUEGrwWKBKE8ss0AH7o+rOMpZ4gSVYruIZbPs2A9xBTj6/Pr6JSN\nLn069kwAGoVBqOv/fa5Mz6sjSLdzxiiq8pT8rd9sYxHbeXLmLqbh6WdB4m4E\nrTt8\r\n=8iuN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDI9xR/rrogQEDR5w/ar9wBmozBuaaZG9MhjZN+u5KqywIgN4JvN21UqK94oTWy4nskgWp2T1u8G09YiLBfdlClqYw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.0-rc1_1610627710080_0.5989984675373805"},"_hasShrinkwrap":false},"0.2.0-rc4":{"name":"@superfluid-finance/js-sdk","version":"0.2.0-rc4","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"0.2.0-rc4","@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.0-rc4","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Kfmoy9jFDisGVc9kAHLBMqkIdy+Cqx0r0hPKpbqD//DkrjJcG9CC6LAmV+/1m6GhvXSpH/lqv1tokWQIpB+X9g==","shasum":"9b526c3e78ef25a63c946b927f37176f740dfc54","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.0-rc4.tgz","fileCount":14,"unpackedSize":44825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAIwiCRA9TVsSAnZWagAADjQQAIzVNTwSXiM1jKcVq+ky\nAlJ5/wUQ3qW4YmbhImp2NWgs59Y5iUMlFl5V27psg5cGiMzzliet7w+zIGBR\naWJaHEuvqosdoEWKKR+1OZw7JawSfdxbG9Lrdiuwp6YRN/wcLqGZPJ6QXC1J\nm/Hl6MdL0HVcyqWQJUF1Pgo+VBjJEd8SItIHCW1ayZbsCrz72O7z/kbBB7wZ\nJAilcWa/3r8Yp823uuC4MKP/GEZaFJEQRuHeh00gnfG+gH1awzssvfnAMpLO\nk8iq/iLe044GzvEzfGqmNbjWfBMkNJtpBwcZ6pA4IGgitDqnsZoQsM6N+WrY\ncBT6z7bBoQFmoSfbomMmwsDs+2VQdft8lMbuibR3TLnqZ11MyGnMKQUDKEa6\njjn/b9F0mMKD8Sf/GHMG1zm3VLFeR79OQg5z5mRVAyLAB5Qe16oknA89aZPV\nkkO73Cbt9z8Xvgx28yKFgTjh1MR1GnQoRWmGM5o9uR2+E19zJPqWaIE5P786\nge+l5jP/PpDfqebzc+OawuvzzH5WD0CUlx6A957tztm0DDxsVIBAYDNLk0al\nObh8tEjVLEXILXIn5uXAVAcv2yPjft8z9wOkOWZWa0KizNxE1Kg3oyjb1Nl4\nMFCgdu5TRwiXv3bmVWF4CPydC0hWlvJi3rhGfVYb8UYEGxuEtoWJPhY7a0Hi\nNuQ3\r\n=kJqF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtMKLQmuyCSnuD7ZvCr379EOHp2nnwNUGv5/kpd0HMpAiEA9bdliofdUP3atALVtVeAeKo5/rU6Hnxf0d4mTR+gRqo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.0-rc4_1610648610167_0.8624618622221212"},"_hasShrinkwrap":false},"0.2.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"0.2.0","@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0z/xhZ8x9YOZy1K0ncD13WrNuuMKXWagIuhlHS8pQwKq31LZ86y1+MdqQDrWNbbfX2oD4+HidtBCEk4bTiL9Lw==","shasum":"5cadf78875088f80a30e10b9779bd4f4aed475ba","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.0.tgz","fileCount":14,"unpackedSize":44817,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAJSmCRA9TVsSAnZWagAAZu4QAKOayNoyLT3vVvDTtlgN\n2/rKshd/Hiew8npx7oebw7lVoWzPwRAeXvInsbvGSvpq7gltTpt1em44qgS3\ndZSS8yzQriE7ZcyOEH2jcUqkdtr/FdwagsnW9907uk6KjWz+yL+4kPSMXxNM\nIleBIwF/qQEjEki7UYRPvTUjstX7aqx3NGOwRnPAZPWv4/gn2CAy9P1BD3kq\nstTS/dSxbWcBnRkOX2vYn+MD9TNgMHIpeyeOvNGqLWcTwINecPxWmlMlcFKO\nsUJhLedmTP9869K97NQkBLVr7g6g1wFkPul4zjKTzU5OBGAOhwKCfVqCIpWr\ndIxqzLtAfv/UDRK5hw/yTCeJJenFtGMK4K3usMRXyfgEsPxGrTR5ONnauTWg\ncqpSCZLMkYAicAdRuS4qngSkL96UmQsJ3FjLN5FLcUUKTnu0bZ6Jznja5J/0\n/L4276C3jA102hvv9V+rIEvT6F2wogz6JdBoBPS/UXY5+UDtgDvwogh6OPAA\nGbO5KEOXMc8ozGKk6botLM38T9xxSTKJqJgmyhZSFfoUs+C+9diDXOiy9kgT\nWWirtbsafz0P+ofQ5ZiUsvlig2ltIlWEOMo7BeRyhRo+0rTePjO+nU44lmge\na1gujDYlB15o//qBmsXiUR/rCALQ3DPhqDtnJBF6HVi2kw9G6YXxLEvzLZ8U\nFY0I\r\n=uQKJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJL8188oXGspUbRlzRR9RpfCHfQuu7whXaOaKGv+UDXgIgRnsAKf9oy20ezfSpQMraia+9+BZIeV+mxr6WFFYrHVU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.0_1610650789958_0.16764494138676178"},"_hasShrinkwrap":false},"0.2.1":{"name":"@superfluid-finance/js-sdk","version":"0.2.1","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.1","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.1","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-YY7lcnk6LoCtldkm5fdurmOyd0nqODIZ+KjLk3Xt4QbrecaMg8T1oVgkfmdnZsPcmhbF7DoPeMEaBPSpYLfAKg==","shasum":"8e9e3f78b48a1f84f6ae5ac0035a94408214cee9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.1.tgz","fileCount":15,"unpackedSize":98311,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAiizCRA9TVsSAnZWagAAQ9wP/Rz18ss19cSIArxITkyI\ndBE8Lx3AMPlesf6dGX3iaQrTzJg7I3lTG7loGwTPr2wOn7zFIsUcswAwVYNN\nj9AMGL/Ui1d6tY907Ld307+0vqXZK93xjX2DntbIjFrRuvj/afRj5/4gZkGL\nFpm5CobkGuRDFXSQ+IaMoJCPd0TYduAePupgm6wwCs/Jkj+em8VlmWK4mCSK\nOubXCB5SlVwB7INnGRsepVYLvv/QmDvFLnBvC23f4V4QacTlckWTlRtBmdKY\nJXpzI5+hRMBCFh2rc47xCU7pg4QY2+WfsvH+99Ei3ujbThesRaGrone2ySG4\nXqUGw58DB0lXgTc78aBjZ0Pi+PoyrGjZF2E+lKd+uDKFrLIwnojmOucWQbq1\n8HXNBAp7TZI7R9tR5dA5pCM1RQNkVjbZKLQNevOnSUtG2GQtU+vv5pJS1Rcv\n726OU8z0Y3O3QnDg4NYIf4KQvW59Y2/E20VKTQMeI+80uC/9zGm2dsfGRmo0\nPoY703dzGGI7fQE1RngAU5moZJr04WF1RZJdI8wECZHMsDfyPnguUpmtKUTh\nwJzXv8Y26Aq4SlJ2F6MjJrJzIrBOTbSP8QPOG58tJhrNsLZcad+WwtAlbJ69\nOwWu/zeR+owH5xpeMMgb3HGFaOBiEQQYEzqP5TG9KUQFDjZ5lNr6tjE4b9/g\nWf7b\r\n=ZgHF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDqWP/4JHUiL+PgmjFDJ39JMQcUo4dZ4xLiUCfSPqCWAIgBns6KyKgWy1AIDOdyl/aHA8ALX6Z+gnJcBqTOHEWnuQ="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.1_1610754226921_0.5495433963506406"},"_hasShrinkwrap":false},"0.2.2":{"name":"@superfluid-finance/js-sdk","version":"0.2.2","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.2","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.2","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-rrdBDJ95bn84axdMmCUP3mWUy7JuEt5pIVRkR2L6izqcqe4rEIk2Ej4Tojg+ulAEUnn7sJPahfHbsTBk1Ase2A==","shasum":"27c85514ceb7b0d0649c3a8846e1ff0275aff72c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.2.tgz","fileCount":15,"unpackedSize":98255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAjzZCRA9TVsSAnZWagAAAZsP+QEIaeIgS6eX8eIsSaSY\n3ewq5VdXtDhhdySM9hH5Whr0GbUbCNHRpZ67Dewx4y82SwTS74i00xk7WPl+\n07zPx9kHIaxzqFyFC2rxf+y0ATBEJMhTlSFXqk3rvPnznatXH75/jNuBDXqd\n3z/ZlxOYiTo8WzNGo6NrwBkIP8qWfwZ4XoN5Yp9Tb9hDOC3tTmLFYoO/wLeT\nrVuHUb83oJp2cEipvj+nZWDZMMmjmLaGpnUQ9fGuaLW7yc5ssMr5afvdajXy\n8TKWTaYtm9YF4ti4EeiF3vS4h8KAeQKhzVl8WmMaXmj9NFW36k1wVJ7jkC0T\nDNGML7SO2Kb2vLnzHIJvZO8TMOXE+a1EruKqhXbvj4dAjaFNtRvC7S3NeepN\nlGPWJX9r2TrGcDW2BFlxhMZDBksVmiMxTSICFTDniBugjlAmtJcxJwI7wx8D\nvpmlHFJ4Iu6eWQdpCQzTiUa4zJGy+FIxiaoMeYUh4bQNRauDUEWcn7mIFeT9\n5732j1VfglW560wiaAxAH65cEUfPzorVupulhXxSgZbdsCaz0ZAV2h0RWJGs\nwTB3/NjbZLK3wodYhbp6/BVb/haDmhaw8WEFMPJ4E2X8AKuJQmKHtao97hjN\nloXV/2vuDuV5XC6XW99PVu1gM9rwkEd7jdu72Ue1mkAInPlMFBz4iR8ACwoo\nHF59\r\n=uVRC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9H+LAFHjf6s/2OJdZbT8ll6MlqhmwSP35txVDAS00RAIgVmNVai6lzlKSaoLkWoMIQ+lxIR/Z1kaIEkpfHyEO27Y="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.2_1610759385546_0.6058420597237859"},"_hasShrinkwrap":false},"0.2.3-dev.9fc570a.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.9fc570a.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.9fc570a.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.9fc570a.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TwfRAhX8X7GBehZG9Sl2cUKJBV3RLen6N4xvALMChpI364nYxJFJs1OK62S7C5/gtCyhvzddxeNxIii7Bcl6Xw==","shasum":"99a310b52c5cb2a4be13b4a4bad7b3fc193e356b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.9fc570a.0.tgz","fileCount":15,"unpackedSize":98283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDB7fCRA9TVsSAnZWagAAbpQP/3XR1DeSlRlhwLw8H9I6\nlo1sVGnGsPoFJMogAgbv6eZtHcdA7MEbs0wVdv/49L7+SVvGETYKK4VQmuy3\nVgDrMFBSkHEJwq+CJ5nVSJTacpZZ6r9cclw7dqyNio8GH9HFcjhLAj1V5ZSr\nkljbNVYCX3Q/1IV4y6Tdc+lA1VzgSIvXYjYDhwW1OGUpENa7IWjebw+zR4TP\nIlxakZjJGHGUDCSbwADM9F8k5dL8Vnh4UUkB1/VecAihGNm6VGZzq9+IX63J\n3y6a9YuRZDXgB40eFwTeMmY3vOwqZ28OXqI1IRHgocZNPx5sHxzeKYInXlIJ\nuB88emM5mM3k4KP+XSrIemqCWd2dv+uRM9pAIDdc9J0c4kNEKsbqRLp15jx1\nReS0MmvcGXGsfRea/FsByyOzx2e8rka9nrmkAYelxKJ8epkWhk7wk0rkCUbn\natE1y+4dr984YKWiE1yH8rbA3EdrbaLUZKhbEdLBuqi13d/JCLfMENz9hNi/\nJ1H5CIaZHfSImYSSEzf6ErtwLWQejCG9gpLnEZIWBmCiHeKbRB5RCDA1T2zX\nmyM7B6nWJSftj3FOsozuj3GX2WAGJCmReIhabF08tKmT99/0TENsoLONGkjC\nqzItuH2CZWRiCJRpSMEg7M1cyDMs4hveuBo6PJ3wF5ukbFiVHaKASHaKPKG5\nM9Yp\r\n=3PPI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoIH0p8cSa17dqCNRcVek9StN6w8wpmvlAZK3V+rYNAAiBDiNhzkWDDgWEkvdhuW/dNTidY1WylwP4IngkiTYUd8g=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.9fc570a.0_1611407071376_0.5394323791766145"},"_hasShrinkwrap":false},"0.2.3-dev.7d56727.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.7d56727.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.7d56727.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.7d56727.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-bw1sKo5TpkXSMlgwzZUvJAv5IoYzhm3CX33Gth0tsNagmfHL6/ZAVgJD2ynRIN2iJlxZxJdwrK7bIGQZOoa8ww==","shasum":"15056e24972cbb7fb3b4d0e16e846df5813b9d98","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.7d56727.0.tgz","fileCount":15,"unpackedSize":98283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDClpCRA9TVsSAnZWagAASJQP/Rkpo1rEU1RttYhJxjsx\nEzDfS3R96nP/0ok4HlcS1GERrExX9Qj3h7K9F+lDiPgHePeyT7+D471Hu2yc\nm1qabKEn4klwD8zBQROyFJe0QuxwWpADL5YKv72SGHfi066sjkuK0h1i7oed\nQPy/Ge4PuzQXaNS6q5Vzxz+xYp2CnL3vozQoSAP1oa9mrBUpilAhNBcLZmsp\nAjdei9Nmb79msZAcphb2d39rSTZ1uY4XiwYBoaNmC8ms9Iozts74OUhZ3INk\n0lC5FC8PUSrAGbd4LHf/IVgMAIr6CuSqhcCraBC1uljmdngxWFPX8bj6ILiY\nWXT5FViN3PrWlDXJRr2cqKMKePOnPxe5AMxiNtz+RlAi1oGzSpk/st229sE+\ni5NvFVT8tRyB0DORqMBuZIKj32EKeARxwH4CX1fsi+g2HRKSaVTXJ+avK8hl\norGl8IL16ApZLHN9kSQGHAHdiQMYiCyTFBCtWTm3Lxv3IdymYgkBX6OD/uA6\n6wkbP+46B5rZdlwdZoy24YGGPqRhOX3eEIyHfy1pjnYI3vjGUJcj53bCA/DH\nNlFG5Z243F3XtW0FN8OJIQhQTEzWXitMWiX/zeuW+kRTjvGpvqxIMvgwiO4y\n5oM/ZAXpp4gvN2QDiv3QIEft10k1afKbQMlzU+IQEo+DykQxhNLtIS1dPRn9\n8Voe\r\n=dU1g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVtZuDJV29ERacDUUjil2uCI43P9EOrEoMYPV8QpLssQIgD4JGs5x656aNLT9cHA0a8V0flOEXLokY2yhn9hszPxM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.7d56727.0_1611409768909_0.643229781960102"},"_hasShrinkwrap":false},"0.2.3-dev.bab2b0f.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.bab2b0f.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.bab2b0f.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.bab2b0f.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Dkeq+kBhhIIQHo0TppZB5voFtIjR7dTgvdSAnwa9Cwe5Fh2VEuyWQgyimnSL6R42IuL1JhNZ921Gqx9NkUDofg==","shasum":"af6681640b4b9cede2a535a9dc045c9a11d3a87f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.bab2b0f.0.tgz","fileCount":15,"unpackedSize":98283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDEIrCRA9TVsSAnZWagAAOYcQAI4EuFecDNGUC8QWIucZ\nn1OrXaYr1n0FqyjE+s3iJf761ZvKYI2UE6wzF/uiaToUS7VcfVBiqKPvEX8F\n+5h7TivgmmPvJ+aw4wYjQsoJnIzTNT93yT9ZZZeoh4/y8yBEZABAhOPLKdYA\nVPls6etR9Jz/VzE3XiIv+ri/5BhZVbGLxoFdPpsIRm9yxjAYAe/+LVRMukP8\nC2HYE5XskhDs9eRLoNmkEkB0wXvK8J1e1ggUlKfd7OxDTQQ0uiu+vaU47NyH\nJJwrcaQMneSoa0vPwixEfLCLMwdqnOdDcdvulfy1di+E1NBP1eZHrGHCg98d\nWXDdYTKyR8ZCbjTdco4DolnwkAa+MaSQr3CF84BbIJcDXzK6gzFp66EVLGHP\ngWX4veI49ejCeIhPnJ8jwoLssRsH3kD5kLguWXoMN95ZMapK/Rzwhz9X2Jno\njtdNtmtUKR5mg1RJ6qdEJhJRBDZ9KxkUVFEYOzgfSlnQYRKGWYzh8UqeNbJA\n67GEzbcQ+JnFABnYwUylqcG/qenHfG3+yIS4jBEl54+9w/4MUtnR9D3ZDBdq\nmoDRDxx28WTKBWWqv7hBK36VfAtANGcqLbo1V68/cBjzJ7vKBmyKScPBcAMq\nn7YGuK3/bFwLufo7CHSXAG8msteA35ExbUyp28x07AK5gTUcToQMexju6Vm9\nFIfF\r\n=irD4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEh22l5tFs+/mfhVLz1lzXThmTPNmEMGuunUdFOyrp4kAiEAhWisvcKpsWHkwXQHQEAgti9a1qbZMMLrSBAAj71vdiI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.bab2b0f.0_1611416107184_0.3001019013992259"},"_hasShrinkwrap":false},"0.2.3-dev.f6a8944.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.f6a8944.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.f6a8944.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.f6a8944.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NvuQvvKRLAMjokowk7SQEAN4zey1dbotWJryBCgPaAwnd/JrczsfEmFb2kIsYB2X0JPWTZMwLnhFgr8oG2t/1Q==","shasum":"963ded32ff32d25e2ae5546ea1700ba5ed1da800","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.f6a8944.0.tgz","fileCount":15,"unpackedSize":98387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDEpUCRA9TVsSAnZWagAA9iQP/2JkerafyTIy3Q6yX9GX\nxTyQI6U6Gjd8wSyCsgIdiTayeqbsCNq4LclH1EGFnMLzvSTWWCvKyzaP+Xdl\ncuGkXRoPsOYjOjIbUdxxWJaocid7OuFeU4tl2jc7ZcPTHFgtspmGBcbscTCc\nlDdDrqKSfbWtvQvwuwpi7AAMpRnjQzy+1pGQSM/cIIZLj4qpzbKrg6E6yeKX\n6BfxHGY190uD78K2Y/ZUaOMNaheGMvIORDsDf9g0s6DBGJD3yhe4FAPmJbIe\nFR0AoDVzjVdEps7l3frQWY7yURc0Q+v9EKx2+I72DZilQtXsfEeFvZjJOXlQ\nJ+Fqb42JQgekhrNJxotLS3k34i9rM0kiCjT421PfL5CyKOe5lvB/1bEG0wAK\nUNb7s4dWlWza2Qw2mtaMzXvYyMQKJlDKpVn3+UFMKSlCr+nGjpYrqVHvleIR\nQEgd87FfNPFF2pPB2uOdXV+5p4m+DoUiTb1KJSpVv1n9tCEZ8v85MARWEj/O\nNbh5mBKNnVvY7Mmvwd5bBoE6A+PbvK0Cv+tFL6PRUs2SmnUVUjizOrX9NSVx\nNhSYPWkI3zZQWuBCsmveaqof2TZDFjUTvf/HmKxkayZF3DH9KQP4ghU43+fv\n2qNP78J85x/5W6COdNjelGipFgSVuqyvXqVj5rcUKGHFMGGRg/ivRD3EvYRp\nAAOU\r\n=9nrW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDZQcu8Z/oQGxof20tIaAfxrFqmCIFYGnBaVyzQ6v+lWAiBaBhAFflxe+gEPJPNz4h1X4TTc9HuA5Qc8LTUm48/g4w=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.f6a8944.0_1611418196261_0.6571109516846476"},"_hasShrinkwrap":false},"0.2.3-dev.bc57a16.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.bc57a16.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.bc57a16.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.bc57a16.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MFWDeeO/6fCvuvAEUOGfxXu4Vr/tZy3F/LYw4fFr4GOmkPZGrFbk7zNEV4KyvmByC2XeCf3JDZGoqyaOecm/mw==","shasum":"b2949b3b773c0b724547ae7f0856465fa7f27a93","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.bc57a16.0.tgz","fileCount":15,"unpackedSize":98387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEB2oCRA9TVsSAnZWagAAI4gP/3cPZueMZCkdBze+XO43\n7yqKduTGmZkxcSDeCuuuG0MokahVG4pWThgva3WtwHbZUw4yxAzDzbPNYziT\njBLM6vQAXEH3T7jd0Rhf2s8SoVGI3muA2NnAqZ1Q60BNeO5EvV4+17jELO8a\nrgm05JG0c3fFkE3LSD3XamHV+I6ydXj1iODZjCWWZg/V8Am0rj9+giWn/EmI\nRVq5Zenx9IbBwxmuxHARxEO+NewfzeFQGZNWyMH7lhDwUMD7kmD+0JepQtoN\nouIxbg+j8/aF4hN1jQ4cDd8kkc0jQ3iPi/AqapPIE8hJgpFqla0UtToQbAH5\nTWmJ4CQvElCgCQbmuhvUhgqNdnaEK31cYGi7I4QAUnGHa0FoAkrzvXC3y9zA\nQjtus72PsY8EgdEzvEdg70rtLL6mnNK1joWu/Id6aFmllE3ppb7jZfu7s/Y3\ntZ+NNY9OK+AQMinotbeNA/kdUaKi0oWd1KfjutiL6X6ycrr3g1ugImF0e+6K\nhBDOAUxIicq6GkmaX+M4iTKy7GY3Rdz8p/0fC8gOtfs+O6M0477DEYDmEIGq\nOTLFiUX1Dp8oHwwkiFyBB/3i47bUrB9V8ZfMc8wuYyzmAa6jvAJYBTJ7W7jC\nCV0Ee8F5mikrcVyozHH8OI2AvIGK4rEl38/3601qjWYtDxyLHAG77LbZLgSA\nn6Zo\r\n=dYu0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuHFHHJRfzxi1aNjK1LrWSjAyYZ03fKd8Qg4y0CHpZmgIhAJHFivDlKcHX9LzsR7vfFxYAJx4qBeb/geEH4SZT2SQY"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.bc57a16.0_1611668904146_0.6581002412250747"},"_hasShrinkwrap":false},"0.2.3-dev.a568aba.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.a568aba.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.a568aba.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.a568aba.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eAHkU5NiOuZ1vgmR3ri8S2e+puF1cBuKPcq4hnGRXE6Rk4h0e2drArPPAddX4Gm92+z/J+ASyyI1aHsm0x+v8g==","shasum":"e3054f4184619986c0980b70d3b691ffc2a6ca78","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.a568aba.0.tgz","fileCount":15,"unpackedSize":98387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEE06CRA9TVsSAnZWagAAqMgP/3Pz8eq1EsBtiITfztNG\npQ81GaFw0qjXq5vpsNjKzdb0zGUwNTdwL4gxyClIOPt+08iRkoPN2u8SYzm3\np9edY6QGIbmx7J50hpCc9dzXeTIunw/RsfoNxtBRmfKLYn9SNJXh7mI9DAI7\nI4wjjgGnT0xGexaaExutBXla6iKRixeCW24yucDiSY5BO8jsjjJhY+YA6EeU\niBGONGiKrr/UEMpVqIBEcgV9SnSNqI89r7jZaVPV+/7pErdRmjPXo1NfYnUY\ntcujWWgspRDppnhSQ9D5f6cFFHG4wv/TdG9bQJYZYRZGv5DHi2NRxWu2HCdt\nKTINzdd03hx7NZwHTxExbtOHJQoh/pBcfrq5CuQaYHEuCbDh8OFBiglLnNOT\n+D+CN59uqpEk8VPrbZBKkfdUejDLI22tFclKmZf7J9XH+XCn3AhEOoKQW0Mp\nlPPvB3zkseQpZxlrAD1QJhH54BrzpTXDq7Iu7Xgc2dXNS3/Cz/2KzNFaspn4\nFMaE85TQF+3l+uNWba3GCUGQTKdRkwt3q5x/VDzHqWr8BpPrCfsF3OEcyxcU\n3xEOB2mtWIg7ynV7f18kTx0u79aPpVozrHjkP3WzaW3wAwWrYnJiP6z4oXtf\nTeL1oQKgUFsE7Zg0en652ARvcz/8Dzjj8+7iIfsdOrWVkyDiHpgT0s0Ilxae\n0Bcq\r\n=uGPM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFkFr4TX9NKHl6x5HFQIZXcIsKdC9QWT88Gl6FlTrUwAIhAPPDju7JkCgLrkEclLRQ+0w3Hl1yL0GuGFLTa44Kz6iS"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.a568aba.0_1611681082068_0.15386228539071767"},"_hasShrinkwrap":false},"0.2.3-dev.811c803.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.811c803.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.811c803.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.811c803.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3sH3f10vjwXhXPOAOA0yRDbmG3IZvz/l16pmfm9pzHzs6LsdChp9wAeXqyCMSvw2YnQ0E8BG5hEP7WTDEdIVZQ==","shasum":"b99a243b3406420a7f3c026a625ff6fbc717d1f2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.811c803.0.tgz","fileCount":15,"unpackedSize":98387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEHZYCRA9TVsSAnZWagAAkNoP/1HiSF+zixh6x1x141GI\nKPJnptJAbXJoP0KgaQtByidd9xjD6/X59rTjacm2Xp6jLsR8T7aVYLSZR7n2\nVeI9mtZMBzkyYusZHPzOM+YqxmHU+werFNXnp6GE0g7tTx1PWtHi+VWda61o\nJh+RSOY9FG8fJGfCeOI3Vl/KiqXCWIDjR4Ett0NoWisamI9WlZK1tkp0RrUY\nenCezf7oyZhENPDy7aI0kLKt7SajpD5nhG6r+Zvj2ZKfWwQKXmVBUeAwk146\neJSbdh7CQAk+M7f/DFingLXE1Y5VFR+SWhPQpDW+W+HKimN9ysKxZN49z63y\nXSKnMKCyrccepAhJ8UDLSqWZPkr0zqGG7gLTRtCAh6AT74JJmb8vr3Po3bUb\nXMBn9fRDKG0iYrlixNkZnbcDHciqbGq1ji8uc6rR7wEw4m4BkHCYIrgFFJ4F\nr6tLmfXIjCSLuvgFxYVoNqAwk5F2r0CF6x5suUQ4B+m2LzQxfBuHHUkTolVN\nUgM4xzBAGqqe8lcSLDMXf6s3+qdUcIj0nkBeyYufXsiIEqJ5ONuRm7BC8W11\nontiHlau7Kmf0sJ6Vs4jR2GbPP7QWrtdcS/vx/V1DaBM+kH3YzixavVlzquN\nl7oo9O57iMOuhG/6hZkV3As9lWPMNDiRzs4d8nrHEaLdFeN1/pZ4v/tn13CR\nPnZd\r\n=Q0Hy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChmBSkoHoYdFE5TRU1ly1tR8Uw/HpRa4Fu0nhvUVZLYAIhAOu25i2VUNFiOzEXreBDdLFRJnBcUnGVQUdVNyc2fVGi"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.811c803.0_1611691607662_0.009349204472308692"},"_hasShrinkwrap":false},"0.2.3-dev.ec8220f.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.ec8220f.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.ec8220f.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.ec8220f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-GaaTSNqn7dRFwktmZwBniTqo8iE8+iIbHNZKT9jjd6yTa5eN+w8xJrApBp/72FlhPEZlLBGHmZ197tw+QNf7hg==","shasum":"553282ddf53ee608fbc1dd11d531f893f0b1624d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.ec8220f.0.tgz","fileCount":16,"unpackedSize":100169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEeieCRA9TVsSAnZWagAAQiUP/02klC8FjWPmQjfPvEc3\nH8n7HoFfzj0hK8xx6pqBdnAbW5v9Q0CRcND0rXNLUQToDrzNJHH4u7my45FB\ntKqeuXrRO5B7uASAtLrGY3PvKaXKu7sfPfeggFoPAJxAWL7TyKgX7E0+IMTs\nyLeHbATwx1TsvTzUQ7pjed98CdziV3Sgyzu/dvSXbP9rZKFNBxmYyRRUzrKl\n+jvZOLNZVC4reV2tnEDk/G+7GikNxKILfCHcDteuATeCfUZlVGwhjy7GhANB\nzR/h3UaJjDeaucaOo0lPAv3sHO6bfEDvzR2EoMFBP/nel+OtoZVrtufYL7K0\nkWs8lXIEXMRTfP0ol77+ZBzcLHzzKu6QY4go/QgL9MC/tMP6L4uBISHEksB/\nBl6eb2EFdeBj/AkI43TQ6h3X7actYvnSBWzdWeNXx0aooNokJH6JM0nT8B9q\narhRcSCZCTv2IA6eUyWrh08w+sJqsltslFCK8wy6uZhEH29acKG6g4NKsrPe\nsICfmdxJCDLqqc7kB+a4rbhdhwDxgs0C17b0Hldg+ZDF0+w5gfik5Fx4PHGB\nbIy8TG1Lw5QCSJgeqACKcxO9hr2TzK9y3ETUdaBwO68IlSrSGyadM8xFjReL\nvFKHvNvkUTEqosEfTuRpJXuEu0uBkM6Il2+enodLM5QjCBCbtJZAqa3oe8tH\n09vG\r\n=iA+5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA2GsiAcx/ql39yZwMoo+jB3jrr6rFo4fUH17J+P8+tKAiEAo8PQJPBBgPtVDgPwUX7/Ge2Olw6F2Q8eu05mxERffX0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.ec8220f.0_1611786398466_0.8091350615918975"},"_hasShrinkwrap":false},"0.2.3-dev.7c6ea57.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.7c6ea57.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.7c6ea57.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.7c6ea57.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-oiBkWgNiDffEr05qULLzexEy00vwnwkJBtEhmCyFDUoFo5g0ikW15lFbrP0bdS+fSFxY26K6rdoqyM4JBrvtQw==","shasum":"1b6a7d9faaea9078ad5148bf1f1f19a4b04e0e0e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.7c6ea57.0.tgz","fileCount":16,"unpackedSize":100169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEfTUCRA9TVsSAnZWagAAdHAP/AtVIic9ufhMkHAfrwUe\nIvPOnqwDeERb4L2ip40jPgbFYAKIeJhXaiEsk40zPnIMdMIlYnMwxgrpQNq/\nRd08bFkhH/FFsdYBbbawzwO+kIKF6zfzjw7cyc9eOvnr57ZyjoIzA/vSvtiw\nWPKnqSySe2uq6rrafJhrSbcgugrJKcIjDu0peI+PU91Ykz4TG7tqhsKRN/ZK\nawJdtGh9NUayHKzwlLyKFkiKDDsqsuBqew3B7bSPU7y/Bo0GYEhA8MpsgCz9\nq7/QNa539T+CspR+Qxd9lSxwjZx6laGdYfH+OYjtT9ksZsZgZ3LpkNyuOlki\npVPI/H/TSTY4sCZxwxvDrvuCuMjXf/VuvZeYu9Z5BtBojJyFfKs+SkDxC8FF\nApsYzO9dq8eB/7zlOzhRDIHk10bXSA7hA8nGuoNKnUJuP/VF33IOa0snRBxM\nu7gbXd0MX0sbmE8oIeKztR6palNEs16ITNRiTKcnPCPJYuzg75c9dmZl+MD+\niW8M0qKtBo4tyDKOpEVBs/JCPDlO6Gn9fv9EHGiKuq63jAqCPnD60knriQ0v\n9RbkxhBPhiNavFNyDCJQgcuBkwHKbzX5QTI8cKniRutsJUFQ1aYHwcZ5uCj2\n8p5hL1mDacNlYG/IboRMz1VeLKyQLxB+B9es2O7W8PypcXkyjDtkexXlCTie\noojy\r\n=h7Ht\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzcaNZe1OEmXKUFHhu46Ys3OiTp3JlOpGokUgxzcMZOAiAWzi9nCwGr0L4Lr92TzbM3FbuEbc7FljQOEjzTUV1ppA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.7c6ea57.0_1611789523819_0.5003077209328497"},"_hasShrinkwrap":false},"0.2.3-dev.e7adc36.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.e7adc36.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.e7adc36.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.e7adc36.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Y6JpL4IsVJAsyDfhASsEpnOfgb1Yj84r9o1cD5Tlt7BbV5qr+phnKpi3bkwPLcpbBENX34I49+OHKUroxUk/Zg==","shasum":"ecdb51129bddf9df7326f9e3d015be1da7adf9d5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.e7adc36.0.tgz","fileCount":19,"unpackedSize":110206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEoy0CRA9TVsSAnZWagAAU2sQAIfi/Iv0JG7jRQc84kAM\nB6AWJR0UxgKM8hCvb6CJ7I0mZ88rCb0FF99JXYY64BHG1BovI/NGwjuzZVir\n26TIdW12dIdBK5A4pV2ziV6lkFH4elNNCvMUQfUBAkXNHWJSzvLBN6uVVrga\nqWTlNzsYZSdvWf5MlNhbOH2HpdLQdirzS3jS/ENL0EzouuQdRsAPh8ruJU3b\njwLiD3/mWgpYTBeDCxKqiui0WBDxPW/2GIkGH9QZdRRKrXFZpIkNKtdcJyFZ\ntER4/BRIdO9guFSdK0n+VTjK4zFKzgeV5IoAKaBbTaxHi7Xdg1r5fJO38Qim\nHPlTCKY926MBWXahv3DNaUifqn/OLNaUywurQdaIIxVtk0zoMgd5ByyNVlwB\nmoLIqFAo0MEoUqzemf1Af79DMqC7BKWD5PBvs5Ogt7nXXLYljzw500uDF4HC\nowZ1yA2d/hlrpUdNMbWB3IlztEg7SN+4JCFcjKCF37b/K4aglzwC4Ko0PCFt\n8wNoYg378T0fLGj0ADEpiIr73QXeL7mqnjCmpBxv/HXL1VodyBGi5o6crZQy\nxaWQXVfkT0NpaXY32lM+g2HCRAzleysmWRlww/0hSyFBwgNf9NBWInANXjaA\nVI/Coh19f0rPQTM1qZcrRkkk+dRfXrNMTX0kw4ypD4odyWNMhiW1br3pLQxs\nX/gD\r\n=7945\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi7Ek35A8tV/kLzFxcIwHVoXJw9V/+ec5M4LNBR4lzCwIhAP3YInSctM9A2YzZ9pS1ni+LJHpwVWNTwwj6yJ3PjjKn"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.e7adc36.0_1611828404399_0.5753506629623155"},"_hasShrinkwrap":false},"0.2.3-dev.9fd100d.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.9fd100d.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.9fd100d.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.9fd100d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-E0pHQnZxtzeGspjEfqw6h+ychCQCcglvXCK6RBndex8oTB+vz51R9XIojNEbpZuO46M5tZ1x2NJ/NOtCXh8FFQ==","shasum":"b019993336a51eecb4b35eb71ee41c5ab88c7e41","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.9fd100d.0.tgz","fileCount":19,"unpackedSize":110206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEtTDCRA9TVsSAnZWagAA4KEP/2gASDf8ZzRpMdYRcxbv\nZrgkErdJ0W1zNnTlto9bh/4JcfVcwwNkLJdi49ksKePEe4/E9AMbIte8xjng\nQvME9Gxwrqd2W555N2B1LERVtYpqBmAdzEcLdbRJiUMgGBB5G2THXsVDSnzB\nfCr+EPTWoaXjK4KeiH/yGLRjleupoB+hAUhynxoVYB/VY9RJfCxqMnHHnZ6i\ne8UFwBVnO5QJU+uOWfbZLFj7U3U1pwDM7sny8FkE8MSnr/OrM4rPxnYotFYp\nI7jqirUceKKzFDo99fDlbdUbkwMWaUGZoz02UNXczjB05+oVPoX/tSkD0UH5\n6eYsfLTvwYp2FyNPIgbH8yHiF2RnBl1ZhWUYpnApX6GqBGLBosVe/WKaySIt\nfso3F1+5QvytoKiyOJsQVTIC3Md24kfrLurT0CPuzzamRC5VYFtblOmJQlyy\n88GFnLp8b6FHigwxOLZAnYe8c8jSCwE6LiHgpv+X9KK8U2xCU07nxGxyRzuU\n/YM1C1XLkNjKM0sC93JuIEdDQTEf/3PcUhuOfNIH4f5HFHWIvn3Vhsrn0Hxm\ndwT24m7JS/3nxkvcb54UyL9PA41muSgduhpD6we0NNZoB/r9cDoraEkWT8GE\npX1JAxP2Y8d21Si7m4u+g/CxntRnBOIgcQHaExLu354G0aR5Zmxc1r81VdCt\ntJn0\r\n=QclR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2de6xjmXoeVegX2lsZfGBX+L0EzXfBeg43LVOVLGoUgIhAJUcEV9iovkgzKF7A3VSNty590ynzXaAz/UsK2axkldT"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.9fd100d.0_1611846851361_0.42877068991322864"},"_hasShrinkwrap":false},"0.2.3-dev.c531e97.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.c531e97.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.c531e97.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.c531e97.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-3l7yKwp4jAVRp4nnBoaKlVBsiDVrPMSBQ1ICEAc4LTsdypoZM9WSh6SHefz6SckpyGBqirbum8H1AAXJw2Dg5A==","shasum":"ff896a3c38c73f35a1e567e8ec6fbaf55882d697","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.c531e97.0.tgz","fileCount":19,"unpackedSize":110531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEyjFCRA9TVsSAnZWagAABocP/RJfHtKtOCQ1IComb0AT\n54EZgb4DnbvaUUK+iGam3xMaWWtL7OQgrepVqWlmmK/EimQzaIQi6kA8FbCw\n1AOjlD5o7nRK5+fnxJjqWexUrLgy/SgpCHQ7twL/PIsYhVKvJhDzEGOOt3Id\n0Sq0Xm8wSWcVBqZJjXrp8GST5gxAneGvovYZCe21AfBbQqn9AMflGTJUkPfm\ndiOqy9u/a7pqwXUG12a2hcFsK88ooFCQMX9366Ur6aDfTuUpt262TL5yvLlK\nCLAMKV9rJaSGf7bEQeBg2xOX3o9BO/QAbSSGFckkr3z8BrAKiUmz1x+3PNV1\nTKSFP0wnr9wJ7RmeZbINfAT+W1EcLPITPNP86LTHzF/0JFSQqc8Dmlqex9Rl\n70QS4qMFVQM3DM13aWtHuPAFaefmwjDakrVizCaXPxgVVzytbb7gZ5xFmXa5\nZrBVmoteN011gQ2WnMrkRa0JZ8I1IxWVIsAXrIP3aAVwKpqSoF8LDZZEeJM3\nGS+rFcaVEJQ5rlMzsKSXAr53KAsP34wPZxf68zF5IXIYroGCSmBFYYVUubb8\ndu+ZFHpb18nvPECL/VEJ4GJIoNBTttDXEncB0MbykZfdm7KgNZueGYk7l5vl\nQjUrtBbQ6nukrQm0gpLbAaSyByfoW7Fsfdac6I6XfLOJC+k+oO+S5czVijHx\n/cHu\r\n=HHl3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqfovbp48gobKFFuQkuvg7N7Pg2ExMtVaizzSY4Rx6vAiAsPF69uEvtTj1+BKyVZCWsxnydl3qO2bHSEfa/UA6/UA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.c531e97.0_1611868357401_0.5140815080030523"},"_hasShrinkwrap":false},"0.2.3-dev.50eb675.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.3-dev.50eb675.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3-dev.50eb675.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3-dev.50eb675.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-TUd1aHXVb/EVvIwPD773dfJZUbYSpB/UwJ9VYzTaJVxqmO54HBkFPDXifR7DI5Ctv7bm+fJpsfLa0x9oEVxOLA==","shasum":"9fdee54be13829cab128610775f30e60fec364ec","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3-dev.50eb675.0.tgz","fileCount":19,"unpackedSize":110531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgE1RpCRA9TVsSAnZWagAA3+8P/1gjkp1CFKe1Plrnv7zy\nnB+4swU57kbCY+TIWt0J/Xt0TYXuJcbqbSVV7RLyf04fKQglNzkLB6btbZzX\nA9OUD3WILAVG6I2Wus98oO0LDzx14HuI7AmfwK2mZMoCmjjGmXNf0iydRRqq\nR8SLdfyPt8ru/4jsLRCBYH9869olly2LPaTNPnF7xl2mRnXxW3RQPx1iyDj2\n0ymdSrHlf3PdXMcGevd3gwVe/eOJH/UrO31yDDC3CSkpKY2FIe6SYClJa8lg\nf/Dx4cJA4GGK7X3v/6JBFsDmoHmoDwtX7uRHXUuG/5jC7se9rj3bz9xxqYFO\nE1ZUGxRjj3loR7qZvoHf5SMYES7NmKBsRSb9wleaKV1NzIejZlXOEkVCMq+/\nDGIy9nByKxW6PFRWLcC81EV806HNnPN2Dy5zsTZpqZKFWpIhtLoIBlvGjbvv\nLiE/yBEO047TR435GqL5UXP4E3PA62pM33a2W5RVaEEpS1jzZkvCCh/iCfIz\nGnJwGJVHzhiqdoqNAN/CYi07xbk5QW2jka/NHiumkq7LVYP8LFhBDEImPzr7\nNMehyu1ZXi9/f8qmPMc44IV0Va9dQhYnuTbamkQezdaE5gE9+sexQ39pzEEe\nq+3pJVDN78tjUDQao3h6xA1PKGOup2jrxkcn0//JI0uQxbqjhEVF5xzTiBLU\nh9Nj\r\n=3Q3J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQzu3LLkhS/5Vt3Ory+tGFdslC2zwRVRhO/zQqUCCMOAiBKl/xP/V8ezIokc5gvO2FSXMYDGn62WukqWtnTJvVfkQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3-dev.50eb675.0_1611879529115_0.553983488749507"},"_hasShrinkwrap":false},"0.2.4-dev.939c83f.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.4-dev.939c83f.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.939c83f.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.4-dev.939c83f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-9fPpGm2n5zhzzE/LV/zOw2qwGmZYZZATmKSyLXXbngB45G91OjqZAehwNbWQjRoJhKHB/RnGY52FWY/zznfm3A==","shasum":"ab0a25a2e0a2057e49db31a4938807da9ac27d2a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.4-dev.939c83f.0.tgz","fileCount":19,"unpackedSize":110531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgE8A5CRA9TVsSAnZWagAArBsQAJ7v6cxLLdnlCtUD0I91\nUEFWVMo5jHOkT8oKwjQdkAU1U4PwVR4dg7E+bSsmVpxxeV5LZFXJLH7t+j5+\nRU3qNq7DtRQyyBelAqm7i+rNmQivLkmfdXydZ9xzML132PAQc9KLgswZVO0e\nO7MA0QO5K8Vexig7NdslO9awrS9n82Uo7gqB6Y0hdR3HhKcguBUUQc7bojFr\noy2R3FSfiOs/D5QGCrzqEf1sR2aAQ1v1+V1Eoh0EV5etPpxjl6/kegQQJN2s\n1C8KMV+r/q35bp2gjfRKFy5G4S3K9JPapHa0WZOuG7SoHrQLmXX874df7eGz\nB+77JXipCeUXgX/ZnNIqxLrOpWeAnySC37isxlW0JmGS8/x0GU7/5njwAHgu\nM0qD13pmUn3FEyVkhnL2R1o12mG68J26N/Z11lBErydQAzZWf1OhSC6K/a7i\nM7qm07fUxCeYMBploYzLrqVRm84uGsRkoomKwzRyCDHEK3jYq/MJFBBdzekS\n2TsJwvdhlX+B69pDlflL0urJXcGgUrNOgXDkPZ7fjxlSN442QHQg9CH0tsfb\n5G94becZernfHGYG/KVvfFvJl5P+gp/5bP8ig755MllF0Rbu6wntLMgS3Q98\nYlPgLeevWmYSiZDuVbEhS2yFf7TQFxQcPRUrRqwUFkHzNHrGu97KeT6BnhkB\nhzs3\r\n=rWz3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqxjs4V92mtdRVPpq2SvBc7fGDHoPJE8Oev/I07wH8yQIgNtKVvTSZOPjP19KxcGRXD7rEk3zN0Ba1xd8c0vTyVXo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.4-dev.939c83f.0_1611907128732_0.668284648552883"},"_hasShrinkwrap":false},"0.2.3":{"name":"@superfluid-finance/js-sdk","version":"0.2.3","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"scripts/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.3","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-lRuLFo88rs7pz+BiShxUS8yvN8yRaxe3TbBuJfJK/TiyGOcTK71rZv9Pc/kVdwfpIcdgCpVence/3eaTFtCodQ==","shasum":"8415fce377e7d2ef6753b3c5a058f6e5791de454","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.3.tgz","fileCount":19,"unpackedSize":110503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFFN3CRA9TVsSAnZWagAAX6MP/RHLvHlm7VDoqJw0CYUc\nqEsVQCp7LrRhCgRSwLWsnTdDus+vFrDDOH0Gazx+TZM0uSWFFwcggegF/Pz/\nnQrEz8G0LxWYhYionbnWri1LS7iAXrW0SoojmVEPc+Zx+w0WIXUqo5XLMHX6\njpTRYOGkBpKNDOHiMG4sluTyMLqPbyW5toY+/WXzpb+KKG3ANBdzH9TvbVOi\nUVwbKPgySjjRbUX1UfCi1PsBoboc2HbguMBIbAS7yovff3mJLQx0CHbBX/Y9\nYI584zIV+dss7xaiG5sjjKBkk06jrfp9Heav4bRZ1P8Y8CS+bbTNG2twmZ+I\n8crMCgYu0RG7kv19jWLiPnYpfHgoFHZzH+u+Xh2nglWOnd88/dqDOD6fWMid\nUo1cLWlvDkreU7+OBDDeLbOOx04xDmqSoeO+tye/xnKtvtxNXTPoN8V8GEHy\nT1kZ4uY+4E9AkmVB82LQ50ZBADvFBZp8aWpu/QJULMQivPD7/e6SKBjhnaGJ\nCNknM5NisxkG+NURZjyEQ0dF9crpbsdrP6mTlo/wnivWtgyZmNloV2RPpuQV\nvNvIqtVZAAmdnV2zw1CnfNRaKVdQ7TJCc/vSrBhZA/FN0psm9IX+Mp8X39VO\nj8yS4reZ79odMS3IlzP6TcfdTz+eIftTjQaFpLlJA/E536uk9uIiXTlgVzJ6\ng0ao\r\n=Ylbl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDJobkb/olv7JUvt8KoqSjpfMRLZyFN4YVKGLH9UXzDQIgTeeKV9dX/b65Ux+iqiDL+2HNAajFMVH9MMBywD2hG5o="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.3_1611944822523_0.9059425445040286"},"_hasShrinkwrap":false},"0.2.4":{"name":"@superfluid-finance/js-sdk","version":"0.2.4","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.3","chai-as-promised":"7.1.1","truffle":"5.1.49"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.4","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-VjyLAmg9nXTQE84qWlq9HryH1eqhEVhYT/boISO/fj6NxWIB6AY9dE+kjwMxw1XEDKeH5zIkn9sMz0hKXhCMAA==","shasum":"34ec0ef315b7e1ce22b5329ea18a0f0071991580","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.4.tgz","fileCount":19,"unpackedSize":110768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFZvACRA9TVsSAnZWagAAyjkP+QGv92TNhxQnlxm+qS2b\nbwJQMB3qDnS/qiv34bcWRDddAeBGU0+qAqJL3V+ah//8C384Tmij9JDQPIZK\nPdiuV2m73G8olu4UFRn/pgvgosIGTCN+gc3xjqrAb9ZnTF229xNA/hOU9Ruj\nuEakwfx22XyTX0yqfvThM35n6POEwf6/itjPu9rXkH4VAuG+ooMuxucCspgZ\n3rF3fC6k2S6ThNxduASQ7fEpPSS/uFh6Dly0bKCYbuXC9/a7+JmA/yc8em5v\nH9A7jjFSnA7Drx8Z7rI/zipR9CYPqJYjMYCi145nIZNXgDU7EDESoN/b8sN1\n8pHPqKwJNZW5LdeipDOxHDOfv5ZfngCvdsesjXGSEoK8Uz+/Ze2uIPeZ+aJ5\niHYok7qC98g3OZhnu3JvJvHcQRItBVzWnVhKVqHxee6eGswYf5P/E1pb4gRg\n5/njZSxA+DXLK36ESW26X4AU240sX0JHj/igJr6y/5vMiPfnw5TTqEPt0cHK\nS89TJjdjYVdyRLGDZfSJ6YSmtYa+s9cJbxAAYQ4E2Je7SdHIsYdyscjBJZx7\nQHfNHBzAPhbZDcdEypIKwkKmqeJf6HdioDVKtKOMR1JpARs7ImjO4bccNypp\nI2vw9d3Fo4QmO3NMg7NseEtdTIfikB72MJf+XqhA/cbex4/S2JV+y7Ht6LXX\nMIUP\r\n=I18Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHSBy4yCot/kO8fz2Pyr3EPYi8j4Orz2Yw8vTMD1ePnAiEAqYeOnHfi6fpxMAkpOvVcX/3zTUuZe2fZK2Hx53paKb4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.4_1612028864363_0.9457494126989252"},"_hasShrinkwrap":false},"0.2.5-dev.eb323a4.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.eb323a4.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.eb323a4.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/ethereum-contracts\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.eb323a4.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-DxDuQNPPeTjtzp0rsU2DqCGRVKydTf58kxzg0/UMZKk9/9nfqpNfKi1M045GdEhmjkDL93pSP3VFJKRwT8L7XA==","shasum":"454455d21cfcf2eb52767bbd3f2a2edf8d468a1f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.eb323a4.0.tgz","fileCount":19,"unpackedSize":110796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFZvJCRA9TVsSAnZWagAAu6IP/1NzHw6L4dk83ixN3Mn1\nIINemoJe/qHtAi30y8cTgldrfYZRyO2UAe+C1266fPuQW+IaC7PZUPopYY2r\nnhY/cA7MqPlJ5SSgMX8EN9aTBldDn8ya1QmvKtw1F9LgVgeCIrOqqUDKEfRn\neT/bkx8fy43gVNkYu6J+Jlnc7qSFUXsGSFVbtJeHbK6YtBOOtNxWXdIPwd0m\nOCeP9+3dSNoJLNP1fc9Z5tFWncP8nojblfxxoPGWHg7g8IXV74H2J6hjMQ3K\nad1iu74ID8dQ96CsqJxKn+VMl0zGhxQdmOA5GKUBVPXXUP2NTNzs4H3eWCZI\nzJwnWgRNFuA9AU7L3kZYLabqzmQ70bTNLailMP/A2YOzeJlebl/zjIZX6Jg/\nAclS1/bTMNOUbD9qeQrO2pMZgI4GDMytoqVLme8qAESniRAzuhvd2bY05R/0\nGG0X4sEYdSlGvVA3rNpCWh0kHcoJWJkBGo1aQOMjylpITPJWhC+zhAnxhgIx\nyUaJpZmRCFxK2iT5PxWzmxsK6OjKQWiaGZsGCuqQe1TSdPflL9R6TS9tJtxG\n4lYvUtlYmvSWMTRAMbFTp7Oobp+xLmHYROmKm4uiiQ0sTdp7j//nOV3w0OFA\nM0fjzITW00iN4E0lDpAn6vGX+hTfRQr3DX6fyi06JKc3g3CTtbgNoC+pb5OV\niK+c\r\n=S2dn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9asDyp3CYt2dXkdXBvFW1eudvdThPWeN0eL9jpeC+bAiEAkPg9toCTzGx1LTgakI8TKvRTko0cUsVF4PGZ/JoFdcA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.eb323a4.0_1612028872981_0.8929154466197775"},"_hasShrinkwrap":false},"0.2.5-dev.3e0cc67.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.3e0cc67.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.3e0cc67.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a while, we recommend specifying a test-suite. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.3e0cc67.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-liov0cII3cOORUjlhJW357GZaTGTuLRarQ8Kdpr7dFmoXsfWGA+3H2HAQA9/QQRoVjNqk4hjbWJA6cyyXlbbDA==","shasum":"e4ff6aa91f05f99704c316b5f44544d3c4328e5b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.3e0cc67.0.tgz","fileCount":18,"unpackedSize":105420,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFbOSCRA9TVsSAnZWagAAiXEP/i/5arqAuUFAzMxscAdR\nOVhWXH4nDE9n2HUOKGUx2ystOFuUBf8YfFx9KTjxjY8Y6HUvi5U5JTM93DJR\nagwV7+VeTPAK6gZqh1pg/W5gJ8qIEGkTZhZBp+GRVBf6VShBaON/y+ajBfbH\nN0OkFA2+7EBgzXWVhUVt0C2wv7YKZ/r+1qD6iXUss96Vw9gv0nIIDDMkcvYG\nVCJXn57zYBmAKe6xtNsFXDOmjgXXoI7+JDNNdM0WkFVmrk6lvH6gxo+VKlKX\n4tgTuqo3xokbpP4vAYbduPcVgf4eEmJ4JODR7SQ64qnGrIBdeOI+PPCPYe8s\niKq8Ei8xddDCe56iTrsjjFx4i9yN5Qwd5P8IuHCNDLNmOVM/VHTpqMhqlX2z\nWCyLyU3Vz5ywSyMlOHUvvqyxZ6B8ga/7MvmnELff2e+3sazTOvuAhT12yx7B\nqJtFp53ruVBqIl/qRYG1BOmygYhAw+a2C1wEDq5OzgXpICg7OzyjoNt4RB0c\n3P1IFSg6WjUbLyspcfVlOF2LVcF069lwQebL9//7ElDqCrUMM21M3OCjHsNF\nTG2/CRJk9JqVdTkxldyEi/HZne4qZLD5de08oyQl0tA2P+woP0nMz703wPF9\nmGaPIVnw5m8uaHSOm0kZjheCIhoR3YjndNMW8qdYPh1G1LSrMxI2QzT+p7LZ\nVonO\r\n=icGj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEa/2NapjZ0I+7BX/qFvN2hFGqpq6uH+5g1e7kqjdFnCAiEAnNxDldGe2SUfRwScXVbWcfPe7Yls7kldFt/eI0BWU2Q="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.3e0cc67.0_1612034962136_0.5850148794408543"},"_hasShrinkwrap":false},"0.2.5-dev.002eec6.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.002eec6.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.002eec6.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.002eec6.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-3IiOOVNG8H6RC4kcn6p9d+lLJfTVXCrakDk3tZNeDA75IXVLOfNTrEG6Rluz0sUqhg0gM0Rs/JlqORLkFxYV4w==","shasum":"8d9dcda2ad1b28c056a72ea025ffddf476c53b9e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.002eec6.0.tgz","fileCount":18,"unpackedSize":105535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGcnLCRA9TVsSAnZWagAA5GEP/11O3wFyyb6ghYZIwQo6\nqOXP5YFqAzbfvEk0eb008keECytofRya+9rux6exc2WHbZ7X5BA5JOB7tQFv\nIVeJKsRPIyOBFatLWmWJ+2RkouW+GgkN0WDJFHY7kNYaiXrGAcPoHzFdWWmN\n+qOOHPJTz3PfLDTmbuszdBWAeCLiIyeGkQNXQ8nmoFU3Y6ZXmVqooh7KMEq8\nypz4kG6IwbKrfA8vVfFo4mHd9h8x44xu9EFHZpdTi9PDxf6e4RQuAVdrS3hP\nknYJfOpbIHbXg978Bpgmno/etzUhEn8b6xf0WiV6uyH0MSRzVQ6nfVnVDvEy\n8Pd47lREUaFSUoEiGjWsq7r/8NEOi1pP/uIso0S3C3i8rp7FZbsq1J6erkMu\n17kxehGjuQehGD/eJrYHy7Xr0ZcF7Euip4e+8WikQnNkQWY+j4ZOI1orREvi\nQr/ryWYKHpwgKj+2FZho/y8oW5xizn+F8DmWvThRi/rF6k1EZtxa8M7wYQIU\nZhHz8AuxFaAn3BAnKlXZ8BrUD3fb7TDvcrP7XBxPLgKbv+BQy6DAXVGYdddB\nyOSL90eoccO65A4Jc+KgD6X0NxwJa6lEyhwTM6ILrvOLlSs2hEsEzDsJ0FIY\ndvcD8IrocW2QAZkH68nxEZ8uXSneGcuVV3NqBpKehfs3rtWI2lDOmjfiEsdQ\ndYDP\r\n=cJ/k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpEtEUgdRUmQxN6U9ztqwaiBE1GTCZegOpT9frwMNyPAiEAz1N7maBFW9sCtQ6HOtCiAlIIiOx0zKsUmQI2DVfgUnE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.002eec6.0_1612302795424_0.6133528582798955"},"_hasShrinkwrap":false},"0.2.5-dev.a48a821.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.a48a821.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.a48a821.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.a48a821.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-ckw1I5llsh70BqE2Kpqg4v1wOGO95PLb9XIi2LYR3fv5v2M1IRMaTPgStQALwpHTkBV4UEGlKqMR7JNnQrYYOQ==","shasum":"1628e81bc5080082b790d3c57e0f48192cde67e5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.a48a821.0.tgz","fileCount":18,"unpackedSize":105535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGpDKCRA9TVsSAnZWagAAtFYP+QENLzjH+fWtqwDytBa6\nT2MoIOVn/GijUBYDDKEb61t9iZWpJ3UBjpXXbB2GL3caNxB1pIacnqZvUuYT\ncjV/3rdQtDhOeLclPpNxCSRRLG/4l9mc4TEckzVrSX4o5ZtvX0KudUCoBgS0\nJoD4xacDQ7jRZbkkjxffp7QTGxMUg4tQ4jd+mExoYux18x+nHi7IVUZNNkih\ndMxeXDdQZa/mHTH/0vb3Huv0tr3m8iOzPwYdsoZM+Rd8F6H7E2BE/7fIOWZW\n5u0WNzp59TZXQGfeg1PcvBBNcVTAax6oBrpJqAWD8QmkOIJSvP/DqMs1WoL4\nkxICNHmN2DtDdWNoyza7RqvxuInMTO696dGy7ebPo1skz1NIpPrW2sjthhZV\n+6dzAHwGWeOoPjGs+Ii00ZgsodpcsO4Ft0Z1Yb6+U6S2wjGDZ7KV/bcF80ji\nBd1jLxOYvK4KEHEaTB9G+HmY95Pvp3kIjaTEMveabavCRVYd0PZd0YwM/JDG\nZSYJ5sQmE6wDTQ5W+cUGtx/g5m1DDurMt7LSHhSezrjbbz7hY6j5iY8pwCkP\nczRKlXW/CfDaTxfJpYBWLsIgdQLsZHdOyiw98FJeUYwcGmP97Gm14WjCArpl\nfF0FvVVgYcNjGYpzAZPCcaHjLaoI1/AgOegGOC3axVC7cu8tIxwWZr3SBw4j\nRv8x\r\n=6iq2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEAuj/GHvv+gHJ8KB6gMkGn6YUxRA3Q6RF0vJnOZmMoQIgB+k9LJaTessbdWvauGkUYUGnjgqgXDCOGGCoadW7SRM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.a48a821.0_1612353738209_0.2783943598559351"},"_hasShrinkwrap":false},"0.2.5-dev.f638d4d.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.f638d4d.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.f638d4d.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.f638d4d.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-0o8rLh24em8EzQPZdScfVgW86Py+oLpJHdFLRzJ/kdArX2fNQiVdCOVaHhadyRwpazRnmfC3caO7cOcucVkkKg==","shasum":"d46cc303c9e3cfc1d065d10feb78cd011fcf5ef3","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.f638d4d.0.tgz","fileCount":18,"unpackedSize":168215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGptICRA9TVsSAnZWagAAoi4P/j183S/3ks9UwlKeHKSL\n11SiW3Qg7CVjlJW/5H44v6WnobL55R/OlJWKNjQWzzhFk8pAW+1Eg9jYs39x\nErlHjbn1I3YhrnUuo7W9XuIZpvUwBgv9WkBO9CCJOq7uTOTSBXz/sVA6/zXC\nItG3xvAEOHIYurY0xFwAxxQC1X5orvWphqhEr9RnGr2/9jl6H4niGFXDhvnm\nPGO3fUcTU5zNtUZTelmI/nfGKfCLtYp+wVkZp5MaH7ubQOJ093gDdGK4m9BL\n4jxLUaMnAUFzLIW7Ye5TJXyODsi07JIE1/24vm+vbbrG7PDgAqUaYDPQIKvK\ngMNzqLFnJ1PQdNerCBpCQeZAVXY+56N2XvNA7/QuY5NkKjCTabzhLCaQ0+zS\nlO1v2WqjxZpXOcxElMsiIYfr6n2x8xy2bQTXqcwZpU1LoNcB/oDmoRx8gGm4\nQ4h9e5leGQCqWCsdwSVgZNFJc0898zsIS+3s2/sv2UCUfkV32jD7Yr5uAE96\nR2gCvBAsYVl3+CYbvdTr0COQzFZjGnkZSNuQynvPADd/sJUWqgG4n91KckdT\nKMFSGFeBwn0OFAitHMPWL4+PQUaQtzsBOQIIL3nsNHJ6TU3FHKVC922jrbRU\nniWMM3fS934mv2tQ/pZt7J55mT+XewmUmtCOAzufc1Pei8eAALPY4zAbRa73\n09Wa\r\n=gFBo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFCcu8q6n/JkcSTSFQiP9R3WL7GgH7phySI2DR+oL/wgIgWCuqaz7DoC8iaqsOF5phRtqkw8nXbRtXqyPmxhf7oN4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.f638d4d.0_1612356424481_0.04299215761611963"},"_hasShrinkwrap":false},"0.2.5-dev.0dc3687.0":{"name":"@superfluid-finance/js-sdk","version":"0.2.5-dev.0dc3687.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","scripts":{"build":"tasks/build-abi-js.sh","test":"truffle test","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4-dev.0dc3687.0","chai-as-promised":"7.1.1","truffle":"5.1.49"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.2.5-dev.0dc3687.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Yef9mTWOKW1gTFMGi8mHWse613C9dbTdRIlOo7y2u3NOuoy9B7/5OpYpaTj3YOdOzDE1wI528IiLeX8OxLigag==","shasum":"96bb7db0cd0cf6b5b623cb709f4d8665ca51c590","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.2.5-dev.0dc3687.0.tgz","fileCount":18,"unpackedSize":168215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGsBdCRA9TVsSAnZWagAAzecP/29MNvITEpDbD4ZDUZKd\n4cyF4tvGHlalZU3NoGbdQ1rDnnjpewWtspo6mKK+NRjiRrobOt2EZrRQpJp0\nTytCfVU92wD2rhbQRrFYP5Whjt8GF/BOSbb7CyEuJX9K4NqLXJgaowJaHGgl\nN1IdVFS4RyducBio4mgVLY/9bvteuQrWg1eRLuiChDTUDT4BRvkSjibZWL8H\niG2WA7DayCj4G0wIqINFlv9BV4HGnZASG4VonrKx0uQEdGWOmpEpOyp9Id9M\n5Hfu2+Uo7IADCcMRdGVLNbFjW0ei7VkdE/mgjbxGJrLWE42ICtqRji0KZU8j\nEZk4XMY7rHP9q5en1KiTtydm/oeKQr8Z7njup6vV3Q1I443tybxs0YDp5CN4\nzYxFLOT9qDsAwnpwv2BnB16APXaIy6wFoM6C9pWiRZgcWXDK0SaNe0w0kKUK\nXyx0SIIDLnhfeW99T2dYHcb5M8TilkuwF38YlVOIgIy11J2KyriZ07kVUxFA\nqgEfy6yBAOF1m+fmKWuu/fZ/F9Ki+CLcJGtuD1AwgbEqqSt3WN5MXsSuQPjN\nynk4rHWHlx04mEjRPTYTfwFgkZAuSSdtDUJ1KaZ7LWAFQZUJKjJwy5vl33xP\nuEj8IyXO3YvSL3O+jxFDOzj1JKEGFbldEtTHCjnnfv1QIJ5mbxjL8butaBD3\n344b\r\n=v8c1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhxmJCEUP4DHNHNOzmLb5i6UXkB5zrb0Bw+8N/QGc2SAiBiAYA9f+1mWEHzbB9t6yF3hHemgb+CsRIc1cc9i+S9RQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.2.5-dev.0dc3687.0_1612365917369_0.7037185036011371"},"_hasShrinkwrap":false},"0.3.1-dev.4116854.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.1-dev.4116854.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.5-dev.4116854.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.1-dev.4116854.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-vpArmT8bEhLMnxabpIIn+A2PvrJHg+EOImFNVEr1gPKBqC3D9Y/ng4ROmPJQf6P8N4O+kaIc78pq9VaJTLbzMA==","shasum":"452689e722675b14750766575bd882139832f714","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.1-dev.4116854.0.tgz","fileCount":18,"unpackedSize":168858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGulDCRA9TVsSAnZWagAAeZgP/0b/EDmlLcxFHMkRelwX\np9WFKdWM6SW0AhwzHtqJkUQCqg6NQSBpYUY2/qq87y2kAWR4dXcZNxFaL7TD\n4Kal99bT/Jd2iv6cGUsZZ593YyV3jvkr8V1/KYcOprC81szgeNYGER35Acx5\n++qEksAIG4pt4X4Czv+M8okf2HcVJlvkRksS6gsS8LDA4qnaSRQ1xxd3uCSs\n4P+l9PunVY6RZsr1EYGn0wP7dqzMl2mFqH4mnLynCOD9836rEe3xGpw+w0Gj\nfA4crXT+k8BQ8qpZ/5obAZFEYLO9QxYWKh6LZkVEZDoDV582o0M+jG1aOWBo\n+Vl5iwxxinft4VaZzekxZMjUBz4hY/ZNR3AcV20FPq1Okja/3ZiVw1ZvQJTk\ndIq4V1fCD+SIG0J44U5C50mZhqHwSMMXXNbc69bvhtSpA8oUhL9qat7JRMLk\nXWXaI67U44AN6jDoGvJMHMA+YkRLbzAhVzf8qjnz/RBEwAGLbFPnpNQOLcDo\n+xZjfAc20P60FvTzo26AkxXEdljSzBEdvdID/G08QHhprIjxx585quulG24+\nynDA6bvBvf3vAYzL4y2l7Z6tnfDiuPmrgdQky2o1yySVQVRl9YHRHZHiNkku\nprCc2vi/g2cJhbNCesbf25jCyZ5e3noWYpSQtWW0HAxOUkueEFn6yYFI3IdB\n82Ze\r\n=INsZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3YkDLLa8IhrqWm12VbepBRkGeO5s6nocWPd4qAP8RWgIgPDXORLKKYP/OwyopRaC2AM/et6xo3Kr0cealNFAQ7qs="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.1-dev.4116854.0_1612376386885_0.7136363655766949"},"_hasShrinkwrap":false},"0.3.1-dev.ab25296.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.1-dev.ab25296.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.5-dev.ab25296.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.1-dev.ab25296.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-EnJFfqk4vup36MZtKuMOO4ACocUhWfSzXHUETZCCZZ3oMfkVXcMPkuljFJVB+frlWjt3GQFYJfg6WcELPSicXg==","shasum":"da5e34f586b3d85182bef5fb6443d8b41f603956","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.1-dev.ab25296.0.tgz","fileCount":18,"unpackedSize":168858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHCpnCRA9TVsSAnZWagAAh4IP/RIylO21yocAQRUf/oDd\nmiCSgSM9p7Wxg/XoCYMCRk3dga/Vozo810He6BG4uMm+Y7jg2pbnk8GK3dqQ\ny4NydopOpQ7qRUL+fTcAN/Gf7Ygc16aL/8d7p4Vga3ciwO5tadu77IFr0kI4\n+HY6uL4UXFdjakm/Ml4g7nfNg6Od+PVRumRA3DWYyFGiViXhPr92t5YIAw0N\n3PAhI/jdiQINNCK1fZWAaodiQ92ri8aFSfbBzqxLR2LennBWoCW2R4t6MvGA\nSZY/CMqRWOOUajn30wqAZScQsNRKsm11qjLEGwS09anDqQq3HckPVg9nieKC\n6dsQ/OgzqeVyJVZh439O/D7lSh2k0wAsGwRTGqAanJveP0Emq771eLfmB+i0\nyiB8468fCP1MgweRZ2y68Gptp1H1miw4VnF3Hzihs3sUMvhfB5TB7A7FVUsw\nX5ET5+KnHaHvCFlDxPxb1+11FG/XG75eSrOJcuGxzApaa+aT1UULhI1niY6M\nnOVW3t4roVdU4XX2uTuUy3cAxYftqddevCmXuqvLYovhfhj7wycEz4OgEkZi\nvIv73XOko8eBzDSViumvxXgi1WF7j1cdy1bu3VJiRvPgak+UbLe0HaNXGi2W\nvyIi7vxdMAyfvOrCkD8kyiJTJLi53Hjl7iW9YD8+C7Yj9qyfhET2qUR3huEx\n81SR\r\n=C+Xm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwASAYH1Oh2MDHwv7G260DX/uT9xuorfYiLIIKdf48vAiEAjqQ26hU9H7IxGuZ2AEOJQo146slcG0PZ3tZN532fdeE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.1-dev.ab25296.0_1612458598781_0.027009485392947008"},"_hasShrinkwrap":false},"0.3.1-dev.80d5224.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.1-dev.80d5224.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.5-dev.80d5224.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.1-dev.80d5224.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-N5pTG6fZuu/qHnQBGqIhccu44NIAK8D9ygH/g2d3uIOygjxW6i0Slb6hjNgPZg26AkFww7Yqg7HYrVa0uwJXhQ==","shasum":"70abf4613ac94da6dc76d89d16728fd5af492a6a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.1-dev.80d5224.0.tgz","fileCount":18,"unpackedSize":173061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHNJmCRA9TVsSAnZWagAAhDYP+gNpVytWPbLKLKStjy0i\nKzUxmDNNoq7c2z6thc17ZpZ/ILHPMygwJORDLN39/ypBGwmYVH+LFvO0Blce\nakbxqMcuIHeyatuRZTmxASrR+8ON9cAebeIpCXNsbF4THsBuvBj5o+Ix9Ogk\nepELh0BBVDSkVMTTARVHtSNyJg2zGiOmWu6vqdCVRvM9Pnh8oQLGBithwHly\n45YOsslbEW4I+JtXYrK9iE9CDaFVsC6zHsUQeK+Dtlg8gcw0DUFWdoHqF3ym\nKpPchSNv7+vR1rtjt9U15P+ug8n/9taxdH23QEzle1aKafCUGj4i/xtqPeqh\nXDYYPsvJfbTI5JSiZiWCFmSrtOZ4F+isxDct1hdFfXWjc2H6RQKX5qHFrcb9\nIg/xokAh+5oEWwTiEtAltB0ki2HTaHWIbLZgaPGP1bxueKgkPRCqmn3AxeHv\nb75HrgeeXbUNneHwv6abK3KtUi2OxzrUrjyLdFlEAQNfGCQcgeJfusSq9qUG\nPSYZjdNF95GD3PT3n6OO/E42nM9TdDZoqYiozvSRI+j33WrjAYQPocDnALuG\nDr6qvz8t4mC5kQMe0BYr9zco2Dj0lFAA2BIsCJ6GqzJ6LYbeRj1Sk8CWyfG1\nhewrkw3jQY/c/RV/yk+n0xyUOBYflXCUuHx3/aKdDogCO68jE4Bqor4H/e/b\nP9pF\r\n=Halh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSe3t4VCzfKZOcDjzjVpox+ljDRx769DKVua1xkkjNnAIhAN9l6u4Xr/pTo1RE1pjGJFYtqIe1lBBeYStNptig8My8"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.1-dev.80d5224.0_1612501606353_0.6937985207337469"},"_hasShrinkwrap":false},"0.3.1-dev.2ab0107.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.1-dev.2ab0107.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.5-dev.2ab0107.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst sf = new SuperfluidSDK.Framework({\n    version: \"v1\", // Protocol release version\n    web3Provider: web3.currentProvider, // your web3 provider\n    tokens: [\"fDAI\"]\n});\n\nawait sf.initialize();\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\n// First initialize the SDK\nconst sf = new SuperfluidSDK.Framework({...})\nawait sf.initialize()\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI })\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI })\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.1-dev.2ab0107.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-SEukjTThpfaU/jGUWmkvlIqgdK7pUNycEPIyddxqkc+8ZUvG5NSQKctEciMeAAZbxrTf/DM/mXthBykQB/pJ2g==","shasum":"68d1ae6245b353166fec0717c3ccdd566d9eb089","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.1-dev.2ab0107.0.tgz","fileCount":18,"unpackedSize":177422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIEjdCRA9TVsSAnZWagAAxuoP/285Bu3onppPgiBMNkL/\nXNP8gAqAlcS19WdwAEbwyKXBQtbuCyYkYbRZS1Ogb3L23ae6z3/n8EarYz7U\nTcbGGLSbri69AlvVj+qveeuiMr82kL7Al4OK/lrmYSa7NVOCd2a1O/ZTeM+q\nQiRDCpOfrzph4/wUbYDhUHk9j9tkz3WUZ79NA/TIc2olWI83lid+Zy4at4cJ\nTV7/ev0LJSOFfLZvhTuc3W+797jKs7HkQRjmAg5ciiK/QM4jnyibVciM2snb\nJtMBzWoV4tKOAdB+jj+iQPtGmJMPClKYcd1+Er58r1mNQE6MOW1UByuuB59T\nD84KEM2m1wPe128BQ+O8YW4sj1kdtdzCyW8cZ9R5Qc7AY6MHCa3wmdqzBGXQ\nlkGncUlt2SsAPNAh/ojI8sUmSEceQ3iXJ7kFJE16s/2DhldnGcgSvNwpOb/q\nFluh+FyJUUY/5F2+lq46LFsjGey+mq9XpSo0wLq4v0FPkXL8olNO85H0JC1p\ntlF8rfr9v+A356SS5oQdJwTJJLALMSOfBtnBldYcW77MpcW3Kz/hMZBHhGCb\nBuSZMlf5sF/HeISl9bhBAkPfSpMZwka2pNYVTEtqEoBbt2Dc8R1xZsisYgB3\nGt4rlbPotfckS0dtSG1xJmaV/FuLKtjl0NBGp44QDhZc3m+XoEDFfcpumvbY\nswrB\r\n=mv7k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICDtcWMd4m1mjha2FaFgxIlkgo+QOyj9BSSPl3X41m6CAiEAjphu6oTLfLBX8KxwM+21bJYHBcm0aeTc3jyQCVjMN50="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.1-dev.2ab0107.0_1612728541104_0.5319422561070948"},"_hasShrinkwrap":false},"0.3.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.4","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-8etP9l5FCXv4TgYhQOt6KofdOVZdLyZJik3JKllWtGMdkqjXOwQ1o0/3kEyERCVM/PrqNRLous8Rf+J5pwSfpg==","shasum":"9663d9505044ad7c6e07b9aacdab097518305811","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.0.tgz","fileCount":18,"unpackedSize":177394,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIGtDCRA9TVsSAnZWagAAejYP/12c2Uugpr3F0XRAu9fe\n9MQqRCxZPIVMuk0gQLMgmBs1rOIKloh/A/mtiIOuhL3A8kkhTFXANl80w9rW\nkzQuV+KgoB/dWPxjKVmOw9tiGNf7mDtNhjgHf/+OXkb4t3sqqoqJojL5qxBz\n9zHrkYfPc3pwZaiJwFNFCB4N4lXRKJEOuGs2fvU0Mkw4j+MT9RHQt7C7wNzV\nlDk1PxoBcoc8FY8hmXVh8kcmJmzxI6G1aW2/VfsYEBOfRXOGiTBRD6I8qy6Z\nqWyt8jmc9YQB1gA/0WbgPX65oyuXUCNJ4vIKrHaCpRYAI3xHrzcuWAvfDX/5\nWRALm+ouYCh7kQuCiTZ3QtBXS9gJvCDrKrinb+g+VbeQ8XiXkBNfgVzeYYG8\nXikzd1wmZVk1nJzOVq+8KLKwWTqIjGBDh92A6p4xho/XyOGZ+OD9L/9ET7Z8\n+Q0kpPzI1/MSQ0/wOESpW2gH7aLuq4xfMHFZ3RjRFPV+R/xnMKG6x7xmB+BR\nxrPyP1tJRewLufFVWEMBW/EL+bM3+uCnjYRVVkDCfJggRgmjaQusFcO7WHpg\nLkGEmpSnEXH+cRHumd4f3WHs8E7EiUHIDuagNF6WHdBUjmDmHZOkqof4m7Ph\n3o7CkP5McoLvHSpuV93pUP6qcClT+VDqOW/d9QQ+hcHxbmSIfax1YNELHaJV\njbxE\r\n=pQjr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDWgU8M6W88EJj8sv3S152pjQZbZ7PcPahkWATAo2T7AiBG5onfpwspJCkcpwvZLP/4M4Cs58U4GBKhPu50GHOMLg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.0_1612737347161_0.6783844386879443"},"_hasShrinkwrap":false},"0.3.2-dev.91c81ed.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.91c81ed.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.5-dev.91c81ed.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.91c81ed.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-QOdUnmo/YvZl1+setdnW0K9bdFmdQ9MPWfMEBD+TynlDlbv7oWoV8SaGVry/2nGl27bmumopNjiRIUGowzyb+Q==","shasum":"ed3efdc6a4d59ff498f9aa473d365cff6607d547","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.91c81ed.0.tgz","fileCount":18,"unpackedSize":177406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIJG7CRA9TVsSAnZWagAA8SAQAJfpAfebfNe/ZKoQyWqH\nUb3WS1LnkG66RYnheQtfNkIDjFs9P7qAxNG7hN42YNNaUSGDtXQBYe/atngH\nx5Vn4j+t8DymmxjkdkTyLjkDK73EgY8DwfZs9RA5B+JIy1MTXBPqHmp0CD/C\nhCuEoojAnWeFinKPcJvON7mejs9/yZfsGwHnmdcXVjexz7j5CgRPQDFCMzT4\n++HJ0w112GLs3UQf8KBRMtbnedN2bRXIjIqBwTaeTFb60yjlr2WzJEPRMJaU\nMPxcL7aF51RC0nDrh1vkAdXuLGy0jo+ES3f0HW/As1IwjZDP1GptkQTeYb4L\nV32MKMsiA2AqDmvz+8KOf9akn10/wBqzkNEECriztBku61iGPeDLInNQeP0F\n0dkMBWt/PlBiOyXQZC1sheO3JFAzrC4s7gK0E4/iiSNPHhmLLo0ZdFnhPeyM\nJliGeZA4IkAPst9QfNL/y3mTZ9DUe56WdQLxpjrdYf1rM6Dkf+wgiZ4YuHDD\nICw1qvnYfeNr+mxvYduIfHT+IVWzMzJiT5bzZBdNWO7rBs79adkoojPgTBk1\n3X8aPL+IBVCH09umOX4Pv0Q0moNw98xy4aoQK4WeRyP5Huy/I0JUJvKC0NL3\nwOfYHvelN7qxNA6lnTbvgUaQCv8yvRovDc52P3JowiKDB66gvX8NUkQmQxQZ\noByZ\r\n=nPwH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvLFZbmRLNZQ5yJLcI8CHNJLqU2qyO0eitpdjadPmgqAiEA1bsma1ULrKiyLjBASdqz7w/+DX5leZw/BHhcQTUQ0uY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.91c81ed.0_1612747194606_0.5815504774087372"},"_hasShrinkwrap":false},"0.3.2-dev.ec60bf6.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.ec60bf6.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.4"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.ec60bf6.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.3","webpack":"^5.20.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.ec60bf6.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-q4IFg9o9I9TNt7frX72rsApfjQUebD3xblOQi4hJBq7jh7Kg43PUj5LiNsA+YKG/4/yjFsSrMb405HPRUIdQMQ==","shasum":"3cc0036d5c98b4a440123b090280955a704661ae","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.ec60bf6.0.tgz","fileCount":18,"unpackedSize":177406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIR5ACRA9TVsSAnZWagAAbBoP/10RZ9be1sQXvehtWHVl\nf1MzbVWVe9i9fhmHfwjogobJ7FQzo8Jp3d2CbvAOLnGLuNQAOSGdH2gT+sV1\n9E5t1DZGBXR4bthV7DvkJsQH1re40Vc1C6P+K/48OB+o84csnjWwWCGwal2n\nbvA/Bzz+rlFL6tee/zHwuxaatV5AwJeDHXj+QSebH3HktEDkDoRC+Gz8eK6B\nKtTc2J7MTzOkDMyw8zr+JW74JZq3whwkj1MkRZ2LmMTA5Uo/x1pBngoKjVR7\nF/nDrRasoGv1wgTtTsTcmvYnof+jK6OcUqFm+J9cuHV31QXOYsJBTvnhaT2q\n1VnOWgWrtmhBPrjY6w1y8Z/7QPENK0Cdmv412XPRjvagwHFN20QIxZOS+q3N\neyiek6QVuUFwvmfsVOonRMqrcRz/EIiV3s1Bi/mpNZ/BcnwK+irEyGTw91U1\n1dqn2zIkllgpYbkGU86uX+lM7DlsA/vI8G/xM+JV/cuBaCfWEBV+PCmJK3cp\nf75oq2X+d5ajKP/vEEq0lfZht6ABvfv3WJGh2IdnQPbgrPJl1MueCx2TFGMx\npMxi3iVTkJL9LiKUe53YWzHrg1InmctVYZOJv+iYUHFPOCqIQpBTl0foMAYV\nACG7l8EXjlZ4Y9xDFIXQczLPEd9xf9Ru1iSAcGH04ckDIgeb1dgSn44b+cm/\nhYHU\r\n=l/AT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCakdRS5vF5of2LF1nhq7a8AbYrzJ3H46S1+8pX8fghewIgDJ4+2a129iVg+dnjwbjEVG9CJ6U9QsdLKTaMiWJ3kBg="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.ec60bf6.0_1612783168068_0.29072279299486103"},"_hasShrinkwrap":false},"0.3.2-dev.4571dea.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.4571dea.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.4571dea.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.4571dea.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-RCoA/5cCNfhmtwt33plzYCFz7GrX3HTmcsi/6V+p9dFt5PxSPX65bwXzDNarMzruIksN4mSg+OVsbdQ0ou9DfQ==","shasum":"0a9a16261e18f7b3a5ded65cb480b01658b7f544","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.4571dea.0.tgz","fileCount":18,"unpackedSize":177406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgITwSCRA9TVsSAnZWagAAEnIQAIsgIrlPHPJwZjK1GBEv\nQzgQtKXD40cfNN+WCWe5GqPUhP2k3gouAc/z1NW+4xEln/DIdYt+N/vVjGon\nKlQUS39O3+AhPoSqi9OnvuSmda9IXWU57ihP52cHD3LRM5c4PspSJcz6lwBM\ncYijeK6L/jKmHVnjj9E6TqLQ89soC+zYro4n/kpH6178TMQcwzePmYsf+iUM\nGTwKJ+sdyUHh52jvNFbzpAd+PN5gQ0RCOJwqJ7OxVns31mdEAVpyrzNodZ0P\nvrPgzxixIg5arTO46K9g/jXNXb1DUeWo7xbkG35ag/hIrS7/pleEMvYpp5pF\n+eM+9OtVPGJ4JAErv9DOqXsPJcEuQizCXi7vGhfQZn/NKjWXFRMyp3kUyZcv\nwYCg+ydNYqWTGUJkMPPD9h7r3gBpEAAAgjoWKa64hlSRWFVfgj6UGZfm8kMc\nVsHqyCN8Ach/IF2VN8zTTotXDFLXDjbWUyY7B2ZFDCIwIb02L18chbDr1nmO\n2CY1ec+sBCI3KPx4609sJjB8V7nN4ggqkfGpni+rchPjcWvIaisDfbP/alQS\nOvLYUTn26MuW+prWsvLGOag5MOJLrTXjctT+nT1pmP7oRAgFVsgteNAOqlFh\nsSEJB2hHt60+P29vBS4JHJUPHVfFvHCp65iALYZJXAUWvpdijkz9g47n7k0l\n4Y23\r\n=xm2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIALfUidOnxp5SNIzjja7YB5dDYZ6JllaE7GAW5gZbg2GAiEAucsYKe9j4EaM1lj5oqmAXvo8dEUpA9gQa19NoN0wZHU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.4571dea.0_1612790802186_0.6047929858980787"},"_hasShrinkwrap":false},"0.3.2-dev.4f08e3f.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.4f08e3f.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.4f08e3f.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.4f08e3f.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-woK46dkEM3A8zdjQX8+y9dU/9FDCoVwK+sjL2VLS96anKF9jJ/ia7ZB3mkPuayC69tsgSi7tMCfK3ZOuQQp4xw==","shasum":"9f13fdf9532d4c3c4d852a1982d82c3925184fba","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.4f08e3f.0.tgz","fileCount":18,"unpackedSize":177406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVmJCRA9TVsSAnZWagAAK6QP/2D6cqPZG98D5oJ/UBJR\nclQwHebHI7tIyjTs7bO2ytPyLw1FMxmBxfMw9sJEqxawhu5IQbDEnnr09k+U\nHK/IdsQBmaC991bK4y+CNkZs0j+y50UwbNHUnxaOkJds4+b8TpsYetHnfuiG\nCZW4nG5+7mp40AaZtvETPvLYyCgFmnQov9IuIfU3SIveWeP/rWNqYbeHjHN2\n3bvjzBBUOmPjQpC8eLUlbImMI3WlG7dzTPoobS78AhxSX2FqcfG9xADt0R24\nJU81UBlDX98xDKdPOJbxe1dMEH4Da4aif94WXJqlMzUZgW51djEu7YbV83PJ\nq0F475NIkV58hEYgpNqMlk8CcmCSMPxz4AqaOQQ6vcPUCiEHJrjlj6tFJ6kT\nAFuGR6QQrEkT8cIKQiawPRUtfE9tCPoodnb4qmUiEGfYIJzdpLHt4K72FBSi\nK3sRbHv/b1QB2Bj3Tr24JJoReNAgGwL6KyiZPbVE32rrvQMK/oOLtF7WljJ7\n/11bapwXAHV63vPsST7WbVsTxQYGjaiFLGhGqrmQcWp5lXtwPlc/1SHCszB4\nl2PgBFwyPjC5PUdOQhLABbyGT5JksxBAPEmREMdYwCpb7yVOLtuK45iw3ivC\npvkI0v5Izu8Q0SNNoEwZ0Jihg3yRThc2hvGAO1MjrqMu3UXmnWxNnveRLmrL\nPvIo\r\n=nxBi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvrwg/Fr7uXsde+hhnxpk5H13qgMh9Wkxca6JzoS7c8AIhAP3MMW/X90aG3HUDxiTedc8xFzadEGjeW//M5yqUm2P4"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.4f08e3f.0_1612798344938_0.2577986339855938"},"_hasShrinkwrap":false},"0.3.2-dev.d164130.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.d164130.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.d164130.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.d164130.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-jnFK0NlkTn8nFhJ+eEJjHdxMC8v5qfR9eBiToEDE8E0KSmHGMdJ5im46daZAkIAzzftEIQ6uoZpzAdkOATCkDg==","shasum":"795618f99a516ba8441bc69072eb80dfb5528696","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.d164130.0.tgz","fileCount":18,"unpackedSize":177406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIWytCRA9TVsSAnZWagAAIaUP/RZbHH+Oy5rtr+YwABYt\nQgX9BTB/L4RaiunSbRmxuASpF+B5Zsyg4tG2XPsSgJx8JuzZRXKxoPyoZeFL\nw/kbVFacTFTJdwy22AKOaj+c9nvVkmZyQZ9PSE34J2JB7iXEqzaEYgivc7bP\nf2ee08oe5r6LQ507FX2/V/63G/PaZzrFWKdQ07aFCDUZFqx38A5BI3LKS0E2\n09vZsaXIWArDuaB+CrJCXfGscmRdHS2DPT8CuPP5vjf33AOo6z1uo4Gxl2um\nWvKgS+5kL7eUyaEpmPK96D/gICaGGrfF3f5xhGgGruhNxfGTSnvDiK0KqrVE\nl0YKCwfnL6z32hwA4sZ4oO4zsb29+aivHEGVSdn0/alrOL3Bg2ezzFrcKjWk\nlHHBYjB2wkn/Ff5EBtUS3Q5DoZr2EsRy81QzMcbzueC4Ddv6d2OIzbHVuIj/\n8SpsXSZaf/pUyhjAOs+h79Uwot073KppgbwQX8gTu/c2MsJjJFglJakgZAh/\n321hsU6kav9snF3wEKUHE02ymv7b3kv98RLFU5xNom/Po0Hm8FZMrXpBQngC\nucSXFPDgWrEMsyCqpJ/6dYkEY5J3Dpky4e/3hasFSJ43p1k+piqMa+wGkjJD\nEOxCJgGoaNOiNZ8aA2tx3ub0xecZ3G15c0e0wGOBgoYq1nUNaM9jSVJgj4l7\npEeT\r\n=e4jF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGukmlBx/4u3B2PjGmPfwv0SWTWXlxewX/Vrn3vr3RjAiEAr+3p2J2P2sPlS3iZnVnUrBa0OFTE5BQTOGMJ7M+rfn4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.d164130.0_1612803245217_0.8929742168150863"},"_hasShrinkwrap":false},"0.3.1":{"name":"@superfluid-finance/js-sdk","version":"0.3.1","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"0.2.5","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.1","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Yti0YGZE6OrttI/HTYyN2QCj9xrT+nyFpWtQKQujOl+HkSZZR4s1d2nVsAHGyoffwKZfDL6qmw6lcU4LciF/nw==","shasum":"18da08603adcc77a17c10fd4c91a2858c2d0f28a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.1.tgz","fileCount":18,"unpackedSize":177377,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIXJLCRA9TVsSAnZWagAA+kEP/RtPdbWDusyzmBP/rJHe\nOoKXQ3ypwXai5/8hmPLKoe1xNzzzjrdrx7AsIrE8xvS4gBY6MUcgC4KDpqG3\nmnpA6FHSn1EpspR7bzlTsCFvuj0+Uo1N2sUV3Qg9xRRBGM/Rn8kiFVUQxaE6\nRUTj4npxakglfWsDv3wWgZDOFr1PUJ6wPtGSENoCUB4y1zkLhr3LL8zi8nUR\n9EFDdT/mloKp3Q4Ztl0durRXvOIzI4N/KVoy3VasJwuphJTHVYqjAesIw8Xs\nUy5EQBsQDr8ThPerrmA8K5vtxmw5q0/+Oxd7uP9Wht++bAG9fVKXHsJIsiiH\n4gi/xJwq9a8BztUFbdfTfyZYsT/qIjbtnuO6zHkMu4ArOjaVfGGuhu7BcVqq\njj6Z97BmGnYal8qRi/0Og2W8CAko8lV0RHmBREVi4eFQUW3zmnaDTairXKBb\nNsFAi5E37M+wmGUtblLeXxxap9pQlkCmcawdHhmo5RBUFeNoOkR6DzXfsm84\njX0YYQw5v4+GPFuDYtRzpJTXYudWfD11RjK2fs4dhmSBPdjVzCyqV/SMllzU\nQRIJp8lXPolHR2IlH34Ag0kciIVxKS6TLO9GPtFhu5bUlPJ98ubfvdmv7Ce0\nhGGP3zU0KVqfSuTH/AC8lJ09sugcZikLPQPfixWIHTLHnKMUgdh7ZIyXNGk1\n3v2z\r\n=9yfB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaRGClBocbvhpCNYUJoYNh6pDeInS7HOenPqki0C4PAQIhAO+cOLinEdqjKRMZIe8sXeunnGTafWYfZ7UW0K1HNOAn"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.1_1612804682993_0.9359538297875456"},"_hasShrinkwrap":false},"0.3.2-dev.41f2937.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.41f2937.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.41f2937.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.41f2937.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-LzkYLFxwHFnBPBiJ3+Mvw/s6Ti96KYSMsdw2YN17nBwM3LBWb05RS9f37E2cDiN8poCBnIkZNlZJK8M32GFqOw==","shasum":"b499862ce58bcf53994d221e5c39035f6e377559","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.41f2937.0.tgz","fileCount":18,"unpackedSize":177561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIb4VCRA9TVsSAnZWagAA3woP/RI5eF+FEUwnh3JmzSHm\nes+SHEs6x2ZMgaS7XxUJaYQoRG1mzSfBAsVaP/h/jlsBjSXyqzC4MLHLWyUN\nk+HM0iEKWks4sWGJszwecIlQguFMh3MVW7mjlE4lav4XWrBsv6YpHDwxH0M9\ns0WEzDuT5IZbxv26rTTTCsRKa3RpR083C+jK2haTRYpZdGrw1f56bQRLuxGP\nv5EyeKoeTKOTDQ95L6PhUI5C4akguFwRBlAxbOWr1EY7JoJ/E71pE+0cPIB4\n+f7807ZiNAcHH5wHyfTwgb6f9VZ+PJRE9/5DRR4tVWYiClPTdtfNy7bLJms5\nDZobNAkakIp3SL/VLiOvQ4pAPNDAZ/vRULh4Ia42fXQbg8IHNzx81P6Zp9NX\nr3L4JLDrOHNwh7B4dCe3Ju4G8i9GCm6xaeV5wkbphrpEEPitl2n6/+QDbd2R\ncTk9xUVTl/SKQCB7KN8BziUvXHCsnMVCku0Iow0H9CXwyWKRInm4mqhqXSE2\nEdR04UBrDKlJfhkyhIBotbsI8XMTwGvCGPkmvP9Q56etcg2Vjp4N7pB91LP5\n+5Pu9D9LwKIGqCFdVqwepGMc8FJRqrqLAoIryN2YuOkdpXuAeQTuORskfR5C\nbj342zTDPOTwPbz5qUFu847XZB0v4JZJcUGWiVBLW6s/qcdpvxc1yJ2egNhe\nTrK8\r\n=04v9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjJ9jXDxN4Rs+AfafXGlruIpnlhE61ju6xg023cwuTGgIgAZ6l9I/gXk+THADIgXU1MLHgo9VMU3f+pqkVkFnsbCc="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.41f2937.0_1612824084847_0.793521929344025"},"_hasShrinkwrap":false},"0.3.2-dev.88c9725.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.2-dev.88c9725.0","description":"Javascript SDK for building with Superfluid Protocol","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.6-dev.88c9725.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | default                                  |\n| :----------- | :------- | ---------------------------------------- |\n| version      | String   | Version of the latest deployed contracts |\n| web3Provider | Object   | required                                 |\n| tokens       | String[] | null                                     |\n\nExample:\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"homepage":"https://github.com/superfluid-finance/protocol-monorepo#readme","_id":"@superfluid-finance/js-sdk@0.3.2-dev.88c9725.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-drSKoD6qEd4IoPpxIQ2s5lPuFqw4cF/r3Pn/Wz7+OjczJLL2jXZ1tUXDL7agsf48rITa1/ZQ+mbC8LgvBH2TQQ==","shasum":"3e73e30d1d950cc1be7d4153ac12c242b307a869","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2-dev.88c9725.0.tgz","fileCount":18,"unpackedSize":177561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIfhWCRA9TVsSAnZWagAADnoP/icOc7KecoxXBk3Iq+zw\nGY3cbsJKvrUZQ8oJdHqkKPM+iiwiQjyzJT7zsezHXo+POwV98HvqIE3nIUYA\nrJepSSMB49B+A/rt4EFBQZk8U33Ua7QvD8kuv9bXxiKyvDPJbdRvcFGz0yC5\nf+Qrfl9AFDjBcSE4i52rK2RbxSpJhBhQ/Okxdy4IKr5Kahg+wALF/bLJFeP1\nOV2SQ/hC/dudj9A6M3Hrg8LCkbYOXDBgbroReaD1bnsXLWlZR89YDIRlpWSy\nnUj9hrhbWOHREazTddkchHJ4rHbLeIkJr8nIPxYYD/h/2xkv2HzBP5xV5li2\nhAYQIeCrBec6pXw4upyhY/7mcVs0a41RRdfoP0Di0K9VQImZLXK4m2wepvPg\nen2wsIMvOW0g7+mKQU4U8TuVb7GBgTf6PwPeF/oJXb3H1X5zo2/TL8K+lob+\nAbBQMyRIMfWdMznbuBDqILqP3bDx4bIBoVeYQnSl7yy0HZinppF7OnCCtxWG\nESQ/WMapnD4OqZMqqPbF/qaEx0ADppmG1ZJtYgsmS4qcdK7AB+guWkUcjzME\nmrNLTcCdobCBYf+MdLVCn+LFs+lVpcbu+n/6KDH8turT/f/9JV+B7LhwW1Mf\nbarBXFNb9PmIG04I1vB5xfaEJHSacDUQ0IIPKdNB4+WBAY44wg0t087AD8/C\nbOV+\r\n=p7ZF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkgpRrfaa20Xf80skk+YiDIopNV+iq48/fHPeb0AZk4QIgQtVS80XQ9g+oZjOAetT0eNLFzBJYiM5YA4CPrGZuTrI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2-dev.88c9725.0_1612838998310_0.6094390404665095"},"_hasShrinkwrap":false},"0.3.3-dev.d3f6ffd.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.3-dev.d3f6ffd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.7-dev.d3f6ffd.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.3-dev.d3f6ffd.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-KBt+NExCC/DH51F1rMn2K28GGiMQ2NfAWHpSoCUSb4bKnFJGxkMuTDE+WcMchZKVg1YS2UdbwjCE2RWM70u35Q==","shasum":"2545668a3b7893d1838c946c5317381c224ce808","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.3-dev.d3f6ffd.0.tgz","fileCount":18,"unpackedSize":180136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIp23CRA9TVsSAnZWagAAVBMP/30nJEW+bmxv8bShpzLA\nHcYlPy7CLyz5Z9L4Jgw81XnAovuupvxlpTuNOu2fxWJt+U6Rp5NZPyn4LfkB\notROnmffhtZ1oHfMk3+09sPSA7+4olAMvzhBXJgNwQPSRvhSvbKMHZ7QvXPg\nFs+Gzx28VgZLsA2B4ij95t04sm50We0jbRtyNo/cf8BaRUdFePKDf6fpQWKp\nDfcJbjhVE22LlaBdIzHTU3x/jdWwwo+y6kvghXPCLd4JukqCkolGpMBSjLCc\nzVXO6h2THSsay2R+2Dgjno7eEWazJ8582lwAo6Om6ysxn4d2ee3BSyp9GLtS\nx9/rVbGbQKV4+uuzw74ID/bY1hHHtyzSdn5Xrbrs2zPQbOVYW6juvW9DCY9s\nMCfTVW1oRnYlhP3tpY6NNh9LM3a6KSKMkZ1XPTyrzO/6emXMu1+KJSL02P3J\nmX9N1HyDz0tWoR1sVcaK7uNOgq1W1zwOImNQprMVtpRGP5FQe/hQZu5++omU\ngvJTibDkdK/GE053XzHJk+W4HVh0J4T+wvS8mD+nu8DbJbcbI5ddluixxYAi\nJtdHb1K50xwaLIWNiUMXvT4gUPx9YHKeYf/rHwCkzhhuHs1Pezoai0HJaAzL\nS93hrQ7oNW7Qg+5Lbq2b6Kq5vYC+S+65KQF+itLoQVU9ggx15zoOarsHz5jF\nQV/o\r\n=DJx1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW/g2pIRF37WJtJ3DTu1p3+S7E8MtgcOyjzVc7jbkmnQIgUf6w5XbItYuiOk6phf6LnbacHzulaCBJw+Fx0mJyTQQ="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.3-dev.d3f6ffd.0_1612881335465_0.3146438274359462"},"_hasShrinkwrap":false},"0.3.2":{"name":"@superfluid-finance/js-sdk","version":"0.3.2","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"0.2.6","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.2","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-XDsoKWJG7Pu4NFftUXBrih+VPHXs3960WNAsLaj7AY0dhKDn8gMtbaXyOUGoBenjPkeetsmDikqfb5tCQEDgNQ==","shasum":"86882b0d0a5337137b64ac14698f4aec2edf319c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.2.tgz","fileCount":18,"unpackedSize":180107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIqo5CRA9TVsSAnZWagAASwkP/iQqjnGkfYQo/tq0+iVe\n987HIGRlcqvjGKfglvOmxY8BKO8+SV+OsIl6zRqd8PrCcS+kbBKsWq/o8yYF\nu+YSOdxnifonUPNMX6i3J+bB9+Ln+awmzPgr18/JH7bH/M7gSPoF1mDVW5Yi\nFBHL8nhEmFLjmLMJWU373EWQPxP5CO15iTUcM9UvyLWMqDWiMRQU7RL7illS\nVtW/f2KEWnfB8sfdxBr+EQpN+R6UYebm6tqEN1fc5DCsVoAQ8/32l/UrPttQ\n9PMxvoKIbqY72cGtbSP6v16yjlvDERQGLOXpKjV67bA75iAJdgBqogBh7PRg\nGR8TssTFpFyDE3fgVoxK8/lNxBvTGuj2oizr3TcfuXtSfwqFd3gLWSSsIPVn\nKSLqV5mUyIN7Men80sxW6j4PLvOpLhQTLgA+BuFnt0/ymBasjgVsqvoJdXyb\n8S3JWjSBWBGHkGVS9EmjJV9dCEQHGqLiXDf71n/B7Spae6jksJt8RVGAg3Bi\nIEgyST5WpYWpkmEIbnU50Zj1kw8c7y7Q7/j3Lr6BIMVVWQEnIFRUNOwja2Ws\nB15LmkUV17E8beWOJ52O7IWWm1kik2UUFYuOKVbMQZGTyHt9NjRAmTu2VGf+\n5LQp2/MCUMVUFDK1A/7vFAYHJQWE/JsgQLlntirGta/cfklsYW7oRD1YGKQW\nw/2S\r\n=Zi51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCevXt3UPdEeIFP+KUT/6q5xB10Gal0GcbhfgWuVNnCiQIhAOIx0rfOteoQu04Y/zS+F6WeqrjWyF1jRTKoIZeuihcA"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.2_1612884537353_0.9307577794064368"},"_hasShrinkwrap":false},"0.3.3":{"name":"@superfluid-finance/js-sdk","version":"0.3.3","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"0.2.7","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.3","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-aQHRDV945pLRYlzK2JOwD98reX8OPXr2CFFyHcIbXE6+SaEJU5lmYRC3EWhM4EVLe3Ba6tlTIubiF1l5B6SV+g==","shasum":"ef0062c9ba3f7270d465ca443bd54f161296a5b5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.3.tgz","fileCount":18,"unpackedSize":180389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIxdfCRA9TVsSAnZWagAAT+gP/11SEKZ3XPbIvw98Jczn\nSEUa+d1036Kefl1+NIxt0h4PwVHOq/zzykhCHTz84mnWDdS7kNgYCrY1r/wQ\nn3yiHZ/8gaWU/KEbUdTlYWmSedz4YerOc83ySHDeWf6cKulG/LwUarAG+frE\nYASZNMD1HfgobyzYBKMb+e4vy4W03i/YLYt1S0jrv7GfPTZv0pAdYSD18DRV\nLiJlMfga7XA6b+oxf+ELZxJz5R4TbyU+ZA2v3hKYxWfCImH7YwucKQBeVAVJ\nlC7x0hXDtO7IPT6DUTFgUC3jdI2k4ek/WHc+zdmifiuk8F0EhTfodoXkps4f\nmvhmRW649y2kEQa+MPv3Etqwcr1a8A/mFjZu4JOlWsKE7Qet+Hqrm3sIcACO\nHj2dmm9CZobxUEH0N6ZXWThFVPK9kAyJsiq1PbSzsMncyxaA0IztX2gNNsYX\nhOTkPSNhoR+f7w/AJIG7TEFevv9qYHWxKOh2UDgmVXErT7lxqDkCGlbH2A2l\nSRgCFh1VkMaM9UMFTguWXZ5VAR6y/IWDatO+jEkxLe7oz5uDWgjt4aSDCEBo\nuGZv2DInlQuUNKtIsmDVfYPSDXUHKbbSNV9TyHeh6Foq912qwddCr4ob/nPr\nHi+a241gn2rrbjmAsAmgDp2RlTDLPJ2KpedpP2GMwFnOWmaaWrfxC1iRzNo5\n7/SQ\r\n=AOpf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFnXGOJp7lUGn5aScoBLgFOTYT+Ju1VESyGLVM8PKTQdAiB+aU+1hpQKVnVEHbWJv3MiNj3ihZFMI7BSbKhX9gNjug=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.3_1612912479445_0.6872843240324709"},"_hasShrinkwrap":false},"0.3.4-dev.018eac0.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.4-dev.018eac0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.8-dev.018eac0.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.4-dev.018eac0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-/tc+JL/qNYuLBl7hLUo7hKeeii8vEps0WfzrPgmmg4AbZd8/GZsUBEwuh3xjo0Q2hgJOpHfK7O0qJuEToAqM8w==","shasum":"3b0395027cdd8b12941702dc4da36e097d12547c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.4-dev.018eac0.0.tgz","fileCount":18,"unpackedSize":180418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIxgECRA9TVsSAnZWagAAKKQP/2qvcac1lS2fIQx2XwSa\nEt2Kf4mb7JDuJB4rctRoOD+15ygkCYfQoYahrmZn8Rj00NxcvUxbQtoJkCke\n9QScmVURlGpL9fsJgR/3XSC9EeJd1xXBanqkZ6XHUaN4Mem6ywolOm8d/Bgl\nY8whZCNxUXInd+dp4yeIaeYCHfDCAZdwJ4tYQfJEr9O7e0x/RiA0OB6Mc9dk\nw/wyXQhzHBzVlzWT00N/gfnEBtngleOviMwrI4504UkNXXJNbCgNzSL++/me\nVHMXNYkJ+aiHdmD9R/8ZLljAc9myhgvEvZqjxMUdoApf5Mzuy+mbsItHN6TQ\nUqWItdgtQjrhmFIQDTvih2BI2S0MQnsxQ/0eLlmRBIv+MGD5ngl7t6nNfyyn\nMPCGM/bs0qFAxk5Jc49GT0RKlL2Qa61vP5L9//flg+Ahh0iW4KPDEi3jw69d\nyRr3FHOOHvuxtUlYFPn8Opm5FfP2hxxIoCG88sryUx9/fAiNDSpisGoplSAr\nYmehsBcYh5ebAOmu24VB7DfshabzmW0H1h0K5MrzuDTNWf5VQGgI48QJ+1se\nx0yySNdMtGa89B4D3AXBHGrRbGM9kv6EOcFaKhg7nxiLcY1TeSbG7hG6MGJX\nl70suyoppf0e8F2dgoo2hpNvv7nypr/bkoJj7noyogrA/ok+TJa95ysKRsXt\nYxKK\r\n=Hz15\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYekz0/GHhnle1BIxneNAILq3fsQU3AqLF0j0C+o21wAiEAxxEiSYrMYwZgPt5zbth9yTBjf6EbraS+jx3wVJ7wyIA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.4-dev.018eac0.0_1612912643907_0.5266790618646462"},"_hasShrinkwrap":false},"0.3.4-dev.a55caff.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.4-dev.a55caff.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.8-dev.a55caff.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.4-dev.a55caff.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-yJfty/GSPYNIhLVfK4SekpvjgbW/hvdeWSz1Uek4SJPi5CjjigMo28pkJixdsGetxnuWKw5EuxhXoePas4izXA==","shasum":"1eb4a49b1a6123070610a62985ddd8280a509d28","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.4-dev.a55caff.0.tgz","fileCount":18,"unpackedSize":180418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJDHwCRA9TVsSAnZWagAA3sAP/3PA4g3LwJemlQClELyj\nbQxAxGoEznXNFUeHIApqEVeMV+LDfv+eZyeIieoJxewk2LsCTZMPd+1OKziS\nKbT3O7RA8dRYDLrrWsdQrf7kNdrODakxTy83YoLgOuH+v9yuXMjDMAUxFr3W\numkIih0v4/3CLvNpt3DZxYcBJyMmSI03l8WM+FojO6yEPyk2hj9jQspXFhJE\nsDW4x3Z5iRL61B8KCuKpRl+t4i9IsHqOyepFH8GmrnjQ632/iXL//LrNfLYd\nKy5PKK+Pa/tw5I9R7q7ug61fpGsVCYD08a7KmyrnkdDZnacTnxw/DmD2VCFj\nknvBC/n8J20J83FYT1oF6MxpIMMJFuZmpQjYZYsFkGshajmavoXOe6YHNkkQ\nG9VW5+UBTpfiN7pg3aJPBdtczq0G90UCPi9+k8U0NTvshDPNst+6a8apXoFM\n4wgN6B2bVqn4AibNcxtQrVZwT8qxH4aSU807ODwzNH4yrlFFxFuBgR+Yhc1c\nQ4yM3kBP84RfJL9mXd0iJEyEoGPTyWduBhX1fA0yIN8xpVLqwgKtn9eLjZLA\nvZUS5V8nu1JpAy3hDgy9E0k49qwuv+jskMJKnpcn7art0QpxqOvp+/Vs/5um\npwKuAhQ7jfa3vW3RZI7JeGcsQMALKs+L4I0Uh7P/E5QY5u3kC8KfDPJgvjOf\nYRsq\r\n=ZV/N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRv28VEC+82RzpgzMtuIEDPuEtsoOCnaPpKHVHaqH+QAiAYaS7lRzM4PxaS4tNJepjqpBi5xXsMzwZdE5NRBjLcvA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.4-dev.a55caff.0_1612984816101_0.38817983208648177"},"_hasShrinkwrap":false},"0.3.4-dev.46f8324.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.4-dev.46f8324.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.8-dev.46f8324.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.4-dev.46f8324.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-sIH/PCJ5Wy/BJU0Bf08idjaT0wByb54saPfJth6ahZIpq7h3HyFlN+GK6gm/VoMrnt1Fm0fP+pQf9gkG2Tw2yw==","shasum":"fcf98bdfdd043f5538492247776b9c4f3145596b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.4-dev.46f8324.0.tgz","fileCount":18,"unpackedSize":180418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJPSeCRA9TVsSAnZWagAARi0QAIhRlEYqvKk4ifeGMAaH\n7hN9IUEz6s/G/KR/yAiBgkw5qYq2lLB21IoFy9K5PJH4Wi8XjG7pLglHOFPD\nA6TaYEM+7eWz0zToEKrSvg70GkRmnHM5oyanMjOGgQtorejSI/H2TX2pA+ft\nq8F9eXm91MDFFQUYJ45ro//r7wswMmL7Vzqm2l28hm2QkL0Lh3sZFT9a1+NP\nw9DF3KCVZZhwzXbhp953orBE5kMBIiCWlVYWkBoxz8Mwzj9JMxaYGZ4bDhPa\nYjcWFi7O6O6TkVBQ3SDEpihMWlaWpn9HyKYX7jQ3M4TvJGfWiPEbypOG2nTt\njB/6zbBVOCuBJYbtSgxz4Q5/idlAvbjAu3Rk+zceY+EtGT0bwtKV1UjnyKRM\nioExRSSFksWpO1zjKSXos8+P8bTVKrEblsfr3ynjx8Ng0Qt5/txlGsuI3kRp\nXFsip4XmWr249cTkGWocEzqnYUUeMWx4zRq5104zoZXodqX1hd90PhFlEMNp\n7IORoTttNn9YscAcNvw9oBa72uw0c2QmjSSuiJD2LEnvKXkv50lgMofXZaSj\nZ7nO9An0nD0kJulB8xwmVawKUPdlhdP3CVlU2L7TmfEZcpMo+63FtAO2sj+y\nDGwq32KXLD7AL6bnRDJpiH1qMgXCQEi/ynpy75eI+yJMqLc8ylfZcsHSLA2t\nMwgl\r\n=VRjA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxnZkSNer0xvuLZ8uWnawwkMqhvNha+9F+psua6q01bgIhAMVau/56FEbY+xHIx2bzWD1P2cDz+r1eyrRA5wbWpk4U"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.4-dev.46f8324.0_1613034654081_0.7130362662566012"},"_hasShrinkwrap":false},"0.3.5-dev.8c3ef30.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.5-dev.8c3ef30.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.8c3ef30.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.5-dev.8c3ef30.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-uvxY13+Wz1NmaYq9hS/12YgZv+B3sUWfTjE2Zndi+Dox3WCM7Ak4NU5K9uhfcASUvv/3RbW0CazB0P/6eJqeew==","shasum":"51c46928da47e854f717ba75d84ca5bae7bbc243","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.5-dev.8c3ef30.0.tgz","fileCount":18,"unpackedSize":181097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJYVDCRA9TVsSAnZWagAASd8P/3RjmjB3UMSZxzY+74Lv\nkBBp6oGGer/1uq8eLZyxWGoLasFJ2+HLJKulOv4sr10WdNFNpjxc9znjenUc\n1WXblbzWWHGHhZd86Js8dqQQlmLQaaDUZ9n+BuuEi47j2ZbnHhaWUef2oy5Q\nPl0oLmqNKZy6JQLQ94lKGcAf39NMkp9gqiG327h75Us/YNvHY84iSwqiAdpH\nJuS5ZYTRS7kkhG9k2KVWQxl4j67+spfmxxPXYeu9+g32pd0uA7f7+lX7f0YQ\nZy0ZKdJ4yt+BLmwO1ggVc3uyFpAOXL3cYmYj3KAiICFeQ5Qfua4kS695CpiT\nrvytnH/ZSdCi+yda1gczk9Q1QhVaktnZv6Q4e0rh2gd2j7c+pJRW1FjneGQQ\n2+8iyrPiRpvwq15JT3RqGcen/bv/dLsuPSvR1F9BGXoNL3FYbrljI9wZhhy7\n1EavZrxMrel63jMpIDBcXvy95wU5EhdUta+b5M2JnxICELhV1VpP1TIreej6\nLgcsFSafqYUWVv9u4n3y4MLpZLOW5rqLM8+ezPK+c2gfuvrq1ynFuXc1aQ1Z\ncqYA5MJOna9ePkwvWIuya49ojXKT+BJTL5bghAfGobvGHZRDgilN050SJS29\nsL91k18FCw/aaeQuGSVr5vuUeGPPr8tjQUYjh6A3E/Y8to05UTv7KH3oZIRd\nKlTn\r\n=B15N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyerdvtOOqXr6bY/ejWHCBLmeepahjim2fBuNir47lGQIgMMWD9VXFS2NjAoX4fBpoQs4jc6rVeCApJ4dKdT4YGgo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.5-dev.8c3ef30.0_1613071683046_0.5920066320135391"},"_hasShrinkwrap":false},"0.3.5-dev.857ac81.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.5-dev.857ac81.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.857ac81.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.5-dev.857ac81.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-NMY4AZV3SmnbslOlYXRgf6qyewdFZBGYE6tuws3tSnZekknQgwIlz97FLaAHc/kKemBtioR6rInL+WwVQ+MHFQ==","shasum":"541b562ca5891a8d25c389e350aadb16809464bb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.5-dev.857ac81.0.tgz","fileCount":18,"unpackedSize":181097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJm7KCRA9TVsSAnZWagAAEFEP/j3lTv0EKT/AjIPZ3ww3\nWrv34asFf7KCuCvHbwJLwTkxyaiLsfqeq1/9dgNQwHQ7LNo+wiVWV5A1EdCx\nqkHAZScWxwsbMVjEcm/kIb7rTXd62ncD3d6rcTCnS0OT5HyF4esINP1mDh1g\nkNT2CZYSQfJyOuWP4p5QDz7aGtfNSi8Zqf5oBpGhcnFi8vNeunSBsUf/M+bT\n9Tn1G4xP/5xM26ze3b5BlomxdRvMjkVSkJk8DCFhP1dXTbXyXIqPD56IsS95\nVl7SnhACNPBuhFcuibLpHQiFHX4/T949jxSGPGHKyDSGhz+wcmu/j/MUVSQ4\nBQsxUqvbopsQBYjiXE1iGVcHdvUgG5oiP+lK2kath9Nt3ZbT/MJC1e3bXh9A\nX0crkP3OpUmsYYGqq38g3W2dYaz/c07VHVbSbJ4jTHlZqyguPlayjcOB+PsT\nlpBXfgW00ktI647DsusIQYoffJwf3UTE0aSfZaKXVfTX5seG6W1WYRyyk6Rb\nmWm7DZzjkks9Ag13MF0Vk4LB8CgG604heCftntxftel3GgMrLmJNQNCqHmcM\nJxVWnQufHaTMxYWJJamhVLiSfYaiSofPajjG8fYbfsaPcjMTxnV1PXE1i39A\nnm5Q09Oynrk5n+tlZ+i5r6J7J/FG3kIqHGqPR1RTd/SDdgZHHuQpg3+VO0mN\nk7Ng\r\n=YBcU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmVF8FhW6P8FEKwnuv4wsQlVrOQiM84v5+EYLCVBw6VAiASvbjKwP2RkJl2M4/013dYzE5BKvp+Tnp5LTGJJw+4CA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.5-dev.857ac81.0_1613131465906_0.6922332981825463"},"_hasShrinkwrap":false},"0.3.4":{"name":"@superfluid-finance/js-sdk","version":"0.3.4","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"0.2.8","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.4","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-lxErjK+GmM10Zm8MvOS3NhIq1at3CgakT4LKyP1oFDzPCc4YB5AGW4yROI3+y9Pta6E2y9zIkDwCTzsTXbJCfg==","shasum":"e0f98c620b89afe00e47839c2ba58748e0823b9f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.4.tgz","fileCount":18,"unpackedSize":181068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJoWPCRA9TVsSAnZWagAAm6wP+gNW1tV476KvjPa7oMzk\n9vMvGrqt5eed4mcJdUfIXg1MwOaoKuMYp79AgMRzIsH594AzKPtZyojbDuo+\nle7GSW00oVRoxyCRR2fclPB5l8iIOzkBAsl6PdLWU0QbbQwp4XOm29VXkAB1\nTfoW92MFGZHQDq1yVD05GyouUD4GcXDyVH7n2fjDpBu5JwkJvAUSbhzrC/S7\nIRnB3IBnh8tfyundHM0CnIhz+TizesQTWY4r4UPF6L4Fg81mEXmqJij9gxGW\n39pyArYcKSb2Kx5rs8xr595Uz7sAv247ADGejh1tsRdwM/zRXCtyOXqU+hww\nKDkwUEy1jj6UzquBTK3prBYRiAm0uZV/9BiAhdMT44NfRNp08peLBcRa40YI\nmPykEALlYaDUra1zjtFtweUqTFyE4rIfpGk1mfovTpi3TTsLptgnwRtm8sqy\ntqyl79x4OpgNX4AQYzWmU4LRPaWgJFYePmKx69csQLiEUkaGt/xZIW4Bzw22\nONojRG7eXo0trfiXm/eH8tVZFP9oTc3KZ8adxVZZthP9oF/Wu/1dsXEsSzpm\nsNOMrd82gL12ON5lGLZti+dCij58oy2TnSMVpUvsyV0B39RIf9ZEjCkYwiR4\n/28FT6Ofuxl4058aRGbbqPv3ZmF1zEiCmptFz+RHbwcx8fXZjfbWOHB42tZU\nzOUC\r\n=zI2G\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAn6oeGwi17s2DHjXB9uSupW+FpMkTQ7FTENFPs/pZ6iAiEA/78JFFs1GjbNuC671qmd9pucDzhwfzoZdiFIzyPA/9U="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.4_1613137294946_0.14573157988977847"},"_hasShrinkwrap":false},"0.3.6-dev.1a82c5b.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.6-dev.1a82c5b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.1a82c5b.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.6-dev.1a82c5b.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-wzArmdnzJCqVxHylABRuIV4KWZFgBJ9oX/GFj+cewH/b635poDn3hMIiQE38Q1IW0mr77i/RspILdP0bdVHhxA==","shasum":"78b247004e9ccb2c8dd050ab731fe3d45edeca62","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.6-dev.1a82c5b.0.tgz","fileCount":18,"unpackedSize":181333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJodFCRA9TVsSAnZWagAAVDEP/RxWuWgWi17YXaN9lgPl\nYTi81M13m1VY+yVSmrEB/M9ZrFzrLQ/5QGugQLu1eN7ORiDpBs31cAVTTQn3\n3QlRs9s30R2xX2GE62R0UbcLGyi68TRcLbHdtenps3V2+3Ldd3ImHFARnnJw\nPDpYdQT0EDw7RzFl75DVtysjC/2Cs95K8vRfuKEnMCRGjIQiWnZE5yg0zP84\nSL0f/xFzYJE1HcwMcGr/hCHcxFpQBkHImADVEJqfJ9sR9CMW07vZbO4ojcI6\n16LibWjupoh1CcGAdQb+fEGmzxUoq92u9HZ4RNFJ118wql9mY0b1on7TC8k2\nPnVmYJ9MaBVrd4gUONGqkqOBGMByLpmdE+n0Bx1skZjiHc7wOaA9s7jXk/xG\ni08osxVGpsEWN++cfXy0mbW8UOikMTphYxjxWZqEkwllN9KdDGkHEMkLa+8H\n5nBm2S+8uDiFoIr0guW2eDhvJOXkNW7TFlDMVg3kmtsQIFLMEcIaL/dvcTS6\nsCAZexJOzXH/1Hiqi/Rau/yBs7hMkIzG3YrpWbiKMEKFoktSRpUVifuR4DyS\nsEQAtaZC3J6X1i7mcX4JRbNSI1+ppqTAZ6u0M2BfIj4Nd80sukTX0KPA4ARe\nm0HS+tG94qs8hAentIbHXHDbbB/iCtbIprorhd2ztB5gO8joj5ouhol9XJen\noPQv\r\n=41po\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpdhE4H/BrSR1ezdGyu3H5f55wnngqdzzoYUPF9fpuawIhAMz8MDh/4QYUp6dBFCiQCpZGjmIGKzRVOIQycfr8O21t"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.6-dev.1a82c5b.0_1613137733359_0.8806345076610185"},"_hasShrinkwrap":false},"0.3.5":{"name":"@superfluid-finance/js-sdk","version":"0.3.5","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"0.2.8","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.5","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-MMv0SIuEfDsBVgox98E1h/UoHMZfmx240p6rqR1favqLNH3jwKvXFGHAc5Xw/hcT36KkFXMk7xqGmRPlfB1dNg==","shasum":"67a592f241448ab8a9c00174f532933e27310f90","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.5.tgz","fileCount":18,"unpackedSize":181304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJonVCRA9TVsSAnZWagAAnwEP/R3USNe0lhyM21l4ZYeP\nT8FN+e/Ime3GLv6/qldw4PF8D6ovg/qabKiq+yoQ9r3Q0vtHQhbtJ5ubaogY\n5B16JeuorSDnpMArq3KWbXoHKvZHO2ZiA+vgGqqO1NMI7XNhqvy/6YrernJg\npxdmPhALS8Um/uadmGJVCfAUg3ezW1QXZQsWtUWlFARsjqhKM1rSzGXHAeWq\nCHjVz1i0PkDuHyKNCWgaxaFlqMpZZdnaTDH8W6Fsj1Gw9fmD5iaW887xAVXU\nSFb8ven4Rul8zTAkA3i0LIt52HNbiDrlQqvXlDWKZ67jWwUJhVF1Qg6x2/xO\njDA+Nay5CB2z7bIX/MSHasF8hVUZl5NPs9ucRQDl0Kqufrs9qDujUY+xqjMT\nACbzsVG4RT+Eam1wUzNGBzOMEDuoleTydR80bmp1l+JDqy7xImUiN++4/ip1\nQBgJdOBe1cCApBpSPnNBfXALfG70s3I8pTL6Qh1c13ZuG3nmFgwRRkleIQDk\nPRmi2CUGLfNH6Vjo/zNLAQA3OV3ZePFlPlwvxywc8XmUn414pLLM/mVUtt3M\n+YFTbqPpxe4yVMhxHb9OHCdi5+0+dAR4F7uie3rOwfJ73CbdlUZgR8YT/L5S\nQayvfIuWqVCGHxLl9aUOJes171E5uhj3so2oXZgxE4jl+9cV/kCaAgT/KV24\nGcPc\r\n=PvEU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjuQsSuEOU+kYDR3MF9bFlkuNe/2cXa+rhh3G0o25OqAIhAPmuG8XZAcUEaLYAaobKgBcmD0mNOfd4x3Aoie89wzm4"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.5_1613138389318_0.1516570926502918"},"_hasShrinkwrap":false},"0.3.6-dev.51583a4.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.6-dev.51583a4.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.10","@truffle/contract":"4.3.6"},"devDependencies":{"@decentral.ee/web3-helpers":"0.3.5","@ethersproject/contracts":"^5.0.10","@ethersproject/providers":"^5.0.21","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.51583a4.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.21.2","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.6-dev.51583a4.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-l5FEGOhpo48oC4B5RBV9J8Lk/piAhBy0rRxLov1y5HTE9u0sG+uWwEmszqYBLLqvxP76Ai0Q3fU9+gCK6eqqFw==","shasum":"d15e396f3407ef6f0503641464166bbb343a874b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.6-dev.51583a4.0.tgz","fileCount":18,"unpackedSize":181333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJ+K8CRA9TVsSAnZWagAAimgP/331pw4tBhHTBfy4UN6v\nZV3A2rBnvUOr5+nQEIrQH3tNLhEZkM7+egiyUc3Pkljk9jBGrYSENaDnI4uU\ndgqEO/fr4HV12P6ZOere3ndJR+85QpJZ4/wjhYTaDWFysc477EGDiI7s5Njm\nc3FkzIQCfzf+6qbbXuM+n9naZYfmL/SIUrhrX5aPvt7c71ciS7z2PK0vwoYg\nkMtMAF0lHQw3WhQcUEYS9/9mVlHAt2mBbSoOl7fUs85gIZb39bM8Uu98qmiW\nU4SZUDgaX7BI8WKibFgkc+GjTPMTCEqVVCiNXitIXMeUybBXPwDAbaCMOQ7v\nG7ZVgVVFgLrOiDXhhfSRW+jmoyvSjwabcRAimjYItky8y741hiF0u9L5kmfN\nUkj+t6WCHvZjazTnqEUBAfUDKpGtASXbQC9wI89CYoS1LjuhXFeb2XXgkzfJ\nnd4YKGC8quaYXWB0JoGrPpTUn8OoxIQz8+J+Nj/O4KtayKrSTy26skIXaC7l\nA0gbLGoAl0MkTkWXNd0VxcrsNeXw4duEFBUw98mcftGgT57ILT5dudTACzu+\n3LIJzpT3ue2/23UnxbjfV1KWyOoKv8wNmgoEj5I4qARpAP35T30rfFxOS79l\nIVCUTVHyqLveIF8UfqHqgYSMoaIEZI1vDJ5F7PMZEkStnxkqIg7XxxE0+xKM\n74bA\r\n=2W9V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4EOPXCp/QK9Ezj/slZfcCHbHc3m6fCIH6OnUheHtYnQIgZpvXXe7ZcixXkEDqMlccOE/dBr+1W+gu05e7OgeEHZI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.6-dev.51583a4.0_1613226683810_0.30585956140199055"},"_hasShrinkwrap":false},"0.3.6-dev.20237eb.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.6-dev.20237eb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.20237eb.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.6-dev.20237eb.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-H1MWH691tj5rjOUhArCytsFKdSaEWkUGd2BYiI+37knp1ShQk8/NfBgEkw0+DBEvy7L2pkGAh9/A5hUO5jrI3A==","shasum":"c1c9914d976988885b23f8af26f61c87965a8c47","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.6-dev.20237eb.0.tgz","fileCount":18,"unpackedSize":181460,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK5G7CRA9TVsSAnZWagAALFYP/0biSVQdknJ/oOyK3zFZ\nbs28BVJFljvTCNTFryKONrYsdIQ27+oBX5u7QHgZk08xP4W1YZDTcLKt/q0o\n0bKzIhUmVTtOjFYsHgsNzfvhgDpEGCYPoVGIjsjWkznahO5XLXFyWsSX/e/9\nizsM+zCx6fSGhXfxMyPqWIVWFawtAwhsj40//OdZV1u7+jMbjE5PcSjFVhL5\nb/i3BrvUJVoYi2jM80FD3hSobwUuxu228IgIIGsuFp4WCY+rHtAZosFqW8gu\n4Ukp+soUHwhPZTAz1VM7iBhZy+7xl6zHp58YrGUY8qo8nl4B5tEnHTHiLX4i\nKNmWNvdTlSVyh9FQuESXtkbpsy3tVJ7rCjgoUZagrT3C/b1a1YOGPN3jqkFf\nzrAuPlMSYll76f8OwB5ANZkE6RaYCbBL0QnMPzrq6mDyYC6vXIrfGxC45XH+\nW9UbrCqmBy9/myEU2U6Ujbyu9MEcXa5zWDOyAoQs9pRjNbMHyjcLyc1weA4P\nIeT+aJ+T7JKOQi70ciOgE5PfNhxLsPqOOl5Fln3Rpufo4aIepJlLgKfRFDLJ\n4BfI3UpOynXg4ap1S3h3ecQX2SV9BzT7NTNjz5AfM5mVCvCH0XwPG15iKEn1\nVz/9+KA0QLicsFrzzpBD/8CZu+z/JwYSKEkYkv1Yx4YBXiEzsHDr7DNCEMNn\nSFll\r\n=m7QQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx04LQ6YOc8UnSj0cxq3vZR9ZjcAImwYc0IFmU/UL2lgIgfmLZZDg96ySpeNVt9xBWJ6Y5ybXmzQOO7xkuAQHXt9w="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.6-dev.20237eb.0_1613468090842_0.6774134613881564"},"_hasShrinkwrap":false},"0.3.6-dev.fa91f90.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.6-dev.fa91f90.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.fa91f90.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.6-dev.fa91f90.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-5MWgAbXr2YxXTHQTgOLi+9D5Jnj8ykNv1rA0H1pMrMvR3XvZ7qcNh+dymnHHaKnICHTv0Na9NMGQNV2q2naUDA==","shasum":"2d50d69783534a315f5ceec6e5ad68c52a51159f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.6-dev.fa91f90.0.tgz","fileCount":18,"unpackedSize":181715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK+6+CRA9TVsSAnZWagAA4OMQAIhf++iMX2/BnmiZJZIJ\n0zpdxARx9rDo6CVvJ3/MuDgif38Fpe09n2180C5kKvnfaNrChcXc5yfi3Rsj\nQOimYNKmE0pHRJr+IIqzKQqLrLa36pVWvHXAaafoM5Hkt7f0GNEm/5nznxUZ\n+aBso0My3dmkVKggDui+QHUeMvASvSxuEF/6v05uZvL5plQElMso3ASeIOrM\nfahFLpl25pTPQmwbjyuW0VCM+FeMuYheyyiUyxD0A+j7IAXUE9x4cVJM8jg0\ne9R8LQJL8TRGKkLpcSJmIf/DTiJo/8OmrVsFFV5XvjZTDMR47cZEW3uwafT6\n+CTkV0nFvkrIoAzDzDF0adtN9xrMUqI1ZBsRVQ6xw6DZzMVfiH/QqqkB8CNP\nBLM0zBfJHTo7xKogrOiG0z80XymfcbC9SZnYFEF7Es8Ir8/LD9qhSxeWYCK7\n1GHmK9b/AWrYCZKs57k9WdskYyWTBHlNvDAiMtkxxrUuxO5uNnG77RVB1LxQ\nDq1GE1268wURnrrHWm2reLDJQWuM4A2eVzQSQeob7GARzkEC4JnWI85IYWjg\na3mmIzkSaQDgK6KkHrpASJccc3Veb/pvrpd/LfsG87R0ZSGfn/UMBnFrXdxI\nD3gokLq49YefCAxnVDMLX4h5IF1uGdXMrT/OEbZzSHhA0R+MYlVaQkUXexEw\nvndX\r\n=fbD/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG7FpkpPKPnTD1l7igwmN9UAGQZ659Q3vInov/EMh/jQIgPr6f7og6VXIy5usA7czVq0ccVEg5cEFCho2BLYBs12c="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.6-dev.fa91f90.0_1613491901881_0.211203434960604"},"_hasShrinkwrap":false},"0.3.7-dev.48f8021.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.7-dev.48f8021.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.48f8021.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.7-dev.48f8021.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-R2ZGSsvY5GoAIc/EWumC7pVLF++uWWVfy7kVbLHIqp2kGQikeo1BtfVfFGqo/I0NbnnXP6J3kBFGwWK8eU7XRQ==","shasum":"411fa736693df992283dd20bdb30f46e22d94e43","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.7-dev.48f8021.0.tgz","fileCount":18,"unpackedSize":181872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLC0sCRA9TVsSAnZWagAAOUIQAJsPW/jVzMIAoKzgEWv5\nbyQf9OzC2GHsXnlLZ9KJ3ofeBgC/M3WvfEmlYxNYl+7S6OZF9ecCunvDw8OL\n2aZQ7ru7n2jg6RXBWg390eniEbUDkHFTZGiT8drWUai2sl4EVsYCMnYqyWFH\nXvBtXtFG+odTGWW7pJ5RW/oryutTUKq1AGSL03D2sumdtqb5eFoD4Um6qpxh\nU2YHiDvuVf8I+9TMgfXHMqmY7hyElxpP833fn3lhyEzEeR2YRV/ogwMiDZLu\nS6YqnKz7nmKxoBtJVRdmOkfpWNvJvXPyg7damnSfL99ql6qkpmoRqYwpha7l\nI9xqrKe2aGyeSzmULGfeYT2t1FJVxYEgioHy/2Pg6MhSmMONhXYNKqTElpai\nRG4fHPscKs1LTCW0tsH6/FsssTjtlpjQNtr8QavzMgRlnyvuTjZi7xJf1Hsw\nidlpY3hIUGtcewxU++Jmt1tIurDSUZPB6ciA1PqjauPM/X8eEUab6BX3ovcO\nHYFEgBss3IAOzKgxxsRUMJcsXHeKvqvf7494qNZmGXLw7GetY9woH/eTg6if\n6ltw01/kWWyM1p8+mjjVgnUonMc0uC0zyzSVZzERgMZI5q3Q6nfkLVk/+OC1\nmwAwmepvzQVbxsY9XWYq5HjbK6SVEZ5w+NLfqNqhmwHQmlqnbdk0LBOakoWV\nEb8Z\r\n=uw+k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD34qbzQ7Ffelo6SOPafN1c5uX6B07E3MCafw6gzWAdVgIgZza+SroD9B8tpNPo4bnlXaBzCO2yM5NirCeJ57Xx/ec="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.7-dev.48f8021.0_1613507883829_0.018062234037726332"},"_hasShrinkwrap":false},"0.3.7-dev.97fb145.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.7-dev.97fb145.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.97fb145.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.7-dev.97fb145.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-qEL6JgiGeF5PlUT+Gs6+k3tV360HmAvpq3nDCL5FaqJuTPhyoq3DQgrfXR8/Az4R8pEcrNRUnnKEEWCXJlRf+A==","shasum":"106686c4b8940d172e56a1205354186ff5d60818","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.7-dev.97fb145.0.tgz","fileCount":18,"unpackedSize":184548,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL9JrCRA9TVsSAnZWagAAtQ0P/A1nUeJHIxGOV/E0/YGb\nnyxdz1YpUtt7D8qkTBLLJ08mpaGRrk/irtrF567TlQvey6hjyd7iYraFnZ7Z\nP1TLHTn8F8angIqsZ2kySycVPQPz7Mk/5m6Sec3szIXXzyOgdd7ICSZSnrKI\nqybnD9PmaZ308pAQp8PcQx0hBPrFd8c0PV2KBS+CjzKqiMg49Yytwe/GS33W\n5XftF/6aMfK0DY/b7UldaCiN7NhH4GMs1Ywb5+c1cZlXVYOg+mZplWN/rYwS\nxqmV9Z/dWtD1sMzyRCj/Cm5QQohDm6SX1U7XGc8LsQYtnx83ezYDgL92Nw1w\nvtV9raC0H9fPhbh5ztrPZuUi68XSlmkYRUD6ccmzlagdl2Wp7141XRWGQU3p\nBI5YBPv2NyZE517dBRRSYVRtIn4pKpXpWbYcmfyJWPR4KJLUYAThWX+KAmnV\neL5uyEK5ZMQtFzOAdWHQjCb9nccC9eruUOVStL7LLKxNaXUYEftav6WJbcuC\n40frLWTBQVUDAxfrIReTrvVTpr1DdJHcDWEva65gr7GaMoKmXwClw6lzr9EO\nXN8gQf6MlevmpuFf3FeOOrT29mJG+qIyJOMLFuHwJBwoFyf6Di6CBFXfOwN1\n+ETofcr79l6WdzOkYl8GLppDYmCYmUVu9y5Pg0gSLdKB/4ASpFnCt5HcSylA\n0bfm\r\n=glj7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDsY6i4As/SOlxM8d0JTo0QfKKwfqsS0mAgbvbO9wNtAAiARPkLgMa/oGi3KhA2ZcTer4xh7zveACImMqwDS2yI48A=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.7-dev.97fb145.0_1613746794535_0.011890288602157018"},"_hasShrinkwrap":false},"0.3.7-dev.8560ac5.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.7-dev.8560ac5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.8560ac5.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.7-dev.8560ac5.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1HaCGpYmBKiMLt42ZliFTkdICi3HOGeJf9DhihMma9hDpIBRfCIumJmT0Qwz5bwjaCSeOJfB/0y7FQxY4CXGPg==","shasum":"67f553a72b71774a824a538ad22775a17b157cc5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.7-dev.8560ac5.0.tgz","fileCount":18,"unpackedSize":184548,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMLnjCRA9TVsSAnZWagAAU5MP/RsK7P1I87R10drtIb79\nza0DStamXZ2fBproGK5YaT16cti9r19h2SW2wMUn7JaV3SADo47xBhg7nau6\n2on5iDuZiiyG9V/IAG3wYRRtkhD8IggHeBXD3IvPz+i1RgH8if00bI6PrOPw\neHoFF7a5mh5jJc3/r0KE3ftW4OmwS//9QkbJDrdJ15qYl+BxuiW65JCx1Ltj\nDATkmy6Ql9QBzf2wUdPsAf6IcEgP4JkKs90PQvjVrxRxZ+Hh2feU79+EV5Yw\nPkB8x103UQENx6Gd+wEJ7LfPAHs2k91gjAnRnM0Y/MmQ9CnesL18Wve6arLE\nkibDbb/8I83u/KA7LQrLqFfACfyfNEMzLWzLnZnj1+K67AJMWyhnX+JOTAd1\nWGCGMZw5RYasTaB6WuoLaNY8A9Vn93YyHzMGDe6u0BOVXqKQiB2+O9ZVk8pG\nPgYXhGbGTi76alL0u5HRbOUEAof5dHjaSA4RCAfQAPoYJFOOrOZ7BuwdhkMP\nqzxEB039fClCcIDXJCjo4qgk4ONECcJUC3lIfnPEd33r6GXcTjaRjmkFPzwL\n9Vf1hH8RA77A9iwZmcook7eDL1MTMauPr+4ys/oJxyZ1Rbho4hKrPNO2lTnG\ncC1SCpvlmTVmpQDO9fHHFcXGT9RoGzcbUeTrU6C7R96PBIs9o5gPkltBIUFG\nVb5V\r\n=Xyyu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfHH0vWOPL5YbqcumsZqQGKT3zBLA9rBMuII0jDwpoPAiEAih7ih4U2vbQXJ+hAiSrrNQDgySyMJLgxMCxcryqQLhE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.7-dev.8560ac5.0_1613806050681_0.6408586916630163"},"_hasShrinkwrap":false},"0.3.7-dev.03ddc74.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.7-dev.03ddc74.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^0.2.9-dev.03ddc74.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.7-dev.03ddc74.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-+2F1HttnHkRY1sYR/mo13N2/2sJeE5NMv3R7n5iA/94avmRuD0EHcCtpGFs0MSJNTzUYGKF+KsLAJzgK20UTBA==","shasum":"a0c6b2ef18af2c35d703e8af82f2a431774a3fa2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.7-dev.03ddc74.0.tgz","fileCount":18,"unpackedSize":184552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM9HCCRA9TVsSAnZWagAACdQP/1jmbqA/xtMDWj1T90JB\ncK/vz7v7rs45KnQe4Vm6ypm7T4mDVTKFuAakwjCi+bmqNtbRNix3H+5AaE5E\n73VkLYbqNr4lLue6AHi+qbXp0matM6PYuXGib8JYMdGxHLNXnMjZUVVgddnd\nnHmeCtgqFojcUf+QOWzz83PbKLR5C+XLNCMpBBHXemf4Etc425CdZA1IdF1h\nvfiNKLFrm8qJb2tNDAUb6XutoNERBxMQZJzWuGrz0ubWUWtruvA7/Q6yxX1t\noeXnwLgJo/p/aDSv5XC1PJsfZs1AZkSI8Vn5Zb57IBsPx1MaNrRjnpkInJug\nb6/LzihKrKUgYbinjUsw1QFj/F1VaL7WAq1ZMoKi4EkGTdqotO+9+bqClW8l\nO6NrcMrosMT/A+6qRbNRJ4xQBgM5ONzYTVF9hKznQAg2jc5GUiU4F0NGT/3o\nQ7KXlX2iCxUhRSr1B1kQMwGFlqABjMvMf6N4+YfDDKN7/0Qn+I4QnVp/6xo2\n5zRrEeEePljJMgZy0ANG6K4pzwJcCm9SvidBkxvN0niWxczptlyPNH54Z1Jl\nmSt1O8CU9QWFO38FrJtECTALIEawr7O/YjPEZ+ZJnBMbpqcQHnyyiVUNcEdd\nUxZ3+tCMJwezXgA/B9bf5VLDXhXU8GuUIzjZAfBvZOb7wI8Wi0c21Kze3KT3\nUman\r\n=yRgE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6VSww/RxKL8cCnDD3GKMVZwypW1/DgvTFORe1GpAkRAIgA8yxySBvA3Qh0/gfwdTyN2xese3utXe609P4ne8tpj8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.7-dev.03ddc74.0_1614008770098_0.1219214926529415"},"_hasShrinkwrap":false},"0.3.7-dev.3085235.0":{"name":"@superfluid-finance/js-sdk","version":"0.3.7-dev.3085235.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3085235.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.3.7-dev.3085235.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MLcPVA92UIL266UXjm3BfL2XcGw7NIzWbpJEb/cXW9976r8MtJwx2ecve8xuhQOHug0/gFXZJtU1KbC+ft+2NQ==","shasum":"90749bb6e44d74e378223128ba4ddfa5b2492dc8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.3.7-dev.3085235.0.tgz","fileCount":18,"unpackedSize":184921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNVnACRA9TVsSAnZWagAAvOQP/iXQguO4woO7N8V1sL6A\nyZX5ej/m5Avawr+52381dVY5dHpSPwoXRhmXffXEa9wOdOFdjsbwxKwpEzJl\npWiQxrjfoAtY6zmamsjkYgLX30ZWCIZoY5Oe8HisDRY9e+kAHpQxuUsTwN/c\nJnKgBpJ2Jjv7bQZjG11NVeonTr1AWOTOma5/oRtlW3cZMo4KDz0FRirVgPdv\nip5nIryJdhL2RSIqEtbCS0umIvSg6HJSMQNn9p4dWWiq2oaVkJKs5YYsF92d\n4y3fXIOfygvMFWkAcizovaT+M2uAbcXRviPaKigGvbNbEmL/y9QR3v2i1olw\nFtdctHfbJcpRKhmbYWyRe2+5Z/P+upnzoc2JA4KASL36OD4dpt6PcOgeHVcD\nokiuzwgaxy5SATEznh8Tob5TFZFMh2hExXF2A474iin2/bWUEq29Oy8O98hb\nYBW0bVsfD9UpBXr/XfcLgPdpWOIxwExzLXslgj4E3m4XrT3MLKKwF7NiATjJ\n26S4I3Q+NKlpD446kkyCoBb/P63PaFenz/N/v5adb/s/55Lqxsy0Uc73Mhi1\nxInI3im3BDasPktXb6PFNWZE6mAkdoE9vWHEBE2bqb0CILdF3KrYOO8bZKcE\nhLQjApypjfXmGcuwn2ECBKB/l3WW5MR2V3CXe184nR1EwETsOIlkiniJxs/g\nw07V\r\n=TlqZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzo8l2e4hpX+qbRV7evAfEXNcXRJRX7tH2B4vAiePjlgIhALITdRWvUMr2Z1BhAinwnQi9PM66X+AHG5dwBSjf0n+q"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.3.7-dev.3085235.0_1614109120392_0.28220853033857907"},"_hasShrinkwrap":false},"0.4.1-dev.22bf818.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.22bf818.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.7"},"devDependencies":{"@decentral.ee/web3-helpers":"0.4.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.22bf818.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.22.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.22bf818.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-801NP+e4bi1STEG4GJnGTdqsL+IxMC1gdZJ2boJNafz4f8CB9YPiTYZ3H1uyzAMvHBvhAdVEdhazeaqSqLN7hg==","shasum":"26dbebf2aa37f2d8c26f81d9e9b7d8bb2c94990b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.22bf818.0.tgz","fileCount":18,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNgpUCRA9TVsSAnZWagAA5vMP/jcIsWvlKzzXBLlf8PbH\nNnza49kLXPJReVIllD/xDavZMBFkYWORK7U8tI8FcEaWrISlFooKBhy1ZNhx\n2BqntoRPoLbxkWWmybfc4otrkNiAJIr52zA/dIOadvmoKRRfIA572kEIoUUO\nplmwRr5WcdOWYamS/Opl0eVE4L7F+lnlLch0AD0MkjJSZLv2OxrPVXbf2Mws\nf/7qSBshnhX8/d1KMuQJoDqiU4fJ6RkjQTqfKjM/5p5lhC320J6UmgE1uHkr\nOogdg69DM1bLReFCqAoQ9T3eazGwp0yc0a68MafX4RVVCIR/oVDoDDG9EeDL\nH920Yy8On795G4LFrL17WkLlSz75gbDzay61ooCFWbQRSMoDvyrcZ+MkTRZy\n0O3xzi+ygvak7CXnXpYf04iA3lR3fSfLP2bHsFY6PgnqmUj4x3OZinauS5EG\nrUBTR5iqzP2eY03EwxoBpdABlOgMxTf8U9/bran+VI2Eq2R4ARgZgEqdft70\n+UjULpSOr4chS2rZelyTl25A9dWfcDhpwPwzyCd+au7Xe42lPHlgHOdbNwUl\nG6aJbBCOKcaYswkwUZbKDPiMzquKJv9PMvK5s5vJzGtrlOHtuH3dxnhuNJ6C\nG97RRZkhMnNV2/eretNuPZImMR0ahtUtCw99PmAyycUmfKVbbfKRxrKAfyRu\nkD0L\r\n=5Ohc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUurlk+fOtvoV7CNAp/BxBRcpDwENbM2KFyPHosmL7BwIhANFQestm7tEXXdqFllYdPuZnpareodXcnH1AyIa4KojM"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.22bf818.0_1614154323875_0.3317829253002562"},"_hasShrinkwrap":false},"0.4.1-dev.55b2176.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.55b2176.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.55b2176.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.55b2176.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-f3dvSpL+ASjVp89iuLX2WGykoyn5kmzte8Ry7DI469OgyEhRJd0ghwJkBRl6MKjlnYn1NebrzCAv89JJ2Ic3lA==","shasum":"de0024e15ff060a366ecad9cdd0e514c1e15b57f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.55b2176.0.tgz","fileCount":18,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNplhCRA9TVsSAnZWagAAVJQP/icgPKf9wcJ8dzPODvUf\neZnPxd8J1f9jNJRNqBvB6ZqbifJPV0ErKMBhLVnzWQNIgNUyRXhqkvN1ICch\nR/3J5BFlWK0itLIaIHdwjc1GGfATln28/SrzZzRFrAO9STwTjMiJvg+oaVVT\nQ9sFD2o6xx8Escu8w/tJNRuoisNRI0pIpABVZ0Xh8NqiWw0gzylrysZCzqjG\nmpXYvP2hqqSWX35Vzw4GG25w/2jBDzaFJyWeQsACETv5s3E70NbIglF3bMpH\ntfAEkHO9Ao0eHeYbQY2filjy7xw40wyqEPZRLPF0COci/ZvfWGE0djQmtdAM\nCnlXShM7hxpSDtRqrqfNSSCagK4UhMgfYpWqI5wkVdj/e6RDyhBz/1LYgEMq\nrza+KWszwLPqqn5/yFcbH2Ckd+qvNmVOQViTPR8+gG6psCJdahuM/SwA3hwT\nEZFP4kXfnuyd23EI47AvFICqWcC7fo5FqUUkw959FOU2h7wgNZhHa240wim+\n7XQd+Tc6igXRtEdzda1V64e8v7hKKA7hHvymSgjbIT9E6k+hUzNXbzfoAS5t\nNpmQPwqhhjZ2+LakSbcsftsJpNckx3ziCfhvyUIW7I71c97Ndv9mKXMbvJCG\nHaXFOhv0DE0fnMXer1DN4WtVEp4qpnlznuhWz53fojJhcxjURHstRp+sLpx6\n897Q\r\n=jxtk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq8HIBIuMEIC6IviYYNS0MDsV/L2KKCd1/qNReL3NDSgIhAPva90M666UulJZPGc/PPAjYHH8n5RquPfG91NC31iMm"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.55b2176.0_1614190944811_0.809658315173752"},"_hasShrinkwrap":false},"0.4.1-dev.25186b0.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.25186b0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.25186b0.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.25186b0.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ROAM2jzf17ra5i8KDRNbgYiwGEIrOg3ez/PcSgI6+zbaKDgn6Dc8eHMqF2zy/G0Ro5UDOKtRJ2p9kDjr2Itp2A==","shasum":"51f6d2cb1949aced7ed2716a62774e8be4acec90","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.25186b0.0.tgz","fileCount":18,"unpackedSize":196178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN4vwCRA9TVsSAnZWagAAaTMP/0+Zomy9sEsD0BzxHWFt\nW/Z8BHcfPRu17p9eiQMYacemO7wMhOVjYyRgkE9LXfGi96P2a9/z/KOlxef0\nKOa9ZNWYpl7YM3njfKOVlV9QK4fhJyF1rghdCv6gH90oVND5Yq3CD9ssD1BC\nFQca9txBORWKOvX5ya5h9ZluF+Ll5KznqWUrMBJa6l+AwrWR3O+vHOqAyewR\n07VuSIQPT/nSgBmUarGLd19iaGKXjN4Or30i3rbmt+YGpMyptxN/wRrYTIxX\nhQYF2t/1yLYABQdykFIynCk/dlQ0NupjTIlnZKkD4S1cY9AfGOw7iiGpoPnt\ncKIUHh+X9rmOtZ+wtcRfRZdmYP8Nt5HmXwGVk3sSf7B4g+j8Tr7S4E+NSAaW\nQls8FZD9CMxDxe3SxY96u1SZa2btV2PNj+WX3P2cY4LF3F6s7OaXQEfWRrY/\nqjS2+/+nFZcgVGLAkyROtpg+quNSd5iWfHEXk4Fb+HumaYiiY8gDsefQ2q2L\n+YhmuHn6PyUVsIwIQekkdIaVwQRAsrL7D4vJq6AMpxOjuei5ukuPYIOPaXkG\nIrUmTGiP3EljuFgLv7c+5Fry0xzYlA+GpzXMkOBIpq3dxWPVLKGmN+pS8baJ\nRxalbCAHr56JBu97YyWq9menzwAkKuyZJjcOh4QKCBA4//Mh7rD7dgc3mRbB\nM6Kz\r\n=SXHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNR0pdxV+9F7oJDHA+tqykJ8WAFNJRl6pTZNOJVb1WrgIgTCNIfn/0Owh/Tqqcz+hIkQEN69sLDJhy8jjYK3quIZE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.25186b0.0_1614253040136_0.13173076235601866"},"_hasShrinkwrap":false},"0.4.1-dev.a7dc500.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.a7dc500.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a7dc500.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.a7dc500.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-FSm9OG2AXVJFTlMsf92tFvKCKshnhka4wmWYzcuXYxoCWNlAOIOj4rvkFzq+CgfdWjrQuIsx1+IGFwpZMYA3iA==","shasum":"fe7a133a3a92601c26665f8af0a15f4d9017f851","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.a7dc500.0.tgz","fileCount":18,"unpackedSize":198001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOT1LCRA9TVsSAnZWagAA+yYP/Rdtq5sE+UXwJPfq8TBv\nyW3CXsmiv73kkJhrXMvyZh6Kr6Kypi0Vvx3z8WCRcfBhngg9G5gr/x82+T5P\nMo5skzUEOxbvEbkwHYqGRAWiuGquF2Jb6I+ZGM73QNhwgatxi6dVeRC976lM\nh3TUhtdDb7vsXdCbfLWkGZlYaxogopsynYLYjXKv4I8QMMX9UpGMyC3FZsin\nCoYk2umRNIJ5fz7rqaLZOlJOUTmJYTo1Dd7WndC2vta9Qr+/unuVxVDuPVBN\n81Mt/qTcyv3VZOBH8zNlm9/RWTJ21YQPbuILNebIT24gYsCLeN6sKWEPBjD7\nlq3xHyD74x7PMJFiaQ29yQ9P3qtP8puIWlNbWnq4FfqwvTnHRT2MYsfY6D8r\nwMaGoIBhNy4pbZKonBvOLQUPgz4pgfwN5upt/j1QlquE4G0TVwO4JhQiCkYY\nX/V7J4apAmZDuhlG50GF2NAiMW3rOQiG5EsGM7S9hOerC/1qP1Xs690UI6x0\nnJr1hAaR372LJlJ8yOmUo+GCEiZ1LqbQznliiAEpxxF9tAsfGFw1DvdK84v9\nehDlPP2Ko80SrBSNmd5Nv0ly+xM0b+49KaMqiiw08w5DC4EZtcr4TIMAnExY\nWlIydz1LpruC+nhku2ugnZr57YLDyVGVb8SqIdcFDmWrU6axTY7eSZW+eCjF\nXHDR\r\n=r/Q9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnCyHubdFGpNJFSD02xDOU1wUmtJlup23e7lzpNAf0pAIgFkiMzBY1c8Cird+EQR843nF2/r2437TGFGbQJEfT+1I="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.a7dc500.0_1614363978941_0.7719515960803074"},"_hasShrinkwrap":false},"0.4.1-dev.6938564.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.6938564.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.6938564.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.6938564.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-mHpvphQncAOjs6to34ZXJCsIxkCs0MhiYb8KN+uMqIKedeVGVLQRj0q+APQJEbMRe5ogDbJJ51rUdGAEOAxzbg==","shasum":"74a7d996fef9173a64dfcd93af37bea27952049e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.6938564.0.tgz","fileCount":18,"unpackedSize":198364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPP2MCRA9TVsSAnZWagAAhYsQAJwPWJULQA5oqJijJOgL\nQojLzQOWvKql6u2QAkmR0wnQYFDuQgImwjPSlUkeC/I4Nta/eHT2Lum5/qCb\njGrRsMlCELAZFEcehAIxzQEJbbxcW5gozTRqDTloc3DVU0co/yackzmQhnib\nOENwKpKRxgWEf97dTm2yW0BYSJvZ/LA3hoGu94SABBku2PZMK7MvNmq7Qfv2\nGkIBss+Yoqwwr25LVICrWOmfdO6Xxi6NTHrh2EvLX6u0loW5FgOiuwSIwtFO\n8AFYPFAO3snlAc1fyuw5QDEJ2YlnSPhjN7ohCxvcwY5NLBqhtlHU//2CQvO5\nH8KTONhijdDMYx/W+65WI1OCg4aQ7b7/5qbPFxqH9Nxt/zZM/7UQfXzV3s57\nEmsPY3EOLg1Xsd5l3ixn7OV0OyhCSUM6H1jA0oCmflNNVUJUz5Tg8PtD2ifX\nc696TWuwKylYeB0yI4MtLjxudiqcSPoh3rbqgSAM0J/sI/MoT7NyUCuavwK4\nmPbwm4awzlCCnj4vnN1b4xw7TM+OHDrTAByoYT1M2JTSOZvlvZmeDqP+lQTG\nP8ZgFj93NhxRkxR5DNYLxlnzUcoD4yADNKnLpEwUrohPcaiTkXHm+bMY8fCp\nLnZBbMzT2UTQnGSwCFVc+uQ4IcCayXYGW+Rz4Zd95F4j0TuJU9oQXYZbQ4iT\nHCRc\r\n=RV6T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKACTzGl+okiAAf48xwq86Y/ZU93XLiioHG3oOaST9cwIhALRffBND9GmS1jF0PonMA3JhIMtGw7pNK8HmSc7yE2/1"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.6938564.0_1614609804053_0.39168106544419157"},"_hasShrinkwrap":false},"0.4.1-dev.895871d.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.895871d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.895871d.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.895871d.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0zHygb8G20jsdUvsh17sTo9AmWaE+GwUTJOz0fQE8inhotrAtmHJEZc7+G96D+qZYeN0QpYE12sl0NoaqzPfbw==","shasum":"dbb1e45d57233fa22400803afd5255a652f15059","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.895871d.0.tgz","fileCount":18,"unpackedSize":197882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPSohCRA9TVsSAnZWagAAjPcP/1uNYnjacz9/EtXYkb+G\namxZz6UuJtnFK7vFZq8Yi8y6CvGQ37NyjpD4Gbq8YqXulDQ4wdehojsP7+RX\nPmGgsy5wJ7tP8dtSo0DIFyUk4P46GSgZ93I+q8XgBze0BJ+fKSoZv+kd9KNC\n2wlmtSkjYE9ExGS5tGdN0xWpCZ94cVQ70C1bTTyjBXZhwl2fkAMBPDrR9g8x\nMqXaE4reOdXK2eMk3aNy4wevbfG37sRaaKMLFYGR3wdtxTCeSH77Bs6yzOQn\nfWQ5VT/qQy8wKt+g7dXk+pmh7W7RrPDSpgmpTJhuPJjstzauzpB7R2BC4DtP\nJquftjFUQmnYZo0aDLmMkfiNDseefXNMRsitFidstGlCSQmSW6Qc3WTfKhIf\nJO0ZYSJfHlbR10I3v8NgbNrAVf3wVk9y2hgOEZncJeZ3euINQCoS2X8s82yS\nt/1Ok8RJWqfUxDWZjx2SwaKfTYI8bEnx7rlFsZmXIMQmq4aSljkETb1KrXH4\n4FFtDWp2jZdbR87O0MoBKsItIruBr4Vhu47qLp869gM1pcw4qi4EZILzhYjR\njTz/I4mS6ZXRoUb7+aSsCL64SPkAgNTQ7jBTa3RrT/eObAhHFQby3RiyGZl+\n0b0BoIc/iEua0DqmFiGU95P36VDxESEF9Mkdl/G3Ynk/yvL9dnSAcN3lgHJM\nrWWt\r\n=Jtcp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEnfGesOB+KpaAiARuRB7Ww/8vx7w/Orwn3stDhvJXaTAiBzJlzjc6OoWeDiWTJmSP2caK5iOlhk5b3QVdtxALCA4Q=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.895871d.0_1614621214561_0.1553193156053596"},"_hasShrinkwrap":false},"0.4.1-dev.ef29ab3.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.ef29ab3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ef29ab3.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.ef29ab3.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vdrGHpoJ7RrzxCjJaBUWZMWBUPqNLPCAokW+JaldCVxQ84Pb23k3ooPdCn2ifPMCO8dS1sKOJ0MwqSjcTYTHrQ==","shasum":"5797f6f73ea44229f636c8aa0c3da3e9bce2fc8b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.ef29ab3.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPTpZCRA9TVsSAnZWagAAYOQP/04AEzDADgWfsPYc/n6C\ndcSyD4fCi8ZAu7VrawPQei41iRt3O47QP6vR6hFz2yNhx5r2a1WgG1nVOnjz\nMY8/2uxp7Sv+VidHx3Q/IJXRatYmGtpORPeRORwDl6gdhYgrYxBAA2PdjiGs\nd0/xL/QIkLJ3e4Ij43JWbsgpveHHa91PVGnnQAOPEM99YGStklb/iQia0J7g\nq33/fucdNFuTcGfLeWU61CiE+AhclgnTs3OWGVQI7ofpDNf/LdBTLBcOjL4x\nk+ZIiTPWR8AAYhpV1zwTXFBFmZJlcDPzBm+A085WgNCQHZeKS2eM/3SciUKq\nCWagGnhpC9Xj/GVNY9Hfk1zMXUC7Kc5/dpNZNIDqQ9+LH3z/EJj6t3EyLBLA\nRZ9vq8K9No5Ci/BK3ACsSSKMFYQ3TvPoW18S7dU4Z/5vDQMDXYKgsipe8A4K\nKJZp5yXeTCkAG5ySodX0q/bMHR+8ZDGsyRVSqrZqNMtzSsct+cmgt/jnzT3G\n4w2Unv1vdtAUacHz1AQ2D2XJ4T42iN5XHiHxWOiZ2PH3CGuOH+8j2iJ7l/Zs\nzMkXxM1zTwHNZlAu6ginZ+P1RIISFBVghkrw/2EUUvYe0bnaJb9lC7M2wft7\nWyoRqkOf2+/hKymijvA5tRE2M92LB66l7YUmSZRQ2Zovr92NSEZjx4xt/5Z5\nQy36\r\n=Dt/M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8Ko54EPGFAY7eVviwhA6dH7uGwyTQigxN7sgW+sjN/gIhAJVg/RoR/HHBc4PPuM3kaxby8Q4RjThyRPMVxFWvPCgl"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.ef29ab3.0_1614625369384_0.9746888267870222"},"_hasShrinkwrap":false},"0.4.1-dev.b2e433d.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.b2e433d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b2e433d.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.b2e433d.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-bz2DhxveCnYoc/LuwOBes13tjpUvsU8QfXn5ofd9GAGiMtokcHVjfhMwKNbEoI2KD2MntArENyd252a5L9jFlg==","shasum":"492284c179b3e44d86986c903ec675cbb37011ee","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.b2e433d.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPTrrCRA9TVsSAnZWagAAgTIQAISs89tHhH4/ueYsv4dY\nL+Kho+JTKW3JyQRHOKbLuzaznnJjcBGn2bmsBE3PeQtRtuHzizhCI1r4QLUx\ndvIU+ALAV4yaWdigFaxhf/opPHtvA5rLND1feMRUOKGXlgc+ayopi8XDz/O+\ndJWpN0+H/ve8CMCRGeABuhGmK/QGEPiPhzHqhoh0+fLJ4G615HroFL5xsVWn\nQ003AsE2xqT1FNdRW8ssO++9WL1JsdW52Q7xfOq5K1JjAl12vmFs4vPu6HdV\ncAYWRJ8d59LLA4kxN7nnekOGIImDTzaU6ABVNj9W3tj7xVTbWi4U+F3BLGYE\nVKnKb1m4BS47fIc9uRMdqL6XJhH6zVmjinrzcb1Obn/QGbjGhts27l8/JFWF\nhVxQhM+fiIu+SEFItK8A0WPwJ/EdBGQlV2qCJCtCuMHtA7sFLfS/BGFoxBsj\nYNIaOZrL6SNyRaBPd1JoTfmQP4P+BWMLk8S+cDSZJbYpRvczo9wmGmAj5vKp\nBRkjrxrxedjwXTDSLneNCYAhqoJazouRI9YVNxZkBlnDAEnUxdNoibiatGZC\nbAOBigrswqNTlmEDC70YNkvIx/54mQQWeh82GypvIK4pXdYYkDvNu/dCMupd\n9WQTiRQdjvSYf4pCG/3wtfe6zue+8QYmarnkO+M9dxONykQIa+pN8/RxDkaF\nN5xp\r\n=vjAT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1dg2iWDK6+LOf4+QdGDWRTucBAkepzJAh66a/feeyEAiEAiQivUJrxBPNXswo/cMR1SBm55UdQ/ic/YBAzA1sKL00="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.b2e433d.0_1614625513938_0.45107097362798565"},"_hasShrinkwrap":false},"0.4.1-dev.220bfe9.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.220bfe9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.220bfe9.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.220bfe9.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-BFtxQ6W1KdFvtYvsWf/33OYjqWThATe1OP3s/kp1r2pNHcyq4SdmPQXKfN0CZfHvN2tq+Fc+ebkOOQT3xdHIXQ==","shasum":"be3d2c44d8f96b419ceb6326d2819816d0c168ee","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.220bfe9.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPUHlCRA9TVsSAnZWagAAO64P/2kPVMxGyTQPkNFdenAj\n1vxaxRTb5EP/dN1BSPiCyN6wFZ8/azAZsZfduVSVwGcNpez8Sbrk1vp8A3AS\nEBpInSNrokHv+7Us0i1XhJccRIc1IvhtbxG09oOqtnXzpHK04edlKTtK4lIi\ntb+DK5ILfTb9+PyyE52koZOZrecvDY6o2G0YGhCK+90B0MBiemS+Kbs76yQe\nqI0f5aCSrKRx08AgoIoRG48v95p4AAVETx2I2toNWpTroF7uM63gEgQPXch2\nuRb6y9kdZImyeyljIqAaUEEQxZEOyPWCHJw+WJOC8cmUSzNHBzRY4kzMMUpW\nA2uGpyjbT5ulCfg3HGwYr21cPcKWc36ZMeN5ss7ShQJS/IdkHA+N+Y85TiRt\nt645v0QdOkBNWkuMjE1zCvrAK/W+4yWzQk4rkKRZfGxUtgUBZFdRlRFepBol\nqTU9bOD8HqdDXLy+QVjB3bkftoFNKuHorZTfqBdJLPuBDhy+WuHrRMaNeDL5\nD6FyJ0vGibZ5GatverU7J+FEYY7CfQz5qgrFG2ywHpRc2jdOT90lJPmR1H5J\nMD8ve8cLASKVx5kECEMIA4Rk6LeLN+eOJMjI216OQa9Wo0Q9z2Fv6yBp7/Al\n+mi5Veqc3F+IzVl6d43TujV2cUv/fTxRZTVOjkp5t5ZZbgzrw9BfvGDk1tVm\ny5ed\r\n=9aV9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRJ6lhHLoKfYDETOzdArIRPKwHtQNrUCtdSH+Fo/zdZAIhAOk3xdh0r6qM/UffQUnrfdcpZKn/m+Hy+fpUz6FdtT9o"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.220bfe9.0_1614627300603_0.22671038997448845"},"_hasShrinkwrap":false},"0.4.1-dev.962181c.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.962181c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.962181c.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.962181c.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-82M6ObYC5XZjRBtLRHk9TfISIY0ZHA7mQY66ebIuntZQkV1Q9RY9qYiCRavJtdFSNObz8rlMikGMDwC1ZWB80A==","shasum":"db7bdbb365181ab1e56f736884011da9fe3c0814","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.962181c.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPivFCRA9TVsSAnZWagAAWPkP/1L2ECeL/KigUHGFl0ae\nmNsmW22Sj8/IXv9SXfHE8NJnJtdPU3ahzFxDQc1I3yhpUdx286eKc4ZFiHsN\nUJ8IZY1VGSfa7sPBHJl1+F+MEtaCuFOxV7TBY8GJ/5XSMhNDoiXW4G0GUu0w\nasMDYUwPgz8S0Un/koNq7AE/ecpjhX431SzW2Z4D6umhVNVkiZOqQOTcEmfk\n6oziWjpi+FgxNyZcUXzNPIK8+JPf/9ALhmBReqkeXmcipohFVRRaVtb2qcya\nVwgoSvoOn8gjH3sbPB/IZXOzKLD6LwIt3PfgrFoNYfYKXfsO3ZSsdEmDESIP\nItF2VM6FZdN0WTzv4NzvAj7Ib9SXiAWTaFi/ey/6XnhPiD8Gy+luVfrEpBId\neZzJ8w/EG6AaVOAbdqp5b3kTAtJjLDDXLJWCmNIRwCm2PfmUNiIUWnynoSOf\nV/Gc47RNZZ1dYOUKFhQfnG4QoJdfL0K9BX/cVvmQL0sJtCIA54I33VEk0t3L\nAr3zjH7gsOgCdlP+bVSoO4dJpuyJrPvdsMC+ArOyF86l/NW+X0TPA60Bc8JX\nYIN5StDkz6/JsGKIoif8yOFRiRrjCET8dScvl3Uv2lreaWq5lZiv3L7CbbhY\n1op3SI9Ssv5UIAgrXCYdHGcm2Uf08hcURmdtYank6z3YVvkM76L48Eb7/Kf1\nmeK0\r\n=nRTf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYn58RULR7iw0vDqa3HQNvdmcaj9pMI+3e8OdGu7E0mwIgaEidiHLtYFKBpT7ZWEFo17nP9qnoTgaO8a7RrW//u14="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.962181c.0_1614687172343_0.6819161927619304"},"_hasShrinkwrap":false},"0.4.1-dev.fc65ef2.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.fc65ef2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.fc65ef2.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.fc65ef2.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-wfbIpRFoPlY5eM/HMepSxiUsqJ0Y8tb18CjRdhT8LXmHjDjVSbcuXerINAXLgrziMx0jHuu2tzGsORo8UczsqQ==","shasum":"2d6f8142fe5243ecd39452bbc05eefaf9177d616","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.fc65ef2.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPkGBCRA9TVsSAnZWagAAu9cQAKHPrjmUDSFpmjoOq8Jb\nOj2q/77a7qgd4nYRwTJT8sGnD3eFyaWM6RUtVVTHIOKDAmiNEDnNKaF7BbCT\n10PLeXSkwD/QYtvKuedIopcwMPElnVInvLPWxuw379ryGKwJ4Jq6SdEjSbw8\ndHFmpG7d3cSo9C/9zL+3b4zpOH6B2zsdxEcVQxKHoWO2XbQ04h28pIsGn0DY\n3pd2e+5SOa/8r/WQ0p9FWKv2XBWI8VN9idQNenOA0i8R6u3+MJXAtq/dZu4D\nYMjZQ2qkrSP+/uEPqYAT/HQ5lKJBFry+TtJQrTiuHhQCmIGUhs0Dezxrfw7u\nQxdMl9icTxDw09xRNbYw4u5306g1K49S6PAhb0rPR9kIJqbyYg4M4oWe1BgF\n5JyEo1Ch1BzUHmSJK2G9HdGpsxAPwrhASrCPptEuPYmRf6H7KYEXjMPtZiyO\nDj3ax6JOX8PBIuD4JdavXyXKkd5MGvNmKs+68OAmiyWG8wygkyZ+iUStutfs\n7nAa8IwZhblX7oQjHKEEccpEm2S0WpzFvmJRUiaimyUrNLk5mUqj9qh0TYJM\nY109m3eBMZSlN/FJj5QdG9EAEJthHWpVxY68KrtPiH4t83kqiTwgisS7M63L\n/qK4W6Sc8BWlDh2Pxqvugc3sBmWfE6tmKwYOE1I33Hp8F9kK7ezkvWc+OOTl\nSL+z\r\n=gHuP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFnt1smGoo3jmwHrUJ1eL5y7lue0RY/6mlUfiOrL++2AiAsFEpnvktvJMEo4NNDiTICCrG9KA6VIhjZYHN6B8vr8Q=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.fc65ef2.0_1614692737272_0.9090093034661073"},"_hasShrinkwrap":false},"0.4.1-dev.f5e95f3.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.1-dev.f5e95f3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.f5e95f3.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1-dev.f5e95f3.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-pIzhYsZwFID57nxiV02E+NVPVKdqFNSCbUePoXuKA8HrJH5vI9DIM9rFAG9/nhVS21pXjmzR1DxALx9iHIblIA==","shasum":"2f8828583c0df1361a4bb61e30b8ad21fccbe9a0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1-dev.f5e95f3.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPoW9CRA9TVsSAnZWagAAcVQP/jpvBoF/Fe20SEKR+/sF\n/I5460ZFEBKKJL7+vEEljmgcnmojd6mnWHyYIYwYSYedNmdXErb1orxRrHUb\ndHrUDdpvuP/HoZ6Y1xic+sQkJdwa8HWDnGgFM+fJI5pq8bTnGepumzxo7Zno\nT/HsrEWitNyoTmkLqz3IS9xs92Wjj5jc4XW3rKHoOXyX1CA2RZ7XdhJ+yXgg\n1moB+dqcTOVlGtFUQJ26gvcHc96dAS4zzGad6Tye5QUP+/3QIaD2n6DabG25\n+h8rXhtt7eoYpkhKLDyCMg2qhkkQa12wSQw5O3OclolgEI/k68ykWl6tIncz\nJvNOnbd2htrVBa1DSg+xzKjSeHWplCDJd7Pa1UmdaBbUfhjQD+6/vhwWmP2i\nEdbajI0G8BlAib+ZUAMJVlvDWupa3WNgwCQgHewS0MEnxAMEAPqbiID6PykU\n1HaR1HNR9RNNuGkQ/2COID7C6e8FqhfJv3Khl13FSPQvniUbVFsGVJ0B/N5I\nOkhX4vDKS/D77TAAD918LcGENZBQ5hK7SF4d7njqLjXIcv8e114+Quu+j6BC\nfbSQ5OnE3VXipjmqw7VjhaS9gx3BKK++GBbpmzvWBk06Wukl8Y6hKkS6sip6\nYzcEsu6nw8erSwTgCSdUpvLw/p8KswLkoocNDz4j+11FC+2ilf2HRdRNQtCT\nF/t7\r\n=8fng\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLKrcIq+RAyQISfFflSvxA5OysLOgB4pwa3gPYXcywigIgISQAL8u07EO2WV/BOVcNLGLhNM32UyP4kqgWNY2I8Is="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1-dev.f5e95f3.0_1614710204814_0.18729288932347243"},"_hasShrinkwrap":false},"0.4.2-dev.3bddaeb.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.3bddaeb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3bddaeb.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.3bddaeb.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-yTyP/lfO5ztv5I5G9D5QCuYP7t0ARjX++h3zV9FByCgv5NuFtqf2kJ+rWJgBEBkfNwjAfjmfS4SG5AzrE47XrA==","shasum":"142d39bc7fdaae07517e8b1db71f291dbde0607e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.3bddaeb.0.tgz","fileCount":18,"unpackedSize":198280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP2q4CRA9TVsSAnZWagAACR4P/17f4RiVFiXs1r7+39By\nQEsdFH8fFZjLzAEU/N6V7VAtFe54goRBL12+2hSjBt4OIqchY3jVQbah6Iqk\n+iGv89jEM790Ypy5mQ0qMsEGqKGaTyLFvx54Hqdb9xvwBuqCGnr2I6n3Ezxc\nWfclE3ohBMHe9ntPqOHfIlmFs2HkrbJYxNA0F7NvD5LPBewklttb1bJKAMsk\n/SqrH0FDxL2vfGcgPXjXoT8hemoul3T/UbsNzPQKtXjsJVHpNpyFQGq3PP0t\naNxdW4O/5/ZrkBNn3fFduxaMaOAMyh3PBCVuH7eJUrQQ49iEgNBSttU/VDMK\nVFndoxiCvaMV149YcvvXPXbIs6ltFODLus9C/E0jB8v+YKFWicCxU5vclhxC\nrh3z8BdlkFQOJ+19tRRQdDI78aKDirtuHBhlUIosxc1Y3YINPabc9lXApiUD\nH6GG/i7/QQCEIVTqSoiyxjIBOF5sIR8kPhlf3lZxaiTQUdCfXYiL1UzqNpYO\nUOvA5NNjjoVCoHKxfWY6XeLrIxJLZtjguvKy8OGd/Fp1cevmH6ZUVvelARxh\nuKEbM7UF60dHrRjIDYyyoYS/QSjujlAhHn5+s1JLZZHmC2dFcdS8wHkW3anS\nPvzAxQBYC1rPn/dxYyIa/ZyrmLJf2g+ItDXbVeCX7KhxumPYLvdhAFwur5HY\nOXlD\r\n=JRwH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8vZsJJZIVL+UfC5hhv+4w0I/4ugxEtHgJGa6rzZq0VQIgHVfKDiOWdNQ7YunwA8sXSMuV9K1dMbabh5MdKq3/hDI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.3bddaeb.0_1614768823966_0.8430526589595815"},"_hasShrinkwrap":false},"0.4.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0IlQRShGDnuVEgpk61MrVRAYOrXOd2XoQV427DM/sP1fGmm0ECgjCTLDofAUAfh3sZTuBPbUprVh7oduj53/ZQ==","shasum":"fb4c8ab97ca92c336da3936edec4e8e8d2773d8d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.0.tgz","fileCount":18,"unpackedSize":198256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP21ICRA9TVsSAnZWagAAs0kQAI/BAtuLJKxFYyhlJyEK\nCM9VlviEN2czFekIkO2mRf63PIrMLP/Kplmc9sa0XIqb8f5exaA1pu04+Vi7\nFUxzD8OslmF+SVn7FwnT5KXYK6HmhEV3RwkumkLHmmCZBF6+4JD4mV8l0zMP\nYD3wtTV38xHET+US/EXCSeRlZIW1WZPdp2nfAS6keri4mKZFwa2IobcgNfUg\nHcnra/YF8GDeK1VsisNFhV5DmJsF9TvEULpYreMAi34Ki03wpmDT/l+2zTcs\nGaSzYOCDeuH4TMZjn1tfsZZGs2kSVm6gndLCWdLTFGb5EzifP7zmm/68aSWe\nhxYtCpzRm5/YmYEXtIxIy5Bm4R6L0BzWTKbplgTsGGEvIeQSbn2ynmVjb7zN\n1ZCYQEw1aLFDWsUvmVfqTmCTalZVIKhQGpi1SZxAVMmj3iPUp7ILPzJRVBrB\nrSiJUxggy1YpdLL5taDtuHkPiSNPuDWrqNf14nRvEfNu8nWod1+0qJsPnagF\nSS/CkQfflHHnod8VDeZwLe4GhS2qb1jcTaTniIqNQjgZmIR3MKQvgMIJOkrw\nK/3vMJZHNm/bE4fhjYjdWzA/MoyLo9fnLx/1t5H+pevl2/m2R3HvCfN4MKRB\n4YY8xUAOueMjN0B6PmPPvXNmc3JyuRT3tIXaaeH+Fq2E5oD9Em15GqX2PrFd\n23sy\r\n=AZyW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDelaiRhtmDrYEQIEckgHfqH1Jwe2ZKMRcqXz6Eg5c3sAiBNx1V3KOwzAK3q7FdDMk7MSYy9x7aYHVxeO0M5E9E3uQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.0_1614769479777_0.6980667022615428"},"_hasShrinkwrap":false},"0.4.2-dev.180dbd9.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.180dbd9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.8"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.0","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.180dbd9.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.1","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.180dbd9.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-IAg2E/zUCQebO4kkaa6DNPkk7+a9Ht012wlF2KL6eWEIBO6OWIqgsGU4YjJEMxyGnmy7c2sLRuLb9Up0P1NtnQ==","shasum":"df0af9506850496859efeb3a0976488c8fae8c87","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.180dbd9.0.tgz","fileCount":18,"unpackedSize":198351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQhoZCRA9TVsSAnZWagAAvUgQAJT6onqfbjYmLgfmoGdN\nX/16tZ3y7K8DZqhKYyrutxPj7dpb9v+gKeoeeII9sWyZbvQMaeJGoU/+xW8J\n2JjMAzKI/boihOTr7fOEy6z/18p6BMvDNwhD/ep1Q5XZ8H3VjI+6yHt+SUqi\n3+qEVsOj0amIaLYKKtzv3XZQoadsP/sHuefrzfAX6AbMKIPy5QO+KoWqqncu\nRREhSQbpNbaWrkxgpFG58gdP7iz9rdsTqiWMFcDi7h/tkZh6tRh4332sOzFy\nwS11q9CaSLq0R8Kb07HgB6zoj3afMIfmVK570kY3l1SjCir2ojE3cueYhieV\nKKjMc3IMZhEdNObD0kDgpRkVgEV9zKEna0xingdRPPzPvQyS2hSSLoOUWzgu\nHcyShOJcqCd7Us/BzmLR8//veDUx4+MYdi2SjnV6QOSh8MJ6xPRQ2pEZ1puv\nT0T1jqBJYbZFsBkR5sxZyfXJ7ZLugL/JaBT+/YvImKj31C061h3kt4ZIGh4M\nF7cLyVkSiOtbm+sbcp/VicAtIxE7ZDC3p1DAl96TM/M4AgEUtjtNY0sbWPEJ\nSBe3+eqzckNu6B1NavhFdsRIX5MTQ47hxyH3WEVat0yYnRnM/ZPVixLzVpR/\nwA5+0F3+mOn9C3f7uSxmKDA+egyDIVhPOhzlzg42B/7obuIH88+1uDeb1ARz\nFdMf\r\n=byKm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFl+A+VNoWNL+rSdwcBXLhWv56DCuaq5xTqvzSVf1XyvAiEA6rsL0AAlmbkN06PkNFly3zMMOYbs6KA82Lao3AtnDCI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.180dbd9.0_1614944792791_0.755221426681774"},"_hasShrinkwrap":false},"0.4.2-dev.a87e48f.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.a87e48f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"4.3.9"},"devDependencies":{"@decentral.ee/web3-helpers":"0.5.3","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a87e48f.0","chai-as-promised":"7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.a87e48f.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Nczwp4zEUFuspoU86/BXZiisjvsk0MKR4EWR4od5HupbhXLatoyrB4f9YupN2LSKxuA34HowHZEWTCB8VRbuxg==","shasum":"0079ca79c5f5ebfdb15462f183526fc3ff23f45a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.a87e48f.0.tgz","fileCount":18,"unpackedSize":198351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgQnXRCRA9TVsSAnZWagAAVqgP/0MD3y08rSY6/zxQKnLB\nXgQ/NtKgQBikCnTkJhqZK/gWyvjt4hLo8GqdCZiFWubyfQxoFRBxwzd/MUEQ\nG/MZ3nbNmVBptOra6twVaxHXuWzvQqtiBhyrHqWK+4L8cUhIyGnFVfI4tKtQ\nm2BNgKVdpMLzY3D4KnKDsjcLRP4oE8cjQYeVUake/8sxl50w6ttthJuX0BM8\nbrQKqFB/FKhrCfKquxjtKpwUTIKSjjkVlQnbmRo5THoTtv9bWXrE6Dteg5BZ\nJH97u+X8T9ijXOvmKh/h7FO88y1U/byZquVjfN7yv2QKsm8GfLJuE0byD2e+\nCHh3ycKFdFRZuPrtGEuwNFADIrWyTiWDxJjpzSyeNsXWZcW5TfwusF/yfKPb\nA/vHe2iOVe+eFj64GQJMN1MyKPEL1fPdRSA4B8DeToq+paylcwliECdiAqfW\nBde3vewzDHVcw9HDtq67dtun/KF/M80xDrE5hbdbOP58h2r7r6FG/XUfSDJS\nrFQnxML2QM5wq+cPItVGfnDNmnJxjvDjbVs7x5vXxs5BOpVPIS9PdBoeW5BY\n3+IzSA4xMWVKy90oU1hHDs3+cUcnMYpSgDPVvcDGyzfhln/IamFXBdm7Ofk/\nzXCc0S3Job2FMUyomovvDy2lVt6rTWGAWWsFqSOGS0Oe5MetP4TCSpKZQxah\nUWRs\r\n=EzEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBpGPMsBRI4QC2YyaeCs0z3T9PYbAbf1VR29T2qzphOMAiBaUgysgdR5NOVZmfE08X/B+Mvi7+QVcRKLUF1C8ePJOg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.a87e48f.0_1614968273087_0.4155814593206695"},"_hasShrinkwrap":false},"0.4.2-dev.723dff3.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.723dff3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.723dff3.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"^5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.723dff3.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-O0lG8flSVZVB5wm9EGUPVnf3NT4SiFqYeP+EkXFrKCCuJXtS01XSqqAJwPsaLS2ALGx9SOgNXLhH6R78/LDTaQ==","shasum":"5897455980e7fbc819fdd3081e7f8f87f97eae05","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.723dff3.0.tgz","fileCount":18,"unpackedSize":198513,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRhrDCRA9TVsSAnZWagAAw20QAJhk7tgKl60Li6IuTh47\n2V2PtuVKMkeylCL65FxR2aAQ44gb5rA/02sws8jh1ggNkqFuy5PvdJE8jUBq\n34AlzESQd2phQIkAFSjvBzEX3oqiPvsuo6PFa+wQVXp70T5MrPHpXtzXIdCe\ngjqkH0GgnbYRlPnR+tTLx2ndKgntGjd3CQ/CmLAn5rqcFHWY+iTxhXgXxBI3\n7cVauGpR1ngYpWjhaTkgVvRiq1hDuGGB7LcYQ4ZjbjmtrEsZzm9idCZGNytX\nzqMn159oZAEkvTilY5tFlxoCT+EPcYAvKrFRxnW/+/cojOyvnOLNIve+HevE\nsIwD41LG+xdqf4PL750N7z1RaOFQPy3o3s7BrFDKp3+lt5RshozkcQM/4ozE\n7CBdmBkMSZuorfQqE7m072whKnfu/Cq6ICb1MdOT1OvjmxPQRmI6WLYR9KDQ\n1K1M/es8dnisq8jXdLCek4FfgI2o8gHczqFAt4+QWuA8yVA9Eak0+aQGr7mq\nMlv4SG103lvhYuR5F58Q6lVl/uzCaNeftPave+TTdXQ3i8u9sHiu9Yja2kL5\nIsJQAG6W6kxCaRFFmxX9a9YQ8AEgXTjRZqixbF/cBgX0wNWATcTU/qHXGKfJ\ny34xXzBkQinpiTyAWkW9eKA0wqX0J0OyVZ8YfEtztn0X0dBbZYCz81EOFgis\nHkxM\r\n=h3aJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDU+SNzoU9ILBnMdpgulCfV83FtbAVWKpTgjaGbaTNECwIgbLKgNmPtXQHvgYnH4Ht5//Nli4xlL+okz1yrsWHpHdA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.723dff3.0_1615207106768_0.015030389440038538"},"_hasShrinkwrap":false},"0.4.2-dev.78fff64.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.78fff64.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.78fff64.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"^5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.78fff64.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-9aKdJPbJKnyf6c19uP/C4LwtAdOI5u77Uetm3yUmKDu6x19+ujIl4C3htU55CuyncF/xsdH1LA/5NRY9eTqw4g==","shasum":"79808b80ec7a1c8cafbe324fdf245c01b13f6919","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.78fff64.0.tgz","fileCount":18,"unpackedSize":198796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgRpHPCRA9TVsSAnZWagAAhmgP+gNzX+T+RXF/OOIWcdF5\nIcv/tZXQ7eNmPCdX2VGCzSL6sZD7HIm0RC1lbnVaM7+9v5bF50e5itnEmFlG\ne2JTvsSCstQV+KDHm4kDRKCpcrMCzSouZsvK5KgRoVkt+wbY7rVCmukJeeP/\nqzfi4K9ehlsypmpCsuwz0oDR8qX6I5HZGrgp98xNv4xBj4+pWIqvsoqBHSSM\nOtjSsZhxs0iGoOffMWyVIoXwxyGsqUcjMftywKTpB8TvvtmVyS8h3d2ZHzLL\nBBY++klGKK/Szu4879CrFvLkmmBUEs/3DipGasAzzUBrjj86bp6Bj627cniZ\nbTPDqtjoOKc9/i0JF5iCdwi7WrRgMAyvKxou01E1eCGz15ugvUNwmAtlsx5J\naUhzjKmYKnPt9jcB2DYbni48kFpwLHKJDQixY77aT4WulhBzFopslOl8okG0\nQ3LQQoCqUoIn5CPT4ZM8i071g7DHrUB5a1vkq3bUBlZwHrpLjDmU3BYnA+TL\nTPuywOEzU1PdIwjwXgOYcnvxguioypEpJx6kiCFiKyM70WcvEflzk/mJ0YIA\nrCm5H2zIbXjfzpzkqLVkmY7gvhoz+IngbMGZcGXy2nR/pI1HTsrqgWJjQAo6\nsWlTRsoF52Ze/VTQ9edopqKAOJXObU/FMxlllPRf+tmBjiH/Fms0pTYQwfR5\natAd\r\n=9Jf9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7UQXQjHSNtsXv4GGtnYC36Zp909V4xSfHv2CV8DMB0AiEAg1WGq2VTdRD5gY8I/ut/xVjJliSLb+FFedbIeBmZBPY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.78fff64.0_1615237583222_0.08942782795030935"},"_hasShrinkwrap":false},"0.4.2-dev.b6e5145.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.b6e5145.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b6e5145.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"^5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.b6e5145.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-lQTl8fszCBy/fkqDH/qI9GehD+kHzyFFNPG5e50qbaG2uFtPm/Jhw66q/l8rduPeMfX7HhmMSZDU14AQyCKutg==","shasum":"783aabaf019ef9fc18c15dc696bfde080e0fe202","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.b6e5145.0.tgz","fileCount":18,"unpackedSize":198796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR0W5CRA9TVsSAnZWagAAPkEP/jLCWBxrfxh8dKBwEaDM\nSntr3SzOufYmfNETmdQG7NS9+CF3+B5CuxFMocwRspIuXOgasYhRBNH6B0Mb\nvVvaerW5bwcL+Bt5Y/LaCJvA9B+2M3cfBnbOHQ9Q3w59f0zihOWw595hjCyI\nARKVB9mIkXYemYmrcY3wNF2Vok4R+eBPROXxR5yE4LU+daa0lwUhO1HySdFa\nlpdi/f3apk+KXHKAPkpvYMaLfZsbDAEaxpfMz3o7VBrRlpe6SerILX3O683/\nghXplNA0io6FNKCiFlsKoyhHv6b8CqiwTxd/5eHlVSXWKlHYHWo6Iv4XPbbr\nlvicNp8YbyN/Zfg0rPmk17rYH9ADVdee8tz7s6mkV8oPTh4mdbZW5FmhqRih\nKBLNrlh7QWyTj+rT8o8gFwzjegI37FOCRrr95K/DY+rtDP8OVlkw2LflNT3u\n0JGitQvMexlqYG9Aq/FnfW2LiI0fjQ1yCstv8YsbhyEd8qbNrxKrXAaNYG1e\nhhKezMrh1Id9Ii9SvrDDu6NXTX3fs/gm6WUhTcSYrMp0fU/T13QvpiIzNsQe\nwVKl7/CEOIyhkIQiIIApYoX4YSEEZp8HEPqDYDx7pWWHYMZU2c+ShraDo2aM\nF/rK+VT+koqb3Kgbe9lGy43xf0L4rWiYeSwPBtN3OzvwCmAcOoBOioGN+PSC\naX/W\r\n=Krdk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD61+TnvoH6Zf0gYYvRqusA6DPXA6BC5CkDAKxzkzR90gIhAJKiQCcfIZN0031DmHCwnx0av9WUlmfe/6PjdemDSPto"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.b6e5145.0_1615283640973_0.30486350160373"},"_hasShrinkwrap":false},"0.4.1":{"name":"@superfluid-finance/js-sdk","version":"0.4.1","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@truffle/contract":"^4.3.9","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.1","chai-as-promised":"^7.1.1","truffle":"^5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-629ZeDtsgOv25rNf5Bny8SgdC2Nml9zHbNmNMjd8KzashKvSdTrZMund3NdtQcbhVAJDyl0kxu6YmX2L0aj4KQ==","shasum":"444550c1020ad6c67dc2794510d4a31d5edb289c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.1.tgz","fileCount":18,"unpackedSize":198772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgR7WgCRA9TVsSAnZWagAAkxwP/1ymIrA/1SRauAi/ot/M\njjSfFj9fgg1t7rwP1vyXToakS3zrHGt5pEExSqPyPIP/kPPwh9OeqPoW0TfH\ngq+XaxKkkz/BURK8COmX3wA0PP9s/Alf3oUE6FGV/vMlsntMKOVinot4c8XG\ndiNi0d77AkzBW2bdo53vlJRNhNo2i+Kxumxu/a0rSgZH7K3puf5Q53O99OJG\nczieVs4WmHfdagSO7yoJNMk9W2E/ORRcBOsdmXtO4JGZZBU3BaS49okCslse\nftUVKIqcH8WK27PVCcp9RVRNkg9MhXy2r/Sbm2FWe+Ed5rVQpB0D1QvXRk7Y\nSHb7pYv22nlGivF8xSOkJAtpp6dN9ArJhuxA3LYrKUCJaeQ6FlgxO1UvGkvr\nBVuJ4SF6VzIEgXpBau/GkcP5sbqifHQey8nSbJbMV1Ltzv14yXbKYFiQnRcE\n5yHLcFhVMKLCzub+eGL7Q5MbyyB3VSRlA8+bdz20ZcpKyWhpPt2/a0+TGwwX\nXnXvlIKWtwcCjLNl8A71hhUnK7/yo46HDiyTN8lkJnDMC8M0MvfJVrUUkef3\nEfwUGMHpt5i1H87TsZmwGZOOn8m1w8+qrpDpvOrOt4jWCMFdo5a/PKqo/OHU\nwRb68dDEGIMFeFmw754g4OxqY+YNYZOylKMuCpxeH56CaKoUAR0DdrQ8D4rz\nnaj2\r\n=WeBL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNcECkVJd+FXQOh+QQ42LCkUa71+vrwsoV12Tu3aGLOAIhAIgIUA/6WWwQsa06neDlip71fs31fGbKF+YmXDR/I+5a"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.1_1615312288462_0.11040286333066684"},"_hasShrinkwrap":false},"0.4.2-dev.e40e62e.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.e40e62e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.11","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.11","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.11","@ethersproject/providers":"^5.0.23","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e40e62e.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"^5.1.49","web3":"^1.3.4","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.e40e62e.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-JJFEgZrP0RV0YlbgoQd17Lcij7BXClNNQtEDD3Mo6+PhVDyTMoIO2blEmeV2JWszK9rfPIEYBkTpEbe+Ay2GmA==","shasum":"bd035615b33f39451c55a224349027c4f9669f03","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.e40e62e.0.tgz","fileCount":18,"unpackedSize":198796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSK85CRA9TVsSAnZWagAAavsP/0RdM7SJo/zBHDT8KX7K\nFEimIIO62EO0YcwMfjvSxjVrjRBMZGe46HrQx9f9N3L7Wk2kc0sYha3V6K7t\n30C37f80qbwJdhuvIdJJ5lR7trdn2ZkYJVFQbatW1ucMOmCdQhjPOxT1DZKS\nvOce5lfytMQIuIshSVrLW3PG8rbSgyBMfVvEWWMnh/toHl5SuMOpoO4cSE2v\nkqaEfATUqA0Lp7T9C4BuF5cdd9Kia9plPEC6jBHi3ppXIOOap5zjTn4dRIsu\n01uiUKyk7buYSRzZT+q+eU4U3m+NAvOE7j0n0lBHn/zt7GbWWwx7EGsFDQNH\nVZiFvXWQ2foqYeW9AWfVw/1NhI8iYLjmN1fCQnuMZoxwH8JHk8u+6CCTbXHd\nYlYYXsA6J7wenWl3A2zmgM4yijabpYrt8PP2d9sA/h2vnT/rhHIN56IvSCN2\n2wSynCJgVq0DB0i2cgA+yJ9/+QQhriCil7vHfwaSl4Dmvwvh54iHvwPHVtsG\nnnPfm3gR/HA4VW/Wi+NCYp00RzqlkTJnSs7//cwM8pr2vvVaNWByWejChM3C\n2dHg2uv47JIuILOb28HXI8/SAQGkSikUv4aRus0lVZZPxVJpj2Pv8Rm0nLJd\nSuqsvWeQmKxJKzUlUj/UnHCfn0GcCLBkMvTK5Zj4FBbiroYvfuFwvTnmEtNj\n5AMo\r\n=QyKZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrY58HqQrhkRyQULFFaqS0LhPy4InhFxks1TeKM4I7GgIgNr5Ly6/axSiUmRpuOfaWhACCyjH3/YJ1bvngc+oq+U0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.e40e62e.0_1615376185379_0.3666615526001571"},"_hasShrinkwrap":false},"0.4.2-dev.e5ceab1.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.e5ceab1.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e5ceab1.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.e5ceab1.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-tMSlTAG2ZXmdsbNFbCG3rUBQypNLyWd+4nIOH4a/k3mHP2sq9fdB00MKGj7rWCDdUsYhj6Jgc9wfFbDOf88ZJQ==","shasum":"061f7e777753d1d756f08114e716036958023cff","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.e5ceab1.0.tgz","fileCount":18,"unpackedSize":199142,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSLcQCRA9TVsSAnZWagAAQosP/iemU8NlELGIUlFgPPS4\nDfZXRHlbuwyvCj/9JRUmRwiU13z3Jw8r4MvBB9PZ8MZKCmPbxGvT9YeGGhr7\nIoMUg2xWSxzPTDN7xfcA4FXv5aGnrVXssB6auULnQitJVPhp3OyfWhvX6Wdv\n8gDXlgLMP5kSXviCsH00uOrwROwdTEzoo36s+g8Hgm2KK6paLdNFzdx01p9P\nmKko0/A3Uvhu7JiOHRcVEJnZhjUNLWI4X+pnFupTJ/sd0bBbrXpZxgsPTH9/\nH/qxFk/adpOJpdM29H07b6GMoDmks9rSOfi8qotBM0Y2aPy1JzCG1v6rJKkw\njECidyu/RkwuH6To4fk+358zUV1Op47x8+XaVQfzlMEpq7F0Gxu8MtenRC/O\n6X/FTFIFYpPo4CxvAZhGsuMmDg15wtAXPf/Bz3dBasdN5Md7NiHHtozlmDPH\nB1AfU/BN4iA8+pXYEoAxf1kealhN9QdK1Qy9LkLjL7AbQpuSKdEJfk55lJna\ndu1Lhfd3qJjq1Qf0o/3hK9ULB5VZYnPRuLyPqQc3U9oHiasMRXiXGRhJCLF3\nnxdKj0E8XtZCX8uJwnMwouHLOYTK0MwV6vURH0+Ihr55kusyY9X8nPm3h7Vj\nPKtF85P73A629ZI7j6YBwqLDsiB4ILH9vDIRCd+yVV7XPngKICX2o5sv+5uO\nKBUe\r\n=aSAf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9tI1R5qpDb+KwPluF5eRjghjxExAoK+CCPnVv5h/j0AiEAtQWklFZPQWn0neb24cEqM2Phhu847XX07Q5g0JzSCt8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.e5ceab1.0_1615378191720_0.9315168969546472"},"_hasShrinkwrap":false},"0.4.2-dev.9dfdccb.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.9dfdccb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.9dfdccb.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.9dfdccb.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Rrxnd8JTuQG+7hF3PmwWYMKW7q0SMiPndq+6v8qScCBIo1UEtpLA5cquw3A9is1hUnI78XeuZpHTuwM0dsWXAw==","shasum":"df3031751a42937aa9779bde1039439a48b4a827","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.9dfdccb.0.tgz","fileCount":18,"unpackedSize":201262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT5OrCRA9TVsSAnZWagAAQioP/j/5g3IWSiM7123ufYW1\nWdDABWe/XJs9dUSYn/3LxYuw81QePfmrqvUCo584nLDkZZBL2zW0Q5k4R0JB\njJnVh2L6tfmgsWbKkFA20A+qQ93mxphZ6pQ6VFKlctu3nVJVbVo4tXkkuNAs\nUlfUBmZlAek53JWIpd49GM71fg2CffR41tH9Ub56UITv52V7G1rNB8lSZdjP\n8JU7UpImLFI+SgtO4XXKfDKGEgfd9fQkvMVfLHvsnyzFkuJPYg1GPyY+NDyv\nE8NbYjKcdnzdq90oAPSBrI74EOJrjfi/AEWT0CixBFyGJ7U1EgoC2gglc6T0\nKMgZr8DgbvcSRiFctQUNW7/VTLHjBo/hVh8z+vgEfZnav98e/SQPvYa+9kP1\nzvRdev1XmWqbPOa3VLeVnGPT9TYHfjmXN5VIXav1JlSyJfnJfOpctpsf/6F0\nUtWK2aZIug3ZpYfYT0mEnaHgaCj1Eu4SwBcIWRqobZj1ISSS/kzng9nE1sNc\nPIdmGe6TwJwJ1DoXuS/SwyIs1e/ZWLUrviw3tEJQ6nEM4EeCzNDXeSouImGq\nlV0gmeZgPL0lgd/Nlp4V9FDeex5bbZ+xcFMotPgPOkyYxYENjXRyORzNjMuW\nj0SocNJfNIx6AaUSJWqDb+zDW8pr465ehqQt3Ejq3+YsWzSvyYATao98Qa3O\nkFu4\r\n=fX01\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT+pcB9IeLZtCi3fH5zp/d+vECfsWJrdPLMJQEibwRBwIhAP8IjFZB0p/sNy88j+7cQWmsgGWfMtALoHJKOUgsz0mg"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.9dfdccb.0_1615827882714_0.8042548192359886"},"_hasShrinkwrap":false},"0.4.2-dev.1291d4a.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.1291d4a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.1291d4a.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.1291d4a.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-SJHBLlz6YG8xYueio9vCfSjR6F8xBTWptIusDBWFJuCcavitVXuluV2Wuzbj6/6uvaMMBAeFhi5dRcREJ1K85Q==","shasum":"385a8c3ea9231101bac2c92c05b6fdfdb6418b15","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.1291d4a.0.tgz","fileCount":18,"unpackedSize":201262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVN0tCRA9TVsSAnZWagAADFsP/0mdvs+R0jAUys2yVZyD\nTmTzY9Em4dk1QpiT++YQjTI/BLuCdmphlF6mEAAOZ8IBx8UpkEsq4WjxOaFY\nj5voVRNyCqz4/4j18OxT4IGlZaGkXlNWjxb4Y5I+rcrAltUeXRmnFgx7i0AM\nO6opLtVSGq6lcYsrBbyxZet+Frm4CJgYbokaNXioA3WC2vG/6l7Xuu9BIhi3\nwIuvYWS5CJITnNHWBZfifc9oFVoi0M8PxRWuRgJkKGPt+lEHsGgpa3XOd0WW\nDAHyrxD+2URMn376Ajg+8ph2cgYBYSDC1sVdXpJJitMEkfhv4jqP5Ao08BcA\nNHYz+fhAd/F09cnj+2hL0CJq1btvWHDYczzGu+gajJkNGlPjhZVmnLa2MBmx\nlxgBIWlegcMfZZIDBZsiZdhz5KimQDnDA6z//Ld1m/AzvYn2ZM6UPdDvRQoo\nKtPc053e7RmaIAK4qOGt1Rxors2SZ1tU/00wpzIYWyG681Ei51uN9dUaXj2W\nO6XQnYwyQKoO1jyrTjRRokTtsto65Luh7zfOvKHeDXzDdGFBsDiSTGtIX1JR\nsA19pgWcuGdUDSOZRCRcGUYDaHmLKU2iL1qinlTgxHvf3QF9eGuZX5K0g+QB\nf7nLTta1tRzECVy1DVXXAsgM/xYpl9Lj0CVxrSJLGdDoSkNlfnmMiLFduZq7\na+32\r\n=cPn8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChXArhBOnrX7MR6AFkS+jTV6z0pVydcBWzMTss8ZWV4AIhAIH39Yh49cylicCHUzxyHX8Uc6Hu2AhAE7kNHly3S/db"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.1291d4a.0_1616174380850_0.3859768069569842"},"_hasShrinkwrap":false},"0.4.2-dev.03e2d10.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.03e2d10.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.03e2d10.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.03e2d10.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-4yb1FIkDKbt43CcQh67Y1Uo2YjPZ/VOjcnonjZ1q+TFZ1UoDBePFXhuGuxy2UW2tBuXRYp25QUJt+R0FR4u7AQ==","shasum":"ef62733ec40a313cedcafa7be1a65ff419586872","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.03e2d10.0.tgz","fileCount":18,"unpackedSize":201262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWKMkCRA9TVsSAnZWagAAq74P/1eRyxcjaE44u1Fk/EHQ\nEUvLV+WkeaadeY6cfKc2iO8jfTsk9Z2mzjcHJHTbnoS+O28m99zN6YmA7aUH\ndD/oFEnTLs+vU17N+m56Lqg0fTDsYPwmAAy5MWyhnjH9E8LWFuKUvPJB8Jbp\n0zAVjs8lmtBm/3CPeLfDdlWf0csmM39Gz4mSeXovIAd73AuiRujYJK8tOSN/\nKQvSRLhwQ99UlCMqAgwOTTjyXedjEkjRfBhSAtwtG2hsd0LbCLB9fbaspgwZ\n5cliAuvVBn6uy03Wk7OjB0UmDjxMhCIZawK8X9cvrX/jhCOIh4kSOrX6XBu1\nZO9jTu9xrl93NtMCSP6NI8/Ay8xeuAG1TP/1ys3bmfgKk9GofFWSb/4q6PwA\n+/I3nhbWO0db/vR1AT+W+sRJ/HzZlAtWcdfvk36w2K3hkYlh5qMG4K5I0q8Q\nXzTorrbSYPdx+zqM+lJMVTwZzg6upmYSLzszD5Tpde7Oyhp4kXi+W+TInh13\nleTNMQmCVkDoC3Euoa9Uv55JcQZmluNFpxVhmHay5TXV3f4XoXneGMLKeRv7\nkGvMhBFeAlbDg3efU/izVdXODnAanIkLEvDnGEyP3NY0Ituasl0O28erRY7h\nX71JYgCSpW60on7Yd7VtOUoAI36da1wLAfMm4qaVRh/WfdcSxxmfoMxWtDtb\nd3sL\r\n=9Uxh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICC/pprgkqHhse2nZZAr0s8OB5u5NJ2erRCCiv7/s4h/AiAj0u1kr2k3f0iCxNLF7wmE6Yy6xDNJVBiCH46hAZsh8A=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.03e2d10.0_1616421667718_0.747274836736475"},"_hasShrinkwrap":false},"0.4.2-dev.ed214bf.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.ed214bf.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ed214bf.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.ed214bf.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Z7MrS9057v04yDuJa9Ahx+nM7UWAyIrVZKAVPNrrB03C+licC4YV6WYN/xUaNCOF2VaYQ9DDrHwDWcCzuW/DdA==","shasum":"3c7409fbeab0474723410bafc78aa8b35529c889","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.ed214bf.0.tgz","fileCount":18,"unpackedSize":201262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWKSeCRA9TVsSAnZWagAAAsIP/0kABVHrAf06fmmCUeNS\n9IzSWJYL+auAnlZfIhH/zs7/ZF8z8inoTD1+Qc9Ni0zF7V5ndRr6Q3yMhijw\njPTR9MuUrBunZsFL9HmfwlmcAchL9KeOS+KfORA0r3LpcveHxsLPqkoVXDYZ\nX7ia2bZtNH0/dk4LGOlM488OuC/9tBVK1y3E/AnVqSgTcLQwVp7mGF/F2lxX\nFqON8s6sJAxwH6MC7SQZuWGyz+GFdGfoUMoW3YaS28tIusEf7i/HbXbXKDik\n2sRDVmk9WE+OO9qdt4isRkrXXucooSpjzW1j9xAJ96vVNBoJoVscVoiKNjhZ\nATPFcwEwmaV62cZvFawRJOZt1Sn2yeBPzCx+nKv4tudhkIdbzsFIAMIr67iv\nR8sVbYKLYo1MOk7BghbXPtwbhTlAclHu8ggRlYe/yROat9BNZ3o7UxjWvfgi\nxjs9jyoXTmfiKUzAwh9pVpd8rHd7nHU+8BaruFGDao96HdynW8K2FKXCoArw\n97JFi2L3ZKq09xKmSAZlnEnuh5ME2D4ZlO4PZ9pGLevpetILUHh6xQm2rCfo\n+sPpM9r1uNccYXzNRtIWYNcTnk+zgMMMJqktde/GKUa5KbLHlSMC6Plgf6Qa\nQsdbF8XEdzSKWzniRjJll3Z8n8SEvnwKuYYFpiomx6MCIJbN/oFBySyiYZsZ\n6nNM\r\n=EvdH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKC6DB25qgsJhwICuMXRYkD3WKMqRbaUjlhFPuRw8ssAIgD+4crAN8K9bR4/94I/gP2VLzJKuHUpQtA29nvb0kaNk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.ed214bf.0_1616422046428_0.18469415862163485"},"_hasShrinkwrap":false},"0.4.2-dev.4db44d6.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.2-dev.4db44d6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.4db44d6.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2-dev.4db44d6.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-uQMNT4Lx7wKScMWpHpsbwggYY1of/Zu2yDIaCMe/p8cqO+sGd97FiNM0hLstNdUbT6/BZ1bjWAU0bcxA8xNbRw==","shasum":"6641e4f59b2ac30c926100266c07074217d421dc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2-dev.4db44d6.0.tgz","fileCount":18,"unpackedSize":201262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkuHCRA9TVsSAnZWagAAYgcP/iSYeNUncTsDT7GHImj2\nDZADBsJArpsQ8+8GLYYdq6e6B+wVNuZ6/+R10uRhvIZcFQvCY3bZL+6b0Z9q\naP7N/UsOBI5JP7ABWZUO3+/+ggp7pQN2Iql2kfCz78Vk9tm6d5EjcwcSbuYE\nyuLYUqCT9uubXtmDKYPegmRVhQX3wc3kPqqk1sgWPJ7bqoZuUBDMiAb/+uZP\nhCF4Iq3+EAe9xJ60GdpzCpea0L5ONFrqMuAamyJ0wLi7wLyFViBDh8DdUrae\noFyDbQ6g/YtcJAsaDWkLUS09kmGTP/hiTjZMK1eHBbHZa2RjmnQ7UdUQVJLv\nZU1SqfOOe3elr2pLQ6yQd93s8vEG3qGeK6597c2qu7gPO2pHWS5k4nqpCZPJ\nQcN5TmtNUofuE4WUjxEpEH3fPuLTBw+OH9Z39DTab6lp3qUD5QYaGbO760nt\ns8BKqYsEskPWRXp35MSqFjmIibs2NiiI2EI5kfcu6RzeEox6VvZdSjjx+14w\n7H60SSEgVytvj4+mZZk1Tlv1/888hwcpdNaEeHU1PZNALvR+o3JVx9coCBN/\nL7djbBJKQJKbKGNYcDpSgQ6h5zHpWraBPP12bwaW+FVCz8FE4F2LMwOrHpbi\nzKQF+gjqQJjQ3ZaP1lXHd00j2sth7umxBUaASO0RCPHlJJRkkrEKWbxw1faL\nb+iz\r\n=me84\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIECCU+3WMrIT+kkmWr/0oAiBHNUXqPe/GlqLX8SqJie4AiEA2uvvhyanv/qY7On0JaUAGci9eH9HpCTu3fpRASaiHBU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2-dev.4db44d6.0_1616530310871_0.24289093422640962"},"_hasShrinkwrap":false},"0.4.3-dev.644dc78.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.3-dev.644dc78.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.644dc78.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3-dev.644dc78.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-stNAwhXBAJA6rqF66VNVgqOdComMY79Bd9v7mtXgqrPp9uNAZhTgBoczmC0LV+OTxuS4lHZd8SNnhS65B4s9Qg==","shasum":"8f845b415503987eca9fc9ca5c460660254812bc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3-dev.644dc78.0.tgz","fileCount":18,"unpackedSize":201736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXKUyCRA9TVsSAnZWagAAzasP/jWYu7KRM+MIMBx4aYu7\nKoo8By/BrMznZH70LRjKZr+KdgNYmNHltvIwBSJwG36GKjIbcuAx2J7sKIm5\nPDDAnMgiQXJMPLmQuUX+2wnlEeOdmLJajzz9slJa65TPAPE0SP5cKzZNDgN6\niwAFAxX1iNEb6e1v6eIwJJ6NzFDvstyPJmYsr37JTQ/r/WNZrgBs+GKI1Nzp\n8BioYJzm18UzsgjcpfloMAwpk0vlXqlZmGtwTjqkR8PyuZz3KZ1E9QRac7iI\nx+dfWwFYzeDxgPiz0y1Wi0kNXYUEnN8Mex9zFFkmtUMXt4itoqxL1l6F94VB\nE0Zty82hJQ8xWxXKKaUG5mvJB/6IzWtY+EW3sQIpvSzYRM2bPDaYCqkYZgV7\nNYUYDMoNzvddvHn4G7IZzP6tUGgdm9ibH47efqlIt4Kk7hbCs21Ang3nC2xy\nBlgMyA18K4GqCSeFjLLGLF1Z271Objgn9UMEiKYk45lpaIwaICiG7jIouvVo\nyITkIha2cpwtLVhk1bR6HB+6Vs2UvNXNr1+BNCPkRC+IPFS5T0UuefyjEluN\nrCBJeGWgbkHKgA4p2TOjvntLs8b97q/VYv+8FUkv5SZkKPRwhN8SBGfRZEmc\noRR41jWORj9o1y7ODusiKL384dHH6kfwdi1kvcNFISHfOSrEsatGf7ShRNhK\n8sJw\r\n=v+95\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtyJi1ee1xRIhtytduLExS3bpzM901Jijh8EGlySfv/gIgPqIo4HvbZePc8AzbIAyeg4luz2WbEOhzJgyJhfjVLOo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3-dev.644dc78.0_1616684338356_0.5347852129365567"},"_hasShrinkwrap":false},"0.4.2":{"name":"@superfluid-finance/js-sdk","version":"0.4.2","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.2","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.2","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-N+3ZqAl56j+b68vEWkijTqMNVGsFdBDWst+3vNMbD1mVsScs0Uc4tdVcowGXhTaj9Vh8iq6wnn/U8iI7ZIzmrQ==","shasum":"eff58bf83bcdc86ee0b01b08b9c1d4f45cffc298","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.2.tgz","fileCount":18,"unpackedSize":201712,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXLj2CRA9TVsSAnZWagAA/P0QAJ0i9fk6p0gy20SMP6pc\nWdvFAnRYL+Au5lUzsQ/oxBhP5aYe1HZw+ykkMohHfSZPNUJsEuLU1SbCbpzt\nG6vQ6OOsjFPmLRwNmal9/xcBcRoxYCr62OfaB8Z8H9D64m5p1S0/TzGgVQ/D\nGgAePPEuWwbFruAsoourDr/L8PSXCOnnySHBCgj2pFMDBnlZGNsjCLqRw9Ts\nETB/srvjY2uA3MnvD0xWloz1S9CkZSSS6mUzQ8QTxWdyWJDpYo9QIAOpYw7T\ndPqVGiAp3mAuX5WoNpvhLopUpqCggUo3wKJSPWslxVmXXZBjNriqeTcqpji6\ne7IuOpnXcPbTvOBAfWAayQZIjlixXyfbXiFpVnAa+D0b3qxFYuwRAXEM5XNm\nmihf8HzfnrmubOu8LuNrKAnVNxECqk7NX0BI7kCvlBzK1tQrn5Gi+iMLbbO6\n1sLfL3cNvjGKFk+hV6993Nukn+TrQWdFFo4cfAqsvQ8iaMOg83J7N3luRFXp\n0q2cIvX3dtVH+ZDmM2xbCmOnNF0C56x32IyRgKOtcy5okUu/b/zN5p6Dy1+/\nltrCvIq0GmlfnpK3fJaM8ygQfKP6VgxEcXfeofAROO6Ng6632RM+em2AndzE\nt3T91hl07GwnTi/1N86G3HdJrP1C2wuxMLZWsHiKtzAA3A6BW2nCB9/CZ7jx\n65Av\r\n=ydhQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDenz5IwCugH7GMz7Ju/m3OakCh9HuteKbkPtRNVUtg+QIgaqrV18EfvGH6+9SXDQWP4lOprMwc1ElKRKrPGuXRLW4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.2_1616689397546_0.9055672533491834"},"_hasShrinkwrap":false},"0.4.3-dev.ab1c34f.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.3-dev.ab1c34f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ab1c34f.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3-dev.ab1c34f.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-XB3vOuk7OKvuB90xtZ2JdFroP53F1WQZhuy3x775ziPcZ4+aV4kZ5Fi2Q+wNim7NLWanQqT4Cz3BEqwOUNxNjQ==","shasum":"d7d9ae5bf9022fc4a1bd7e9c46a72866eb0927cd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3-dev.ab1c34f.0.tgz","fileCount":18,"unpackedSize":202064,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXf9ECRA9TVsSAnZWagAAu3UP/3dcEGyYwTS4Q27I+2LX\ngb0Zqhc/8wO2uND+rY70rXiHgHR2Z6/DtK2FR3ZVhBsKIp0aLjPlZrqPaAcw\n+s+sXWneP5EKqKz2j7ngSCeIpnrAalahrDGHhdJkF8HYKcRTrgd0olEp7u5W\nc6DrQ2Woo+QVnJsM9V9aXPtLNT4UxXqhv7TIx3TA6hN5LLv+bIZ4lqdgHbWZ\npzf8g7AsL1EV5ZNd6w1t14wDEQLEAt7IFm740a912XGMOCc4Eh1mc2hvHwD0\nmj2VI9XArDSze64wVm7uLQqCiMuNeEQB89YfjIcbZLfCAYrTits5JWVYhmY4\nB47LLLgWj9KaUNoci6ssD069sCSv3AWyO6aWL/xYbRWNOo977SYWHUZ9f1lO\nfyKuoIYI3czxem5XOmq2/1Z//7wU3TZO5GShyU4RDb/VUulXMyIRcTmENfrZ\n1jmkJ6Q4TRR8oov6QQ15ub9232a7sSpbhdKx8F5ZGApXRq0h/8lZ1hvT+4g1\n4JLvWz0IRK7cSK84zWlF3ejAgJIOH45lF5UqCCS3zEf3nAHSJaSYkBuSu2Cn\nnKxlsZbRscejLzaNQR59D2qFQ7ZcsrWtMexcxyjGOBH9g/ya/+1dM16fOXNO\n73Nu68WDl/38E3eRoJag3wIehnip/5YRevjeI6pGZVMg0xhJfknD0i/6Oxsn\ngXgB\r\n=1aRA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByeYYTWbGcb8QB7lAOa7lbzY3Y8zc6w2knbZlJ6wyhLAiEA+eu7e3CTVI16wn3N3oQn3lUQ+rhtuxo8w0uVu2cEadI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3-dev.ab1c34f.0_1616772931980_0.25572681743099324"},"_hasShrinkwrap":false},"0.4.3-dev.5ad4132.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.3-dev.5ad4132.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.5ad4132.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| tokens       | String[] | List of tokens | [] |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3-dev.5ad4132.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-sMk3FGz90rfWap7xiuMPkcptLbmdJ4hS4xgRKHkK7MJc8vFFesQRGkOF32atlZkRW7eRiASAiO+DT/5VRV8Jiw==","shasum":"6222c55c11b878fd97c3f560fc93167a266a3aa5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3-dev.5ad4132.0.tgz","fileCount":18,"unpackedSize":203923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbwogCRA9TVsSAnZWagAA/bEP/jYEmH1liXZj2CiN5aNf\n71EmdXIvwFnH/zm6ECyWpHqbqyhKDJDOajU2w0sPv/UdvkTaMdXTSeFrVB2i\n3lNXTk1+NHH2clMqeFslLiHayyMPI0gJkv34lBjeKeod9ujTHiv9/CaQPKCS\neu2vdCDIJPS/WI+5bfT/gnS3Vg7CKCbMo5AVl0EU3HH/XENU+9kpmjUSaByl\nR9n9FWp1LAbrQzpSyYOrwRRMNpfS9G4Xng4YJHXgGwXXRm8MKmGF8RpWpYSG\n38G2cKABDs2oi1MIhWNahmPIKreoUr5ayqw173VJMQBcQUAjbN7liRLMOJRr\nNQ8jy7CFKYBzrpOrewql0cmjJOmJ16mgn2RAMqJepuwvUN4a3M5pvYHi0sBm\nqEpiYOW30MbktWuREHePSuuhQAkfS/7robHKRLAnRyR3iyc9DMVXuq/7qimW\nQfImBH/3w0Y6t10gt79L7G9VfUtuW0SepEjceBvD7bEHi5zB1WIJx1SXX0DE\nLi0rgi9X3XjiT+AlDis9ptryi+seRvqWahs3jaRWkXvjtAhJSHlxUttk4UPS\nYTN+l4NAP5Oqj0v1PtL0tPKX8P+yutCUN0Erm0tQY0dOiNAiJChdFeVe8ZY6\nER2924PagqR6BB+Dx61uThFFOl7uFfAhOxIUJpFka2ohElTj17mOL4iijV6j\nBKMz\r\n=kL+M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPi6AhAu6oErAZySHl/KzTOl0bc6RQPiwguVM1fdAQGAIgZv4cJlTOhvoxuElkwnh1EUTLqO/xu4dx4q/ZgpgjxqE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3-dev.5ad4132.0_1617889823971_0.5758820804772045"},"_hasShrinkwrap":false},"0.4.3-dev.d0e0052.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.3-dev.d0e0052.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d0e0052.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| additionalContracts | String[] | additional contracts to be loaded | [] |\n| tokens       | String[] | List of token keys to load from the resolver | [] |\n| loadSuperNativeToken | Boolean | Load super native token (e.g. ETHx) if possible | false |\n| resolverAddress | Address | Force resolver address | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3-dev.d0e0052.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-IBS8rVsUaMJHr+o7YKM8RoDVF2LT+gyG2cd2aTLbLQ0f2jl3xKzW1Yd8GOqI9mnWC+izl1/3zIkxEBWmF4T9bg==","shasum":"a16e67d3e318e7654a7e54d46f20679d7eafa507","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3-dev.d0e0052.0.tgz","fileCount":18,"unpackedSize":204189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbx7WCRA9TVsSAnZWagAAdMIP/1zth55S2DNyjUEjhhv8\ng3cPeBTgEHpAx/8Jqdx1HKQu9livI8SfitZvBBKPYVI97dlMctitlUG+JalO\nB+vpLvByURMRTjKJHf6Tvsb8pMy3xP+4rHfNPPqDD7iS3Z0WfDHirZMh32UG\nRgae5464G1lpKeSghkGYOaErDzrIpeCbIlHMvwV4m7iH1hy/BcIlQBq4cJNw\nU4EptR8IqO6xvqKvhW9HPaYLQhD6bxkkkYRGJtfu0DbDg5kWRSGKLQbhVXM3\n7GSsE67cBgSRTxsOQR7cgHeO/lsvt6dqRRBeaujt1A7/OMgqKXd7p/CaJujc\ny+xCV1wAS0NULrVstxHBokTLtXXrSyLJAHE1zbfN4OrZ1hgj63APpDp3uG/o\nz4Xokx/h3blc3nlhBYxTlEZcMsFGvY/2W9IlDuqnrIJ+lu4vlGRvSyRut55s\naeqNqRmKrhOw/ro+lldkCWyWm8nWgsueNQfg1kHN2/gzjZYRFEF/5CM3fQr2\nnweOOU+I5+H1pjPH2qXO1MZdztb3tSeTapc43aCLpndtcHXIyAScAIx4ZQQz\n9HAG3AKswy5Z4jXdl9urTqraBeiFynl1R/iTlI0pIbbGx0jukh/gjWdDDNcI\n87tDoNptapHYPx8wVZfjxE3ZUntC9pfi8v/HYddcR7DY7zEaVksspKW7qlhm\nygY8\r\n=WRNU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDazm/TFAxArzkesiWqY1Ybv1hvdxq8DoZt5KUbc5cb6AIgPz0f4HItUq44CwyBtS00y7EDoTXgpp8VYpFZ6fQyO6Q="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3-dev.d0e0052.0_1617895125965_0.23713420787158013"},"_hasShrinkwrap":false},"0.4.3-dev.af486fa.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.3-dev.af486fa.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.af486fa.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| additionalContracts | String[] | additional contracts to be loaded | [] |\n| tokens       | String[] | List of token keys to load from the resolver | [] |\n| loadSuperNativeToken | Boolean | Load super native token (e.g. ETHx) if possible | false |\n| resolverAddress | Address | Force resolver address | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3-dev.af486fa.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-2F/RrZTsUjlHSWoo5HA7fX+JdQsljGpK53nMe8EfC58oF8zGIgm48CIlNhP03REkP7RG6wSPUJbLbZz6tPXPDA==","shasum":"6ef615874d67898925853b3e9088e8c74b0f3300","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3-dev.af486fa.0.tgz","fileCount":18,"unpackedSize":204189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbygyCRA9TVsSAnZWagAAzKQP/0tBpHZsa3bKlgUomFXn\n0ggZr3SXudDm6hRUCpbpkspq1b4BevUMOHIojqVbXnNopWodGRcMdQYtHy6O\nNbktCW2/+Af/albExMP/6PmV4UfesyH+hIpUHZTbOwg+4fGdg5E8+L7b7a3o\nYgxlLg+fkS8Di5wWTZAbFbwpg/Bcflc/UPlTFX993hIT+vcS1XTEzcph+dnO\n9acfUqXLPIpTDg3rOJwEwaEljWbGG1tT24NtG0hUZH3NK61QphpdLAyUrsPm\n0IejV5x5dMzlKRmsnDmjvYnlOkk0RPT5JVCDV3O/h5q/q3Tr2n5z6ixOsbYL\nyc7trbJhZ727VPENQXmcoy1MH/qk/A8Ebne7/gFZYjR2/NEd7zdIJPIzJZ7t\nNB4AhaSt0NUgJizvTVAqKJC+SJVuXosxhPAK+bXsFJbM32R+aQ18U5IbUVOh\nQ424OCKwFSOPyHzUCn7F11N/4/p3p0j/2wuQFGqt6l+ElQ5guaaR4wB7u8Hi\nAGSNVD77ZZ2pm6Q3X6gUCbspyDVaFq3mwnPmGzrLg3UoXD+CbOKupGqHDufm\ncn2zN2P2mBUEVzuJ3jAO7zzdwFsHTd67mZrHX5IZpWxG0F5h8gmqDX9Mh8Fl\n66MWZ0HgHZZixC+BEut2Y+3gXEFeBdOjU74PT9+X3wL8V+m1wahY//Jc/giM\nYg1a\r\n=4FkN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8iKcaRqCOJMMHpb35+KgCHYf53Nb08M6+qw4S1fHrZgIgN60M5ruaeWfjTVv/XpduXelwih1i8D5acy/zSKg0Tds="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3-dev.af486fa.0_1617897522356_0.25942339919603197"},"_hasShrinkwrap":false},"0.4.4-dev.730cbf9.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.730cbf9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.730cbf9.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| additionalContracts | String[] | additional contracts to be loaded | [] |\n| tokens       | String[] | List of token keys to load from the resolver | [] |\n| loadSuperNativeToken | Boolean | Load super native token (e.g. ETHx) if possible | false |\n| resolverAddress | Address | Force resolver address | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.730cbf9.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ztdxPrGI37ooVLeWJjAatUGNiicygESS64Vc/6cLW3mOgqCkO7U2FnedIYlbiOcNmQULfPyQD1zsBzRMBeZMYw==","shasum":"74f103ec0b5268fa83c053139b0b34c58988fba7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.730cbf9.0.tgz","fileCount":18,"unpackedSize":204190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbzNRCRA9TVsSAnZWagAAJCcQAJy7rXVcBknXvT4ir6dQ\nma1HK1cN7tNK6VBd/zKWlJSX4RWMJOjkmzLouQH7ruA6fiMkMU4EA0pbG7v+\nqFaHNxmcyCwFazwub7urMIwZpF03+KFt1Jzqd+nB4YXXLtidtB3U8e1EnjAP\njUqcL5VZK4cSdibsmkhSjeGo3gcgnCjUEgUUpSzVrcCIh4bTp4mmP0ps4yEq\n1NvByKT99s+jr/6WtKxME/5s2gmJKO0j2K/i+Rn2XfeuWmkmkoFuCv1lCxVV\noxQY1R4ljVa5UFdo2NrtbaU+IhmzWBSytIutVGHHsjJcjoD8+3IzVtlXPaRk\n/OqOS3DPwPRWsVAE8ZRBD9GCMrE7HEgwq2c0dh7u5Nw9h5Uj907D36rcHc1e\n+djwYzqu/t4TFD+ThF9y170L60javEDDkw/D9fLF7aBksAApSXCdnU1Lzur1\n4Vwc0eKcWhLZhkamMB98f+hEPTCpWzxjAQQIUecU6PK6tCwjLLxin0qC9Xbx\nKlxz39Eq+geSJWbVSwstV+JY4ErxgJ8YrQScApIz+98W61lJUCVDl18W+wMX\n48V5Q9mWhKkabvbFpXQ+i4esPseDWb+VZzzIYYzZD6G2Zd1CKDK9syJizJgN\nKQOgiNmlFGUtqwslFudy9kFITFG2UNoFc1DCRFPavTNi1IjsMqQPxJDrZyVJ\nd/4s\r\n=mOWm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6S/CpH6UME/9sr0MhClargtJIUWo0eAZqcrUprghiHgIgd2bv/r9Yz3ppIwNSm4lC3N6DGWAS9b1fYjkoAbv0WYA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.730cbf9.0_1617900368586_0.2533111835083883"},"_hasShrinkwrap":false},"0.4.4-dev.b61a962.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.b61a962.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b61a962.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"_blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\" // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument     | Type     | description                              | default |\n| :----------- | :------- | ---------------------------------------- | ------- |\n| version      | String   | Release version of the deployed protocol | v1 |\n| isTruffle    | Boolean  | Use the Framework under the native truffle environment | false |\n| web3         | Object   | Use the Framework with web3.js (1.3.x) | undefined |\n| ethers       | Object   | Use the Framework with ethers.js (5.x.y) | undefined |\n| additionalContracts | String[] | additional contracts to be loaded | [] |\n| tokens       | String[] | List of token keys to load from the resolver | [] |\n| loadSuperNativeToken | Boolean | Load super native token (e.g. ETHx) if possible | false |\n| resolverAddress | Address | Force resolver address | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n* Truffle native environment (developing using `truffle test|exec|egc.`).\n* [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n* [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"]\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: hash => {\n        txHash = hash;\n    }\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n* `sf.cfa` - Constant flow agreement helper.\n* `sf.ida` - Instant distribution agreement helper.\n* `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n* `sf.batchCall` - (TBD) batchCall helper.\n* `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.b61a962.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-PAo1vLrkrV4x5+3ya9NGoPn7bEQ/JK5k0T4Hb/MqerDS1SYmYRglYFTKbbFJWt9xVWpVYojDxn2zYBj25G1BjQ==","shasum":"ed9b81e22fa77becfbde1320ccb4259a758b31ed","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.b61a962.0.tgz","fileCount":18,"unpackedSize":204440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb3MJCRA9TVsSAnZWagAAcqkP/0BVjK+aEuHCV2mqezmv\nmte7l82mBFvIjKlvMamMqtUFyUAOIzqk1T7wo4BwqQZ24U4cBaSOQSgPNY4l\nRHCfdW4G3S7rygjwcKSdMUe+HNmXbJ62eLejX0zPgsnBYf/A6Q0HkljVeokt\nGajACK+cIYbH6lh8+jVlNcXM/17e4/0lixiZKnFuUikDzRr7ZBtBqMb+IQlC\nBPgCrIxMtYx82qxFXII82+mJd2YEXYVWINFw87mD+p5TIKY7py5SvG/kw6kQ\n4B+DwkF6gKPnxmCLHXvLo9Dv/yA6D3pES9AyHxGTSY0StnxN1O3Ms4eVKO1v\nCSC8JafCynKy/kxYe9LrYwYksJeczHe05kj/c3rwrsfHteICjHWMRhv1adk6\n9iQBS9iT1uCYOSX0HemSwtw3ivYYTtUHlGpBCRWWkxkjHw/pGQ0PLOLDNIbt\nl8TNfqnwLv5NXasVh9yQHckeXmASkvHvt0BYcAkBJ6+n84qnAc/y9FkQcQiq\nqVmuqy/msNvy0ubnCk2zZuqD86NgL1i0Gd8SQA3ei/Wv0pkI+Hw+BLcinyXt\nC4bRm2LWvrx4DkQ9d4c0blThgfUEHo3WXnRJkYcQvPnOIxvk5xhivecq0lXV\nrjNXXjMyiLg9y4gOTspiJ9YB+986Eu9hCO3V0xgGdpK+0atibjQEu+OgDLNd\nk574\r\n=taur\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDE/kAbzeePNCwehu8XnUcX21upMSrpGJ5r5TOk8K7EeAiEApnrOm07PZEbgzw80Wl4i+VGGyjQmQsNPSHiLA0TK39s="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.b61a962.0_1617916681429_0.3873697644203298"},"_hasShrinkwrap":false},"0.4.3":{"name":"@superfluid-finance/js-sdk","version":"0.4.3","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.3","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.3","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-7KJFRKBno+QpzQYEAdri49Su8HZJvdxMs2eVlQTpG3nHaah0L9ql9MAdCRmW0VAYnTaBNM2d/WpQyYmrIEDLnA==","shasum":"6baa6e8017f4e32d8e46b5cbebd7d2c92d4c3b7c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.3.tgz","fileCount":18,"unpackedSize":204416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcGP2CRA9TVsSAnZWagAAIoMQAI6yhYwMvE22JuqCCeie\nmlxMgUnMpxR20yUxILSkSueZQkWRHy6EwsOhYu+ZsX6zH8+rlI41Kt374Na0\nqureI3d7R7OkNnOHM9MTChLsshS2RHCPihMXgdEG4i2RmKXYesLod0HsZ1vs\n0pwYL3bXN4GcwQDyETIdq5aNoqXYvrX3foqlrnhBYpg1hrYgXu4jja/4DJPv\n+lQKtdZcRo6GC8AYt4FMmPHUWGu3RHT+ugKuB2Y7R+cd22PbXOZmed46pwU2\nDlBa1HlsMyUI2B0DZH5DYuWidNzZEVfCoMrUAq+L6RY7Rnr/F+DLIDwvPOxk\nRsEkYU0j2qqLxF1QJJdYIUuGUtTOnyJJOWndXfNmgTxRXCZs+A9ht/eyn5QR\nhuOietISzNY3Ax/QUl7dCkvptmDDUg9SDZddZDIusxFeHuP3waa4fF8kxKCt\nRivx/dj5klIv+ujgcoRwdkAYKjL8b55eezn75KoEn9BHjbFz3KLNhGpmpuMt\nGC75BH/taXgKs5iadGH+se+hCaKc0/2z5OlrXPyZUPHvYMLkkwKPbTzElAdM\niOdeIlv8WZiopocO9U2mTrMidy/U6OULJI9tQpXF/Y3VF09n27aeRaJDeG9/\nI3Ga24tIXKDjom0VV5ryLqRw64fuKyWv7NXW9TLlUdF9HhCEmIsqeBFBpFy2\nij2j\r\n=hdfQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9FwhPFpeTwvMdzUDuPPJvo/HcqcCruuRVSPVVxR2dJAIgZj+NPM4PV4dJNeqWr+os/2BuWetqnFa2Hopg5E69PQI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.3_1617978358287_0.9722995642863355"},"_hasShrinkwrap":false},"0.4.4-dev.b78e728.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.b78e728.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b78e728.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.b78e728.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-N+o8neXuzkpNDHNviGAfK8ca07N+MntHfv+dSxFvmKYNgVoafaKrJYIGCe7cvsG7pFkWXOOh1wPYMhqWXRQVkA==","shasum":"2c7eb7376173ff3ed23c4cbb1f7ddd1c91914c5a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.b78e728.0.tgz","fileCount":18,"unpackedSize":205440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq+fUCRA9TVsSAnZWagAA3QYQAIxubwu0LdadjUfWphTW\nniA52RXLH19UKYImMnobPj82S8oAAqweKNymOMdWMbwwEzN/+ewVGason++9\nt2kMF0jsv7RHHv0rxzJIdqgF9KCeKIke6+E6l+p0CeFnmcOhLSKYKr73L9DA\nLuTKlAKqP+yGJ0b2QfkkY0PddvEGuvEqxl/+Ld10v3ZjbT43aZMilUx4owSb\ni1pNKyE+wNDvXEPTrCiPv20/MTEzyYJkBRrjWDyXKMnHzzkCdtIS8efu1b0S\nqDHRQzb56ZNZ7DljEp0ivCOQnt92GeSiQYY/5MyTj4/+pWiHF6hC3dz5GbWy\n2YclEXc7NHK+4q7AZudz8lUFXr2khG05AViAHJ9VCTCCrimlPsgquDKMvsPk\n6BM1eAOLZJP+lH51/ym/XxgPQMs8tEmOshf6YpIyZB5OVpFLHVR/q7XgefGf\nJDc2A/wBdeQgCzveC8cF4g/oZ6fBkWr6y4EEG3Z6A1AJYX2LU+9tX0XbW34X\nm4tAYch3OkdagXbSeMqOj9gvt/BR77u//qXKzsQZBYpEgNeBvE0fR2c0C6rX\nJhjJ1E3z/L665QKbS31er4x5AghjLgCeZXp5j/XycqdhAX5CkYLYS7UUSiiS\nlECLB4fNw5kmbLzlr1Qxrmn7jevuBuhzlBbWZkaVfgruGJX1dVm9sfitvfEG\n79LU\r\n=voLz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5KV/gxEsY4FYv42W8accyIWh9DDbqE629rCReMteYXAiBPNi1ICpE/d0QTrvXikvfR9+3WbDXJVyE4cmMEjQ4CiQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.b78e728.0_1621878739849_0.8763348263602371"},"_hasShrinkwrap":false},"0.4.4-dev.0e2a60f.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.0e2a60f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0e2a60f.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.0e2a60f.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-4Z3tyhMZS+z2u0Ly09xnRj8wSyzsCcfk0jQKYdyUvXDtWDANVFgEHuyqwe6jcvrE9HdRSpL6k9F3JmYC9EJv+Q==","shasum":"0bf3e0e110f7aacca1d9bcff64afabc7f3e72bca","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.0e2a60f.0.tgz","fileCount":18,"unpackedSize":205440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrSSHCRA9TVsSAnZWagAA7BkP/0Dap5rHWX7pj/pP9tcZ\n+8j9YmkW6dHT2CNtr5HykboxCihoDK/MKJQwBVsh8CDgwsM3KXtGLWBmxUQQ\nElRQkgUeUbMFTkbjA/uqulkxlDOHvCPzLFYhG29oDdTVUwHbmE08xiIrUyPB\nHED6YsfGonlZERGS9T18Jtn2XUjVqHnzvXJxUYokLxOHmyqMafQiFfWcB6g6\nRrDe4yVRk6Wkgyo0t5PWCmtXpjrWEAKQahIRo63gDdCnxOcrW/Pn+qd+KeF+\nQzzKI5Y6RPunWlLl4ewr97DUnGcUTZRK0W7QQbPedND/OEBGOyohPlO34fNz\nin0FZlfRP1Y/pZMe+6TSmXFizZZgb2cEskUZAwaT02qCrIB2qmFcekdtWo2M\nEIOSvH/AcOvQoMTsPT4Xjj4IWeoH6QfPAtis+I9iLCXKp98pgbKRNvVeXSYk\nUKwTauio8v3uIiCVBYPWh3LCxBCAM/WUuWBKH/9W5q0vrgjun1rVsp90Uvjh\nZos1mhnzUuJzAEJI/E67MTUF9DeYhdBzAYnDm3S1dCrMPeSzSt6eJMtupBlA\ntMa0m+XoM+gBa7srt4AXsCFY62tgGqlkNtRs5DZwANRqgyTWyRvdtOoSTj3Z\nP2B6FODpheihZZitpZbSi0ohEWDHWcNWu7ouzoIAiWllHd1c4qzp5cTT/uGu\nxnyw\r\n=y5RA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDr96fpomWgkCpgMWp32+HUxOCxHCcyFm7yYf51iIm9AiEA7g68xWHBF2WPOcJ1kJyKvoIPhYWMWBg4m/f4njcmKJk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.0e2a60f.0_1621959814859_0.7060962251303593"},"_hasShrinkwrap":false},"0.4.4-dev.cc0d44b.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.cc0d44b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.cc0d44b.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.cc0d44b.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-yKN0a5ZucF+EUx9bHw9JVk13Kim6DF4g/7dzOxb8wG11jaKlRbTLf7A5MnzI8p/yXOqIjG1JlfCfzITEiMoB8Q==","shasum":"b31031fe671b7865c13defd661a52c86f2d1142b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.cc0d44b.0.tgz","fileCount":18,"unpackedSize":205440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtj5zCRA9TVsSAnZWagAAhzYP/jwGKDCwlYqjJzSBEGo6\ngxW1uu5ExzQN9JnwD1ctw/tHNI0UJ8Isk2nOP3ti6El77nTzUs8cjeHhnbZE\n+mjwTogY3f4vcZQnTzoEFK4dHd4WqUxKDvx8tyVuqbZPhCh4DQed8AIhGhLZ\nvLaraAkJO49V29PTKoExkB/2hodvZAKYB00Ldht7Mwjq2bUhtRGJBVeEjCUM\nTEEInjrkhMHYAUNFVf8srpdS50Au0Of2SY0E/oseZx5p2SmMd36ZQ9NhFTEc\nI28OnQBH4zyZIOoB81wIZsq2L95pVsHPFUutFVZScb7Z+VzlGmizFymUkDdF\nMjnCh2NEOu3PJ4lSGH/KpoOq52MuGd+8HzSnqhR1FeEtEUtQiIf+PwJnUtXq\nobKz9ewE0+jyBBL+A2rx+KM4Uy001IJUDna7fsxA5zNnEB6/OdoWeVzfz7qG\n38Apsz4J5BktfzToPaBC5PyFIX83kc2cbqLacPumkyk2hJhpNXtDJ0yUg0cY\n8UG2EaTxgzOCllI/dpyM5VsGkQD0zwaQpZaw9AZG98NFwDkqx0YbPaurKGfj\nofxEdIxV3mC9WzkO1WEHhK/kILDaeNMWzACRzA26JwYIZcRxYD33P6FP1kTv\nmPENYobsmVPsPv1Um1Ia1l9eFOxOi4uJeaVTLUk5DwlP8cQMfDLS3nTbpmtR\nmlFP\r\n=gxNR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFC/wcoth9mTIZ08hp90RqVZ06SYJwMzKncjJuaXcwNmAiBTvUztDcXAWdQL18KFUM7529elJsF1MK90zzbArRR4nQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.cc0d44b.0_1622556274816_0.13035875366961291"},"_hasShrinkwrap":false},"0.4.4-dev.e20ac6d.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.e20ac6d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e20ac6d.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.e20ac6d.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-lLbNSK8JHvRHQbQn46EPOtsodNZmH2DE4Ub5Q1i8NVHIxeUIZ8QppXtdyapQnbkTJ/v+grkmv2Ly9I/qpVLraA==","shasum":"ff6247cea90d6a4da481c7443ea48ad9fe373014","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.e20ac6d.0.tgz","fileCount":18,"unpackedSize":205440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzIwyCRA9TVsSAnZWagAAhhcP/08qwFaELaW9F56ziMgx\nRWnyYk3oPgLEdgal4Ahcol/4O8YHdB1toc2UGHe7wMTPDhPBEH2aX7/FvpiZ\nGXpzngOH7zOwkpCKOV16dviEjgUDLxZnDgJM7eZQhSc7Xu7HmLiAPUzdaQnh\nDBx1Jhl8C/skmBnB4yYjVaJYziEevswF8QRuzedJwmJHFbZDWemdTADctNCm\nfL8Vd1o4gRddKR+NaIzhe2NM8PGkbGnXlVmCahLhsdct3NFvClO7ENgU1GZa\niJPgOVQcxd+agK+ycoeWsmPVxOaPbUo4eluCtRirotv5Iv/oKfFXLBs7U106\nT6KGSpIAD98VBGaL6Xzx2FYgd+6xIadWYvZgsD44FeRX4YwUQoEc0aHtZSIJ\nXgmohMUKYMpQNk9RIi4IteHy2AD68wr4gcEONJgt9FLm/+PddbaNghW95je8\nWEVUU+3ZpUBtbjt2+wJugtfvclYQ9Ikz9LtqeszaT+b6DtOAw4k7Kgo+uqGT\nfsoSCEBIcGeo2DJXdfAGiRsnNzAJkG8kjNS45dx4HMs7BIEgssHfA58XDFWD\nChrhOmkiId+aw/g/ZifMEOVfhA8eDM7Ps+7w0b9ffXX7hYc4OPfRUlQ4CCdE\nLYA2oVsXEVq63B7dyBweBnWcRcVdTpnW1gylkWWbn9EwsWKa07TShmb/jeuO\nyJi9\r\n=KWJA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGkf+Cy89+zOf9qONyhn8uu/Z50ofy5sDG9uzkrWpnsAAiEAmPBBFHw3KJW0kX2egzSTtV2RNopKDsTnSKYFdVA1iVw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.e20ac6d.0_1624017969635_0.7429973658429958"},"_hasShrinkwrap":false},"0.4.4-dev.d84ea02.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.d84ea02.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d84ea02.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.d84ea02.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-XXmRHBSXjG9BjG6jjcFDpWiV8AJCPoB3vm8likAURlJsSRKXgXM5NTvGmm41hNTV5OkfdqXUNOQmz10rOgpfig==","shasum":"1b6a04f54198a77ad877ed5436f095df1174ef07","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.d84ea02.0.tgz","fileCount":18,"unpackedSize":205559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgz2xfCRA9TVsSAnZWagAAS50P/R1n4nZnAkHw6KveL4o0\nTbs/wT5uAgJOcNMj5NQr9IQvMxb/afkr2tbppvhQa5+Fr3PNBiT3YjuJXK2g\nSOol3+GusTxvNE0sOXqCMAtC5S6Yl95qdWCbwDm51MlIvClXdmUQXbXWNweR\nOmGEDLumXse4ePCzmjTja2MPrAB0v7dq4saMkyJwAPc7s10w3vBwxJ/7HOSG\n0n8i5Bk4ldLKxYYABpAJgVmkb7K9xhg7LHK6B+xC9KFCmxPsUpIlpuLxZn3j\nwV6+7qki+y/nchqyWCQaZTyoTyB6TqkNQY7TT1d9yWhkwDpo6aXuoM1Tufpo\n8iFc5giweCmt79ttvG71LtJhce4mxOAszQtwW/8AkF9kc9fAneBhBRqdl6cz\nOwtwuZn6Jo9nhmcOWSwR+iiY0XmQ1N9wYgTbgYeQfQFFCX5MbRuYCUdaCLoc\nwsE+zCSfE/Zb+lmg3d247mG9ICpCQoOpvmPr2FhJt95Al91jHx822W/0hm0j\nGHMy2H0xdZSME0GtoKnHzERSYDxPCkXm/7W6AdrgEk17WdR/rfOK8oWLC+Rc\n5j+bfB4OE6oRFyiJMgTSEv+je97eaNFZRBQR+Yj+dv3sv+sIq/wqiMvmw7sz\ntafIGr6SQFi2DuazT5oW3UZM43koyAfc1lKWgCYdeCY4m48AlrxZA10QZUmc\nwqQr\r\n=jTCu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLfvvlZehE9K/cF/Y6IzF0uRdWjcHUFHFG3AseUOW61QIhAKDkGKDf/asadA0YnFSY2Wnu7CZUHxpgGxKbqfH0+uDA"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.d84ea02.0_1624206431031_0.7970020208595081"},"_hasShrinkwrap":false},"0.4.4-dev.a327a9c.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.a327a9c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a327a9c.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.a327a9c.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-e8DUKnrUigHmom+VpWDmEwbOXyXNH5iwlxXx3Y26lYIzxalQkXtJ2LjX0cz5AaIxd5dqL0lfRXx/Ytdas3X8Pg==","shasum":"dacc5b68aa8906d673238dad4d5dd3c67c7d9c10","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.a327a9c.0.tgz","fileCount":18,"unpackedSize":205730,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0bBRCRA9TVsSAnZWagAA2hsP/27n8QEUHnVJ59EitzXL\n6Q77VH2iM8Y4UGBS2UmIuVGzTkR8daMm+09VcgX09uY/VJFWdhAoSJuUM1+p\njOI2BWiGCxqfQI69FValCmGFogXAZdoHvTVkf4bG8aY+bWzadliv6qLSMzXX\nAKlc1YBZEnjwE2fMGvBwGdcEaOMv2AyPesIb6haQPT4HiI8KOJfTQT4fmYsP\n4AdODheSgfOaF5a73FhD+oCv7gcFNzZl+XK2VZgyTo5moT0lKWu8vQFMhJJQ\nHCyIeSjIaDGK7yhGfFyyBXGVAR1ZucwWT/Q/7gzdjGrcVeMIxaSoqWjH6ELc\nwNqNsz7hA887mU/V/8APaYRCZ/jtxZ4ECaaQrCRM26DvMOQZodlt142eTcQU\nO0+vyPmXYwTzXGACgnD3AHG84lS9koZf44pPUfT+ijLflrZ8NcPYKLAn+J0M\n91D+8ZHYTCZ74/z4ZKev8OZKeOGLDeXemp6Yn4K3799NcjRLksosrdK2FLz8\noQIGoBxGBzqZKhX3egahTAKWLgh6UseR7OPsqgxASRDaIicNX+TBVwxKQzRe\nCyaGVbYb00yFedPL+xQbSpIDTg+yLxgpFiUqdWm01H83U1ypQB/lQB5svfJ3\n6vii9TRpxPYUmh5udIjULBB9VsVUmHHPzQBlt508YR1ZAYk6kaeha+e6o+Q1\nvezq\r\n=ka6Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAe5yibrXMO/5s5s0AX6VY8a7XyKY7YfPQoM859zvLgAIgN5fd31v+MhpMz4MCz/H14+EWiYxToK6w9A3XcNoiWb0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.a327a9c.0_1624354896810_0.6609447808723654"},"_hasShrinkwrap":false},"0.4.4-dev.44f7b39.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.44f7b39.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.44f7b39.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.44f7b39.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-3is/tlJ6dh5zeRsq9v2F4W3+2KjvJqkOpr0BPh6h96CfnabtKvqeCJSN/9CF9XoREGZkzpo8QqPpXxwMNEwc2Q==","shasum":"56c064b6fed7738cd7799f4999ad5a2d2d696306","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.44f7b39.0.tgz","fileCount":18,"unpackedSize":206025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0b3HCRA9TVsSAnZWagAAmVgP/26uFN81lO2IVOv/5Zb2\nR/+bS2j7DALkW3Hxj03V6lHhicXIspl2L0VBqwZyTQBrMBso6g/1eFiWIjBc\nklEE2zmSQCq7LQ5WJGVVGsgqQaRkPxF3sxG9RY6nE5MHrD8pnNyTI5eto2Jn\n3EswleBXjJor2BEmkQN+gwaWNZri1zvPI9GZBgxNeQUlvW5RKBAByb7tYr9X\nyR4chmUmwNSqwEYyvUHU7GUKjIbmb0ezoMrPmDsV3D3FvAQZGzK8uiw8+xQO\nUgRm70pCelhBxzjCyCXPFJ6rpI17gr9XiTxq+Ab7qwkV5sLalKGTFc037+Lz\nfBT3BgsDCWj6GgUs95DzZLK3QzORxGenynEpn0RBI1e0PC/ehL4smkMSgYJY\nditz+rEiWzY0Np5LqKJm6GniUXHkYaRPeK/pmR9iVLzlR6aWcuUdyu79caMK\nxcr7E/QUlzEAAXNY5QhopaZHMYZ60sF8uC6YX7HPSuhuFSg19aA7vd1WQFiB\nJ6PfzyZj7yFXnXYwk2GAUkxYnrPxMaMsy1f6RgQ3iil0IUQtbrGWDqa3X4mm\nvjsDmz//8r7bLcnk0VD6dJBtQTGW55kaXFXhoZlyXUN0Wq1pyKUwNt2U5YI2\no2Yr5UOcjl++BSz5fJR8vrmsW5gbCOS2WeA8Wi0pgkT9EpT/9WP5ZIyz0zB5\nn8xO\r\n=ia8F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELtGXzLoLrer6dy7HFMBKxaTs66rcatpRzf0bAf3RXlAiEA65wO4bbPvesQL4RKDELBxESwb1kIL2vdeT7VAklgpxc="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.44f7b39.0_1624358342768_0.9553820328946769"},"_hasShrinkwrap":false},"0.4.4-dev.fd42afb.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.fd42afb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.fd42afb.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.fd42afb.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-e7NIlOI0R5W5Sb7gOzWpyhelG0ooYbyNAxeqR0mviXLKbW44DEuATPQXINwiTZ7D3L/j355QiWOJO97yAUyBQg==","shasum":"5e4bb96ed5788a41c553a737b96ad00a55d9d1a2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.fd42afb.0.tgz","fileCount":18,"unpackedSize":206025,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4wFSCRA9TVsSAnZWagAAgPAQAIldzHwoxxr26QLB3zpr\nWtFWNbY6KeNueOOkEHcfz0ylmLafGt7hs6o2eUxk13wy3rXXgql+2rTVW3nU\nJ/F/cGVjLfUC6VzvnJUdAx822I5Hfm7ux2vx/I/wnZSAnPGaYgqUfRnDVpzZ\ng0M025w/fMBMezWBN/HUnADwVCkAcZGtimN4Ded+Wot5krIwylLOVcGuCg4R\nXdR1UCFMAEsmxprqgmFDiEWNWr11XY5y0VEapvsf18d8jKBgRbgo+L4w/SN2\nRCpWKVua+gaD7CvYei3t/ueomkloBv+/BHvdH92baQXt1KXKL6KNn4P8ldWL\n5oCC/o+RmAIyc8Z3q66x4nSbCZXxyDVQ2vEngVIoOijfAOIRpqi9SlytiQcB\nnL/imsnKMRRkGzKvQt9a2hTfjeoy8UMTBTwqIgX9JswOHIb/MpRp/MWYNiSJ\nUQi+6PH5yfc3XmNWhFkTt+hiyI3LTYmeBUOh+ny3+jR/WYNsfngazdCZbGQI\nuoxrx3dNHtmfCB0sROvsrDPvqDqrJpQ39du2rRjjb/WovLtJS4PZC/CcCmHm\nIJWPX4Mgla+Dt+Z7UKl1KBKeiDaDtQmkXnuiBqn6/tKHN1BWin0NP5x+xlVi\nVH/zC1fIJbQR9xAzdJ9cLgmCEwEw+jopyok5f7Q/cMfBKLRhEAp3Kh+g5Rp4\niHxt\r\n=tfyT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCr+2MPovYB6JhWnpy/cg1Q8NxYmWzdWIeg36+MPBwkOAIgGlGrnniP8V0t8zVD4rMPhGsWdGNCCSOdkqfN+lLDDgI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.fd42afb.0_1625489746165_0.8278634319140028"},"_hasShrinkwrap":false},"0.4.4-dev.d584c3a.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.d584c3a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d584c3a.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.d584c3a.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ew2qcKBbqWV7GBipfuUbl0D8JqI3zqXqejLkcnBbif21ZCPK+gFcTVTMU0WN5wkC9/AvVu1fXTjPaXs8pvtzeQ==","shasum":"d2d793a0d2eba2c6b63eee17704b4fe945bd8249","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.d584c3a.0.tgz","fileCount":19,"unpackedSize":213770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4w3TCRA9TVsSAnZWagAAjtMP/2n5gsGO9BJOh1qq5xrG\nhTsOxABhjUfHlrgHBm/0t6fhn7snZCv4BlxZwvEG/ZEUlDyFd2AhYh3viJdl\nHKp4ptwq/IXF9AmPAIyN+ukHzWeNmuzsHmFbXEJVgBXjtxS1X5DQCl4vwC+Y\n21HvUeIFRs6vjwpIwMGb3d8skOdzInfyLMf/3QUOFJouNNOAReoG2iztJPsq\nsMK1hUMV9IKlLMetZYKhN8t2e6j91FDDrDqCYG1WvuWDnZ+pc3IDaGVhE3ld\n5P2ZfeyHuQ5GfkpMT9rtHWj4tNsd1uz6SMECq3EQESpyIzjHPLa4qW/yMFjh\nK2Tq1GJbpPIZYiAnt+Gpgg0Wy6krctuP4AkVp5EkNxH6YuB1IpmVhvas4WTj\nRgRNkRIGBMnTHxTcWjckfc5F32rwUtpKSCsMk/qncn062bSc4gHD5ZZ+RL6m\ndfF2HJxXK99e1FlAEeH/2o96VIkxtyHdbem/E1pBDdypSK4DRiRSmbrCV6pS\noAQF4MHulouMJHCU+ac2W6gsWdeST4CJD5VXZt+bdfESjTSlEQIeUFfznq4W\nhE7BLAkrgZkko7ZKkWUi8qCoTKkActIspVTx+Yj3VB2n4OxWBD0oXXGnaCX8\nn8rHJDB5+eR4co1Jrrl/3tGXTqSdOHDqOSgeHwiC4H0A2DemQlUdZpFr8JQ7\np+LR\r\n=FSWt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGP8ssoU9LCRE5IaW87I0f/nSNGMjoa7cuMUVO6nKyzvAiEAscehDyRNyL3EAOXYuBQGI3Jx96dZy5zY4K/6/ZIIN2M="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.d584c3a.0_1625492946832_0.42430490401563903"},"_hasShrinkwrap":false},"0.4.4-dev.e96ad98.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.e96ad98.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e96ad98.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.e96ad98.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-e44OrPHXPiwzM/R0OGSnaF2XqzzCoNNSBpj0HaIozU5D5W4qJanaIECnzxHoZJkupj1cGJRW3UfK9PNPmxd8qQ==","shasum":"15b6ce9fd624bfa6c44ae9102b019f730c029fb6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.e96ad98.0.tgz","fileCount":19,"unpackedSize":213770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5DJ2CRA9TVsSAnZWagAA4ikP/A6quuBzbXD8AOVlih5P\nBw0RhbOqosWSjBxlDUAsWVIpIjf8OFztk61KXycfBpgxAjgVoWlw5UBSuZ+9\nWn23+zYQ51fFpqydkmQGtbXc4+8/0BVtN4N5fRhG4QeNfLmAGn7DER2WaNYW\nLO/Es/ZhOW7MflWwk8R2b2eejMBr909ZjvGnMA2uihx9uD12M5Z3iy25VxEq\nfEk1vDTu0T7W88G+J9lq783msnz6deXajKyfdW8UhHELHbHseLBXcjDV2oJ2\nluvwtVqZ0KQh3Qp91NeZP/N086HMZl4dV8eqzPRvbjIjYMhxnYKnx6ztvHha\n0E4xcI72bQ8u63H4k2m91Ho78QH4ksfd3IZXEw2DnkUJVTRB49s52eV0jQqx\nfhkLtDs/vXTHh1j6o6t8LGro8cJzzrXH1MUpaYCU1tOOMYja6APOPU4obtBP\nUBRdiCZRsn4zlB5XMIlfmOenAa9OYBXr93rTCdigtvazjcjifmtZss50KgWv\nrFFTf+SwzXH/YphJi2BDyo2IYreX5HqbYuxN403q9v0v5I1adBoQGVIdfuoy\nNdOHg4KZI3iKESQmioHJsk6KW19QC5ct6NflCU5IuMN1DKtVT8iw9cfOMH9z\nHnxscIUd/mzCf8E2bP0uFEFiA9i6+1dzEe/TLt8mB0lpu3I57LMWY/uaKIGH\n6prh\r\n=DyUu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQ75iKGxIXzXKvvI0zdULZJ6neH3Qu8NLPG3R3QwL4aAiAJmWLb4tXeq2Eaus45OSI21UEyK4zcb2sQ+6VCH4dTIA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.e96ad98.0_1625567861858_0.8457839115234143"},"_hasShrinkwrap":false},"0.4.4-dev.cf27f60.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.cf27f60.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-prettier":"prettier --check **/*.js && echo '✔  Your .js files look pretty.'","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-prettier","yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.cf27f60.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.cf27f60.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-DHZxynzZ/zIZbAopkFDGJGHyDh6aUDoZRzM+7N3D432HY8SZFtjdBwU2Yuh4mnv17bJywscaTJ+XoiXYVANaFw==","shasum":"e5a448b4afe04c66cf7d2eb9321bdbf76b8fabe6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.cf27f60.0.tgz","fileCount":19,"unpackedSize":213770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5uccCRA9TVsSAnZWagAAe3wP/i4VR6e6w9F8N1SCvuiy\ntxANdm5Kax1FSMWaLlqbu2FiEol9k4HApzvGXGo8VaIt1moIxa2DFIG/ViEW\nhF8TyrtfbHTOBxHdFfZGhG/y6hgvRg2yUwCLhmiNwJnYGFk/Vf8yedpu4Awx\nC6gaNW9uzUni5Nn6Qg3hmRxmFIRlgl0FsZAJke5J0tQrtShVzz0CLeR2e8a2\nLfCqbTvGfmwy5L7+nKsyQE9+58cTXSITns4nDwmxaVfmZThPEpiUGcc+BTRz\ncNCWQH563a9J0Lwgv+Drlnmmwbl9yugff+PZmqmxtb7aHirj+1e4rjreObSw\nekCRl45/Nj9QHnnzuXZIoccs0qBnQmQvXJ14De/vUEdI3aUV6vfemKjQrusZ\n4hrFlbDxN3q4Ho/y+u6uT5INXS94hiOSxOu/SIsxtWmhtDQW1oR/Wmbo3QaJ\nQYA9VFKlyMH8ScSpoQuA6EBM0frUonIqKDkiE3YKDhNDRObLnpK1G6fePoUc\nD5JJctEM4Dd5h48f/2emSEpEJWpHRIfpw6R4Im8JAjzIwzIUSlYXWCB5PJS7\nBWzrMd5b69GjmUHw+RW6Hwem7vN4W6vIFXD3Gmt08alACdJM8yJAxxABsCTa\nTV1OeKt2IwNkLs/vYWs5CBVT1+gfsZZNtBDYC47nBuFvm6wsV/skw/Sfkrj9\nWERs\r\n=LBjF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFO1xxirAJskHK6Nc/swnGGe16cipZ/TGjWsHbBkKnE+AiBT11TZ2ej3WFtmYAd/35K700Gs28LlRiwwA/uGi19sLQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.cf27f60.0_1625745180133_0.7435587511060884"},"_hasShrinkwrap":false},"0.4.4-dev.9e35af2.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.4-dev.9e35af2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.9e35af2.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4-dev.9e35af2.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-3Zy6LVXIy5EI6Y4ilzIj5OGOFWNjqle79YhrMy8YONwL325vMZ4QlJheKeS+Ki757/JNgTrK40aM2ZqIi/7QNQ==","shasum":"f098e08ec73a123190d4073c5c580573a1179e34","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4-dev.9e35af2.0.tgz","fileCount":19,"unpackedSize":213200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6HsYCRA9TVsSAnZWagAAirUP/1/eAjersjiaWm12XCCc\nwRrXzGOMDVNP8PSxj0FeoZ2Hgec5Ox+5yiXllLbN8UcOY5BlyZdeMH0cBTKu\nDiH/gBSTro6etGg6OfYhirdkLDCCxvKwfXTvQkDgdsBnhouHwPkiZUogFp1a\ncll5Q7Lnnaq7sUt5pktug8ncvsJHs1UPcUJS0k0PIK4Kkn+TTYAs3138tD8R\niwzQevwXAvaKoeiLJTuxFFrAq/cQ7Uiv2AI3Gdq0dh/obolzmeRw0Ed2d2Db\nXDV5GPMLWwdQeurjzWtEfMeARkVSrOObWcYrpZFTojn7SbBdu/9U45kuyRgY\n2NbGzjrEPbD/zu4R7pLWxE7fAu/P2qZmaXKexDa/fHS657VK/gr4R8txoJu7\nO2eQvz+ytyZKUz9iQ6lEytJkcm/9XLCOyGvXr03tBauXQ2trVYnKPBqeXfQi\n4gJ+ul8uwxvjk1qNWkV8rV+aEv6ulZa/SyPvvLUABxPn7HXtI1rP18OJudtx\nKYMRrZzg5UM7TBvLrku2D+hEgc/PQusmHHMIS12DRhpkXeLEdhQugjPmbt92\nINWtqVMzzsaYABeTrz8YiGIKtYDZHTJOld60hh+zi/aTIFBX6/xCWKnst6dk\nQLcxOiWi9xJwI9R6euYu8s3xalA3y3eNLxBVjEvYuYr9SygZx9OEktNZOuq7\ne97n\r\n=wTxp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7kRPNqMjZ75WxsPVOmqeQRgCC5Ma90Cxf770TsY6GTQIgXcdRkafs2JjLtQe8Vfg4UlZCIyeANzODPkK+PYW5xko="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4-dev.9e35af2.0_1625848600256_0.2900740690980632"},"_hasShrinkwrap":false},"0.4.5-dev.ba35ce9.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.ba35ce9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ba35ce9.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.ba35ce9.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-+S9OB3U3QO9ucZEmaJmmLvmgMJVYC7aWBdpr7RXcGSleyferoFWpAkt2uBn0FkAFv3crKrH5qt4EvTWLkAo5tA==","shasum":"e87152547e875668240f26844fd304de0d03519f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.ba35ce9.0.tgz","fileCount":19,"unpackedSize":213200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6IGKCRA9TVsSAnZWagAA3B0P+QCY5met+ZBpcQJPkWX4\nuVMaV8Rpz5Cht/P6d4exRh0M4jeMn64ZMmsRskVj7pyuo51xqmRhPuNe56gi\nA+s4c9Gd1mQzV+KhkzEUVHRJUXb/Fnw/quo/pneAzY/tJPI2q5LWXJzfFouE\nXx1tguEvphBKuthYhnyrnSvuMoBch6p5RmVakCH/1wnj393T7GaaszwxB/9e\nRZPBEtXbNrUcdAcO8uxH6Qz0Q8CjvnJVgkDxh5ljMlChLD16jUfdTXNincVo\nn8r6bZDbgCnIUI+Aqn7E2fmKKmKwr9Elq/y0U7oxc2XsIVKjdH4zoCU8ml2o\nW6+s7RDPT2E2FOaaeh40+/cvkDM1qahKWx38fe9jkeXh2VCXqRrJGexAd2mG\nNH2TP6QU8X5ugxYd9SOQRllFA353T/Bz37CRRb+7xL2x1CUg0E1M8MTAZ8Jd\ncUzKsiY5hxuGQHzsWSsBlmY77yqkSPB4W7FVs1WjOigU+buRB5xP8hce5les\ns2HOXCVE+ZUJRnSspieN9tSLP3U52Y60rPQG0QfqgWQnFWVszgdFXg8Y6gyC\nC1f/9Q+Uagfo1fK48PleCH8o8wS1+wFmS2PObfGTadCqEqM3dCOyV7SKRiHi\nO76mYIPV1/BpcN3jCfsI45hozM0/F7abMcYUpwcey2EqX571MXVSlTEB7/Vh\nUBfw\r\n=Fx4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFgZFsP0QQxZA6BTpwEbRDn0s8bc3jrNsNYaa0dFl7qyAiBDPfu6CHObBU4KPNbpedScz8tmXDfu5xo4YmHt9FJSOg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.ba35ce9.0_1625850249675_0.2706173752030179"},"_hasShrinkwrap":false},"0.4.4":{"name":"@superfluid-finance/js-sdk","version":"0.4.4","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.5","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.4","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-hiPZBDQ2i8t5ouH4BDKT1MTSxJzogkfK9ymbcxw3BcC0q9Slb5p+l5QPHLM0AiZjcH1koZ8jsrth1MiijVW1lg==","shasum":"60ee80112f32b3e9332982548d856d57cf327110","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.4.tgz","fileCount":19,"unpackedSize":213176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6J2ACRA9TVsSAnZWagAAfCwQAKQ70LyQSmjkCT4AY4RE\nzjjrWYKE4x1dfRwRzaiXHJxfiCySSJqANzKTmkuaH7u4cfCV5wLDy5oOdQOD\n/jYur9gP0RpV4glcn71MjQ4Ts54fUab6s5UQjl3NG/mcx/GSMz6o/NrSP/ds\nuH/OWnpuIp5cqu6Hhs59j+wuhLeZ6tbF73GR2Wyn9RVMKOKXcs/37ImknEGv\nBEm+U2P41Fatsl4UIa0VvbJ2alm77KxmxKVas88o5Iz3W2j65iCdAVndJqZv\nNswTC/jU/PLaIiCCNnC+rI1oW3wT9UUVNF+BxZyN4Nv4Ak4YdbNcm8JswS+n\nvW12EXz5oCBbCV31DYkWSlqjrmd5VqrN35W4bxAHgd83z128M7nuYMAoc+ZY\nK3adCaz4e09KcDrw+9vL0B8ELEmq4h8Jhv5WlQKxG3JmxJYqY1bVjGUuEU+O\nT/QGQ+pxnkZQsF0PVq5DxYmczrVF35yazWKkpzn2bmjdconSs5hY8rXJqnTr\nj9e6Uoko++3k16XXCTucxa/up//XzvbCBcRgqWdOJBRBp+Ip6XLM6vLJsht+\n1+X7yVEH1rAOMLtbEFms6T41oWWHHi6lLWKnvLb4TMzpWwpGHY2bcUnDq8Zq\nKd0d8CHw1Tu2y8vQIygaGcqXO4tRM6H/6F3jtbcHkq1xL0Jvf34Jp2wmLQT4\n1g7h\r\n=rWbb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMCAUCaNT7oA81Zt859o3YukSFo0nt2H/b2ZnZS9g95AiA46QWNDAvXn6pF0zi0HCbezUCpCconjg0onxKD3ivWQQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.4_1625857407499_0.5210413389397361"},"_hasShrinkwrap":false},"0.4.5-dev.17a5688.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.17a5688.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.17a5688.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.17a5688.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8FrnNeI140F5/macedFRphXkXka8brZZJhUoCLAsCilbOUCILusNLp0m+4yPJ3HHb0M+Bb9WWvrqBtFKoGROPQ==","shasum":"124b99676d0bfcdce1c7ae1ae2ffea3761cfe2bd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.17a5688.0.tgz","fileCount":19,"unpackedSize":213200,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6LVeCRA9TVsSAnZWagAA3EYP/jHyBWRfNyTk0Wd+guSz\nY/Sylg5lDxeve4DTlDhNUlum4sqs9gs78RxmAyHdpLIev5HitzXuU7MsBcCY\n6BDa0BmJgdltE4T4JnMhmriRz6MPNEQgmyS8cDfWPMOWuXAL0xt0Yfpf8bYQ\nDQYu05hHhEqVNryqk0I/tqmSEvO5o/5p40hmHnTST9pa+3y/xQCVIcqBc6VS\njcFm2Kda58Dv3QXO+ZJwHGx5SY4N4tzlq2cwqO2Duh6irXa3zYRMhfxaJC5M\nfyi6tOIkEE1HCYhlFDuxGSKYhv6amnXjBxkF6Rkt8PIa4cNYLGCtpOdjbij5\ncgjgBQL1s8TQfILJDcRK989W7SZDxBicq4VR0uJ7aTKZ50klmmmC3VHFFvJb\nQxOrUGteqH73etn6fo5+l1TY3g2+J0ilYkyvdhcoyKBN3bnOneGXRNo93Lue\nBBScfmBS4J5UxYjDITmox3LSzmFBmKKGe2VkoAA7ozO3/GyxWSwwDR7/+3i/\n7vTcj4nOue31t03UoOk3+jpha0vTozKf7CbjNzv6V/7rMM5ELJ5T1FTuwgpz\nhGo73IabVwJRdtIH8kFZ1veD49JYGjlp+Cmxt7kTb1BejXK6WD/FTNXRT1Jt\n3zuvd48PwRg8mkHuyD5ygLkOAqc6KkUr0Mlgmy0drlLcNQgMC2vSE61Kg38L\nzU9y\r\n=Q5fs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFEkWmdJ3U7/LB5CaKhkR/bPOH1cV53lz8AHV6NlY8naAiEAmTOh2EpVW199Xd6Zqe6aurS9cWNbfXVUNdDR0J3Iv/I="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.17a5688.0_1625863517676_0.5782989506891185"},"_hasShrinkwrap":false},"0.4.5-dev.43719e0.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.43719e0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.43719e0.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.43719e0.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-23alHUU+jGs4LaSrB1fZ8iIc+0opTNSa1NxEp9CSRD1QadUJO6el/LYJmKX244c+wxrKg73YAbEgujtZuCj5iA==","shasum":"a7d9e5714e299c63150440e966d45ca516b2515c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.43719e0.0.tgz","fileCount":19,"unpackedSize":213210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8GyaCRA9TVsSAnZWagAA9kQP/0xpLb8ZRKs6p/QoArFL\np7h9Tr+1jIb5obgiOdHgGdCA0YDKzNg3Qpm2+1PGumRIOJ1lZS5DLS0TdS99\nxM1umBj7swoPysHhGtyKfO8Thh4BP9KkjRljiyOwwGE2qtTeSsCt45sHktXk\nVIZfQByTX67xKivVdYGnfasL9D5WBb/hj/h65a0KqxHobGLBIx//xZoiVj3i\ngo9eUZaPtlUSNTOF/E20/j9mAFZxrcA6eKmCV/ptIZ38H0lyMMWGtZ4vxxGJ\nPeqCgkczLz92g5x2uFq3FvtFuEQQBjkxH0+NeyB/2qft1Jd2T+dgo+Rng/Hi\nwvlujaSRQ3IkUjlWbbNTxiY2v6mlMA2weUohwz+en+VbghdrYxslD30Qsn9I\nszwJ+9GRB4C8tgNE8cjx54kGKIBKU6izizWiFDEsjm7RnexK8+5smUzQDByZ\nM1TbUZLgA917t2CL0Ah839TwA+rMFcS1NJFzdtxSThNvPS5SJwIFv9+C3/pp\n680sh1zyc0pjSFjXuinMAk1M1y9aMI13umeKGyI3+oAuN1gFosn4bzsxDpeG\nc83Cb5dfvnjeF4uZ6N79CR2y6GMlEVOnqhpBo8Zj94t2PC+AlR+XESh54JUj\nzUZE4SIyynLNYh5a1LP+IqVUkK0qjeRZxE7iBEmId9uvTbPGL8M7fgEXyf+5\nrEze\r\n=jJGD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRBDMnAtaIgDlFfbW0mw0Dhn2ZKIBwJt/L4QHW4BWHCwIhAMZFJQQtbRp3fZdS+TtvS1xFj960WzAU0qSlu4LqHsWX"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"},{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.43719e0.0_1626369178664_0.1775172045279798"},"_hasShrinkwrap":false},"0.4.5-dev.6eb4952.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.6eb4952.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.6eb4952.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.6eb4952.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-y5zbw9x/Z+rh2493fLAKWXSaMsE6fL4HMOFp0OgFos30cY9RYShxpcageQY7wNuQOPBzCS03si2U5BqYJVln7Q==","shasum":"93f9d8eb75140aea03c9624c16e5ec6925a2f485","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.6eb4952.0.tgz","fileCount":19,"unpackedSize":213210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg9pVcCRA9TVsSAnZWagAAUVQP/0sZCR4L1YZrUiVcVG9e\nJ0s6MOYB1KgFoQPJCpadkTWnchD2He8dGQb+lMFE/CMRn7e/EsdaLbJh/OzO\n+m1oGGFFibLXZIhj2KFvSz8HVSfwVSlI4axQyOABD7jgqd+jRu0gmGDJTzHX\ncUkGpcgHy15V6VdhB/BC5uAKTM1jBYpBTvPtCWUVxWexK6xXVMXRTfWeukql\npZ8v4LOIgjefan5bjrDjafkzDUa5ceL2uadutWXLO3vj7doktyoNPOKGyjma\nqCa4d5NZlNrOYnhyOLmilDXpR0uVxoYXYdQ4lQE9nsmbz0cJbTUAX8Oxq1KK\nLQCx3O8oA8o7CIIhOEukO7cItuK+iIY31Z0ib2xrXS6YA61pqwEenfXJ8GWS\nIWF/IZKuL++Dbyn8Y/d0f2obGk+vvZGELdu4JXaMqX4Bdx2MuodIE0off1Qo\n9yUchCTzFR5nG769HnXLrkRnSbgrRPaU78IcF/1kuWbnnKejRLgWUP0QdyAs\nggZ1gPv5Q9+B0VmztBIrfURP4Iqm5zgByJyKQjpQtsuK4EGrBeVCm57i9lol\nLqoR5XJLjeV5OqKR4pMDrWwu9dpmlIqF9Obyosz5G8qtSXdM3YeL6IHOPo5P\nFx01mJYrra4dus7wUUHV6jj18sRIVBrzbXw/ohJtgjRt0jL5OB2aS/XVZWrf\n34LN\r\n=rEsV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSRHr44eQ7qYXON0zRHfDIEQN1HQBl1iIz6C9gBjdKaAiEAqqN3JDFSZgTa6n6HdwCKsTxdUlmwOJW58+Fe/O7z664="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.6eb4952.0_1626772828294_0.811143050135563"},"_hasShrinkwrap":false},"0.4.5-dev.e7765f5.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.e7765f5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e7765f5.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.e7765f5.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-9GbWwXmFdqh57XQjheXFc1jTncY7RtGsPzV/bTDoFoZLt/ncXtmFHk2/mSC51PwdohGeBwr8tBwyd7bIWmFmxA==","shasum":"accd254b439104325de794841cc7b7f38e103d5d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.e7765f5.0.tgz","fileCount":19,"unpackedSize":213210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/uxrCRA9TVsSAnZWagAAFFQP/j7QhQMH6FNwxLvKwhMv\n0ENRIP8H4CaO/2FQrJaTV5Us7aUXvmfCKI7qL8tY6nDp76whmw75koMEMBVx\nnLyJnnp1cpIul/NXY7jL8wFk2mpxUMwe5/mgqEGw2AHHRVYhAs6Rx4MHiuCP\n+OBufivhRTvLzyHWMisjlV62iZomOxtaGrsX+OalVvbQ3jTzdD/9gmZhTSPy\nCcQyoRa3je+/A3g2DzhLFDwNDci2sa6T4ATWIByN273f7/ex5GqNxPbYXbvz\nVPVgAsu59KO03P1B5qnMVpNxM68L/lkNFWauaG4ld3288nAtbV0Zy8uzriWm\n4oH5dtUCszBBpBTK9JsDMZFkQcZQUKXbNw4WPX46asi7ELkQQg7FvUTdRY8m\nBEM+kooAlJove6xs7M+LUd8kyd0NpAbrHRnMcSkLfcbSa+4YrcRbbPl191/I\nXGSD5zxy4pN+jUxWW+U+XjthfBprC2iCaETWT8UCHQTCRalFLHl8I85ohMvq\nglMioE6pcybT7hIfzsLgRmAO9eGMLlHqp8iDezqylN518uqP9ENz5AmSLJoz\nTmeBWOB0fYswFm9ovhDvUju0eq1kaFBnWzofCJ72785vaG4LYlfvo87KpBYU\nS9SQSvO3YJDm55mvYpfRW71ePR//M6JTUffb5HErJqUH8F8g/pmY7LSU7xPw\n7I45\r\n=ultj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKswyfZeVbXliYoWP3dRqJ/Fx45/CkFJIrOfp4UkKdYAIgItl1NicDCyaqHtyJsSRaCudYoWapW3C35QR9Ghy/ECs="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.e7765f5.0_1627319403481_0.4045176421636021"},"_hasShrinkwrap":false},"0.4.5-dev.91364b3.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.91364b3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.91364b3.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.91364b3.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-kl2AY7071DBqpK//tPRndKb76Q4dnd/MMvISA6mbfUu+P8GyLLCqIhZVJJ2ahKI15egVY8YzTWvi+vvdpPDhvA==","shasum":"e7618263735b50bb74391e9ed1c200939abaf53a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.91364b3.0.tgz","fileCount":19,"unpackedSize":213275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAspOCRA9TVsSAnZWagAAmKUQAIod/Ka9mwUrg38WUp3u\nxbii5PwxDX8kv/mz9zKM0KT8TX/KCJOWGes1YtwUxrRv2O+RX8PIlf9jsOgK\nEyHWY4YxsrhzHbOvd97MrcyogTxI8ItokkKjaB1Q0TnoEmv0aqDGnT8aARj3\nwIPc1LApQuPMIE1QvbTP1/C8F1Muqq/t1KPi5tBGVOIUTB/k003PrZimwJle\nkX6Lm5bYEmBFcpJv7yO/QXDhq7Ds0yu+s2FJVXwNeywuOrYuSYxoK5fgnMkF\nYnqITH4ieMaeWHK7iXgBZpX5ww1lbN46z8ywR+XHt2PAwTGZXZgUmHD5OMR2\n0TZm6gHSBnzfTdpT+RjYXz62RnDZ72/9k1BTA2sZrdgGm5TlYxjXO9AQfLl1\nm+StUrXuTUdhLPvJsGLD8VcnbUbWKDUiDlKCbLE+Vef/Sw3jBaS1xc1U5mk0\n/vHfYHFx6Ila0/fiD1zRrbYle+tFxnUNEzfmwC5Eyfkz5NmLxSxLwiyUf14x\nTBN8+JpAIS+mtgw5bJplRGlsELuKkgOyZgKQPbN0/uH/JPd868XjHV6JvqNb\nE8B1mGvEtDfTYPh/n0B2qEm85h2+ZGB3FL5Z9uKfW1v4g5LS7oz7va96zUnY\n6KAcLj/fKajSght5W/PfCvG5vuLhDx+EPT31lnSnLS6MFGVh7qd0cG3VzH28\nJrLD\r\n=1OU/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgEh5NdRwHsScQd+084gIXHw8Q3witF+lDRA/T3MdIsQIhAM2+QzQdfmU7XclpxbVJ5svu2TxraYSg/iFvez/nHLkr"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.91364b3.0_1627572814406_0.6527587759266635"},"_hasShrinkwrap":false},"0.4.5-dev.7aebc62.0":{"name":"@superfluid-finance/js-sdk","version":"0.4.5-dev.7aebc62.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.7aebc62.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.4.5-dev.7aebc62.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-xK1MuIpmFUhf07xmokwbnshxcjaE3kw3I8/jW3jwrDJDlWl2mrPIQxq2Kg2RTw9qgVqG/1C1A3F/mAKiWNAUpQ==","shasum":"2ea2ace2c319b5b655d9ec909b887a81a3137252","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.4.5-dev.7aebc62.0.tgz","fileCount":19,"unpackedSize":217035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBCzoCRA9TVsSAnZWagAAb1cP+wWIGUNsFFAIDDjeXnR/\nbi31jFKuixMTCv4GQE+F/HmGk8bqEARWSrFDQDRpsU7f2+C8qpHnoK6dYv7S\nceDFI0jLnCWZkIkAcn0NBZ+AJm6FAfB2uLtYgcJEJMrE3l4D4rtmVDKyKSCO\n4J6CjXpfDrk3jmmxVF1zfJaCNkY6IfLDX28Avcld+8X0xhInw79ZR5KUKwLJ\nhAXXMAAY2TIfzzf98FpZd951wCFpp0jQnq/pHSR45P+2FZzrXhEh+wD+bN9g\npi2iLcxDvrxReP9CutC/NocZXMN3Pq36J1gRI5FlmiKjtgLd2zzHbd19QKgp\nmNF/Ebsn17GByxefmDctc2NvJsSDtK/FehyJSTcWmHjx4RSzQ8h2fTBMSEG5\nQSKiEToNUOYf8zmVdXVIYFoWwhwHsj++Ue1JO47xml90/xZ1lWeOUb6qZGhC\nelhcP4qGQfO7EeHPrKVBd7BA28NSLG31N1reTf5LHf6STsrr8sQ8c9T/SrWf\nonf5i5fEHRZLVck2dVIc+n5WXRtS4HNxxC/d1lG01xRnKnlG20ACKzWtimnM\nDCdWkFCIuTCfcYKR5AF/1YvPRwLw1M+ZkLsdm8mbn0zdQO4G697jBT7ZkDqu\nzfP1gQOdVorul5Pr9wnNLuZO2cQ+6oroyVB14OhDaYkSDbU68j4T1JDuXf1d\n7caw\r\n=jGET\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/q+y+6KZVrGYtzDClKoZvys5kOh73GDAebqZS+7dSUQIhAMwSepp1zVG3dI0wCJlfzlVhj8bcw7JwbgLAOYF8aiA1"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.4.5-dev.7aebc62.0_1627663592057_0.6118293223717632"},"_hasShrinkwrap":false},"0.5.1-dev.6c261db.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.1-dev.6c261db.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.6c261db.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.1-dev.6c261db.0","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-bedlLqsXY887trK+MUYTKMH/mLuKwJ3Fm+iloF8akyMMu3nL5HU2alpu9fGwv8yvBGPTDowC59SbZ7C5eLKo0w==","shasum":"b44fe66e13d69db2274115bac022d69d73210b3b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.1-dev.6c261db.0.tgz","fileCount":19,"unpackedSize":217035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCXwgCRA9TVsSAnZWagAAl84P/jAMXUjg+JmVswd5Rk1e\nWo4QGiQIJ+MVBkLqPqfoIRJUC/mueJ/KVL0gEQyms/svp2hGGYRhNZJ3yuPd\np6niIJavIrM7RXR/kUhlWSCI4+X1D3wa+jLTLrYsDPglaLkiSSgF6qxrwPti\nKFpXiORrdf68laHepyrW24ekTiw/90KNvXdn62wZqsZ+FSikoeeeBlwWK2dc\nR/2r+PMGDgj4YjsAZUOaED0CXTq4a+HSLuTeHrsE/rF/u7T+CC/I34DbRtMv\nbV89/qr58c5hMfIB6djkEtHs8ptADnFb5eAFAXad7E0794FXl9bYOMBbxYRV\nbqDHERumNah+4h6auJY3pKzuIeKf+og026WQArXNzId52FgFV4Wig7EF4IYu\nXNU4bfUvrX02TCHUdo6oUCa+wSItdt1pl5jW3TgxME993/TRAXpcDLvhaLdd\nLyZd257ffqu4W73mww2M9UfigOyeA/CIbdfKZFx1db4f2I7yDNZg1di7bb3u\npJyDfHjrDCvCntHQA3kf+TEkz17PrIMxXb3ZHl+wIjzmLdOOozkBekDo0qc0\nvAx5GJIjxzg1Ma1xz4CKFqRXPatIVehY9JX02i62jMBEKJ485NGuTRquGO7S\nlU1ZxdVY/M5zFbS5gsjd3O0o+hxdUAvbXCXO1A6qq4Q7WayG+nIm1SxtNXyT\nOIif\r\n=gKQX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3a/kdE9FHFi1751nws6euJ8Yu6D0pI0RmVcglrVN6cAIgEyo0iQO/qMT2r1yTBflcevgzqcS3sve4WauEJPZvNJU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.1-dev.6c261db.0_1628011552743_0.6688216455662956"},"_hasShrinkwrap":false},"0.5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.5","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-6Oyn0yTFWg36OKF5j6Jfi9covJ6cCSn3D+ZTGFH4DY1LaYNglKD+BXAxrgtuglx8S6sUa/E6Or3Ssy0FIJ1thg==","shasum":"b39299c3373e1895e8b28440af516f8f4d4005dd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.0.tgz","fileCount":19,"unpackedSize":217011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCYpxCRA9TVsSAnZWagAAKjAP/2JkN0JnHVyeJSQP53DX\nqkkJ/D+B195zZ0U7wDPOmHCmtGcK1jpUBhqb6Q+ChodkvsrNNI8gCZV5aJ9z\n9qqFfDOQtPFcTI+O5n5aBVwodPj1AH4W5xaLcUBTvrEmVMe0c1RrWGtjGqzw\nMGJs0pUbKxwcYjc6pIx+9ZRWtbm8qThac/AH+mpTj4Iyt65EG8ajnJ73L029\nksgMjKvP8nlf0Nd/jX92km1ubqW3bBsp9jgS22d9paHXQg1yny3m3/dNxyxs\nE/o5MFmPzRWumfWuc1S+CoueZSEARQzwmLqJp5E+zLFFDvO1bqU37J6So9K8\nvfB05IYhr3EZ1cGU3QJPUwbvgGxhHwZZMc60t9hicqsSl/3fYYbZJBeSf28W\n2yIauohJ9OCtfLhviGVNVSeArp6fvv6sQScoDwh5Hio7yLbWni14gbt5SecJ\n1qlBLRsXshfS8q8JGxUmqPGG+b/n+sLEgf1km8cCiH40GETeXnQQ27ZBaRIm\nf9cmWupk0NTtjg8pUq2cmSyG7Gx3Twj1WptVUOLs6FWvdNwwxZJ3l//8xBEp\ncWbjjPfZL4IGYfb/Q1Zbo3+lcm/1NeFVpD+uCLgRxUYnxuT95v51hJzZpfSF\nNz0x+gUoIAvEeglHIvs/q3WQk26/I1V9heB/2vZ4irEqnv1pABVtQw/jiNud\nUhZs\r\n=XLU1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVLGKEoEG3H19k/AXz2yxxL9res9UKxoksmt0pSJVo1AIhAIWkfhqahqD9oaQtV0hHhVXTRXU4o8E9hPimfrWCuMYN"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.0_1628015217450_0.9113047662458194"},"_hasShrinkwrap":false},"0.5.1-dev.e67a9fd.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.1-dev.e67a9fd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e67a9fd.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.1-dev.e67a9fd.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-bFt6zXrcvQJRp3GP+iGVruTS3rXxm+93w92sOfqJyACkImLUhht3Ex7Qe+3LIGLhaliJgzcjnqhXAFn6QzmGDQ==","shasum":"3747612e59e38e16c81be27a0aa1c0c11313ac1b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.1-dev.e67a9fd.0.tgz","fileCount":19,"unpackedSize":217035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCZVyCRA9TVsSAnZWagAAssEP/3tCJD1aUWQCLC9zGM5O\ncBiXTN7y4YbsPP5rDvvGeIQq0hzwXOvx/tZ29aiqCfijoUumATQLxKJZ/Ial\nwZCLyz4YHn70SpiiK2OWTsSaxHJhjIZq+WVtfSORPV4LBkKbE6wUVg74Uct2\nroENQhACeBmwdDplfYpRO9uVvqomEJQmx7MGIKtM8wd3+EbdQONkLR0wFMyy\nbrQm9QszH3RTqskGT6ydSsIMOK5cXFTD/CK+C3ZdHoU0I08tfxQKcNIxmD+Z\nUmNyE5J8ouUVxLhCEePjiuEXN0gCBa6QoUuB9hvJKl1gAktpPhVq6OcY2Zqc\nGQh2ngImXQC2iFT2niC6HGk4o3pKIrDmx16c5e6GZCwt8VHoy8B5I42mzXFz\naeZvzrlgv71It8XHqvi/3757cemvJT5Xi+/UrO0Oh48rI89e4VJ7pGhZF/VI\naff4HXZUrbHLTtih45R2PBLj7FPt7p64LlBiNHH1yc69MWSL8TiUeqZL5rdL\nkG/P7rhE/lYYa7v12efDn6NeycOTGT9EUhQ057RGDi2jlmMI3P5Psm2iEMlS\nkFSUkl/umYFn9Pq04rRXJiNcYbQ5iWyKQ7dV2jI3x5NXAhu+WPTbuPROdun7\n7ycoOta6nd5jJxuSmRtbBIYM18P2fUOgdIfEosSeyjsTJCon+yVcFIepXtMV\nEc/7\r\n=om3E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2j4DyhnoZHKX7DUVBIJgIiQSBD3E9CkLHG3BAY22RGwIgKfthOq/xDDMRZa/ot/r10VtnXe9lKUNkeWauvN/Fsd8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.1-dev.e67a9fd.0_1628018034490_0.5265598573104706"},"_hasShrinkwrap":false},"0.5.2-dev.d20e812.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.2-dev.d20e812.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d20e812.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.2-dev.d20e812.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-ud7rB/Cyje24cFJqMOLcrUglUOpA48bEURqtRys6m2G8DYkUzC3/VBCS4MV59hK5+Lg3F02SqsQXAkpG33LLxg==","shasum":"fe4433011df2e9b506f6ccde3d65622f94d99608","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.2-dev.d20e812.0.tgz","fileCount":34,"unpackedSize":249975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCbw+CRA9TVsSAnZWagAALd4P/i1Gx+FXoP/beBsjhAle\nGTlmUTKTqpHNraVlJmFfN9RKnkc67SBZihIM8Syz20FraCsx/jj0WtuRz/DR\nGOC0rCZ5BJOsi1qT38aUOgrdx5BAnjfnO616Dm95PVPn+9/JgbpVpvVA04Yx\nQlmf/8tOnYDqKMHknmjN0a2RgZ2ICCAtc4pE3zS5geWYx/yW6dH+dMiIHtda\n7fYnA5v7czMm9Kj7i0SSdr18QoY72IDlIHIgmoGY841n3aHniffw9sqfr1wH\nX8ywKQHZrqeAGBxH5RRwj3hKll5C4HLONlX/fhNLsJMEqGecN1favw7MvRfa\nS176aRvapWjAOwOulHZqJMturd6HUWFjz0rEwH85rHYR+eCjXJQeFe8R4CTy\nylhCi+3JdD9oumyFkBP8oeX6h3x2LrP9Y65LSwxC0lvE4Xs6LH2pLC/sEtaX\n9snyWULUsUCuowIXQ/YiUME6553oOhnY0+UbkGP3DMb2gqr9px25FZmm2KOJ\nShQwSDDEf8dbrLGGARuK4Tuyh3oMVA70FOG+Ubq4h+lrXW0eFAj9KyoaXWnB\nIuABDiVcHdFkPZBGe6zNpXz12UMnAsKFb/HyQYnl/s0ECx7dzzEhFn6qzmGJ\nrrIR7KyFTu8hU1ubr5pqzMfkKekqpJ+Wb5qnYsSJiP67l5IJ7oz7dFj3sSzM\nezkJ\r\n=bZF/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcGX7zlGEtuZkq4N/K38BYwiZG0ZkxMq8iENzmLBSpuAiAOISkG/iXwbEanuXB+ufiLLNSSR9frQxxgTACn8brdlQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.2-dev.d20e812.0_1628027966340_0.8843384919111603"},"_hasShrinkwrap":false},"0.5.1":{"name":"@superfluid-finance/js-sdk","version":"0.5.1","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.5","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.1","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-IXCffPQIyfWj2N6zNd3SprrJMoPNS3aq0zKfrk5e58nGZIkkTvy3ZcM3eW0alyRM4mx8oHcs46hiOjXF4G+8Xw==","shasum":"9912d311d01012f74208a179ff256995a24cbff5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.1.tgz","fileCount":34,"unpackedSize":249951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCb5QCRA9TVsSAnZWagAAPQoP/RGM4wAIp4oQm3g49KtK\nQ3lSVHIvX3NTDXDK5478U7Jnqv2vkt1NUZitB82r9OhqwVY2ukmRNJtC7h9Y\nBTmniIZw14pdQxT9xvPSIx9MhOvMk70tzNPmb10j0DveZaVXhyXfBg+gyl92\nvtXavxHcikRryeWf28lRQRpaFYw24Yz790pe4TRCQaARaoBNDG//006Dv1dd\nVA5qirstGgvKYNMDi/7JI0cqaQtELT2Iy9he9PdgjotdBK3Idsw2YVSB8huM\nuWvxsJREm9V3PSFjkqlTsH51p6N8mgoX/5JFtfbo3d1MM2X0S3AfxROqj4OC\nMFepHFkVzl8cwcnNgBKaoOiJmjY64mfN2sK+upXxaNZIKqNzlW9Lw2vUZv90\nBVSEI3XpRsu2y6AZ+ZF41jY1YhcXfnQZzgOzp2yubU3PPwab7Z6EX44PsdVx\nqqUq2/TrW7AbUrNb8vwrI/IdA4gd9Nri5yn/122H2MUhx3Ye42hyZTiVZq2+\nf5hjTGxtsVL4/y+c+RrTPRxqpeirKDbeFt/2qTI5+rVzxYhv1SpCP90hk6mm\nmYnQj02VmKCAUx+ZNzQf8A8K7Ke62hLRezHNtcc/c2KLqFW899Obpwk9v/VM\nkagimG/aLKFsGYbC0ipi/JCMypOh8mFHiOyFgELOVF9zuXbtrKV7cA2V7x/E\nx3RO\r\n=2erD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBhI299phN7SfFxzSkez/aSxMldlmY1q9V9X6XiZPrNwIgMsS4yb/SGG3JeFLyoahWdulfPM3Lm5Z2aML/XWcxcLI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.1_1628028495850_0.697728279638836"},"_hasShrinkwrap":false},"0.5.2-dev.5662163.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.2-dev.5662163.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.5662163.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.2-dev.5662163.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-x0+852k+gF+qCwsu3QXas8mgcSz6LBjMKae/+pa0lvd35ygRy6P5gy87D+Uk/Vm5DPSIHOyQbVtkRo0aIYqCXQ==","shasum":"fac9fd6eda9c059454389d4c7da8abf75dd2e1f7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.2-dev.5662163.0.tgz","fileCount":34,"unpackedSize":249789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDPc9CRA9TVsSAnZWagAA0XEP+gKfDmpK9ldv5gRHpfEC\nwPjVEbb07gXqHLte/+ZF9ujLZerWLk0hSWSy4JgEBomjPmIfd4hAkAb8fbix\nbWE3oW5r5E7w+KFByvjUqaQu3c4eDpVW9gXuJ+jgzpvaJOLZ02cFJgv8bo7w\nRN9htIMwXobWvcIX4BqzHZOj8XYK42Onh+b1H3VI/vn6+SgurlgsQwllpxqg\nqHUbDQpDI2+TPg3tYMsWwjNX2V7fXls9w12ypmrdnhcuksM9fpibzAIvacMN\nthSG2mV+dB12eoKh4V7fHRo10FEi8uU8HmkVaQ4JBDsoV4f2u8lG58X+2vLU\nRs/vEBTjaZA71nu+Chz79t4UAFYrbU7bTzq5/pVmumezGhkdF08qMiCql1aF\nIUb15TLY9cKIaS3BwJt3Htq/zjBTEXG1vVPkJ+ddC06uLn5qlSAuAPuCAkBq\n04u3wkhBL9oaKb6M5vXyYlOpxYsHFiGf3Rw6v+x9r/3z6GlU9otcFFGOmYwJ\n9MW+rbB/yAL+FpJMSwZ0bHooINO3qyY01SG5z+/PLQHiZ6eVUxC2zJSqs5nh\nKvMdy7n9FhGdWFbWYYH/XbV6XPgmG7hjtFXZrEkIvNAZzUZNyEMgMGvb/C3p\nVrmF1ISExvmZdMuo3sPSRXsHn9iQc/X3yJ/3JxDE5d960ymRpZ8PrEUo2QOt\nx+gT\r\n=uoZG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGqNpDBSiruSddV1OUYFX4y+f2I0UnmaWJbq3P4kaNMHAiBKWtqP3qTpibSopmjqYRWy7eAIXLVSGQ+WWA3+ValoiQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.2-dev.5662163.0_1628239677684_0.5068436086991253"},"_hasShrinkwrap":false},"0.5.2":{"name":"@superfluid-finance/js-sdk","version":"0.5.2","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"1.0.0-rc.6","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.2","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-vT3809MWOl4uMt1OL6PxHkbsIMzfh9t57JvwRb3pbTymGHSTq4LAXaURUkB5xMvY8hz+3JVNN5D/XKaKJ828iA==","shasum":"b9878e153db916449c60c24ee01eb009cf2b67cd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.2.tgz","fileCount":34,"unpackedSize":249765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDYD5CRA9TVsSAnZWagAAEcgP/0W4Ymkl8Gdl8GDVdqAx\nd/2YtCPhXKIQRzKCefWiXKGIVcroS+DX4I78oqic8SF0jXDXPvAKwMrI7pDp\nMe/GOFA3GitZe/msYjScjKklVDjfWahwFmGshF44Kjl+oOzF0JhY4YRu/iUU\nXhOZ5tmEt2VbleZtl8St/Mb9oUvas6HqUiC+6GPoHYHGoYv83lgnio8cuXQP\nCwbPD2BJcmB9Bqa6AbNu6g2cgTdM4Vz9Qj6df8Yq1LjZR7C+QRNMsgubOTUZ\nlZjF3bpnDIObwrNyzJKmUmr25E+NchZxBdQ3LZgGLJX74E18DkBXA6cGUNNS\n6fuRz6afzGc/5CUnIo8XNV9MFnEUyeOJuwLmg0I5R0lVwBZ/RpfoHhApkq8x\nSGVTszjuZi4JEr8DOfBgD0cartjlXJks0iHIjA7kxmHZS3bLJNZewyBoLfbb\nWyxCZ837fJVSvYJ3W6hjSOhb4sViiej8y8uiP9pOon43Db32OVrj+6Z21Mpq\ngzPV0AOK3OdE2oySvKu//TZ3rbyJhM+f0ZXEeAKKFjIoZP8di+mI4kWP8xS4\n/0C/pm+tLvWaK+nFi9BTu31X5CqokA1b3pg9VQBt0A3ViI2+l1dNp6YVfROl\nKyp+97At6387HPeOjjTV7m0VxoL3pVq3TUPUh6UGQVdm6x1GH8Ff+ggAQl3w\nDaGk\r\n=TBRh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/ei/ykuJnyYF7iw3X9CNzbhUvImu/Uvnt49VU1mO0MwIgUrDegSR6C4hFsiaPgiuj7SymlA8zkkSVdoHQVI7u+l8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.2_1628274936835_0.9970237231956476"},"_hasShrinkwrap":false},"0.5.3-dev.3900e65.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.3900e65.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3900e65.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.3900e65.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-CX4Ns8znPgv0CS9CZyzXiBJOxiH5rS8jKK6bTVCMWifibwhNDcbygOAG/Nkn1ryEps19EgpHaQQ30XGe8+IsHA==","shasum":"b7f276a7194c88687486db339611fb9fc716b18f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.3900e65.0.tgz","fileCount":34,"unpackedSize":249789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDYL0CRA9TVsSAnZWagAAGY8QAJcqVXg1Obd369zBTynQ\nZLuyXWQSpJrWIrnvqz6mfBuOLNwIUIYYjO95mbrDafUZtok/mvWzdhxzRtaS\n4vevYbhcVF6OoaAAJ7d9TfsAQpT+J2wq9uWPmAGxWjF/NnoeMGvDBdlErOtx\nqobfzu+WOuW2uVvTX2bRB9KYa2i1JTHEvmaBjQ9KRM4wcO4vKl4cKdamfuZF\ncQyE4K4kuq34SuuDEl5mFFAdc6uNh1SY6bdTliqufsZmCRfw+A1a/G02NSQ/\n27W7UzJKbfS/CNFxjlPChtGDn4t0UFfqP+WRp22P3q+KduQgj9z0/cnvj4ZW\nXzY+DsE6JgwyAQ8VjnnQaT3V8NBZ6qsFN0ZIm6WPz+VxaqCrB3IYEy/Vbs2O\nf1AXjel8T1JolER3wd4TX892ALhxqwGkzTba1Xw6pcDqJb5oJROA0ayt4sbf\nDAxktAIVcCo6zzefsAQm/PqutrdoAK0bEpk7tylGLC8HyJkWi1FsljdZQSCE\npckp8e2o/KPgl48DztKIt6HllpdGkHslqnt5fVhW/WqcJaEFshnINCR3E4lZ\nUhdTQW+nNyKyUOq/B4Oa5C22BM40vqsl8dTFK6idtK2l8wQlqyQDm6cP+qQ+\nuf9OKWoqJkJHZbBRNoutzNHf0JPFqX8mIyf8znOxyVE40fLlnLVXfi4M4o5y\nfieB\r\n=0Cs+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjL6jgdEXHttErhBFmeeXeWh7Az16GSRLllIJHBXQB4AiBX4/Z7RkhICGuZ/kEh6omIkbyfgodug5saChq7r/1VCg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.3900e65.0_1628275443953_0.821237139404954"},"_hasShrinkwrap":false},"0.5.3-dev.48cd899.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.48cd899.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.48cd899.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.48cd899.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-v/o/dA9BXzZQu9vNql1aHAdjapPk3iJMuChX6nmD9x5PPkdQwVwsiGFjGTwmeb4P52y0J6ifBP5ykc+2M234IA==","shasum":"f9a7fe654d44e734405e0494cfafd3326a230950","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.48cd899.0.tgz","fileCount":34,"unpackedSize":249789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDZQPCRA9TVsSAnZWagAAzaEQAISKkrzUDNEI8+VrsdGZ\nFr+ZDEGzxJlSerHF1eFAoA54mhbhGwiI7YJXGWBaRz+4P1rWJtAcNgu/AkCN\n9dfwrjBmDtWFZA7G6kv0CvuUBlgpVYfTaioYtNk0fwrTX3BTX5zR3Y1kHlMb\nu0Dzskst1TpJlcmTBJJ46ZNSb7R5Rg4Z5FGP44KshG3DZVyh/bbHu9CqHCWj\n97aGrM5NGYlEQbV3lnOhGnCHX004XYZVEJqUs+G75YsfTihlDkAS0XMMjSkN\n+wEIXCtlwwxonh8Cv+WdWCpcqdwCJ74gQkjmL+FJErkj2MUBsNOE8vV4sTBI\nNoOZyeY6pDjyYRql6+4nzDDz5eft5OrsScAmvWamgQd1f2jFX0BQQahgIrgj\n6bzGe3jiwY14pwIQuUGYATERizH21/ECl/whQnME5iKXkMU56PbN+PxFKfkC\nZUXiYfHF4fuQHz8WJwapDakHNxJNelg0TWsxmP9eIrLgC2/pIuAztnX8/b0z\nrf1Kc2nKscdPhOzJh84rOY7BajmSQkUtjm9UHvHDVWdJ+N2XmEO12xDprzMe\nZEl3j7WdZfJ16ELzZg5eXojYQ1p2ddqt3nMTRVrLVW33k+fTPQOSVViBQ7Ie\nehY//peBPMNnofg4+hmTg4vC/WjU5ihnAn22bWyaM1yRj5PSyEu0h2O0qGnL\nbdc1\r\n=4dSU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkIdamzCKK5Ad6XiAxnT6SVBu7SAt3s+pPkKB00BWj+AiA6PnYAOSXNpEv2cP9iZULuNR4PPmmTVxWG9D9xerePrA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.48cd899.0_1628279823371_0.4848120309783548"},"_hasShrinkwrap":false},"0.5.3-dev.89bba96.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.89bba96.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.2.0","@ethersproject/hash":"^5.0.12","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.12","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.0.12","@ethersproject/providers":"^5.0.24","@openzeppelin/test-helpers":"^0.5.10","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.89bba96.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.1.49","web3":"^1.3.4","webpack":"^5.24.4","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.89bba96.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-tWxVx8g1o98HomWo4s3/3qtK/d5ZyzbnH0WEoGsZNoDbbqieKzdFAXScrIo+0iY7qLjYKxekTp2DIl3hRbjxkg==","shasum":"b921cfb12adff50558b52e5ff232548c5e8d21fb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.89bba96.0.tgz","fileCount":34,"unpackedSize":249789,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDZapCRA9TVsSAnZWagAACX0P/AmKUFrHCol89bD3Bsnk\npfIJrI5U1msNtGfck7QsAd1/GdLh7+xC0+9NVZB7Bt1oAsMZxU2YS0BCS3AG\nhmKIetb+ZDJb8c8buVp3d4iP70Y4tWuZHqHCyg14GQrgsvmq+ktYyOfPRsmK\n32U1+c1XtDQwmPlkaAoTha9D/EV/A8v8rZ2rfttZPOVGJyy+j9eb6c+zBcX4\nMyoJvIIXod5bPDP5sS9EDv0cfT+ZV5lk+Dy/wHMdfCMfeJzxJjsLymzqieYA\nEmBJXdxuQEuHSa8iyqVCn3SZl8vNP1s5eN8uEzIBjTlm4x0THvzENts8TWcN\npG/EXH0dOZtQNM9g7fKQUmGJ2zwylJ0YgRrIAdBL4msEiX32LDtVqFzi1JEj\nq8KnDn7z/S6aMpCxDPb3371RXi2eTDdaXjuKHiehnbArMXHLrPoVyD6oZAPz\nHNRseep7YU+3pqZNxsP8sfM7P+MKeprkQh92BdLEun/vxN80Q80US0KVwHEX\nNrZG9iGCGXZ0LO4LaBbD+RL3ADqwztKr8/Lso2LjBGO+9XhXZqTI2xGJaRHE\nyPTSbjzdACfBQUrD6uccqhcwcraJblvJ40/Kq41c5vmM8wZ+D78UXTWbnQe8\nQSIQltZqIh1t9KaB22BGD/sFpHT5aBP0NP7/JWhcMZyeYCDwFXLLfjXngboD\nmXa9\r\n=I4SX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdusoQGLTxCiO1UoZsSuddAIPjSfNpQ66IPVxHzfIHHwIhAO114u4Yp9tQbYKPwThT6L5G3k2qG4DZB+lyg0vOquM4"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.89bba96.0_1628280489494_0.0548959788019987"},"_hasShrinkwrap":false},"0.5.3-dev.299b726.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.299b726.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.299b726.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.299b726.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Lp2usrST7yc1E3l9Xisxwfrlz+wT48gzIv4ouYkTrmsFLGVAgWFjmuE0yRC3F0ntRJqZOf1Pv35wuQN1cIyIAw==","shasum":"f983e766b5b6ecdebb38346bff2bf8fc3173491e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.299b726.0.tgz","fileCount":34,"unpackedSize":249785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEmx5CRA9TVsSAnZWagAAmJ0P/3qYtsjBeqYQ+e4TBJTd\nYDaP6OyXFjKeJJtAbm7nX+ntUrwfjqqjxzDEsfJFsyylXkEr3WnwPGkknhyP\nQzuDKMEwTDREkhvmSyrt6xMV8gP2etXxc4CB3FlSCaQXs3F+Dkzdv6KRM2Hd\nOpfyojgiYDrhw3f+YUQ3l5CAdSXNQzvwzTezBxnGtEGVcUc/q+5ONGD8MOOO\nDJDJxvCCWJObIW8lkf1pf+fucytJshpniDJjPhfxiJtDPs5f9A/t1jcVygk+\ntyh0mxGy1XjsajqzkMISVoJWqNDRv/Q0dT1zvMH5RC11ax3Q6JX3nC8tFow3\napmDdok60VHVpMu1ZsxsHDfbhfSXOlUaUD3J3SKFCplocTF0mrhsHnr5td3r\njaxSwcgqlkWIqRpD08/gAzwmlohnOhV66xBl5Db9R7tNgOdCTcMZ1T6yEXYR\nK8joKK2IFuTh9E9kU5CVQBxWT5iMHYT9DCM48fWkxitzeYAeSGkd/q52XtdX\nUQm8N9gjsfARczGztai6bbef1XRcWCRRvRXD6cyAbddNtlHSXJadhAf5vnNK\naSuLBN9+RUSkhLWs+T/eb+VONhF7iYD9GUEzq5xkIlu+SQygfgIQKYrLL9AK\ncmgcBD1o5ULlGwgt4oWi5AXz7aXSf16lxw5ncYnhP4SjeyVqjcjGIl88Q6gg\n1J34\r\n=xF+O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCouUR5mP1lRKiRoIqTiMccMp3kHxKFXf2KEm/ENegN7AIhAKNiAcCaEwdjbaIcdjCJTbJ2k1aWxsS+liSlI7TdcLwA"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.299b726.0_1628597369674_0.34702878047072017"},"_hasShrinkwrap":false},"0.5.3-dev.ec7100a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.ec7100a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ec7100a.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.ec7100a.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-5tta/AivhLmh/oKXCVZS45wsYgLaDY8m2a9oQXhXEnYUYfwk40KJSytjDeWA7FNDN+Fc6ik/sab1YpobowzlAQ==","shasum":"b875cdf1812014ebff84d145ddf610c5076b4e48","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.ec7100a.0.tgz","fileCount":34,"unpackedSize":250048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFtFcCRA9TVsSAnZWagAAF0MP/ibew+SzsScIZrlOyN4W\nuSuzHwLRynYj0J2Zpfs0XCFlz00228wTf1azsCybqCgKQC4vjC/4C8LnfU/N\nWhi2HSaZkqF+cvVRQl0orEFGpOePINisZcc8f+uN7s3HJKD8ftMe1J5E6dkr\nu6NDMaFkIMJ216Xwbzc6sZUO5W8E0wYRRkLlKXN3qjnir9CUQ55CsgAtXuzf\ne7dWi+gGVZTxkRGBb4B1nM3fml7ON2ZWNxEJ3c2J7OFS4DVieU1Ei7xKqnzY\nTQR/2CElfuyPsCSkNTOcK6SDlHI0V9CqvAEUUgsqPADUkfJvVwgLJ8OuWQy0\nVcqtSsxbsyi+xkwyXTmb5uma9YPuChp5WyCGDS8hshViH6WQmJr/aG/wROW/\n4OXdgjzMa5mZGQ26vlURaZ2IavriLogW2eAixGWtRdn53k4cIkLOL1Lt8hCz\nQ1hf+PAVo/+gjXKbxcxryxHQ3KuVTRjJ41HmrYnz+2BTex8NXsy3kLLiEdOw\nTgY9puYj1ZBDfHUbPuNzVvSRfodomp57DMDb8ZgRA6GwWOzYexccamjKGuKI\n9rQYY/2lcrncQN2lRjnRtJjABtE0VQRZ3MmuIi+HKcYp1nQRDCwrx39NvPOU\nwzFikn+RdSct/KWiCrvIw6q6Xe2vDSFkzvHtUF4nZRsFblMaItijTL57SX+S\nLyI0\r\n=fHfP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH5G/uS8iYG5ozz905XxFL6YTrNAtKGCTJIPKRMHWqjmAiBmTw1diZO65C8fPY2Qn8yu7M5IMxFgN1mBoW51Xvt66w=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.ec7100a.0_1628885340028_0.22425384773009438"},"_hasShrinkwrap":false},"0.5.3-dev.56c62d6.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.56c62d6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.56c62d6.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.56c62d6.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-DIsZ6BKbag9P18gZJ5OeevBXW9EbQlbc4nClx57LdrOn1ob0eBR8zDpajBkMpzgmh/AbFLgt4v3KKADAifIapA==","shasum":"aa0160e6b20e87f59411382fc8256942189590a5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.56c62d6.0.tgz","fileCount":34,"unpackedSize":250048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFtejCRA9TVsSAnZWagAApGcP/j9p5XvNsHs0yuDcTiQK\nPErytjC0WIFjlMBuZFXjsBxtbJNnn6YfP4mh4dioOqyVZUQwpf5E3KKRV0J2\n8IFm7mFjcZ1E3x3WU7FHoyyw939ykNZdcdB+1fzIVeW1AyWlgKl41OSUKJpG\nQm6jSNSYJZ0gHzytq+JAWxindg9IMFSTr1S0OxfcSxfuzQpG6qPRAb8+iwnY\nXY1nB/BpEGp2j+MVawAQ/ELm5LY1GoSSC+fHLj44N16WNhRT3th7kIYP+ICW\n2gAxS+UwmBPb2zoTfGsUijPElChR0NDdB4YeW4cV9t4MGbN1OTUGC3Tn2xCh\nS856qMd+tM6iL2Rh8jSK6iVd5mZACFiJx6i022ej2n/KmInGEJZCWb7Iuh+a\nr/70fLGhZp9ITP79YCfaosBGGbQWMT9jK9bVqqDn/+DlSdW6nvc/PxXOF3qY\nxs/CYuoVijr/U8y7UhwVxtu0HkbHzdz7y9Q53m5kyR9OeNdpji1TAT6Y2YlE\nc8xGKg6lWYZyKYzT3FyLSmyKCZ7QOwoqRtLopMDRDNaCUTsjjUqpjriQPwUy\nfA9HrV+zqQtV0OMn8MOzGDlyjyv4sjAsHgrVRioM/PfZqdQS4QbVov3JIi9S\nFn4HqOYjPyKwXKE/GF1z+4JBJbMeB7Kmg6U5/qf3syxCo+8xXrKvLrvOSg8K\n9N+H\r\n=tHvz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRdgxigTljgwmoME9PCgGAryoB9apzPyTHt3vYTh4UqAiEAg/zsnhWdDf4Xv760Gj+yB7N3KP7jPu73ajK0CWk5re4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.56c62d6.0_1628886947520_0.7128215497645565"},"_hasShrinkwrap":false},"0.5.3-dev.059bb92.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.3-dev.059bb92.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint-staged":"lint-staged","pre-commit:lint-js-eslint":"yarn lint:js-eslint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"lint-staged":{"**/*.+(js|jsx|ts|tsx)":["yarn lint:js-eslint"]},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.059bb92.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3-dev.059bb92.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Vdp+0yb+QOJwobFLsl0IQzBlegXx2F6FcAgr+KgcosPYd/ezCyIZPEXxRMddna4gXHG4N7rFyYI950g06dI/+g==","shasum":"f025879f1427b1a97c98e713d975c7c73667f21d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3-dev.059bb92.0.tgz","fileCount":34,"unpackedSize":250048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGoHzCRA9TVsSAnZWagAAmTQP/0UHEFpXekoHgU1guKnV\nkl0ot9fSRrRdoA7Dgj8U5EMg+hinemL61yXEaMXLsZRhZLvWrp+MY27+bExE\nIKsoqJ81X/wPZPK2qCMbAHR3PBW+06zsISQ3w53YCfDD98+A+ibflJGwWqls\nVzMiRYijoOnzSCRqLbml0yfXK3Wcw5lo0+mJApiNPo5niLCllr+TG7AV8yoq\nr+ojZXGFVoTZpq+dl4N2u1Fa9SpnQKbr1KWeZ85+6G7hr8ASYYzkxtK9aaut\n7RG2FLelCH5ExWWnEBvAlMUqFhRZJt8roj1FzjofE39H4IrnIwaxk5TcvD1Q\nWW2HEflIBaqICfF8qL/NlJYBTVs272yqyA6Lr2gbEs2hU/5lWCfLsKFw+9qI\nIBZiViTz37btJWF3vjTRQFHnBoTfq3Oy7rtKDFySl8woiOVuwxRsdm2b2TLE\nHZzrgQV+BRRK/+WCl9hEehEiBfnjHYAt7XhOuymyULVolGZIjxOi8+R2sb90\n1EcEWL8BOxZANI+TNjwF1yd+zy5fuGExl2HWwRuG9MyJ6htrMZ5mZShFb+6J\nVee7wW+vrR29ht6X0AScl4kKfEjoEa9BW3gQdf+zmdNoliLhsiC5Gmp7hm3h\nHuUbRvOWdS30qgPxVZsxjPErqQNhyeRqwHCU1Nx38BbAypiqEOE2nAQLHq+B\n7vJX\r\n=CnMg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBqcbLwRKylgMRhwOdgY+I3nwktEY5k0TfCerLIOg+2gIhANjFVd9A++1dkmOmsSBujgW1rIOZjfyAefHXqqDwSELC"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3-dev.059bb92.0_1629127155062_0.7574595165220714"},"_hasShrinkwrap":false},"0.5.3":{"name":"@superfluid-finance/js-sdk","version":"0.5.3","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"1.0.0-rc.7","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.3","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Dmy+0hs0qMm7RQeHunF61Jv+HkHgYzg6AfXGGX5piHnsRlbuBmauXmvnIbTjN6ci7T3u0dfhbrg1nBECMiZQug==","shasum":"d65c3567994e9d65eff3b671d2c0373e4bd3b9d9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.3.tgz","fileCount":34,"unpackedSize":249848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGrtICRA9TVsSAnZWagAAZ5QP+waw34fD6lYbOA0mjcSr\nbllJZ85H8QIBRXtg7BerL5jeVqi5FDIidnwI84OrUlXOmua07SDgfrJEBHdA\nA3vAd6mwzAfQzR7ZfLoMovyx+L+F+kvxo7Nm56cwND1LluNuIV0iAPe00974\nzSwXFzXs7sBdbziYmJxi/RJe6eOvIJN1fl8G3UHGfZiMc6o/aSU+H2hvvbND\njkXDjMSmgzAc99EI36cBl/cLaQ3G1MotFzNLoIMtpfggOGI4rU5fO524KhoQ\niV/Gvy+vnJM5R+I+nweNXlu7PaIEhm4IMXgNR3LvkLT9BQJPidWUmeO70ZCN\n986gYOMeaH3FrxI0pFeleZ3uNl9jSUp5Pz4vBJSpvmz2DGromXEvR2wtQKqv\nIwsBQIeAeLlOgX3q6245IuR/bEpozbzxmR272gl1dZ+j7bU1crr2Bssx5t+b\nvgeqnItZvJH38MFJurEQFEuG+mfno8VspqXVPdsDhQPviYZiTL+kjWbuDcnS\neeTrt8Qcv3tFnW5+5abuF0/WQR/9VEfOavGxgjdXZlEKGA1XN9gobtkMoEt3\nBghvK8t18dH2SzQPaGsPAX5C0gJg+qaS5gzPmy2xz2ubmcmbR/jjLheG2iSp\n+rKSxO9EiBGMtFmkamI0dfINBj9H9zUajaNcvzkTIQtsJ4DNNnjwUN4Hdcts\nonGv\r\n=EHRO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMB6dR9XS2HSjWHOiRrL+Nx0O9dSTmZTbqT99E8GmMmAiBy6yLBcz6aH4YVSCx7eZaC69DOWX/BtXiwoP8bVsOKCg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.3_1629141832139_0.925957974505925"},"_hasShrinkwrap":false},"0.5.4-dev.30ff8ec.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.30ff8ec.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.30ff8ec.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.30ff8ec.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-/nXyezfBac4v9bBv7HrhtMpi1ijNkr6qFcmmv5KS2OUyJZbTme0fUrgw2l6SwwPTVq3WtrvgAEDm/DT7OP4wqg==","shasum":"9af091035c570e4cde775f3e5ad79f03cf9dd010","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.30ff8ec.0.tgz","fileCount":34,"unpackedSize":249872,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGs30CRA9TVsSAnZWagAA81wP/3zFDYnrOxqPy+ndGpZl\nmtUiOD9yqpWUkJLJebRfjQoiTtKkcq5Fdbq8D5XwvSmLeLgqa4FYIXDsoxWj\niRWOyIw8rzYm5+oE3ysnY1+La+9Lhmt1fIsufoPQw/NMLZ69EoSpyP3kBlDQ\ni5zVxQ3RVmUQJWxR06BLQBfzs/SWzcRtsfmfknbe6esa6kKd/qrKEFQINzni\nH1Wq7XI184bPCKt9thiJacmpWVtQqiyXQCx3xHk42JOzDBy+uIxw0Dx3+CSk\nmunNwcE0QJp10Qy7fGVNfhxJtXCGqIwN5zi4xatrhgzOO1IbzCJ4B776TYX9\nwRUT11akKJO6Hb4LFEOamAWcB6FZeNmcpVUIlRXnwVejIfO0r9VvjmqPX3Y5\nSUPFwPgW7xzr+IPcf3hHz27brNfsx9bjNa4drAe0z/AF/HqKmoMY/Yl4Yvax\n05jbhLISOKzGt2JP313lDVbmApoQlR52aLcgK5Lw3+EqRkyIiHTAXjwGgR09\nB4KwKsl1TArOu0joeSZkI68e9SoSI5mmeVsT3RzhKJXku3FfUsxfnQ5VGq+V\nzIbOA5+zvbjt3tDCP3a2KJeTSTPsoX3e8R+YsVATIzq4XGqKG3uHvW58L5xu\ndt6imw345j2GtXZezESMi/v4+tgjRptKNj3xlVQisJXQIcibxWrpgV1V5jXS\n/UAg\r\n=cu+i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVJK48MPX/zIdAaueXolZjY9Q39V5e8Efh1JxH4CtUeQIgR1Wlnh9dC9KxoguPr7EmqdnaOKirMWiHE70oahvvpyk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.30ff8ec.0_1629146612152_0.5135031426340413"},"_hasShrinkwrap":false},"0.5.4-dev.8ae39f2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.8ae39f2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8ae39f2.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.8ae39f2.0","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-eLkoFfN9HOjZB9/+hDG9UNAde/TFhcW0LBLCPSPCMjO9JRxbbegJGSaIDrRNaMpRRtrZrOvz40nA+AwVH2udnA==","shasum":"b64fe240b16d52fc1eaf57745ae1f1a3b98f4499","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.8ae39f2.0.tgz","fileCount":34,"unpackedSize":250082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHn09CRA9TVsSAnZWagAAjgAP/RLTNgF7423B1U6vcZMw\nK31wwVVrTGOmroJHJx+k5vVjDD5/Hs2LJdPhFq+P4uDXzIr8HgyNxRkRhlI+\nMGP6rS46v0u+rrayC4fYnVTHHbXLZqH8CPr0fPq9Epa4Rh2eDNnMje8KzvfH\n+xbBtyxPKmByrjnDG8xSgendH0c2gOa8D/yAFRU92pvvXFLk0yLOvuX3zzcR\nlZ1nKYV0mLZPp8mdiNUy7Fh68K+VXuhK9Ji2dOwBFnXhnURoNB5YF4rTZxGQ\nVWFr+0AdLWXgZvsOyLGZbvshfKVqQdyYnJCVfvrGORhAhKmLE4W9D2TgB3sI\nAJevkjzTcgODt9iKx3I6d4y5COpUrzy4Pa7G5ZWm1zCmmj704eugihwKnXr+\nxjcRBhf9D4jIU/h9E6RVGygcdvcc9dj/Dj6i4ftPNTCOh729yp5SqPQs8Ysv\nlbsKr4yspbsRdnL1UnC9T1ypsq0Xw6PGOrU+6fsLLT8mNkqGPh5sQ72GyJSC\now7TnULMkJISjIEC/DOy4p2RiiGrVIB2Ve3pz8k98PQU+C7oMuNaAsS4/1Fc\netFfvyyY+/0CI0FpG8ORmo6PWBUdS44Fq9wwowPGsEkujK2azb1x9wroY3bl\nGDKT8XoisumYcyYraOx6bkvb88mHlMPLqBZT9P9rH0Z9K/KqB3Ybu2hRY4fv\nhRvH\r\n=/wDV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUZzSPogwhgt/8W9nimiANYX+RlQ95cThyJk/aqeEpbAIgWtZI98i/IWl2FIlLFIjmrgkzojTtj5Hjkx2to3j5TDg="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.8ae39f2.0_1629388093674_0.6626421398313493"},"_hasShrinkwrap":false},"0.5.4-dev.8323943.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.8323943.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8323943.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.8323943.0","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-8STcs/wFckZUrGPGjEeDR6Z4MDyWB5YbKAO/z6jWrzcdVdZGp6ZnlIvdFSI+rG6Kt/FHnTGYaisTqDMWC67NNg==","shasum":"413e2aad0fd8bd2eadc159e2671e671ad4d41fa2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.8323943.0.tgz","fileCount":34,"unpackedSize":250088,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHpbACRA9TVsSAnZWagAAww4P/j27xlg2S3S5heqxIKP2\n7enX7QH62fpVcfKqePaHJylsmwanl6RWGx+Fpu8qG87Wj0Nq1RmfDAXd5hiF\nryk5xaqhrGYjqQyL2Hi0Xsyw0t5hL794PWYtp0t2qCveTHtwz6WUCCKszsNo\neu0GumNcshoixkjxe5+pkRSUFZZPg5BJVAdqu4okny9dDEpAzKXewvzdV7nT\nLH4P6Ebp4imLlNrjHaHmGigXjHJW2Rzm8lZ+hDZ85SRULhark8wXy4HkWBM+\nYN83GT/HryEb7OTtPFd1qIosUh3KRlzd9H2VqJmi82TwI76IXQwHTVC9J7Ey\njtE917FspzLS3SBlZT98vfwt5fR03ZsleQTGl6m8DfXScfx23xv8r2kJjCNO\nqwIA3gwM10lJe1n5JcBlk1eOsZoCCdBcsAer0fKt8EXIXKfep/ZtQPF1ekS3\njGS5dJZ41cV6va1xZowrRSFkWMa5ccCwVKJhhh23vT61BEoWqwPyvGhbuFFA\nx7i6VzvU1S7UnIVRx+3dZdEhVVS2+cIOH3WkrRE9jTwtpkALoXkyTAAo5y37\nMSZVAfF2lsSlxddwnaLAnjdFBcu6Vv/FA1VwWTwxhZfVivPkaF6OtOhnlCG0\n6BCV7kLXR5i8xk5hzn0J/xe3A/8CgUIYuPac5Ujrd3RHZSnyIlifQlnGs/UY\nhGe1\r\n=CVEG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFipXPnIMSd0Cw1lZiPul+uRVnBEZtdtHBIS/JmqtrGAiEA/4OyBcIJ2MI5zVBPagZX7z9JhGkNt5IKyWntRYvy/ng="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.8323943.0_1629394624321_0.13217620856723955"},"_hasShrinkwrap":false},"0.5.4-dev.89a1dd0.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.89a1dd0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.89a1dd0.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.89a1dd0.0","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-babPT9RR2peecuJuLE9afaUgjfk4yTw0nGSlnk0sDRv5q2fLgy85gN/5VAQ1TuMeneGZK8gH6FjS9damRbiEKg==","shasum":"2cb424f04b8b86ef1065f393dc197bf642cb9a90","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.89a1dd0.0.tgz","fileCount":34,"unpackedSize":250466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhK+jbCRA9TVsSAnZWagAAOiMP/i4AozDjL7WTky2SquV4\n76ShZDDfufuSAz/HwU06G0ONLvkqcJhs60MIv+AGtjv24EtZ2CMdOb2IzKcD\n8cp7yNO61vQ6sQyvPzOX7zPsJ7+ZguforHHFf6i9ZgqHoaYjlfj1sMnAEeRx\n0g/FkEDL5X3yGJLwZkP5dzIA7OimxkEzhp4xpYcOaIGQK8GsNS7qY2nHfWhB\n0xgO/ju38n8kpxxNaxp9OwMThyXOyPwdEK6XMd/TER45Vwa9PvSfPcZMMw+e\nVubRahtlKeT6ck3YAnDjRh9LwloR7sV4RuN3pitBWTO57JtMRaMXeGOnLuWK\n7JbY51nVi1Z78EEz26xkQOd7neuZPTiIZ7e/7O/e++C5uPbyAPgzHxgTId4A\n/royyvIaP9X+RRAVATi0rQA5SuGZKpEwjN7MSPIHkV4r8R357ayimQRtBnbS\no6Xzgr0UMxt9Jy3S1d8km6JETxixNd8SW1fCdF3eQ3VBB/vJn0BJQ1yT1TMo\n0i2sv1RA51/cxC+vOjQRWF7VLs9TLTHpXCNKCfLlElEAtSkkiu+7LetdEccY\nGQILLEQg6/N8A3+emU342FIUr+6VVfzZeew6kMfzGKiWugBh3aWe15UHuDsH\n7xYVjLYwjns6PaDYlFuKGrM3BIhbouywStolpTufAEzFUyqC/PxlrqH/KbBO\nga1Q\r\n=Uafb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwMffjOf1lHBdrgw82oaSeCnIbAav6lG3eq/lxziDNoAiBwOs8/xLK5TRMGNqpTzl6VMkHLD00BRTf5Tb44fuTElg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.89a1dd0.0_1630267610918_0.6057498297165309"},"_hasShrinkwrap":false},"0.5.4-dev.947a459.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.947a459.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.947a459.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.947a459.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-UMIZUWfkflLWAJdcPzRMF9jj5I0YrGQPMMGG3Fg99Zh8BTKRMrD1UWAeUdTEESv4dBZSm3NdY5B3BiWVAN5xHw==","shasum":"27d68fdcd1ce1b6f47583842beb87aa4d4deafa3","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.947a459.0.tgz","fileCount":35,"unpackedSize":800174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMgejCRA9TVsSAnZWagAAv28P/jPeOfKAAB63WGyMuFoi\n0bfHnA3vt4GFNZAy394A6qLcpbQRsxLDEQ3TZ28P8Ul/0rTd+E14VDqSHbDT\nXC99wSZ5BvIqpefu7U1ktK0RG3sRmHK+YPsEf4UzoDMfvRpuv2EE238YtqdC\nYT0YsDxuPadFDrA8qPjXaHKUmzxC+VfacPAxo24LWmxt+FJmTA/lANrpdb/m\nxfHANlGeY/pVpttnWrZwAC3fJReE+xt9998cg1XwmZ+qULyaBX0o0T9emNl4\nhdzf2Dc20s07VdMMTs48jM5zYapOevoI5SwJILASrmpWdsyuAzFFhOTxBfUO\nuvEnHVbTX6UjJ2aAGWNCOKBufKu2h6omOVVkwJUwanKbod0UsqkmoflukII3\nkCRgmNrhP6EkUqdEqtAtcehxo90eUp/dKS3iUG03SHcWFCpXSfMsriXsZN6V\nxm2vgiCF2RlJZLs3a+xnINCJ1QB+UpHvZfqQNjYDnII118lGZErX8/HlcjAU\nOz3leX7mUpagY1J0imHSAeGPor3feq3oebsr7iOafIMDQHITf0QsAKUUDISf\nNg7SPEEb0QP1nkDZM9GVUM/fA1uTUyl5Cx/ZiS9PqETyRJAxtq58F90DsRdf\nEBb84qU/wZ9SLSf+SovD1pQhmZMhRfFxgi8Kw1WGgbt0giLqgjLGe8X4+6NF\ncqA4\r\n=r81f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELw95tNdQ49N/u8S/3c4/jXdtlTH+dgnnwP7/it33P2AiEA1O5L4SLfzILCBd8bufU7Pjf5N9VeZegMp5FJTpImxT4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.947a459.0_1630668707102_0.6289175424543689"},"_hasShrinkwrap":false},"0.5.4-dev.6d01c2b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.6d01c2b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.6d01c2b.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.6d01c2b.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-qC+K+3DcaZutKBF315X9BJvu/aHd+eK8t656DHo+MbgN/l+VHToCYFEQxin074DnBq1b47Oice8xB8SZKipd2A==","shasum":"5079be6b375ef2b8248cf80cbbc1d173dd01d8de","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.6d01c2b.0.tgz","fileCount":35,"unpackedSize":800156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNf8PCRA9TVsSAnZWagAAm+EQAKSBdWLRKbiNkzLgjxzy\nnllwjS5qBmiogRvLcyA50FpP51H9PmHQVv7qGezJVEXuoEBKLrUYBXuMjL9v\ngXd/rCGEraSfhhj95zkbgwZf436cZbiJSYLmt9YeXhlgd3zsS+uR4IQL3Huw\nRlTFhQZmcqNLlnwCGas2dJeSWe3s4i9vuqB/w8u6pgk1VH/1FCklEdQT9OOW\nc19C3jmSbdoxx1ev0VCDjDq5wFBetgUOCK5WtOug6wlBVZRXQDMbjJcgh1P9\nvPa9JBqwU2VuSsU7pEaYekv3OwyfYFVTVarFpMwY7L6pFVhbhqphdoCjkewi\n4CzTvhjxTXjnG8cf0lQxxSH6vPsaXbMZRjdbpmI0Wmtxoh6M5ZVN+472vbzU\nk3s5tb3immI8RDYd7LLH/OjFN+fdnqKHaHXA5uh1W6ulYTR4PN8kDv5NaP3E\n7UNUxGPS0A+Im3utuQbm+IcxmKh1ucktE72K9/K9DTk38J3YIRD1ujKIkV43\nsUuH12tm0FQ8rY+gbxY4zWGc1ldXrvWBS9k/x4clgAWdVZbtQyckplnXfiEH\nC71ZDwDo6tV/EWiRjVpUufqValEl9KDF3+d9Atjp14Ge/PLBjWstBgSTebxf\nA9WoTm+8IZauCaeQ6QkdAkr7xjxVsbmpkasycrwFR3bl7WCQgQ2tBO1xsUx+\nsu1J\r\n=i0Ns\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfIJ5+ZZZ9a9nvxhhNo7C8ZA1fCFKCN5yX1uB/MeiFQAiEAlDWHrB9Zcl9WBzJHTcItksjL0rSsgeHmBpZUB+xJPOM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.6d01c2b.0_1630928654994_0.7734285713966946"},"_hasShrinkwrap":false},"0.5.4-dev.a829c7a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.a829c7a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a829c7a.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.a829c7a.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7MCR7UzlFYDy4foHtNRPMnoleVOUtvDBtsBumk2Aw1hOp6IfNreIj2E69hokOMZQQYiniDKruKApJFpQOgnEhQ==","shasum":"f3f08cdb02816b22d85f19fe2196eeab3b7107e9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.a829c7a.0.tgz","fileCount":35,"unpackedSize":800156,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNhBhCRA9TVsSAnZWagAAvwAP/jAUKx+lV0UqeLI4cYUX\nN54tkZqPdiPXGuxsyJYQQw9W03CTwozzO1CZImGOXV5xCDQDbBCczUAGZS+c\n9jkZSedN9c9L4xzKbv/j9COdPOdMc46jY5naEQ1nGJbrIac7ssqxI4q99on4\niZwTa7G5RsN67QkoCcVzF8+dYGMldLLnGBlqAFn33PaRO7Uf0E5LU7yEXlAs\nvoOIiwib6dhJTxDUfiTHZ+Ge0Ted2UcFapvmJBLRupvRESHaqGcLJ/D1p0w0\n5eM/PcE5haNybhyN8zpZgoZEe8oJiXJoXU71dGgANr9u0Pr34XZeenGF8AqO\nXKtrQxayLlQAnP3/By6CVYz2VzBec5GEmQV9taON3kqdLfc2cXt9Yj1wtvUd\nQDNwSq6GZUx/lFsMxjZCZi+2WK+zxBfTNwOza081LjXcp4+LKudj2B9nTxAF\nzQn7MCiPUceJA0Y3yoSlJhfbYG9JZmPg/A5tPOr9AA/LpqeXQVXtI02tE7nH\nR9sM4etAygvuVj1JmW6jb83TnZpdQXpbSPqGSN+J6dsr2y7YSSYQr2SuQ4IN\nJ6+eqT/mmIqG/Hp1hB98dqdAEtWMKXGg9yF90lJE3fz1eoRXPss22DAd4WAr\nT/QFxTjLSVQTvNebhDQ6useOvTqnKbd0L7YewlUSZXBPP3wtXTfzQSSBI2PC\nfzKL\r\n=6QLi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/2F5TqSM5cJvqAnDHT9Zk/Xc19MLn4Sp1cPtRxnER2AiEAx8xM6WaqWxx3Q80RHBYoAl3d6OVTCf4ZUCVFiW9kQ5Q="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.a829c7a.0_1630933089572_0.695305512612183"},"_hasShrinkwrap":false},"0.5.4-dev.38e46e2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.38e46e2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.38e46e2.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.38e46e2.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-IRzNPlsEyQjhYSjbB2WkyRJetK8u7BJx3cozgjRYcOWw5/s/ndqxWodRhZ7NkIKntYlPJZEzKgx0ZXcWsNjAuw==","shasum":"8894d1b7ed052de161dcd7bfd0628b6e74385cc7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.38e46e2.0.tgz","fileCount":35,"unpackedSize":801189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNk9FCRA9TVsSAnZWagAAqwgP/jmBXBhhr4LzIVW7XRWd\n8bdAE6Ao9yPQQ47VezDvwklwD/iFm+f5jGcvwVhfrHWeXzKPZ2fl80Xb9Db/\nAjWU2BAsO9PqCCkhi2fZJmjDUGbHxvPkWsynnar9F7fUGTc21az21PJEoIlI\n4V7vd+pjdNJg+Gef0fczKYrzLMzLn9LXMWdK87UgUiqzpcV69o9upolKMizW\nzJAXvfdtze8dV0oyNbgOiCifMKYHljA3ILn5VVPlmu8Sku57I5+kTJIkqxSr\nJu814T7UUk0o5yCiQsSm1pYWbXKZMKwJ/jzSupfhGJTjTGE3xWXT1eatYQH8\nPufupVMnhZxg38WJ6f0P5S4PoqmdVZi8Ng6qkbu37cykolN5gMCZtpYBnsCk\nqw4mGtZEaYUxuvr3JlN23hkq5BYv/v4rtLqqVLo/WPRwdYzwyMPIK+kpe/N2\nYE7I7RfoZPy+2EbHbA8oDKJFqtUUH7vSLS6chXwm2xFcqEOszGGk2mHK+811\nc6sD2xfUHTE96lC4hCXRDEAqWPVwM3BcyckVwDCuuedDziNivmIapq7urUvS\nXB8tYyjo55VtkCOaP4haT9mJWVefl00tbpg2L92/GovCM3kcISZCaGl6oF2h\nT0Y56KlQIOxPbAmWsXEtHhkTRSo7yqqObEH7MRZEqLBzzpuXQBmf6nO3Guy2\n3x7c\r\n=qvOz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0dOz1P8mo8A/FCxL6uMkijZahcyT6IlUpzzTB1ObCSwIhAKejRE1Il1Ri5YPuPtSOqMJZ88olVzMT0EScvgrHWu5C"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.38e46e2.0_1630949189804_0.7329430486135888"},"_hasShrinkwrap":false},"0.5.4-dev.bebd97c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.bebd97c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.bebd97c.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.bebd97c.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HijtWRwJ/RPZ0MzxnRqz6haGyuNTwmkaAbsG7WB9kHvwQUmSqy6OpfPwSyJ+6nqG+MwcymwJwgwIslVVgkrLhA==","shasum":"311669bcedc457467344d88a774b0a7570faaeb7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.bebd97c.0.tgz","fileCount":35,"unpackedSize":801189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP4V+CRA9TVsSAnZWagAAOAQQAJ77rduFh4oBkZ1xV+dw\nL3wtUdZHRCflaOp6dXJ7OCIkSOhFo4EDZAGtjXyJ72CZgR6pSFtKA2XZZXWm\nm4xL4HzfZVIenDEA9fxEUc0FzQUQZ9dfXzzKF3gcxigJbxIWkqWa0JWmSG58\nBLiR3zsbcoVOkVkXRKDen8Os2CobYOwmIygHSG/K6oHvTiccEfHdEQguw6wW\n/7D530pJfqOEPuLXUPzILh1kWjdgLwpHGxq/5S6yTIeBUq3f3BUiGVH6/u1m\nNLDkN5/29jOqqn0sc5agJYeqeirSP279MQ7w3mRAz4eK+ANXVlciDZ4JvBOc\n3no2ByttAT10K7qVUBNKhVJ/jDGa178StQ763ltGQ5ilu4BKxAsIjZJtRZww\nZ2DeIDUS4/DNKagpRC54E1saMT794J9X5Jfg/ZoKN6Aqr6y+FqbsqTrikK3u\nbP1sx+HMl3ZiJS5Jb/Fy832cx62Lb7oe20QUwfOyFL9E8sN9HzjyD0lt9sCJ\nxz/s8UuVeCvsGzN8PIqb3A4hNewL5vDv9YDte+8KRY7b5NyHo/9z0mrqu7Bo\nMNIr0Se456PlCy7XsxZa5NR0SH3iomhiUO1BCd78+3xxq29eWrDP3152ESi4\nbuISfl5dTn3wQThoRToav6VW91mTqXDeJ2lau3/nf1LPgjFE8F1lyRaLv48E\nlk3M\r\n=I2Bg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4eMhdQAbUBbFWX720Mp5Pli1MKLbtpTBd2tJ3vTWjmAiEAjA8FSFLN6KqVzLqPTJukSvtvvogI25aj6kPnwzjRTdM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.bebd97c.0_1631552894522_0.7121378033419401"},"_hasShrinkwrap":false},"0.5.4":{"name":"@superfluid-finance/js-sdk","version":"0.5.4","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"1.0.0-rc.7","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-on7iO+IVISvjcMskNkovoohxVZ4n92HwKFBdEX72NSC3vGhAVqRtvtBG4ZUxauSZD9MPDTVqRLm2GWSJ5qQaZA==","shasum":"ba48f64ae61d3b44a4988b0703a049c51bfcd809","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4.tgz","fileCount":35,"unpackedSize":801977,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICayZNpQaOD2R2+b1wlIRLSD8prEaQ723DNaRPGTmC47AiArDkN4r/eL5mQBF0mfIqvk1YishjtOX4y0kElUpXuliA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4_1632310632496_0.1447613773225025"},"_hasShrinkwrap":false},"0.5.4-dev.a00bbc8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.4-dev.a00bbc8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","test":"truffle test","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.4.1","@truffle/contract":"^4.3.29"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.3","@openzeppelin/test-helpers":"^0.5.12","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a00bbc8.0","@truffle/contract":"^4.3.9","chai-as-promised":"^7.1.1","truffle":"5.4.5","web3":"^1.5.1","webpack":"^5.49.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.7.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.4-dev.a00bbc8.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4ATQzOTQXkXbx7G6+sdTVojdMsU44AicqcJ86GVFBF9oIpdqdSmhS1rYlIYHtkATgrFZfFPBhRE0u80a+wOLkw==","shasum":"fb6e5c5647117043ed4f98ba95702b7bbdf3ea10","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.4-dev.a00bbc8.0.tgz","fileCount":35,"unpackedSize":802003,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOAsOJDzf0VrdwpasCBpvmbK85JXV69GJPGzdUQ//zpQIhAIZb8UUFoTr52InVK8qMUZUIDxs65yIR4gkvHKD0lFmG"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.4-dev.a00bbc8.0_1632314672041_0.5731261207719209"},"_hasShrinkwrap":false},"0.5.5-dev.ceb8c25.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.5-dev.ceb8c25.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ceb8c25.0","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.5-dev.ceb8c25.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ZDVZ+yRslcUz84KRibF8IRPYXgbGQCt1EtShi/C9fWWt3zvfP4700g3TaKTD2U5VmHvBPPWR6NwOswQddeeEpQ==","shasum":"e4f036acc046a63a42da6ca207c5137ad8977893","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.5-dev.ceb8c25.0.tgz","fileCount":35,"unpackedSize":801959,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKOQ6PC0E5ALGxQRIgGUSl2lMciq6ejbkjVU1wqlUuygIgeDkz+IS8CSwzPm1JBqXrXnaYNIuqicwELszFUMUZwHE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.5-dev.ceb8c25.0_1633022541222_0.6761638054295422"},"_hasShrinkwrap":false},"0.5.5-dev.be0c14d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.5-dev.be0c14d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.be0c14d.0","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.5-dev.be0c14d.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GnUij+HB0/GhbtdKWJXifIkVZXaFjR+aHMmWCFF1GP3hBT8uEOHq3FZL3ATbSlyJKn9Hd/tYvHKeVvVb8DmdAA==","shasum":"62658447c1b68031bb7816b664f3ce2e5c992a77","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.5-dev.be0c14d.0.tgz","fileCount":35,"unpackedSize":806204,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEyibio7/7NbvKNWaTKUoDB0KkQmOpFX3Td0KFhlVNYAiAXfhvdtG4dG5AYUsIOG54KWv5+tlGd3pxqKTkhcVJT8w=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.5-dev.be0c14d.0_1633025041064_0.29891629088638316"},"_hasShrinkwrap":false},"0.5.5-dev.585edef.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.5-dev.585edef.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.585edef.0","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.5-dev.585edef.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-6VKKN08vw9q5ZOTWnVVkPwL/L3XvtjRlRuUCQglI1NuCxrpELcZHe7Mop6pabS1Pl/+pHG42NjYUcMCvyAfHlw==","shasum":"56aa0a2110ffad27c3912ac2757a157f9c91f313","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.5-dev.585edef.0.tgz","fileCount":35,"unpackedSize":807941,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4Sr9QlyTv05fu0EBg5dTtVoTGPGExtl1EC+PuTAPmrwIgM+WZCP585995Z7eaN17S7PyS7aNuyBAAxjkqFoYKtL0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.5-dev.585edef.0_1633357551273_0.004030793517027842"},"_hasShrinkwrap":false},"0.5.5":{"name":"@superfluid-finance/js-sdk","version":"0.5.5","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'yarn test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"1.0.0-rc.7","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.5","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HXCQUYVf0OfandzTWVV9vfn3tnBtj2A6PeM6XzILHpHmk4P5WPW2O3FJ6lYjVTSo2DDRoamrE2B2ZkKxjneWSQ==","shasum":"9b311b4ad3e9d43ba14e7da734b0bbf745ea52e9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.5.tgz","fileCount":35,"unpackedSize":808222,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7/+NQLWxk1zbMbUc7wYMCm0fLghtqm7/KhJc1gmg2rAIhANoAseI8MIt2cUFySR2wuiK0tlezEaRIk5A91cKx3TMj"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.5_1633451054630_0.8292411317092458"},"_hasShrinkwrap":false},"0.5.5-dev.a2128ac.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.5-dev.a2128ac.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'yarn test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a2128ac.0","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.5-dev.a2128ac.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nc+sk7Qs+mIJRWXLFGCxDhzymuUusrPzjfzYd4DVVdXbEoprVD5/flf/VH0Phj0NggX6MFYDkZjzdRfwS0fkxg==","shasum":"8fd2faa25c047645df11293ea3d69f341021aebc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.5-dev.a2128ac.0.tgz","fileCount":35,"unpackedSize":808246,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3QGi71nfPhTWXy0ubao4iMfTvsym9cUBF65uGGmy3PQIhAPoAbRjhQBM/5V2C8taoplah7KgiAO/jo8kOn7Lsgxd5"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.5-dev.a2128ac.0_1633452580190_0.6580146389142445"},"_hasShrinkwrap":false},"0.5.6-dev.19b0897.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.19b0897.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'yarn test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.19b0897.0","@truffle/contract":"^4.3.35","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.19b0897.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-UBHTzvxEegomEg3tnlLDGDe59nn6035DZuU0hTagN08WwVLDWJ+nChJAWXyPcmz2IA9H3BFIO2cbM0NyQW6gFw==","shasum":"03b1eb99941d4558b305c282029fef13c4f43de3","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.19b0897.0.tgz","fileCount":35,"unpackedSize":808246,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC78xOsH5F88ZEpkkHjCM36V/4LoTU3vg+uY/VcMCl9wAIhAJx6xLoMO2JTZh4lK1c8XI+CeFycdpRnudXVimk/EWCO"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.19b0897.0_1633453033230_0.3332729397974097"},"_hasShrinkwrap":false},"0.5.6-dev.19397b5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.19397b5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.19397b5.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.19397b5.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-tGJfTU+hrmjdzP3FGRBYUE7ggbdbs76J1R0RDk7gL8s4a67NovMfHHd7AO/Yx+zY+zLH72iOo2HYw4keKqWiCQ==","shasum":"e797e8f1e1a10f99a2a18296f66f61d8eba5744e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.19397b5.0.tgz","fileCount":35,"unpackedSize":821014,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlqo/x/VtRLW5DWwHBghaxxznkLxBwPjgCK4Amj61FIAiEA9bLIpVswQB8Uy0uO8uw2B3PRzRSIOdPWyhSUTj4P8Zo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.19397b5.0_1634133177319_0.13393826957255794"},"_hasShrinkwrap":false},"0.5.6-dev.55a6145.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.55a6145.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.55a6145.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.55a6145.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-I1kyFkfz2UohtslXQbxkgB0k41Nl0drR93OmfDMsB4PQ+zVEJGyJdFzGoKRNmGJJ41sKHpsVQhPzyJx8a0GQsQ==","shasum":"f367b1beb8ae70e66421663d9822a80ec34108ad","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.55a6145.0.tgz","fileCount":35,"unpackedSize":822316,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCQ6l6+Eq5T2dLDwfCoL35V92heHihYcWyqHBwsu9U3AgIfDZnhg4Q5zmgJE9yHf2wIUJk1GdLibb7Nehnh5s/sog=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.55a6145.0_1634718777009_0.8346125728319693"},"_hasShrinkwrap":false},"0.5.6-dev.82023ba.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.82023ba.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.82023ba.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.82023ba.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-gA7Sza8+pdabXu+3imYv1IDnHnW6425D4rt+SfSpstk+xcIXKCpWUT0ZHmnseKmnKLWOqNcITHLlu2HRYqfN/w==","shasum":"081536488390d973d450e10e84282a946acf9222","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.82023ba.0.tgz","fileCount":35,"unpackedSize":822316,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeU6RYjPIugpHgyC+B8vasF45yhp/nyW7Mqf1L8KP9HgIgVn31QBFLWfbNoQ3EUUCjJ9owPogC3cZzr1WJ9QfYmRc="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.82023ba.0_1635245042826_0.09986703949979003"},"_hasShrinkwrap":false},"0.5.6-dev.0ae809b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.0ae809b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0ae809b.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.0ae809b.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-koX1jtOQXqYMqKt9F8MwrC26traQQi2WHaRf1YayHV1m+5NQuZLqfOJ7xTUiPVx6m8F2zLHnAoZ/Q/qUKkCENw==","shasum":"3adf4726cfe12bf88c1e45b0cd88343bb38bcf36","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.0ae809b.0.tgz","fileCount":35,"unpackedSize":825710,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBK4YOOv88a31l8ehxjZ+ZgINbL/m4ycz8JoOG7sNBbpAiEAw5SsilQ0+YmP9XhDWQalnAiOKJqW96SIVcLAbR+XvQs="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.0ae809b.0_1635436264115_0.36879832949052926"},"_hasShrinkwrap":false},"0.5.6-dev.8a1acab.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.8a1acab.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8a1acab.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.8a1acab.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-uH7t/M1VEJNJl5DFyYCgTlKg2CvaB1GB/hqkFgiMtK1RO+4atjik1tGvY37eF1XuQ8o325/MNULLkIIKhg4mvA==","shasum":"7e5fb71e4d926892c92631f6b08b1ca6a294f61d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.8a1acab.0.tgz","fileCount":35,"unpackedSize":825710,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICi2FCwUtvarzub3817lLWLwawZuJnpJSKd8OWlhFzXkAiEA81vMRq+BPOGQmFDdh66I1eGTqHG0SL85kJdlW/LwVbE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.8a1acab.0_1635495793718_0.648720391935169"},"_hasShrinkwrap":false},"0.5.6-dev.df8c637.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.df8c637.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.df8c637.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.df8c637.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-0FsmYQZVKcj4FhNTlUhahHTbWTwItqRyvG5BLJsqlOEDJERKVhatz7Sy0BSL4rRwAS6tWhMU1n2HHsthfijP4w==","shasum":"80a67dcf8b691636ed509d409e80412601ea53b5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.df8c637.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6pbYucGqt8m2Q8V6YtVUi5Q6NA/1kpEWEHBG0/bHj2QIhAIDAmEzX9jFS/NuRk/VfkoNfaVwPwBSRpuTSbjRXTnKF"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.df8c637.0_1635519999079_0.08583364511047797"},"_hasShrinkwrap":false},"0.5.6-dev.0384f2a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.0384f2a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0384f2a.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.0384f2a.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-VlhxC83VdPYYhpWZkPCxdWdc3BXM+YXGOkqvmNr/fuuTKkG67YYWDeANqYdQgsyyuhzpAIAF659oKnxw8X7YLg==","shasum":"faf2f82985e3347273a511059dfb620947d60d64","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.0384f2a.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELIrrsGgxe06iYot7zcTTukIIee2jEdN+woz05EEH/7AiBQknHJw+hRluBuujwErppBI+frOzSI5jg/lM30Yk/vYw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.0384f2a.0_1635520815514_0.29075183683021844"},"_hasShrinkwrap":false},"0.5.6-dev.04fda1d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.04fda1d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.04fda1d.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.04fda1d.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7UM3qBv4lcUc+t5Li2COfCYngP3DEn6M+37kAQmlI/H+YmNLOSWgTANPZxDs3hw9EMOVwNwhHUlu8nIQo+TJMw==","shasum":"94a074d4306b4f1055afe414778496ee02ccba60","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.04fda1d.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNsZVGsAa8oC2lEo0NtI8MB37+ntkWHD2ck+8qn7O5GQIhAIipml4qc61Erc8RuHtByXS+0Jl8R0eVvEgZqYX5X421"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.04fda1d.0_1635522716447_0.9401526307303041"},"_hasShrinkwrap":false},"0.5.6-dev.6ce816b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.6ce816b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.6ce816b.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.6ce816b.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oLTbWnN191mZSaxWGe1bWFygiYo/5U5s1znSc7djnPyQ+XBVlczpVoaaW6riV1JgIRE2xw5UAIfCTWeIR6Zhiw==","shasum":"8fdd177929e82818b224b6ffd0271ed28f4935dc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.6ce816b.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeXSQ9G9XkbL6w3fiF7RDptfbmWua00NJ1ouSme3NaZgIhAKaGRKaZKeAKSwQnDe3D0q0mcKS8BtJKTyi1gCaW7KMm"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.6ce816b.0_1635766673643_0.3637528570772719"},"_hasShrinkwrap":false},"0.5.6-dev.43e7fdc.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.43e7fdc.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.43e7fdc.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.43e7fdc.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-SNduVKSF76Ojm8bMPTfgwRpGJ04BhPZZTzjZsCC8RNPZuBHq4WppeZRwc9ykfZP4s2Rfg8PW/vDIAtE/SopeHA==","shasum":"bca1198b903b61ae32bd9341f320442c81d6ed3f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.43e7fdc.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm6sNNQfNEwed89hY/QOCdbLHC/lEXjgV9YNQsols3DAIhAJrHdGg8bT69aNgEyyIy8v1lFPOXMK4NIsPxSYfhnDjv"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.43e7fdc.0_1635780938734_0.5837983464511314"},"_hasShrinkwrap":false},"0.5.6-dev.2ed5aa1.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.2ed5aa1.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.2ed5aa1.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.2ed5aa1.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-vUxRWOFsDm9athamP2NeBzCdvreAS/Ge1mO7GBtDt63ZgbWs1yTNlFN5pIKSZzULH01KJ3sPZ3iNN0n8mtfiqA==","shasum":"65ccaea780f5cb26179e4d9533b72d300db1b120","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.2ed5aa1.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSBUKrO15wIwHjphxVBPLDX4Meoojas28WP+ZmQF22BAiEAkXEx/ijbR8US3hcGDbhScz8zLXYmQtW5bIB6/goEaUs="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.2ed5aa1.0_1636019964086_0.877896916214808"},"_hasShrinkwrap":false},"0.5.6-dev.8e99262.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.8e99262.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8e99262.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.8e99262.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-c64IwMvwK/3Q66jjCWuxr8tT/1as0ZknOUxq3AFNw7eKV+8edcU0Tg0x5plMrQNCf5k7mkM7RytW3ACbafHkKw==","shasum":"126eda66d88dcc7bbd5abe3a6ae8001d1b5b5b0d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.8e99262.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2gSkx4fO5YLgT7yuQ8g/GvLCks3eERpnBdlDQv65qygIhANRhPmBJVA8n+wYeRWMwWgJk9BZ1AsbNGLXcykTq6uYN"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.8e99262.0_1636372348239_0.47607880126900204"},"_hasShrinkwrap":false},"0.5.6-dev.3303a7a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.3303a7a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3303a7a.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.3303a7a.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-sI3sHJFcDRVMByljzEECHNXsknj9rHGHj4cLUF6lNpAoT0Siflpkn4bWYTN2bvti0a48GAaDEa4FjOhDQeHnGg==","shasum":"9626f0c8c8ace0e0dc3dad9d5e104a44cefba38e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.3303a7a.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFi3BWOEYXu20LVn9G1VzKBysdeer6AekqTPgy4Z/zxgIgQReFkGjI6bij8PiwXlGsom3YqdzzBeipS0I2K4akYEQ="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.3303a7a.0_1636492180420_0.1127890730710972"},"_hasShrinkwrap":false},"0.5.6-dev.041d4de.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.041d4de.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.041d4de.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.041d4de.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-JtsU72n39LjZT8Xmk9sDJlEiQ3cAtuUr625gdSEL+DlBupAQihsIj57/FGGibwP1NMKGoVrgbuo4bKooHKTpOg==","shasum":"82e21cd506f15bee85ff3105741b54c2955be81e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.041d4de.0.tgz","fileCount":35,"unpackedSize":826434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9f+hCuUr0iigLkaJE5M+TKezNyeCQC2XH9BD340gEHQIhAOXo+WBqOga90weffdDRI/s7hQCX1EiVY80VylPXDtK+"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.041d4de.0_1636988495586_0.2514506495976052"},"_hasShrinkwrap":false},"0.5.6-dev.b28955c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.b28955c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b28955c.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.b28955c.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-tkAYKvFYSrlv5CqZIkV5mCG/gbBbDIsKIKQO+6P1ZLTT4MCXqJmtHKHvd14jYXu8N5ZbcL+nmPZw5USDW4Y4TQ==","shasum":"c9bfeaffb49f5620cff5feeb667de8462364e0ff","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.b28955c.0.tgz","fileCount":35,"unpackedSize":992584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlNN5CRA9TVsSAnZWagAARIUQAIIm15bmEqRrdqALNAiN\nu2ARMxU/d3OkUl13BmJJYW97yNNxC4fzpBISUFplj0+f4vWNdqzTRx0NCaav\nINZW52M3eth5OAsx0KN4P8A/CmjJMhugJaNvrj8JkxYAwaA2mO8JSAlGm1tx\npwHo5gI/an48x2Ek8EU7jCTnI9x6K7b8qWhJHQ4wqXMmkSdWYeB85zWdGhgo\nC+nnP4Dx2TuzylHuUgSe7jLk/eH+cbO0JwGcdjAwFicFc9qj5ZZbU092bvHE\nt+VSzxARA3gOgh+LYFZBzaAcHga6M7xfL+9ryFGjAOQIN7+EqJ1tr+ltbEjV\nsoelBAMLOqnr6zRc0eAMhbFJyHBGI85nDe2YRU9ZCqY9TaKzZSFlRoEyW6SB\n22DYu707Z9atV4hgoweIpOD2DLiJGjUH+5XnZVZE0iEquoIz24w1Oc6YqR2l\nxve8gHLr40e1e1EmiJzw8di9+pexvizkxs1dpksViGnySYCcQOw4lVFkNft6\nB4HbJuVPbxmMbpG4IEYBBK+yahqRCHCA9Ip0TAvJu+GSSYd9HsRH1vxil6iY\nRw0lW2SKq8nUBzXVA1yMuQNoHaWgEkKlr++RwNQbJZBgeuVdJNOPPozKz5lz\nv5mTfo42DhMw2Mrj23uAMpe/FgmvTz/wll7BPkylghgZc89Z3pth4asZ6qxV\ncMC+\r\n=vZ21\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4HrzPgNLjsAQV7oGT/+DqM2YT4P8aX8S3e0Wu65djwAiA6st5p5VrxlsefxbAWr7JJrPzNj1EBJ5/grLwHcqN4nA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.b28955c.0_1637143417064_0.5645594619602294"},"_hasShrinkwrap":false},"0.5.6-dev.0515f42.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.0515f42.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0515f42.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.0515f42.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-MUWc9oWhoBinkZHP6YcvCs5vOobJPHm6wbc8+XyPQrQmn3PkCspNg8oXTCSYRxEm13EzNMnZ14fgLcyNgp0t2g==","shasum":"d8fc959ac2d7ccbd9abf1b11f7ebc3ddc46a9ed0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.0515f42.0.tgz","fileCount":35,"unpackedSize":992584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlp+cCRA9TVsSAnZWagAAcuIQAJNmM/Xob/3XQU+UF0pi\njwzBTOKiVwvH48P7UdQD/FFg+4kcDM0aI9m8dOOLJhzUo1/Lvc9rowpBDDSi\ngJJIM+47TVz6k9y4ATICDAedSeDm7XCKSlalbcte8Q38NS9Ecpdjm/uv2uoY\n0UF2X8ElfLuVe04ac/u6sV8xaaQFiwiy3Y/xNVRkhG7FPFUTEEdRKGerw7oX\nXj0AYOMfrZw8ZW5CqLBvK4Is4yqEbfuLo70k5EyvCG9Ejh8ScEyEf8I9Hf4i\nSyH8JjEk5uwPGIFZFlQiWTQpic4w9yV/MK+Ms8zLWY/Et9+pV2UriSbq8L9d\n7w0c45yCdZL+f+S1XswaHvQosXY2oelp/BEB5hzplAXGdmwGIeQC71gLwvTa\n7PsxxcNnDRH9w21o/jIoZVRMFw74/n6V+vBZ9LNo77u0D4XvIWWp7FjfWaVy\nQvZ8l6edNHq1zN4yByHrfBIV+4KHUyL3TYUlbPlDAAIxd9tFMS8kD/vY5Rc5\nEgqkF0V4h2N7HSr+cDKOkyTDBUI+/Lg8YG5qX6aeIDATxKiNJEzFEW5SeGft\ntmOVG7DBUUDyYbk5Tu6ORuhHzYsx0m44xMui3xmHKD9XFcRCHaKc9khUmJUY\n7hwyN+woLkfpjnaZTBtle0f68D47ZYhdKpJj5q7F0XPLozJqk81lu4sONcvr\nz7El\r\n=O3Ts\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXmjjVN4kbRhSbsO96OY5S45b0NYVTe2PdXHvmyj1cUQIgMoW1hxCskSnWuaRvV5DxOxex+vaB9QbJaH5ldpu9ExU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.0515f42.0_1637261212533_0.9521384869892955"},"_hasShrinkwrap":false},"0.5.6-dev.fb7dae8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.fb7dae8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.fb7dae8.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.fb7dae8.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-USOu8qmNTUXHFNVtP5C+QnrVzTlF2gNv/8Q71SvnCw3wZvdVAUIQiifaij33iKMqWCkX7nzIbSvD1R0n5waYsw==","shasum":"01d6033edcaee1aedc00f76d72c317be52cbe199","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.fb7dae8.0.tgz","fileCount":35,"unpackedSize":992584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlqDPCRA9TVsSAnZWagAAt1gP/jYR1JNXE9dOAWSNrL6L\nkuY5Nv6iCz6rhTs8CMkuuQMn12uwce11igqN5rb7RgXgbucbNvGKRySVGO5R\nHR80QzzSDoxBh054HiRjHdI49BjMc0NsWAQwJUiD57Snx/XXLqp0F/iRRwsk\nWOttRZJrGPSqKIJN9cm7ehbiHofPrw8iNhHOYsilvz/4xbK6DAwYoO+p3kQy\nbSwSpSdSmK9elcyzd++59kAnwVCS8oRv6IRciPp4T65qdstemJ8vjuUGVco1\n+w5nlkAXoOBdAiBD+tg6xGTLHMJbp6NmjvW4/eui9L6GVt4ZZIOGVJNRHsJR\ngo3dvBKnEJ8huAriganFgEXGxnZokg9PpXmmT2j6AVw5inSgv0yu7p8wHsaS\nHVrQT2aUqZU4OjNZHfHWHs6cxnp2OZ3rAfWi6M9RABU6LJ+cSPnDJGHg8aEL\nlMLMhD39jJ8mFL6FbtPA7ErzRxqpZA5mKE9BBYgFNOjHapWD4lQaA/dACGyx\n7mwXQLeDpLvaK1JP3vFZl3Ilx8ZZ1va8byweG3LCg6xUCWCyB93nY0mWcWRc\nKmiHf3OOO6SHXOfReF3MqtXXDQ9sWjWUFqqle2qx2Cgganv15E7LV22ogLmb\njttx5vuHJDBF2JxaiFdyoaWv6Y24dJ3d/gaDdvH46hD9EUUa/AOK1C2Kyote\nk6je\r\n=oYE4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5fIE0SU+KDh/cJP2hC0GHwWGKNYJtusNaQLKiNHAocwIgUVOl/HFWNiiRu1H34XRsDTRwVxgg+NWHm9qe59apkh8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.fb7dae8.0_1637261519758_0.9812222097970538"},"_hasShrinkwrap":false},"0.5.6-dev.a9f9410.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.a9f9410.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a9f9410.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.a9f9410.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kkP3FSIl4hSwFd9dyT7J2i8/wUXc2esmIjPS1IRS8nsekA8fqjTYKMKG2dbi5sG8yCc9Ra+gSe/WOLcxy6uv9A==","shasum":"86e742c08d0e78973455258830be5396b8f7af1a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.a9f9410.0.tgz","fileCount":35,"unpackedSize":997763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm5MhCRA9TVsSAnZWagAA2U8P/2UdO7aaoAMtwKl+mv9+\n/LNOzLauIM5wPOjLeg+ZvvhS0ZNb7QnYRuSslBA7snlaLWU77cuUsTk1O05A\nOziY9F+FTLq/9IYzC1d40WFej/o7qEpacGGG/c15FKjN87PWS5uX3UP+ZpvB\ny1YaRTz4BAGPPkcGQRQ6K3d0b/oLOvYFSj+PnGP25NLW7nHdFS32QQ4/WD6R\nTm1Y8mEN5PKa49Ip9k7inqfQesdGjKNg3Ok1jjIFP6Dz8f4vmRYWjyu6Y8wD\nEz/QJURUSFQ39VYFkWAZtaGCsuxufeKinIFlpIW60RRYZa51iy7Yd0LJavem\nuvWwzzxsUhlgg56xb3zpA2TFDKYcjdxbCwsFDew+VwyUravyBoRZ1dyM9NF2\nEnsZJ9vKqLY4FhG+rNC2htrRLiapx5yCePkLv7u/kos8bNQeMKjlfWiFUz2V\nw+5ZAGQYqnvHP/O1LuD8MawaT7fTJ/BoYHJgMes5CopC/cgC08XmP4YiLqs7\nF5WUk8/uDQv5aXsEWuMZEAr28piaX1PHO3uEB+gxHBQIByue0szZjeNJJnQO\nmL+/0tVjGVkZRbdSDc/fCegchyySSbfNeLQwbOa8aaieQdv2l31sKGpXCd7/\nRPokBvHTZN5talehhosfO0vRkQ+s35XuujPE5hcigdrUD/hjZpcQ4S0RRPW6\nmpHE\r\n=lV9p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUUEzG61+BS4Df/kcwbbMA46gt+rcbu2joBYe8R5ZWYwIhANF6LWEnEWGH8sZXvA1uZm7Ku2mFel3xlGXWlwxsXhrS"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.a9f9410.0_1637585697621_0.8174677904881249"},"_hasShrinkwrap":false},"0.5.6-dev.c4f51ea.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.c4f51ea.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/tasks/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/tasks/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.4.1","@ethersproject/hash":"^5.4.0","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.4.1","@ethersproject/providers":"^5.4.5","@openzeppelin/test-helpers":"^0.5.13","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c4f51ea.0","@truffle/contract":"^4.3.35","@truffle/hdwallet-provider":"^1.5.1","chai-as-promised":"^7.1.1","truffle":"5.4.11","web3":"^1.5.3","webpack":"^5.53.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.8.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.c4f51ea.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-p70nr96uAe3WuCqGdYtA83c2AEiuVDU8Trp9I94WESOWQAr8iRx98dlCT5QweMAdIFRLWbVdQWNKb2DXNgT2lQ==","shasum":"fd6eba7965c3078844c8c569358b09a42d4c2597","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.c4f51ea.0.tgz","fileCount":35,"unpackedSize":997763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm7wRCRA9TVsSAnZWagAAKPQQAJJBqgEryOX1vpfnz5Hp\nO+dBL0U8l3Gh52cI+N/c5sv92a5D/1iaSb6f3SurPEIzznMPCJaUurtZECTr\nwb5d0xSRTc+KhEfNGNec7aifpu6zcfOmMnpUTSIJgoVIZKvK7TW/WrFGOF9P\nugQV7N/z+ddVz8mOOalceAvLgyAbryemMe00MayQFpSEiMp06BkHLOqu4ccK\n9FBUDvGF2e5UlsY2OC6p/j8VaTfTGqPmgdqX07k49/KSFpnlA7KFYHOWlKcI\nRNIwkak9DgXcP5pg/s7SUHu5I3hcjAqQkhacIr2l5JJdij6fwL2xu3pxTCki\nQgxTQilDP/5bBrqKnDblYGO42dypNih2dEqi6/FzExVHfCwlcODfBJ9+FVoB\nFoPKqbWrMPg5vyCtEMGqG67gWgtKdiUsz7SW5m8WmVbRYlUId6ETp9H5U9wj\nlj0Eqi2BVLWQqxDGQ4DdCqzOVdlkQ1hwa+tc8fct49yELJPHzam+UDyZiXY1\nLEL3zzdaD3hGMKQ29ugfI5WPURdBS60k4jC1CEvzOEqb0rne4rF7oDx2FiMA\nmCmzqDhwANa2bDEbtf6VQwqGTg0iKz5egIt0mvsRE9kmUyHur2jdTVNqiBFf\nsxPXLRVIWJw8BteqXK+v28v3HrRPhWJc6FdZkuh6XjIYw64ul/B29gnc3qrm\naVcH\r\n=WbSE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGM4h7MnMTGUW5WM3EJ53G2Bwct8hlzz3ICPlIRBUCv1AiEAk8nAMG0Bo7NM8iVULLljCW02u5WwK8nJ3IeVGYzC4Tk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.c4f51ea.0_1637596177448_0.15656849969101239"},"_hasShrinkwrap":false},"0.5.6-dev.df73b21.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.df73b21.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.df73b21.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.df73b21.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-DhOU3xKOBjwAqgM22V92HGvUofP2FziL3i7cLfIhggRibLy7DCM8mXJ9Q48sMxzC0UYljSzwatzOAJgUKiA7xQ==","shasum":"2b5d5eaebf4d97679548bc2d0f5bd85db85c1fce","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.df73b21.0.tgz","fileCount":35,"unpackedSize":997777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnMB7CRA9TVsSAnZWagAAAQUQAI8MWqsq9/qxw7tWWaUI\nx9ZbPu5nUdkChe9S2z9R6ZDrgO1YEcoqcxBFs0j4+F5jY9md1qfB6Qs9fII2\nZxjWiL1Hb8Do9+yaOMJkA0wNzC5NL9u3Thu5j4xqRRLE7fgdxcsIcn/ZMryB\nELoUVCztLn6bl/qiLHVva+n/9Xj67gU+aaR9FqSIuHpYd4xUOavIziVEInZH\ncoWfXxmpsVF8x3CuNkvM/mrXwRrcML9X4+M9BgCBiNNNFDccY1+Rdz+LSGhH\nTIVimnQKKoQpP3BTZjv/J2558nUgT0Se7bxkUaFKR9vsKV2B0kAzTyM1oZa8\nPlFvvDmoCgjqBufCuDgPeSMtNuf3nMHsG65mvg3mM0SAyyK6NUz996108YSd\nfWCdnINSMhXTiTtF3zEL75l8RxjWKQzv9nKXZFHx6j3P3VCd7yBDyZ/Klr04\nKhSTCUKKqIWrR0Y1RFUm99AH1qnyB+VtbnmEuRY2n2Nr6gAfiQDtV84bDM8W\ngCCsf2x4v+Waopi2q9Q1SUH/VhYGS2MtQWJW66VRABeb9g+UtGQByrKFdTgk\nJL4RxIFxiQhUdU5ok37Tg3idIKu8srT8Jy5B94C0D4+fzwNucAVXhM8gDTcK\nP9b54tHUnEaPlPrWDYbIR3oN6D4ZLL+Mign2vWSHykLdnCvjtZyCMC35PRVQ\nh6X5\r\n=ZR7/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDozzPRmEkKC+K/RLoFd/GzMRqJFXZVvnoLf6WS5YiHKQIhAOEIPFGagoDQWD2+zwVcAHBg1rbIKumM4I6mE5S3cOCe"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.df73b21.0_1637662843540_0.989426224556788"},"_hasShrinkwrap":false},"0.5.6-dev.ac1b585.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.6-dev.ac1b585.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ac1b585.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6-dev.ac1b585.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-eJ/6EuCfR/RSJoqqE1h5YcxQiUI+MEZMIBQvgIEzGGf3z1CnitBNLY1lV61rvOiA9btGIZ1pq8TAwTgk58NQKA==","shasum":"e6a4ba086100dd7eec641847db2b5affba277847","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6-dev.ac1b585.0.tgz","fileCount":35,"unpackedSize":998446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnNf6CRA9TVsSAnZWagAA8TsQAI2wgqxJw6iLLufa3cFl\nf/FUrCoEEMe1RAKIi2tQirPVz8OlTk486qPJ34xcnaV+aoXpSSwavz7JoISv\nJPUapDocfibEG4y1MnoA/fapEeubj4asKlHZaEuE3wm/tnghWdzhg3H/WCO/\nXZRp5e8FcPqAO/hoT7WN/00pz9uNZFhzI0/YfGNdsNenNzOz2tXp8jBm6yOK\nbYs835dIsu6sJf7e6M7itTd6uTM1cf7YShe2O/SiS+SPkByfIRgP+5DQXjvj\nm4vyXyW67lBo6lSwVzuDQa2oEwJrsrnyKsmf1ZOWZRa1I9osEfW8dz1M+RQu\nl47nDpQCti+7jljR3K3kDgDjECfMz+klxbmd0Ay5XNkVQNBSxMZh4vxP8HeQ\nkjPb9LlHm2S4x5DHEJwN9QLsFgThD5CDcI5XzHrZav1C7bEuEuU56PKU+zzY\nRcv9lw817z+u4QtGS9U35AftUs71s+km/tL2lJoS2eO9YANFFHDPzVRDL8vq\n9EBVVc6VL+cVEwgRM2wdcZQ80urqrDp5ZikPTjwkVB2XqzJPKCAuHZ49pBR4\nsPypyDN8MDZqu73lXBPqdCSCBa+SQxC3oJPzKre/+NXhC3UmdJAeSQ4msD3T\nC6icTPfxBtRMF3lrxuYXbEJPuxLOj3lOlmnv8pZ3vyV6ILscAKiONWSjZGUV\n0qXa\r\n=I1co\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/AuEZCIe8VpWvFFqRSLWWYj93bAMqr5SkRduzthZCYAiEAxOFskMtfjMC7eXA5E+B++Gv1w3VkgvQ/evJy4IlWmMI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6-dev.ac1b585.0_1637668858476_0.15317719778128924"},"_hasShrinkwrap":false},"0.5.7-dev.ec101d5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.ec101d5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ec101d5.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.ec101d5.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-x71DXKNtIvqfuQnZeGitZ/EUjqLOCIdnRh0bI1prE+1jn9TXpXPhHzvJzvuM5/uiCVxg5xtSbbVY340T/FufCg==","shasum":"62478ac9daf28918e686c10a596a996fea2654ea","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.ec101d5.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnNvBCRA9TVsSAnZWagAAx9AQAIggGgEBdrsbyTyGaLSR\nPfw7a3bVnBnmcsK3bTKdUy877z54DyU7LGKjtvRJYHmGIPKfbiav0u1Bebmv\nJJ8OYQS82Hf1Br4iQmSFwzPskoj94m9h/4THK1n2mtpidYDYu9BMzYxJ3B0L\n8JkHRfaWSJpMokRFQQw+OaL641J5DHrKeJ3+qk07sewijsfVqay9X68g6Q1s\n9KzdI3TqeK0IItxkH4GG2s+Q3bESBm+mMlNNWuXquOH07DP/g32Cr0A5Qr+D\nPtyn/tX5m/QD59x+MtqSZgcd80kfge7caodqbWJmLnyCuXQuScZbmuZ5Tm7o\nQCk3upB38oBjBjwh4zODgqNR1ptEeskpnI51+5YIlyPzfa+XLx+jcX6PyfDF\n6ad5ansv2f0rVxlrD2xCBWGgf+I/DVlZNAIobiHDeWynpcuclzz37G/3B4mr\njlyYfx2ls/wExupKLTjJbcsUWw5yzP+JCx6MhzoRwrYSXlHEiOrlMTUh2+19\n4tLRd9i1ELe1eIezMQ5ssl4Tbibny6ndy/B6MvOQbZG3yq08/FqHc7DPh4uc\noAps4pJyVNeJXaYqxnmkVgNe9GebyMlvWYyL3j7KRFsiyIRlsnupBHL5nymQ\nAmR6fkGN+MdhaTgZm7re5YlPo0lddBnxu+JwqJ7mjcW/bIpRRMj/2aYHPQed\nkouL\r\n=4cSX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA6TomNkRZ4hLm+S0Bo2iSn16ECCi2cKgBPy2PmKX33VAiEA74iyU275B97Vv5oYVcC3gg1Wc1rAAH5XmdR8bSwsuFY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.ec101d5.0_1637669825083_0.7118627308618983"},"_hasShrinkwrap":false},"0.5.6":{"name":"@superfluid-finance/js-sdk","version":"0.5.6","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.7","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.6","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-s5a5padjIKnSmErYco77Ktgb3SGKoF4YBzBipxaZGZu3QjeXNeIOI3fN1okWJDJkS61QsStGChcb97Gys46BWA==","shasum":"0609c2c4a4d3b4f2eb58cc5bc4ce95aa039e8997","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.6.tgz","fileCount":35,"unpackedSize":998387,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnOA0CRA9TVsSAnZWagAASK0P/i+SR3tbHPCQTWwFH4i1\nJA4hCsy2Z2NfvxOsYtG7B5WhFDTXThOf26ZjXNtqxnbnFyF0pClCtJ+ntHWv\nEB55dT1TJQb4iC7LXbcn+ICxF0lnNcqNblKAEwFUuR5e8KNU3ksmnFZbmL7o\nkVnlzY7lFUA0qNUzReClODtnpWkQWCPfIxA0Q1U6DtDWmkaf/MLDv+Xzx6nh\nmXEqrBsFKW1svjCFPn9LPAxVXeNLUDHKt/REB6zIDCEEf8W4lyvVO/McceB3\n4YC775wyVa+uA5uLCSo04q4nlOUcA/7OHQi9ewYpi5iCIW/evnoL7rb7ew0N\nsuyUr/yELSSd8rPPzzDCJqpfvbwRf9aza1tqtkOBHHsDiLKVsv19FZiaBnfF\nmypRsvftO/5Vnt9o7BCuZdhveKN5bKiLZn8/lmTMJqH8UJ7ClSERBsK+oiCf\n8sl8UDomUhJITFePGJZEbLi58sIiyNNpV+huDM17ep7YNOtPBRPqVsRoffGs\njdHlpwq3SHVgnBJFC3Zj/CyKcOrKAaZPnEywGz27xWfeeR4KIDGBhGi6d306\nTcBzTGu4HRRoIRh8lwynyqxUD42IdAsEciahwEdBFB4wFAAgvtlwfGBvi6Kn\n0qK8+vSY9OYS8W2pUpawb9OhMb4hEhf7a4CvI017b0LKXSKjEUH8KojNecB0\naeD8\r\n=AvbJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdf2GH4o5/Na5Z4pX50xc0acHPupA0Qwi/p0IiEdYWbAiEA+50qLagM89ts+CluiXDhj5BF+tU7DY59W6CiHfYhKiw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.6_1637670964163_0.2606722364616687"},"_hasShrinkwrap":false},"0.5.7-dev.65e7bb4.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.65e7bb4.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.65e7bb4.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.65e7bb4.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-QZFYKKwBi+PtCMPiXdr6J9QrSQQ/sSb4tDOzJ8yHO39mXHPmaoilFbdwfgDryvIFHB19YtxPiMm95sF0dEflfA==","shasum":"54f5de7f02aea2e8ac8fd0ed27f097e38245549a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.65e7bb4.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnPSQCRA9TVsSAnZWagAACdkQAJjTZ9QW5zXAAItx39EO\nG9LVzzwYHPjmqOCSaQciQy2OM/9+HCDD/CSvYukNnDfEVn7Ilpj8pnCWMPdS\nr1kvysnKNI/2l0NlAI67zD6LlNPomPyeDtYWN6ExUnYEDPaaqKCbE6sBpbX8\n1uUb63rVnXpEKELK24TvWtNKMWowXHeTCgsMofKzP/4vQl49x5VmrV0C5Hnd\nBI8mxLRgRqTm2DD8cemcPYw8cx/rg/naK0rSProy+HhBtAixfFs9iS4zaJ4n\nRbCxyMtrASr6mNoZCzyN8rO6MsOCaG2JXUjyeSr96Kq0uddrE/q8irJQcWdn\nmYVoRweeHm/OsFE1zrlNEYjVM8fBgrAOlyn/pS4LijP8o+cINKNfmb4YSHbH\nC33d1Nxb08k/Hld0zAVOV8DSPhYtwZbZoVVnruJJPrHF9h10NP3BIgASPF94\nnMNefMDz4Xi8jDUN/Xqyeejzyr1GdSDWHxScLWv6AaqxL0P6PRMQkiKZ3tvR\ntFj/YGYyRqQ4atcM+IXu4oQIm+HAMvtTVxCo8m4R7koZffureStF+N4jk1ML\n+/z2vB7NdN12uPiwoisxuYF3ftPBxgDlVDxN3L8GpWJjpVh6VVhLg6u52jP6\nW3rtOb9ah4i80BYdZGvaUDCC/g84z2Zhvqhx10kadYpRTHVh5khBiO1d9Yzq\nguaI\r\n=Yz1O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxZ0cMxndK9ksj0GTCxWnuSNLUvfFz365gTe5wB6cvJAIgRz19RFw5WhMUbq+p4BlkoPtgFwX6CfkVyty4Rui/l5A="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.65e7bb4.0_1637676176362_0.15709013739137223"},"_hasShrinkwrap":false},"0.5.7-dev.c7199d8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.c7199d8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c7199d8.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.c7199d8.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-x3B/z2Ad+2W8L834efu347HAY9ei00oKGYg2kKN7ymu/IEGrq1eOvhc1jzgui3qVsNxj/oNBuZCgEFCsv85qAQ==","shasum":"53f9462241ea9255994d26165152c57e5b6cd7b8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.c7199d8.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQ5gCRA9TVsSAnZWagAA6JcP/iVhHfJEJc6bSu956/pl\nDiviPeGOLI22YtxchCdEF1G69D0OSNkWl3HeZx9HJPQ+LL1nbai5K/6gJAO0\npeg0jyqdwqPkVt+b52GG6lh2fFs9+TGdkuQ58EFA3oYvHLWTr+JasYS9BDT9\nGRXjK0xXLaCMri6/h2wbnts9fmvr+JyhCgJp9c7qr6KQ1FOfYFYR1z5gksIg\nes4ylXBQVv4TFI+ds9caD3sgBqDcUWal/3uEnEhaF1xBKDPPQIF4CkQHAy0m\nacQooddcMrvFasqlYI0f3iX99SfZAb4CcGB4YnlZrtFa45tsIyOGXIGoVQKV\ns4vY8s3DKGOs1iqViMO72q32ZcYRW/m3HRqeqey6bTkEyCMUQsCbW9f1dmZR\nbWi9+dw9Zvxs5InTIjNs+CJam7zOkzCjwul4oUt9C3k4kUAg9fGuniiaqg5W\nSrl1SAJ0Vdq7+ahEhxMVoukTgJY1ow59yQJ0c+3TvkFaAkpncEaNESKLxx/g\nx9BN9HDsNisjZeo9ax3fwwwLypEcVYM1eyvg9UXMC/QzgNuB11KbYPZXmyLy\nIo0v97gTpSV32BosB+bwR/gSub2wvjKkkGVFFIO+vp1QIrAkHewBm9Y6PI+D\nOjcFNMIS+qGhFcvKoKfrRrqKM85ROvB5r2Tv9/NFaSMGN1UOAOboMo8BBKVc\nGcuz\r\n=7QI6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlON+aZ4sQtwIr2/KJHwQ0Y/AH+ezqcqVWItxY+bgVpwIhANSviDprQX6U19ZMl+fPIbC30rQxk2QxqNJnwBgzRDjk"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.c7199d8.0_1637682784285_0.1637546694805374"},"_hasShrinkwrap":false},"0.5.7-dev.0846cd5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.0846cd5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0846cd5.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.0846cd5.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-A9iJq3O1oerUQAYrCJ3FGQDPb4ZfbG7Idkce58XdIEHnsWN9+UxEQCdYEkjD7FIo4PZSbpNfFud9LA2YXnt1AA==","shasum":"ba63eb8350e4d0d338c45bffc27d60a61c4f1d85","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.0846cd5.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnVKOCRA9TVsSAnZWagAAWQcP/2iuTxpd/vl7YDSWRgJC\nqcRt71ftYq9T3RsBswjvdZ57B3q3ppItRz4n2zRB5xeXHFMg1ZBcEpIorJMQ\n6IaZpvlE2WMiJ+rlJ+8RwBSzxxAM833GqZp6vqbqulYIEHe4dDVwh+z7xYxO\nYAUdpdKOkaAnaiT7mPAsEJ91uEPilb5mn2Rm9ADSKeNx2LZUBO3lYD9IRnT0\nSBR9kjIn/bLpY6RzPQ6lK5TBtyBatyIdR6++pYBsO4SmcxRzVFrjH1X5YQWK\nfjeBMsdzyGsP2MPpRTApxtly2+1euZNmgSHZtQnoLELjwsAzi03fGVyXM7gx\nnWyYYCDcvQZHf2Wf5bFm2g+0kHq7VgwkMofCR3ODPyJ0pVoymdIRgCQ2iQJL\ny7B8jUxsbEPk8gXk48ohFMjGIoPjrFzs0lDx/A2j7wRXEybsrZJZ9dIFpbJB\n5wORo0o8VFrNfX0z/IJvsJPbf9HF0sU6qjMe8vV764j9+5yaRhVdaYED1hy0\n36eMG5CKrhZzLJIete2rlddhF0VOCXOGIp2+1TGFAPPGwD/wYjYuAcDoMCBc\nOtX2WMZqnPz8+sGuaQXviNSmZZ32+YqlzkEh0ddvp/Kktckfs475MFrrL9LN\nZamKiRJDV6ZL0q48ueuZYLA44rQgpmNan62/GtDgiHdOGi9jHQEpSbzaJZ7v\nfuPA\r\n=fol7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdVjRKJxR2xZN8r+JqtQogXTttv0ow5Higb4Q7a9qHsQIhAP8G2JC9vhgd1U3879Qs0vsSq+1A41WPn9YNbslCOxjs"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.0846cd5.0_1637700238741_0.12161374282935244"},"_hasShrinkwrap":false},"0.5.7-dev.702671.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.702671.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0702671.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.702671.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-/9/sFHxnNd1MgVycC/K4aZXRovxkhA97Sn2Uswb6bocIKXuccR/qfuyvMS5JgtXKWFhs9z6bTcS3c3ZfbQYazg==","shasum":"9f9e2719953476bf9bfe236022b7ec1f6a6ba652","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.702671.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnkGQCRA9TVsSAnZWagAAePEP/3Hl8D8Y2MHxDM5qSznK\nQA3A9y869LlmLNR6gU65mNmlCRscQVIXGczjtqbfqOD87FPWQd0eL5bsEQMs\n5stYWs4GqqQYsJrMEHM6NWzwif8Gi+wiPJ83vtxl7dJ34+I9PFgF73IIeSEQ\nYnqUdVlkZAGDNJHma/LOjrCRq8rThC8UAVi84Gx6wHUbb2YXpgcsAHkCEsZt\n6j5Zhhz/yza3QotK8HASID2R1nXRgoxKNA4KOuIaLkI7JPUS5if1sELI5auy\nu30IQJUd1dix2iE4Iha5EG6PAObDAoYUYBBCKZuRVc0C2M3xXM7YReV74i55\nM6638aOgC3OZSL6RDAUPcYd+PeHuJYnjmtJDwxTDn3k63Hq5QJMeBv7oG0tS\nIW3Z3f1Ure2HViImGdCBrCWBVFfQiczA3OKE1OKYaP8TfT51PdgNXt7Ow1YS\nBLTUM9GncJBiTyTa6QVH6p9fZm4lglbeTBN61y0aOZYscvQsDOKcToHwRl04\nLXLg2xuD2cFbuzOiuvjOEbgfJZ1iCvND62eI+rVtN+ICYaH7iras/vrRzzp+\nIsPuogUkIH+J47mRHHN8ygx3qbiGODlr8l1/LVe+fvZ4PtdhlxKMHaiyMPLH\nlNf5WuqsVD8JfuHrCGq6o3wG0ohyWoMieWwmJgDGmB37vBhmMX65dM2hemWC\nqNR0\r\n=1uUm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDDpGLlxVAsxHf5GWfHb4Sd15trRo5rDlWPOq2aZF/3SAiAkcUi9CezVZNoCtxLa1PnRxvH0i6UUlKghGvFAxxOoyg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.702671.0_1637761423877_0.20619210475617034"},"_hasShrinkwrap":false},"0.5.7-dev.c7fc68e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.c7fc68e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c7fc68e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.c7fc68e.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-CXG+cqSepaj1qXWrMw/uY4nF2XxN5qc82+gJ6rCE9u4qRcrP6yqzIWVn1HWl1xl/qmSyc5lb4HNQjRp/9ceVVQ==","shasum":"7da8ef32bbd4cf22a36c36e75e955523c737520c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.c7fc68e.0.tgz","fileCount":35,"unpackedSize":998411,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnrr+CRA9TVsSAnZWagAA3hkP/3ZUyq5AyPptQdNSzR1R\n7gdu8gz4TrTimppjBkIvrPHeq7O2xI5WJOtSleflmfDSPKT+pEpczUB0+heK\naI3+rKI05C40uRCRCUPcb77gBdhDSlVz8V3TD/NT4Z2T8kPFLJspTF0aUL9x\nrOpYFS9z78Ns1sZCVsNSbPtzKsLCw5bBdxdTvrOU55XKf2yBuPFJwjnyjoiI\ndK6Q516CuWeLw+Gh1F/X0k6BSvna1GWCMYFUtLKYqrzN94rsWqMTu3ATpoTF\nZ4bgH7XeE8ogJKNC4zNiAQWjHwgZvsc2RzuhUVadxvrprR9LU2jhEglTFvEM\nc3+ASw7SCdJXPJBFbS6t5XhTvuVIFd/22uixfUprYLKvXFQu5j0HIozbHsTi\ncFU3ZJjTzRpvxQYh9lQkHOzDTHx8DHBT9GjLdHOheP0jovjOb8D1wkVeg1Jc\ntNaDw338urhzlYRPuV4Hj/6XWcWThnPB5+VghqaDbr5dphmRMkmVlAuLKr9E\nu8El88O4S36EzZMbfAoDxNH0mtB9wdutcANEFy0kxGVr0nsMadK0d8+kTq5z\n5PogkbaOvRwpEIqpVD8l5z0dAVNd/dPBnQPcdZHv0/81LpLYJXJobv4JxPxT\nitH3u5m962lnTDjHtupQiB17xAIsb+d+gTt1pr6TQcPaL/Y6jIFinbL0wzYS\nQXsg\r\n=4XL2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJWD9xcmbXLXA+5a1/gW/P+16ujPyBU8QrKwm3BjCqywIhANWcRfhLcCCmPxi72/Q5B0swlDm7P4LNyBAuQ1H5WPbk"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.c7fc68e.0_1637792510169_0.36763019084444215"},"_hasShrinkwrap":false},"0.5.7-dev.ebe1896.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.ebe1896.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ebe1896.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.ebe1896.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-tjrQAR/li7Wh8F46oXgVd6m1L+vWGAe51rX4RPrBJP61H960P3qt8C00+R/1NS7J71/kFQIilijpxxnaPpdb2w==","shasum":"a4a37309c23c7b558131c2bdfdfb2c67d6a0b832","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.ebe1896.0.tgz","fileCount":35,"unpackedSize":997651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoMz0CRA9TVsSAnZWagAArPkP/1kZehhf7cx3Xeq1OKpY\nJNkIEIB33TOEKPCIYFbijFN7Uti6UkJrF4Dk33aSm0XE6ZMBCqyD4kODxRqD\nZdVtBV/k6hBaucieuvftJnNNgPEQ8qTmRxEK4Gtr3SgHC3VFqFjaFEj4OKHe\nYXaV98YWWn6hp0nXg7zqwnqFEj0+/bemxbDkDO0X5pLC84aDu9+KKf4vMthu\nAHS5oMZLA4GfPbkIt8okPli2L5ir91p/0dPzbh1QOsgMs4kCs9ydbqGxy7xu\nm8rNVXn4Ko9hvQOix/Sg748bL9YhDM+bzDaKJ45oBvWFd1Lz22d1QrY6YpzP\nj22S90JlpBCSWr5WBoNjkyiK/dAMzdxJRD5EaPl4c1N9djBgwjN7Kzxp8nZ+\nDlRXNtGt8LWvqLectPuHOW2cH1CRQruzz+lmkFvcc01qnP1AduFh5n8NknZs\nI1yt+VO2gUUX9J0esznyhvWXzSQXd3b/NhshZ+X5OxZgcgqEsBBFQHdSokfT\nZdljIi4XkQtSaLTEchVH8RtXqe5BBjGXt0pQ6HVElveTT0HoUBwEMowk12dr\nxVHOLuiC0oLzRZxUz3UrC3aSbPJ4yNpEa457aUX5kOd+IG/z+4HX/0opX1nb\nNo8kCA4XttQGMl7aeal5R4MbwjCPb03273zIHc46wcxg08YDUisxBElJa1Gp\nzNUs\r\n=+Uvi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEA/8/4K7/xYpJ9rwnDC4OpW59NCRg6hThLT1RQUDqhyAiEA/fzD8sR3a8VtrD2bHuhggeA+bF9lHwoo9K453BAhYJ4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.ebe1896.0_1637928180714_0.0640404584667098"},"_hasShrinkwrap":false},"0.5.7":{"name":"@superfluid-finance/js-sdk","version":"0.5.7","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.7","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-AkS5c6zR5tbSOZwP8xV8/VkkY63ES5yOCcmguXsKyr5GFu1CJRLo8MLjfpz9GhMDV6y76FZEzx27I3d0Stgb7Q==","shasum":"ac1de5a0cb67dd77bd4ade7e931ec6e75d40be46","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7.tgz","fileCount":35,"unpackedSize":998716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoNq/CRA9TVsSAnZWagAAQAgP/12nh7plGiJ4kmegZpU6\nAcf3/x0SS4YY93I1X/KJqKxi2AYnwB/yn5EdbrQ7l4+Zkbsf1zrSGxR8/zPz\nfRjo9GOJQ3KwnDh8trMzAjlpiaLB7nLnwcIXZMA6fYaChwfurefuE62fNLLg\nS9HO+DiZ6GYC3V2yA0/pxCuuYG1KXsEDasTd2YM4aGD9s3/0iyx26UoQH+bS\nWEMxrwzzAkwlQ+zxv6Z1JitPwn38XNo6Xyz1fKA9TV73kA7EwvsmjtbqlBCK\naF6kGrvEmJxeruElfJnXlyawhGM0jF4e33INUeBkzh1++mInTrudkMLy4FAy\nHruj8/nlsuprPx4GhDZJ/QCghlym7MUfiUMkbghmeNUCbdR94TVbD66iGWaX\n2H36/qmht5j5+OddtCvLZCX510M8SKyVE4oKWHDZIYE9WIXkf2KyC2w6HmDZ\nWeAtHLykFw14RQ4Tld9h0avji7hxWJVLttLKUeww7VI22M23gxBuHxG5zsZe\n1+2CXwNN708UkgQhHT65L64g3wUuPRS1IkTfHXiZbYxcGcVqK9FN6p3kcUt1\nXD8wsJR/RRQVxHjo9A4aSdaZ+7OybhXY9mOluqz9BVmYZaJnf+D9pHEkqeBu\n8MDTjF2ufWxXyspjO7eTvW2U660XoxDT7s/o0/8asRnBbB0E9KPI/d4E4x0e\nf1YR\r\n=GyxH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7Fv2rsGaaP4ojqYnxuK9VY+dMSa/5WrRLwDG8JtuYOAiEA6hI7wdf0mUJM5t3Nmk8eEwl6B0OgXgbUhk5Jk0i84Z0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7_1637931710881_0.7135501207731016"},"_hasShrinkwrap":false},"0.5.7-dev.9dfd215.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.7-dev.9dfd215.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.9dfd215.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.7-dev.9dfd215.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7wYrux1/OI7jSgN9m/totYzvRO5sPwgIBjB/dFPxJYEUTAwSYVoc8WTp7I0mTlOuZXMD8HSSL3j9ttBFW0SNSQ==","shasum":"46101941c12397b03e6a6cdfa75a361b86f53ede","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.7-dev.9dfd215.0.tgz","fileCount":35,"unpackedSize":998740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoNxYCRA9TVsSAnZWagAA6rsQAIyW26uOCYBwany/KVxp\nJJtZJxrK8uKniC3VYyXdLTm+pllp2HuDhYgW/Ehqvc+5VXayXvQaluqKS+nt\ngkExCJr87P3GPCMfuAawmKAz5rrEpsAxJUWU1SbuEEkMvTwRQ5IxaUWKFmAS\nlia7oZfR4Pu80pRFaLADdtg2VYzUid5JRkitzFhUBZ+VyEZ1amQOT+gOVDwn\n0pF/rdxnosuGbMEVgi1DaO3UaaEXUDHQrvoecpnHQbX7qTMLImmQ9h5Ta1WS\nOJEEeuQ0kDWVFrFkA7Y/YLF79y5IfcZOrTg4ZfTD1Ja+NA1RQbTgX8Zy2/Fm\nzmwVhef1K93p/awOwepIlLvB5cuyqrSYFOed2AwZvPD7909NEHPg8ZLvgDcb\ntq6imPt0PGEQYJKgK3TtgBp0reQ1eJjIRKgCKYK5LdXApsENIAVC77hW5Kjz\nw09j8pUo6Nm8hnheu8GKSCQz0zA10zEJpqw6yhN572lpS4wlMKFpVJI1scU3\ns02RkxUzwvnwwofEI82ShHrmWia4JYgQpxIh77mvjN2Cl5SCxL0Hs1i1F+zS\nva6chGm1TLihd6YNabOIVdzaGKqTyE4FT/ju6xavl6Gnp0vlGsstp3Lppo8R\nA4HDq5f8goaXsa9wTNTW3YFbesToSSKOpE09RrgNmzWTD51dTsHUwCAqiFPS\nCO71\r\n=s4/3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDc/Kl+y5IS+eE4/QcS63SugCbr4thP/aDExcLJHYGKBAiEAreyFKfSp1OE7J2Ajw8XbPip6e3gponc2bypH9ZrEtqA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.7-dev.9dfd215.0_1637932120182_0.5023995652112505"},"_hasShrinkwrap":false},"0.5.8-dev.f475683.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.f475683.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.f475683.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.f475683.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oDVxuE67cN7YrbdvUz9GVaucWTaJDlLu0rvsarwi0rzBzSWq8Zaw01aX4KvoH2OQgcxl5Gl2KjhPll4uGYb5LQ==","shasum":"896c5093f3e76a54b15ce05e9ba4172d07eb6f70","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.f475683.0.tgz","fileCount":35,"unpackedSize":998740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoOR0CRA9TVsSAnZWagAAkRUP/RxqY/LDQhoaryWWtgEQ\nw3nBnrVAYPmSUYtfeKcB1264S5JvSOYgP329EWdVaff9zc/KgVFXcsTeQdoH\nLSgGGl1w15GFAOdJzAKBu+lOXgByNE7ANOT1IApm1zA+nk5gKBIx8PhjUG9y\nfaNQ5jq7Yt5sAOjTHRbT8yWlVnsCD4zurvBKK+6m6S5xvRfyJddQSqsa5Wor\nqpKNHTnWopHWbQ8wyA3+BDQmbOR951etltGmzji/I9MdogiOizZGFd4HWMMn\nQuFZBGshzd1II8mKvy0LOcZfGeggZ4mJvOMbOFdWJg9r8fqsSQF2ukwE1VwO\nLqOBjU/6nBIwFnpWsowFDlGlwgS/eLwy1Ejmr6ULc2PVV6l2qiRhtyWRkNQp\nZPbwR+kQobjn73VqF6RFszovo9v6O498Falu6o10yUcJyodKQlIZEHSSGDI8\ncfcRQphP1mlfU8tWTCcsNkKZA6RrLOMMuNpZVxThfvFUmvKLZ/B/CESqjpLc\ny5OCm5HtwoOa87eqPHq4Ce22CVYVm0GEuBV9PoeWGyPEGYGtyJXgXGPJQ7dc\nXvyQ0xxn/wfTC7byBvz3kHoXQEUGdXsSWWioJDXzXKwHayxgzfo3bcT46t5m\nJVZ04NQMdXse6LUuXxf16R/rKbCV5nZebTwYyIxoFAj3YERdrBG0+Obas4ox\nMBns\r\n=fSSP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHN4DT6JD0+3O6PgjwerzkbPANANVHxQnTE5rJQwPNcAiEAgM6c5Hkb5oK+P1Fne60Iz+oSEtLDrkb/KMNJSCYgtrY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.f475683.0_1637934196636_0.44304265706389945"},"_hasShrinkwrap":false},"0.5.8-dev.44acf92.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.44acf92.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.44acf92.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.44acf92.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-vtVMVVr8XP5gtnNU2BpFMIpEDfFmZ/hxe0CmIfbF0Od7PRPa6mE8+b08aGbK7YLgOVhKPpUWKstIXl2tXmfUrQ==","shasum":"20a95ea7e544b2711272c4183e8ffefbf91bfcd4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.44acf92.0.tgz","fileCount":35,"unpackedSize":998740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoPEnCRA9TVsSAnZWagAAMjkQAJbL748dzd/A80YC0CNU\nRLS1WJfoFF4UP/SmjbCDrMiwO9UN04sI8J8h+aGDWJJmTbE/wOtndMQp4yFL\nZjeqsn+DnrbHudS81FrKq7xeYGwUNOf3sn74ryC6rKVEgL3Rlz63Iic5hISb\n2Cn3nzjl+li2IRCwFCVQQAZn/aRwSUapf/da8+4QGgms4H/1K+lbSa0i9OZi\nHcCnSBOAjdM+qic9UjJqNSf1Cg6mscozbunsnUc/uwvA3xxxXEb+euPem7KX\nTvu8gTjIoCc2WF1kgy3tM0wRB83MiF0X+YL5cjISAJCp7QQ5jN+X8OufsQfr\naRGLF37cu+lPuewE9zde/eFPdj+vVKacog8MvXA8eXxj+4ITYsl1qzpN0HEk\nSQhH4VgRUcMvFb7oI83FgQ50p5a1vabbxgur4MchfJSsVo0nn+zbn56AQ02M\nicP4hx/8ZoQxeSmE+jMnk4Q7/NbXgp9mtWAVyBIvFgTgmHJ4o6Tiu2YLuiEu\nZYMxTAFu3rOSbnXMUyfzpOw47XzBrrtjyUPAvC3gtDHja05qNgwLd6sYgeAC\nQFrgFYbda68z5pKXwmKHBBxjIk7c2fvD6/Oeu+xWk+5PGDyi1rvtkyNQgnZB\nLZgpLLDaH1Om2USdGkrVLiFH+KTbZq+ZdKZDpEE5GGulUsqJYXJ7pbB6A6OE\nSbgl\r\n=HjkA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID/QUsiwRwNBTJPZHdDz/Z5+8yh/jblE79zSyk/qK/R+AiBAAJm2JXt9r1mCZFRkPVjPtdvxFwYro8LHmtlpDSfOlA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.44acf92.0_1637937447282_0.561007357291337"},"_hasShrinkwrap":false},"0.5.8-dev.251e82d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.251e82d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.251e82d.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.251e82d.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KHi1A7I0sgZV+8xdXslC5/qlS3ok3l3XGj75E5Z6fult9KkBvJa3Vs2+0uIo1hO+BERLJCoo/29I6a5+Gjs2wA==","shasum":"c23025c9c83137b107d35b60792d5041b9d5b8a8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.251e82d.0.tgz","fileCount":35,"unpackedSize":998740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhoPsZCRA9TVsSAnZWagAAXqoQAJ+pSLXaPQU3USomr4oX\nrcnCQ1n6YOsP0wxwaRiIij2VWyfL2enyiYAyGvi0ajiW5K4WNYHOw5vAKh1w\nup3H6cXQVTUUeSiOBChasTWua9ZPOQbUMZR5aHibZqrcOZP+adcx75VFgwxk\nGjIcZklOe5rViobAKkOe3DSvYnh2leo9oSwROcKyyZTvMCsiRDvoJNy0DxsR\nXHk3mHTVjWmaxRAa8USkh1LIunf0kGo92KB3jlHEF/QC3KCogLZx2rTnhSvt\nea6qsSoiiNAJ44aF8/4nhdJ60eUP0t/5lF0+KIuV5l9x3EFF4mbdaS21hNyW\n/R8Kt7QGhuxSUxTUKQCJyzProcPaOHwnPxYD6xEFnlTuLuOLnzJXYPnoNtZF\nb9V1QFDwPbBwLGL5FoZXX82ICbKHCnYIMFwoBdBJNbc91efSMqLfWOtTD0l8\nJNk6t7gTxrkRwni5qdqv1w9+aTYD/PkwdCVVrB1r8fOJBHEaezC52SXBX9Hj\nXdTXUXeeU51fzcHyxdl5vE+pB2j8oNSr/FDfnPLBVTB7NX0w4FqMY+Ou0nzb\nRr7MWOTQM6b4cioFdlgBaw1U+GaV+6+wUP+Z3qsxCoRghDb4JlBYxHa6cOGE\nGHqBW2TSnVF5HNDJuU9iqnokGNdemE99zShEkUXSYT7tmrc7UnhW1wCTR9DE\nBup+\r\n=w837\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF3aXmQuWBnBnCrsT2r1IOHqicdNxZyn7rw4CNzEJN+wIhAKs1RQ/6Cz+Oy3hTaMbAaxEYUMnYKxZ8brAaf6MeTq4s"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.251e82d.0_1637939993053_0.9221246461971091"},"_hasShrinkwrap":false},"0.5.8-dev.0770a20.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.0770a20.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0770a20.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.0770a20.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Fjkq57nOJDR1idmWlemR6G57Yf9Nd310PZVwGLB9dnkt25LBMk9/zeVxxDs4sIFhBmsJ9yZgkGU3PuiNU+O0SQ==","shasum":"b5941540df1a073274775792a23bb0ff30c0d0fb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.0770a20.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpQTDCRA9TVsSAnZWagAAyFMP/iCNQGUkR+2z6pboeU8Z\n8vyUc0epcZZxlaC8AKjLDMxO+NSLUBPfjjMkuWhFSGp/L6qSIvalyDEj8CWm\nr3KYv10CiH5SxNxV4zK4ECFXwrzN9feZX2UE9rMDxAxFsO57c+8l6Se2Bfwx\nWp3MvV/gJwQHqyjeC2zvvb67B95HEurENLdzqCsWH9f/206G+oWErCVB00DD\npmHbgUg/QRWu2TEXX0ZmiauQSEMWmoCrB5vRCqRGI5tCr+YWPM2yd78xsamj\nQO1xnLiihgwiRW0VVugMMSGEG+VHt2MosjJNDqohP/wEoAHJZBMw7CY9ZkZd\n5cHJgwKDDniL7IG2J6rctvDptb3ZKyympqZy/9U/nPxSQCYdp2WBjQ4hAmnw\n+HeMZ4P+ZNdqXgvqKYQi0UMSsTikRGXCf1pM3t/BLSeU1gELAkMpF7UVMMq7\nQLbg9RtTSdnLL1rBYEspKuTK5lPWy4hS/b3pTbqpGykFckZsVC9evWM7kZJC\nnvWR4QVcauIS6SAyltFXz7NeZbwWr/encqjMSmS2rrZxAtdkGRFxga1FygHC\nmKV7+4xE4TSj61/ZsdTTQ/ZJpYdcm4N+IqzfSMEARTvsWybniw79ds9MJwrW\nqmuNoul7wCEtFrpuIlLzxGXt06I0jbDpawFZEn7b/no8b3f3wD911HAx1Ivf\nJvXS\r\n=ZjWl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLTiJP8mnmr+m/YOZ5AEwutv0U2MMrH1i7BPmZhEkr0AiB40VPFd8dxO13t30+4KBqWuSa3Ibet9zdhdcSckldxDw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.0770a20.0_1638204610996_0.30682012576567197"},"_hasShrinkwrap":false},"0.5.8-dev.b79399f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.b79399f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b79399f.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.b79399f.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oH/GYIo4Q1TIg16OBH9bUl8aBz1YXRf2OvEX8kUwWqeTttXSr2TDWtucHM9Iqd8r9WqVtSGxX9DnThxJzuNN1w==","shasum":"537c7b68d4980fb4c535f988ebc69e253cac8a24","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.b79399f.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpiJMCRA9TVsSAnZWagAAG3IQAJVAFc/AZUSuHJKbXXNM\nAY4c51v43oskEgxUB1gNXx+db4no8vXauJbEANCX7TKC8kEOT8WkaTFz+ZdX\nsVqXg6hd3Y3qE6FAcujPvVtkkPpNKn9gj2Z8qwyI+s5sJbnlYQPQMSRWKpfn\nUecE1AeTGAI5oY9Tx32/p7toPUNf7OWdfCK0nzCbg51Y8t4sUtTuYb03pPmR\nGLTFAwH1yG7cKsP6iknh3RItpPqmFEhKfd4R2oXE/CtO+AASFKMLMZwkPIHu\nJ2aYsCPBkMI0L8zcWRZ92Iv2wEj7wRJew2qF9Ybzlsg40CElCXkbgqbum40I\no8geAOIEnB9YtJciyelofYXjD3u7QhlGyqfp5vnUOytodpdt/ZyJCleMWOgw\nbH1Svc9qG9Cy01pnQvgWf8Y7Fy3Mj0pCYRi8KRQpN3CHOAx/FcC7V4knW4L7\ngDJduybugsA8hkt/io26E2pMAfuSGuqtlWNQs5MBsTfguoPhcQj4l7/Zrzva\nywWqeYYVOk9SLXg5GOc3qspwxHgnYEqgkbBTTGHJe07eB3BsQutJcRPvW59Y\n8CNEPqewZ4Mbz9K0Z+CdrKLQwVi5LqKCITmZQPP4S6dUY9eptZIgRJSREdnP\nX7kcsUSCdooJjwLCrMLN1anXsb5ckHl75L2P5wda+CEzeZjIokrKmzWKYMbK\ngnkw\r\n=xt51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJDrqLdPpsDH5UvIIuMxnJI1RZfyJw72n7Be/4OwEpKwIgI4PV1Cj3hjN5LqEPyWci66FUQVOmXeu39IIukZou+Go="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.b79399f.0_1638277708672_0.4946229213492477"},"_hasShrinkwrap":false},"0.5.8-dev.5b14268.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.5b14268.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.5b14268.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.5b14268.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-q/6/y8xlRJc0MMk71t8rJcbTRUJ59rSBEqqpDgWHH3I0pTyYD2mTztB/6edE5y1/PbL2CrJ/RIwFQdECtqdyrw==","shasum":"931f6b3c92931c9a49019f008f44703220f417c6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.5b14268.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpideCRA9TVsSAnZWagAAhUUP/2JFG8iHb2wCA/gxK+EC\nK4zG9evgvp2Ws1iOtSSpH+RpVRESAQ9m3ZTdzY2pMaKxs7Xw821UdNrRX9XI\ndhxCirVSEmEsQ1Rk3/vgGjnTDXg8hLeUUWij0J3ukiIJlYZ5Lsncl5NhW4Lh\nkkrMzH7c9il7AgrwHlZ4ctNvIvKQ9TrHUd2kVf3A+N/myFCuNev7eUAmadGb\ndZ4pW+lFNNKOa72yVTdmA/fvop5AhVMOgXU+qDOD3QS5tUTMfYlVWerLYkDv\nRb1B4OafxdUzg+Y1qwysT0tTSQL1anVjv5XDNNyBk6uyA1yc9H8hpC7N4yEW\nRGXdwUtbfqvZ5WIAqHiVB3bFgIAbrnJhYeQ9AAZIT7bWsXLbcN3QewjYbt1F\nwyNETwd/FXiSspmbKsowxANA/bRFTr5tFpTnVDIA/mjOATokPZgNAqPgFgUS\n9cc3Paynnb/o8dTrvu0aW2TgHEObf9+qRqz+J0p6ukxxYN/VI1iMzDzwKgg4\n8btBl2gFm/txgNDgMB6x6kRSpPTP6dWfG79aSK+QMJ3b/+KZ5Szkic6r4bQv\nI/VfMwQcBOLga+uVTUygEsRU7oN/uivTFqw5iKOcaQYVmUEOK6Hkw+nG6/IN\n8Yz/6u+e78EjYDsFnlFaWDThUVlcnk/pRa1NaLzOE7xjCo5sNUus2CihDLvr\nojtZ\r\n=FpL0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/v5j9BOmFTNxzdsD2FUyqFAK7rKX4Ui5PWn+vqvhiXAIgQa0MZIezweUlu7WbL30jA+9uT0G9NODNjk12WkMOWs8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.5b14268.0_1638279006672_0.056416699735444054"},"_hasShrinkwrap":false},"0.5.8-dev.18ff2d2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.18ff2d2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.18ff2d2.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.18ff2d2.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-AEyoGvqE1lxhZbOFF9MaZXWHQfiXq7rrKDYpvIHPHMcaS6tImkjDITx5bI29MBZvhzUvxOLbXn8VEmung5zM6w==","shasum":"31891eb3d1bdaea4879a9a4a8be28f9048285918","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.18ff2d2.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpjQpCRA9TVsSAnZWagAA2dIP/0Dq/6LRQSpN2bmjf54d\nHtgCNarioFdAqCDKjiprkjRXvTtJ1l+tK8lW+t0sbTd9pN0qiqGYM3DdATcK\nU7/W84TmbBWBarmnanxAWHqohtJLfLktp/g+7CBjHSsV4bIAbPGe421NphAB\neaaMmtjw/pT394IPNXfubbeukmD1DSqkPAuqEskA5HQ+g0WqxHoxAIrUrgDa\nsrihrTgilpcu1icmfEATEqPYIZQeuiKwocOMz+Lm4sVLQr5rr/W5wYUPvDqR\nkunIySwSuabvnVBilotzojVsJOJCv4X4FSDEmFy5F5k664d1tOgAET+aubhL\npOXlFan0wQ/te34IQZu3KHIR8SLKqaKpNVa6wEHNvakhJFZ/EpHzc8W9NEVe\n2J+xthSrxk1s5e2pc1MN3wgysHuXnxua413Ck8D/4S+NuKo+dOrlMAQ0BqnQ\nGkcz1iIcLHub7RWURY9FiozvepAiO0bBSWC5zIf0ywxtjuAod6WEn53Ix2wX\nRR3cipkqHZZ4OQbsqEd+/i1oJByEjy38TOYRnmgcaDhEjh+5sjy1C4XHH7Db\nw3/xuAfJJPfCUvxPcHY5tL0xB/J1w7TdMj27xCCpSeofAgIAeRkwss9xqJl0\ngQqJNlM2cv1awJKsOvOQiZp8LdSTzK5T6mRHS5s9xj4cAJdXmDK/rT/EUQJX\nDeZx\r\n=SuCb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDEFPxAQCfyxgdHdKHZy95l9BJb50Z3b7tQLz2+5JXggIge+mT5J5vjgUFdqOJrxVPqfwrDdH0vgayy8un4msLsbw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.18ff2d2.0_1638282281437_0.8118734772594438"},"_hasShrinkwrap":false},"0.5.8-dev.691004.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.691004.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.0691004.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.691004.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HlqxhlCJmURbWv7U7+wgRBq2LpCsuPIOwkVZ3816ur9sOxPd4h1ecbfv3xQFQ9SblonjMs0Sq2+L6VN/i9fXgw==","shasum":"c86a064081e78b92e7f1b232dd2bfc7fea588f75","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.691004.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpkkFCRA9TVsSAnZWagAAT/8P/2Ug+Qj3MoSHcLEPp5x8\nePJtf/yeHzB942/G2cmuFBVcnWokJBuRniQiq2z0+8a+WTev/LhUeYgoZ6hn\nKry9LhsxPh2dtk6K7VAnMZEeJjh/Q+1Jvi82bH1ZPaDq7m1kZ1EooXala8MK\nVVWuToihCDsswbV27Y2fQPXQb5F/SdtmXnimVlWRRdwcN4HizVpNg+Zau5mw\nkQ6bRUOVGP3999Iy7tHNHyna5GJHlRS5hku33J4v5Wvon3YoqyxHP8Q/KtsE\nGq6cMOv5M/jz/J0Doud+Vp8WWXwA3PmIrfAy4jMhid2w3SDFNg2Qh71QhugY\nEcIWKCIg1Ucbx6KiOEUW8CJDjupslkT2TNVCxKRK5AuNzu6GqnemI0ZtcAdx\n9J6bqQCmSB/bBEFnyTmD4J4Ikxq3SXVfuvu/ZXy4K32CmNfhhOYFK6wZGs3k\nyU1FtBDGzQnVa3us2U097Q/D+QMYDbzeCmzGMjSVQGzm+MD6gMwLXE+4HM5o\n3mTPAQ9tNj//+hofTWZMHEuCvz7BuaEuEt5PQ3GhXVUKGTgkAIRPGHpJ6Dfz\nQ9RRSFLrDdRdnTJ7qTXnWO6yUPQMFh4rMq2RH41qQdZKLmzZpMkvkE6Dc+pj\nx9Nj2d+ieRYoeXDyLFS8OmXJwcChZ0+cPPe3uP8VJ7649Z6mxuN99XA6BQ/e\n9rmG\r\n=iFoi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXX0yt9kb8Q2AWXXroK44cJwgiOa0oMLYolT20/9JGvQIhAMTlt1973KXt76O9tehEF8bkb1kZPVrzwIbV44Z7raTE"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.691004.0_1638287620968_0.5676642125265714"},"_hasShrinkwrap":false},"0.5.8-dev.88df1a2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.88df1a2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.88df1a2.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.88df1a2.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-xVXRbLe5FB2bBXRQ4ijqX8H5xm+szmI+GOgGxUBsFDrsnUmdLfX1Dnv/+Gxec5VIqlIB8gEdAgBQ67c/ghk7TQ==","shasum":"c941b14f549a7700883f83b8dc7b5e11af79b677","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.88df1a2.0.tgz","fileCount":35,"unpackedSize":998780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp43iCRA9TVsSAnZWagAAvTEP/1IZomw4xBkT/PJiVTT8\nJ2jzED9/vXv/rJkEcNLq2yI1j5eJytZsNiFyTO6Hfw/lWLCOlhNCoeERf3dI\n3TgCT9/cxxSsuopKcInndhSBWcJQweT3EQCVBMbX1loIOH6lbntQH/xbXM17\nyAx1Vc9MNXbzkG3faV6jdhxptl16EI6+QdT+L2XFabz2flw/0yim5+Y72FEM\n2aT9/3rv46QHofGtngmD79Pd6BK7J3Mm81M2CCSmLxUJ6KbAvFwywMyQ1mZ1\nGv2vzeLJCDTaZmcheOSeK0rhjSsPiuZ8gkB4zB+T3hDckAxHS11M1q6LI4Yg\nwUVO14BU9jCnHAy19tucdfL+AzvWn0QhHV2zoUp1L25ielvlQfmrqdVhzcSy\ntsWTCx9RwRo4s754nIAy5GNtDpUyvsnWqbmJLgJSpeXjCdci0HkLE9YiUcni\ntIcf7CvbJKZev4s1IyKNUZgLT4cPUhky5qwCfMWc/WBB429OvhBtxPRk81oN\ndHvy8mlIM1JlWEJIrEgfwCALxrKkokL+3LTqKXYVBcfnbdsCUdFgTFaGR3zW\nloP6uBPAnh5VDyFd935oNS5TjxCvUxM7/FYfhONRka5xebnfC/ggK3nEZeYx\n5+jYwt8dxg5VoYy4TIrIc1qpmrMVQLvSMi3EZh5+YpD8TiWKXp+gYKHW6py5\nLY7P\r\n=rsDz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDV6c+uGW82QSbYSBvuHDsubV192DxxSNhIsJPkGqZ5uwIgYH2CA8nWBsBsxCB8dtYNZFW444Smbh/9WVkxX4nX8j4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.88df1a2.0_1638370785923_0.4794684760302521"},"_hasShrinkwrap":false},"0.5.8-dev.16594f6.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.16594f6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.16594f6.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.16594f6.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-jVxpyWqNzjHlzlq+PKBmu7NOejmle4d6qEg1skKAyBOJk39+73lLirORhzxLAJVw95Sg3a7u75ROK/NPupXCFQ==","shasum":"220e6d62eb9efeb12c64d8e77c98ff1c8890f13a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.16594f6.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp7HGCRA9TVsSAnZWagAA80MP/jOWqhN5yhUzXYT+FSdH\nrLo5ePvWf3ERqNt7wwEvvrP9VKcrfKpK8UrY5BuDiAdRDfFYPchNTetm0Oxk\niM94cLHlJIRkEXfX2pNJJRHBBY3NcanonEu+u1Vh7O+2qmlZ+FY71NWtOCt2\n91r8q3xNCEWxbqCHlmhPsNtHZAQV2idV3jz2t//dMORW4KvN0Ix18osCBTIS\nsvIIJnxlRD4arKKwZENuwWro53Q1IS9prhTzdV5K5jXKwVgtenkmRmIoEGAb\nsZDFwzxNa0w2R+rhbwB1LPqbOJq88Jnn7RUOvmc6aDE/E6rt00dBdpKwK11d\n9zxO7ipnCM2uV/Idt9vrOjsWvD2vey5+mA1oy7+SU43azMf/AIDscJgLMXUD\nKu6AdXVgrRAN3O/xRPzSk99CPMRz9T3119W29zY7eyOJnnuVFPUMJwe8nnLh\nUyJdnriSV4RcrEUxnsoV96+fcurBIdyTXTcfsY4CadsxBq+MO4mIThgbY0oX\nmbY4oKsElSy3jaMdy4k9KnUsDv8YqShJedW2JGc5O1NlRXWe4VP9SyzWojeP\nkl3FmE47lQzwrf/ImXfZxbUqZpPkv6KJq8IneTNXB81RO8SoIOA4wn3z21sf\nlOjvx4PYtvZAyIGOjJ4GUf8h7vfi8vO7vOP4pICevOTFE8NHvUb8wB93NHu9\n3shZ\r\n=D6qE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrz3jQs1CMSMvQKsP1eNAyJNl5oRv+HS/277QMkDqIUQIgb8gwgS+y9Wp5d+iC47ladkqzEOwJMZeFpnLafKj5mMY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.16594f6.0_1638379973782_0.41373167235860175"},"_hasShrinkwrap":false},"0.5.8-dev.7fb5f9e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.7fb5f9e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.7fb5f9e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.7fb5f9e.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oA+yw/Er6u3LOA4LgWD91MKrMx6VmmCvJVm+GdXLe5EGNj9fIaxjIMQiMrhgEtuyYi+jf/gpdCkQLXRua7Satw==","shasum":"3f289b306e3e2880dcc424481c814581ab5361db","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.7fb5f9e.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqla+CRA9TVsSAnZWagAAOI0QAIBpqJz+nW4ka28+9Gv+\nNie8AC1NOevVIJ+HACVfQUZyb5UHOSK81IFfk+eiXkWK1VPq98v//Ff18i/V\nWfgDoUwBpyXSmplqNdgEuYjOqKFivX71G6db2+P0raUQk4MAq0eHqEhIZ8C7\npvCAsfKhvyYrdFcCvDi+S8JMIqK9zYDaBrKpv+DM/MLgfaCHLpAAjxAgkyi1\nN95jl9MIbMuLLg5tfZKgKWAkQkhZLw/Tcgbn/N/YYnL5x/BZroJhbtp5RM7T\nlfizPlKkeLiM2Ih+S1XfSRmnvEetYMFI9tMj4Ac0CxbuSDSYQkraJbbTjQoe\nJUGi7CS7hbCe/AhaUWU9O7l8+5kTwwDMqwmasQ2eU90k1yo2w7++2nrxnRdm\nHgx6IDQm56XEwYqeWSUUsQYYQFUS1x5lsgpF1oVzO0k+Lr7ZleF+zzhYsgRo\nWGR0uRRMa4aNbJMzlDrhggTcjH0Dhz9KWxjb8r2U7G+9wKOiKd5YTU5jsJBs\nKXVJqnk8ugrCB2f6qNGh50++m3769p+Aac3k0h6AKBfDF0kzfLjch/ykpK/B\nSnvhehhwxiYv3JD4PatrRxI/CbX66R2H0sMmDdK0rMtYQ3y3vAWHWv9xExkl\n5Lk/y3TzyGLgjR09NaS7RmzGfhjeuXjF824HNqSUlNF83PPl+UVJCKoxjxLi\nFk7R\r\n=PVzH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtCxh2xa76lEs6A1wYb2IWpXYSLQsHE4LtIBkI9fBvoAiEA4deYjGGs4vOiy69yMFEy0UXuPzV/CXrDUHWAC9k8w5o="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.7fb5f9e.0_1638553278242_0.9284128166133969"},"_hasShrinkwrap":false},"0.5.8-dev.640e6ae.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.640e6ae.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.640e6ae.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.640e6ae.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-fbUHmWP7ZW4Vy510HwvdEmEiqD8PpMk5mt28mmM/sEvvgb8OsFokDqNVuowymIOfMgvrhON38p4Z+MvA4H1SMw==","shasum":"0ebb652edafb547293692b7745a7da54a2e4f577","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.640e6ae.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhql8FCRA9TVsSAnZWagAArTMP/2zhUC3qOQxz+3PT/0MS\nC400e87JTDeIudUTiGqq9VhYB7Di+mlx+t56uuPnGqJrHcRZDyAtBrf0mS7Y\nNnGjC4Fm3AFvbi97rTECsGJpmz6nrV9tW+RPZKtFUvKd8S1b1Hjj/sjgGbKn\nEY2yuYZRc0ABOfn/xCKQ2gGbwUgC/l7T8gHJ5UysUxfQ50GIX3Q6H5bzAA36\npOo5FZqJcGIP9ULnITxi1JIWNFmktv9pmD5oqpES/UW9uRVHsC8J1w7GfvZy\n7jja6oJKXjBJfiktAkzgBN4nmVzUAmDBISgUCNrpWmURcbWOOmL190IL262B\nBCzMmZcBSAGp72pnjjGr+kokHzVU0+2Umnl+pqee+TjWSo/zZKBS2QpTCoed\nquaKXyh4aC7JUjymDKHzgLTcTlbcJkSxTRCAcL2m9i7d1qzryAt65jjBS1/b\nal9IrrL8wBQ8Rgt3d8V5ow+OZ2yxjcHLpOUtqTyH7pQUVuVs8NI7Mo+aSnZD\nRaRN1CMUf+MCNogZMI5yHPP8RiWu2N5ieGZpNWtBuEfKDGsYnMLo0iRZFvvj\nlplg6zVI0xr0Cykgv4XN4AAVlKL5gXc6P1/OJwkVLJrcXFLmj/4L8DQ1dds9\nRLsRCABkGcCIwZsLDWWBhJkGh5ygXtNDNXjTAW4DLV8BXjkcAnCm8GQLo6lJ\nkYCj\r\n=X73P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYEYwMcd/f0ObeP/wu3OlEDLhKjeP27vSH67hZ2x4sAQIgAkoAYxF8jSz5kdHfk6V7LNMqJPsXH2t5tLy5GEgGjwY="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.640e6ae.0_1638555397265_0.06075057467377376"},"_hasShrinkwrap":false},"0.5.8-dev.86e9998.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.86e9998.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.86e9998.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.86e9998.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-XzQlUrG/rnvofVHixwTUQuILbgdh4an2nddUWoo4EgaOXPoGnzukGk0gF/rq+HSVPXPt+C5Ydpe9FvZ+8W3P0Q==","shasum":"0dd32c9804e5ad3eecd5f703a5fc1c3d0a5f3de7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.86e9998.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhribYCRA9TVsSAnZWagAA2/EP/13pyN6998GkJanO5HZW\n93AoD8sw6/tk7/0doBIyXXcg3BkvTr3xpoyVqeu+sMvjzbMX3J7v8c+dAwyk\nuWaMHBRg2hc4pBbiH81nv1O61+mqx/gLdcRri3LDPN5l+wIvQja83eEglQ8x\ntkAnwWfMZvIJ2YsNAR6/TGfRNERuo3fisX2D8EeEseiUS/e0IK7Lluljgkjx\ni1xb44v8+4h90RmpTczo8O7g2JRBfU6MNZ8sOQ1P3+5fngy3TMKN3QZPr//P\nQwtML52x12FUzTjk1Ukz6RWvZic+6wZNoK83frhZf5rQDjTF3qnmc0QQ7Cvx\neVkQH0R7jvjD5HHJijeyPoUZSkQwWGIWS9wpdHtOomUAoZq4KTf02a4yo2jT\n6UcU1ZdIzYWGkK3bnvFV+T3s/P/PG0y1gpHWm8os5KTiJ3gS76ATKJ8el+uI\nC+segnGKaKmGFvHZEzdZvt3SVIKY1vR0oO0J4XqznXb3iTT1So3Dgblq5+ZM\nuklBD/eFLET1wzknGWv5oocHDF3cFMJX3AEMaNf2pxa0kaI8TjCExm2fVmhS\nYZ060V0GhUJuyBBdHZhLUrQFYoZK/5tK8JmSTIW8qZDO58DGybJy1yKmafHB\nIWLuhB0E3S9yM/Vt0y64BBEmZ7/ucWpY0WQmsC6CS/sw5k8bY38qAu9zmwOj\nx62F\r\n=ejQO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlIHw+FctjLBcrbp0exvaxRqx34EmFU6yZAra7MZ5F4AIgVxRana8t1RSbqwUkiSkUVo+wba5c0JFfTIjOHQzN9CQ="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.86e9998.0_1638803160796_0.15357622822896566"},"_hasShrinkwrap":false},"0.5.8-dev.350d38e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.350d38e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.350d38e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.350d38e.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-3b6PjdRFlihphcxQLsxQbmPoKuMjusgr6PQyCboo4qmBRQugLY19JvgcnuNhAIcGlDqroLIrb8ugBaVpytY4Tg==","shasum":"c40df8a96244a7beb1de31e3794038f95718c670","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.350d38e.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhr47JCRA9TVsSAnZWagAAEjgP/20IMND5jZv532CKQfqn\norKsNJ4MeR2PwDw1olDIr8PAzxhOsIN96sVBixckHl910OQstANyqBYDqgfk\n7zm3HL9mif7abIHL0z7vgbFzxQNTwoWGgK7gVEX/nQq+esmd2JCJRMFcgcRM\nvuvRjBJxFlqn0u+2dAkz4AXd/8eva031+qrjpY+Dex3pVh5oP/0tbp/JeEXE\nvTVml+kZhcd5L5a6LAIuUwdLgVtPASB6yjJrNHIJVc8lgFLcszW69BGzj0RM\nHGVH9h1kGBwTSjHfGeWyCVv/whxK2KTEBWqFbHueLYtNFymrHmIioSewkDqj\nOxHEbRd3l9clUdFIxOSD8bctMw2dRtC9bowyEimrhVrll9ZJVk/CLbt7DLTy\nJzfA7rZ1zqyuI4V4HbeLJOLjMveIH8NWTl/hBynYxGEEpRgowPOsqOZJOq8H\nnlZ9N2k67odX6kSN0cioLP2IccYmoHtopOoIA0So/NF+cihWlnIhNg4GQdS8\nrCvkIJ4yE3GAE+5USjxI1Hqk87X2ejJIjrZHPSix3oDmkcpwpvOxzLVwtp0c\nJdxQ6BkB/jK7jBFrb8q8113Q20HfKQaZkFwMp6ItOfkxM6bFuW145kJLiv0Q\nlQiwkWCvvmghUpCR8ZXtESFMCDskeN2wgLUsHYC6KP7mvRFL19yWh8TeBnXK\nJjjO\r\n=d6Qa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0dyHFG0OdI5yAOQ7v+gw7a81oYA4KVChCsQqxDTMwJwIgcyvkLPjsKfWpEMbt/k7dIgjupGonuxXObIZUlRrl0rg="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.350d38e.0_1638895305831_0.7388799882288248"},"_hasShrinkwrap":false},"0.5.8-dev.fa49a94.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.fa49a94.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives --fix && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.fa49a94.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.fa49a94.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-X2Hb7sNlwRZkrmhFJ5NGRAxRRFuxqqhD2QmTnJLebyj09lirBZoNNhGVGQPlwBjfhJWP8RmQIKciSOto3H7uFw==","shasum":"2056b8fa05d74db7a56a650571e50c523b8a2b07","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.fa49a94.0.tgz","fileCount":35,"unpackedSize":998572,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsKSnCRA9TVsSAnZWagAAgfYP/Ahm4n7qdT7WMJUKJgPy\nwMVM7CY7pXSwTVI/Bi6+B4P4ke0kuviz4LtMX0VdkEwmkS0DcuDZ3Xkp3kxi\nwzxFmsjvOdzSbuWrb0oGWMasS0CFmIU9s1jNDThTon4Ki5zimsaBgVpKRtJy\nUqUbTrsk2n/myf+TwKWP4ndO0BnM1cbP+6ZnUeLzERdL5sIQG/tGp1vhg6Wl\nbYoFYXs1vBLrVI5B954eksjVxobhmFoEFFv9ZYQy4Ry6SME9+k8MllA1+TZS\nmYNCW55HxcNeFXlhZIou6ToDlnTki8VSU9vvEFwAMUIu/fSCjZ/kbz5D6mRW\n5Fpvr7POeCRWIdpnP/z/sKH2Cq8wlw0EPOqFEb2/MYrezGV1f+pC6YZZMkrJ\nYL7qWO6akwZfT9gMlqp3Rh/dzyc4EVaD1YWCcy1M1VqJMTrqAEsBjp6mfSDd\nuflDANxoDnuhOiHz9pgbr+USU9wN2T3DayS47ZdHnlPTUhsZl1e2HX8MFGg+\nVD2hs8d8BzCA9VjfqFuVthmdW6K+/Dr6tOpxbZbCJapW/xutwQxnuPsXwfVW\nLKcRn/I4pYVtckT1IYaaA+cMfcAr8MgL1n9bDYBhLu7NzlZ3NFLkbbYW31P8\njBTvCb/YcBWY2RsnAUnBaLODNg5Zy1c+Wk6oivO10qs6WwX3MRUSbnBHtzv+\nVjSH\r\n=8FiO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVlYs8ASnbGu7MZmax1c2S88iIq7KhtqH0cI/lRzlQqAiB9RWOO3Q6Jifm1nD1lK+ZuOQBMhLoSHJd0NJOxbWmedg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.fa49a94.0_1638966439449_0.6361646829128782"},"_hasShrinkwrap":false},"0.5.8":{"name":"@superfluid-finance/js-sdk","version":"0.5.8","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.8","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KLjEF70u6jzQrPrYg0CYukrnMDE9FcOoZbgkIos41zdPrpsALITkM2uPpSOYwE2fifwZrNn7wMKH7WHBk/PULw==","shasum":"fe1a177a52fbee29df21917699a03be7f1275bba","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8.tgz","fileCount":35,"unpackedSize":1001266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsdxZCRA9TVsSAnZWagAA6oMQAJ1FLm4/sQMrnT9NWQOY\nrAYda5hhvimsJb/Qi3hCThI87YQYGpfimPvw4BW1M3c/OqDdfKgB3Fqyf2Sw\nESmcFLW1R5fjo592aoCbANCxzXsKa1xAp7hchEY4AkibZC4xO5dXgZfi7IA8\nBDSJaGBjOikSaqMR6feRZHonW1ue9UG8Q9DXV3M57gQQdEkKVhKyQ2BXJxZo\n0LZwdpIZK8RgTPOGlyGESs1in/RBn7zXnd6f0NChfMQK5p1eMg7zR57WCQCB\nOxIVXS2EPN0oug7DLI7vdWmEHpQZ4Vfg/VMk7e8RSnsElNVolNDdIA4y4yNe\n5XNsHc+UazqoXA+KLaDDxfQIAlw1Thv+dAbD8c0dWHxjgYl9vTVk8L71+0jW\n9YwU/whNpLEQE2Fj7P5oVgLXyjyCdqeoVTWbYFA5L+SkS4b3lGOpKzX2R8Gc\nheF55Kf8UtbtNIRvddTaAtlDoz0oIv65223yruK1GZROgg4Ce6J39CPGHnH8\neb4KMCPR7s2/YTYCb2nQMI/aNc/xFVlFVhNPXdoUtlmNsv9o/fF2EkqVlntm\nVTGINvHdOCA3aCPm5ch5bOlQifgebXf0DYL4/gz9oFaPRhy6AGoXwTfZ0vuR\nc8awz9h7ZD+nD7fGk/kjF3S4QjthJbxDWz5a3E7qX+B6LR6usuuxLnck5Kzl\nHueG\r\n=iv29\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZU0yfJvvMzdre8aGv3u9eD0S9myy42Qwc/oDcN0+7cAiAYCgGx9GXwgLAIoKVs8ZyMFhVY52S19jOkk+hyxZXtfQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8_1639046233770_0.2021437325631421"},"_hasShrinkwrap":false},"0.5.8-dev.bc1d5ba.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.8-dev.bc1d5ba.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.bc1d5ba.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.8-dev.bc1d5ba.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kkcuRqlMBlbEcDpqeUOtXmTZJrHissS47l4wn69abTq2YpdxzjwNmzulQT+wvhoLCnpivMuPz8YaV9y6BjwGiA==","shasum":"837af692dddc1819a24586bf4cc5bb66268b3cad","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.8-dev.bc1d5ba.0.tgz","fileCount":35,"unpackedSize":1001290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhseK8CRA9TVsSAnZWagAAFBwP/iziSYXisi+o1c+q2AoB\nJfu7qtxNjRwZAVOhfFycJqXlu3dfLGz9tXPEgxJmCcI9Z4s0GF1GzGRR+xbA\n/5C+5I3I1QfF9RxzwHb4FBXj2P0/roaEjTNvpjpzDxDoSlUzvlPCqpGFux77\ndof6KBLEcpEU8TTJkml3IeXOehLsn8z38uKQxRdOjc4YFqmT1ki6TdNh4e57\nz5mcyAMlWmRJGq9KObQyxm2tqTN4/VIB2P4keoIQ2uEdJPK9Hl3/vH+A6Bq0\nmybUsf31fl6acA6CSCXYJt90qdxq+v0d3GD7SJye6ig19rBvx63+U2xZMwoP\njVF99SokQvs7uUnXucaI56brkj+eqJCMbHRtQPumir0YgvrtXJ3n2j5V7FmH\nij9n3jrn2vtnh/VoSV4y8FhLz2DkVFVtNz6TKHw1F8MsPjt2l/qfedDtKvPN\nvTudPz4fAq8P2sy2jQiqCIbON0T99PK/1aP5jyYlqZM203zxTq5nkJTjyPMh\n5cRAqtkQXItd95+gEEFKPCLfUKsNz1tesMRt6I0Jhar4F6O7jGO2A+EJCaoS\natuiU9EeEHW9c6Xm6SnpFAin2dER/M/h8TSKX19Psksb2kTiSQ1CLDwtAUH0\nnwfRws8LKAlMtqxM6Id+EEy+G7n5vnTyKbSuJg0WPrLmGQHegVStDIfe1WlE\nv38/\r\n=NOY3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8otz16WNjLBFF74GYnRLwm0MuSkQX9XPmVgiXNKqZDwIgdY7rMnZc2wnVOhvaQGJlVnE6aOMCK+ijEVkNaVIlIJM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.8-dev.bc1d5ba.0_1639047868213_0.46938125948371634"},"_hasShrinkwrap":false},"0.5.9-dev.7bfb2dd.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.7bfb2dd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.7bfb2dd.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.7bfb2dd.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5R9I52vTzmLcYCjxFe8KejpPXW8xFJhWgUdXnS9X462hzrKJbAARp2G9sF/rMIw0OlRkhXFYamtD1ofpHjfaRA==","shasum":"2768a0c23a9468e9c3181a4da18695deb1e86291","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.7bfb2dd.0.tgz","fileCount":35,"unpackedSize":1001290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsekcCRA9TVsSAnZWagAAOE0P/1XqnTPrWpIb0wNnM67Z\ntv//UqQqjyxIjXISeIwUeWibfqR6amWPMZCN289eS70W6qkcz8Q7GqLNTZQQ\nsvBIRNAZcqxpe185Ozvjfg7ZJk2HlwsUGhShRMfGQIy6ibpBLsb2xsinkkuM\nVNR1Bi6rnq5aHgtchzg+pEHtTSPbIOKnswUCoiKBItUvXuWzG485lbfEQnU7\nRNRxZo12OHk3TBCLDnDBiUQhO4XTCM1/LdYDITnO/REMpDtA5pB4OWT8gX2V\nX6z9RlpR3vqfyRISZ31JUzGjD+p3RFgFTMU8skoQZXgLVKKAEU8t+uBcEsaE\nPoMbQ8rlM8Jrm9z9t7l8v2ZmNHFABFZwFWz1ItFnNiMAwL/AHfCPmDIuv0lD\n7FpZN6HTTNAV5yCT4tKFaNUpKIZlMLNW38iICo0b6qlFX1k2oXHAFJ3kL8pS\nluVBqdPIBGoSE/DUGtxsdQGDXkgWI4VuE/eRp7rkkB1wRuqZXrswoskOQopM\nSonp5kNsei2ok5Q2tJuIaiiGXCMXb8qMI5VNiLjescQmfhkxBbYbe9+rUMaI\nLs4lcqs5ViSkfryTuJNhwqBPjUdibxC9NaNgFp4KPcxVlFMwV5gMRUL1heop\nyyPll2/wCS0fI1NXkIKWMqqhqfN+GT5EzOQuT7SkqkhXDXCtdWoRWpLQUhd/\nDCyU\r\n=XmOS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGJZ6uvcx68D/c3oirvE3lAcZtFz5XwPNnjDQ8R3+CX4AiBLWfzZFEuxOirefztNQJj4KcKUbYIHXOLQ2D6IcsFt6A=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.7bfb2dd.0_1639049499943_0.2708603097553206"},"_hasShrinkwrap":false},"0.5.9-dev.8caff13.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.8caff13.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8caff13.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.8caff13.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-yD72rehN9Czf0ysq1AknXKtHg5UlefUG+IC8eDdgvymT+AV8jc0oIelNwG+5uPOyBn6mILCiUG4vcc0v2XHAwg==","shasum":"6b459cbefe05ea8bbd0b467e943a786a7134e41e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.8caff13.0.tgz","fileCount":35,"unpackedSize":1001290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhshoMCRA9TVsSAnZWagAAtg8P/RFFISiYwArxgUClyZ4b\naz3/49r40fTAXDBnXE1swV0SELIENwTafhxOzZnm2Pjdo//XQDmRJ5zYnkZK\niDhqG2PcVcyqtwh0KaflKyaUlUsGqhJz/43Sy/d6uvNpNCOA4TQnYTuRqQ33\nyhzURSUmXhOVTL9+X5bv2JDBWmFvmrrDu4yetnJt55R0QzHu925cFOcoeYnQ\nh+287ibnheQlECxuhkcYP90GTHfRGfwXQynO71WVXWZx+5LInXNMEjuSpW2y\n5I62eo63kmR+lZPtvhGB+QSi4Oyp1SLWfrbWq9eNNBe3N2/VLI84DoIuKFME\nF+PP4v0hw40fDqNVm1vmfWQsKfu79ccWPQ4E0Irlpzcc4uWQdeiMvs+zqciK\n9zeE1j6MxpZKI/laZKmDIxrP/gybFbnYZAvfH2K025vcidail+4JmNEpiGUD\n95SmnYUmfbS3uxu6i2Wir3FHCmNqc/s6hZF5VtEhqPNpsUO5DUlcyBhAtkz4\nNbOX44AN46SQTullPY0TvEnaC+kxUcFSJQS4DnL1ZZZRRrfYbc/r+BrACuok\noGMZtPSc9NzAeNKPh8B13p2O+6R26pCWUWZ/D+nOP4eFn0bfWYmlDBU8dR4G\nd20nS/Reg1cLfOMDSJ8imh4F5P8W/+lF7+XkUC9t3XIqhoV9Cghj/fDwZxlv\nclWK\r\n=NkcP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDd6Jc86PGh6JzCWEGQo0MVl7ig5/D+Rg656/zYdba7CAiBk6vEFDc1P2N7vgA9eMrGyV9hVLiOWvu8CZb85RvMiXg=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.8caff13.0_1639062028783_0.9840353595019913"},"_hasShrinkwrap":false},"0.5.9-dev.09f628f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.09f628f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.09f628f.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.09f628f.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nXxXKc2cXEoS8hGStX0Q+hjyfkqRXfenFcYTInRWKxqvFCf1cltQTIzocLWvyQfxmjNNzsTxOZRjNPFF4+HEXg==","shasum":"9796c751d3243810fa40b1da377bbe206f4984d2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.09f628f.0.tgz","fileCount":35,"unpackedSize":1001290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsiAlCRA9TVsSAnZWagAAjJQQAJyBVTqUVekp3GGSQQon\n9CZtdKeryDKzaU+7ckVEN4cJ+3GQagNcPC+htweCjhcCMr6sfZyvekKB9T52\n4FiOONp2My9vyf3SIPnNg3bX2kS4nMBbLMxlmZ0CiAOkDz7yhEC9YxWWySl/\nFdv/TKafnRM+ULt9YEBut9FWxak3Dc+SRAxWVharVeM7gdSNj4ns1tcrJbJ1\nSGtAoRg4wYkDfY2M6zCERk6F1Ex7RfR/RDxhIWEfvi+bY9gZkarx1Ga6vsyJ\nwKSN4+mW9SuS85hKdLMPpYn8yvk0ZyBXzXd7o1fIuL3zhfRuqXFy15otUUxM\nCH86PTJkT6vYCf5Kac4XghO98qWZKTGOC2VY+MX1pbLV8jDViH7o6p54Q0mC\nK1xm+LmNN38Rdg08O4HEOpstlmORLxcHzgcg6B2SQ/cd9QyVaMq2yAJKqv9/\nSp7HhQxx3hJVJkDS4gMTtbhDFAXGsXNPdcxds2nRTSUZAU0c8OA/pzIO1Taq\nyISL8wPs/UWHqW0GhjdCkQAi0yyXWdZ7OXwvFLY/Q/ZhGIQOwbvzPRU2KChy\nYFzx0fJGbB/ugS0HN31t3BE+MVebezMWQ7YZwM+Gzo9H5U9caV3tTeUGjZB8\nOSJIMMz08QsoPRcdmYZKyeo+3m4o8YPke2m+p4xczVfn6S3LqKkDru+7nXo1\n94d2\r\n=bFtd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAN73VtdrXY19L1dKe58pnKG4VUGHJ/EPVa5zWu9BqiUAiEA8SiEr6b2/Z0uSSkTVQMJKhUGVN7XwWpqstDb6MfZiAw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.09f628f.0_1639063589738_0.6427828568816116"},"_hasShrinkwrap":false},"0.5.9-dev.2c190cd.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.2c190cd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.2c190cd.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.2c190cd.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-iVj03lb1ccw+uqwZUXV3eOaT3tpKNUmiOGC/Dt6604YxqLokqn0iMU/hseLhBjnPk9cXjf/cdSs2Yf8pK1kX5g==","shasum":"1ef0c839dd7539e256ae60ddf52c8db0f620b677","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.2c190cd.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsiKMCRA9TVsSAnZWagAAiNQP/0jUXQSiSC6pdTtJMz9D\nI7ICs2Gx+oh6hWdhubBBS2Im+Xmhyfr+RSbb+puWTa9R5d0Qmalr63xcODVh\nl//CCKOu8UuiJx6VkhyYqA7HfWXF980TfSFvW7Uc0MtXjKn8SkucaMzk5YWQ\nIuQ3gNSf3izu/9C8GqjskMbffrdrldVQC/EBDexy8xzzhd3C+dAfzgbGa1MI\nSbhcEW24tDjobmZogUqAV+m4QWQic/dys1YwuWV4eeSWGw/Tz6pUieY+g0aM\nR/4f4w9nUGp46tCIwEsTjT3G5iJw/kJo7wxQLvbw5ISxv1JTvd9pW0Acnk1Z\ny5iCrFtAUUiHW4FuCs9BOvq6fEHhkRvGEUbtzvUoQ3xLfwo4RM9FcNePN4gC\nNVS4osnmtXCFTUO0TqZhw18DNbqrGSHVaGRRfxVcPNb3oO1uBzX9idpXJY7S\njX6DnBEgaKgIUeK86DbJVX2Baw74gFjj5szqI+LQu6kBykG9oz7y3AA1Y6q/\nImmFoOn4iQIB/vPJD1th+FEakifZ4L9CmiOVY4oZMmspbWYEESzFe94a7YCF\ne3fCE6xowTng8VqeNOrl4rcYDsXvTAe/ZpB5R+vLL2YsedmR8q51Jjxksec0\nO50pgbo76uVPXlc304u+gLg/JPSWpSpIpraLbm6yEKsH9PnlJbGAgNYkOOH7\n2L9x\r\n=+z5U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA59h+23LS1HPswfWWRZIKFKJd+L2llqxtUnu1deFhlnAiBlXmqhGYAMtRtm11qkHPLDxE670mdXieZW7nhJEXujBw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.2c190cd.0_1639064204199_0.8601257342251778"},"_hasShrinkwrap":false},"0.5.9-dev.ed7f292.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.ed7f292.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ed7f292.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.ed7f292.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-PLSCZ1FOK9xyKWCygHZEf953fvqwVfc9m6lVidqCohCiXSsgMM33MSEMbS6dIGShU4qXJk4QGUMwe1cIqhVrhw==","shasum":"d5e287362f0254afc3050a2fd931d6b5725fbf7b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.ed7f292.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsjGiCRA9TVsSAnZWagAAxzkQAJWhOdRMIJnpdeH0tZ0j\noWt9VuFu23lq0vRuShxQEPlSkgTyfsgBZyAOgc4SqqCuHmeWQqZeLrir+AuZ\n8T8AwonJjMaEN+dGAXqHBOTzJPz37fZaAOnJRpMAbk+x0AVe60cwa44OVG8Z\n+owKqmkFrwmcJ0ox6jMSh2yiabA2hZqsWtD2vSrF8z33+aatvIPLjEzsx0Bu\nmPoQj9pQ9/V0jqJwmXodrxus10k+0tYI6FSL5coEcXOM4LUNCuAjH4/IP1DX\nrKLbGVuOTJyOXkOLySSlSwzAnqDZjwMZ+aNC6gLVmI9VagkfqwiyNk39TkhP\nTEY6n2mHo3CLR8Z6i7B9zlF18W48gRG0CaQ/n0h0IEMnJJrDssISh4f+wPhd\nxuHzlzrkYq6la941iHdKKMzIa+jQB054AQqucVjBnzlnSYVE7ijvy5pT4iuE\n5e7VRG0VnFx625kv+Sqz5y62bCa6nSkJ20ShdEb6j0OsgckivtsMp1l/Ddw8\nT+ZbkwRV55s3kRDLNKxVBe8yrwRnBKV/ODNH0yAMekKKDmbQm3rcy4IC8fwb\ntvjsTGlEwyX9zVu8BIf5VVFJaNwv49aeZ86QWcVxlBM/kMcQXqZYIWV1dGd+\n6qAM9neJH6gNw16AWpim89Dg6p4YFV3AAouK4Ix4feZ9ir5tkOeVBLsqqf3V\n1xjI\r\n=Zv2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuDa9tu+k19xPQquL8wgYNmfWEj2+x5CLAuO+KLs/pTAiAz11XtQPMepC3R2ItqafLkhRt2GocABptdWCMwdoaSUQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.ed7f292.0_1639068066418_0.32215540005652676"},"_hasShrinkwrap":false},"0.5.9-dev.e0742d5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.e0742d5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e0742d5.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.e0742d5.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4QAbjnXFN1EF2NsK6Cd+/vpZqyVF6lOHC0SSU06ewITDLnYvL9TRuZEcja9PCfTzesAk8ZFrAUoNsCF7SrbiJw==","shasum":"48bcec160ab92a7bdd2cd9cc6274c8bad7517437","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.e0742d5.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsntYCRA9TVsSAnZWagAAFUYP/jFNTAB4m4uIdxwSe8qe\noIABrMOzUUmxnNism+p+eVPG63YKHoTerZ1y2FwivBCFYUd0Q3piS9duFloY\n0ODNlZXdhYfqW0DF1sKwvtKTz4/l71iioQyRf3WXKtTErOrXuoLhGN9WoRSn\n0C6e58GsF9eQgjsKSg28LMvRbiknoyzXL7L7DCfXWSHb4fy5kIJOlM60UfEa\nH7+Rp3Jgzo6LoEFTvtyV4cmunHmy+Nb9fOEKRgy/vZd7ZpVKDOF548LxpzTJ\nb140I0mFwq93dpsgSSsFnMdpYGS5ck0DRR5trEcJteBXl/3H+xg/VCz6FINv\n4l5IrKwAJ7ifMYVGfpyx58D/AGcaLVvTuxqG+dh4HvNCnqwRQ3IS2KsM34Wk\nHLN6RJY+iSUA1AoF4gLuQKdB0hvUlHohd2JYVP/tV0I7nx134+98tDWWyUDL\n+LBLWyoZndyWHfvZWfg3fOIRPly9ljqyDI1T+A0sWOttXz3QEQ34ypWfYQIx\n8c4SoCGk93CC9LgjoePFqFgBV2qyKAEuhWbA757Mv1mQNTq5PeWps0Ad1v6+\n2izlr+BFsEcTeE8+e6urfgFnIcLKo6o0ZVT3bgT2+pX5C9w3yNoex+2IO8YT\nOe1Vp4UhKNtAagyOPwNe4J21E2nOnd+XMU8BBntJvZpRpBsP1Xbntcvh0lwT\ne+SP\r\n=YiN5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvIoM9ZtLm5rrotrEfvYOe9BO5f54bsU0NYTsuIu8/cAiEAokeM3Kcldda2ZLxdRZWO9bHVfgg9X+lLQbX6WEwtDt8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.e0742d5.0_1639086936593_0.8857028783552958"},"_hasShrinkwrap":false},"0.5.9-dev.d7f58c8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.d7f58c8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d7f58c8.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.d7f58c8.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-b+Ss0jVaY2Sim3OgxnpATsHl8YV/KtwfEZjWW/PvKoVM2h9eW02niyXJYhjYeo82gk7NF0nSme1vKXs47oTZ5A==","shasum":"acfd923565707ee9744774e119c16fd8004dc455","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.d7f58c8.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuimFCRA9TVsSAnZWagAAJcMQAIQzuYl0pBeMnwfcdhK8\nU2lr9fdU56vuHw+yn+AibzNmHNmANcu3B6IRePmkZ/qDnFNiPv2OO4VQXZZm\neCX5eXbX5KimXmSb3vi6kNQ80+ld6HeCzM5CGGdsmlHA+yzM1mG7MMw9XXBT\nO0TI79kKcovv5SDPB35rLozAG4nTuawlQPCc+PjqPvwdv78qZ/+6q4DqxZJF\nrXHMXBhpDfpfX6yDyOo/Me4lQ/b41uWD26u1wEeWhPCysgB+/lFYrNvGBn7H\nOk8EfKCx2ypoTHhCU2y9WjWlNTfRv45xeVj1QEJrUGle5bmib7T+YRPlE8lT\nN5cu3lww9lINgODVxr5gD7ix6hjnX5hZ7rrZqLexM/z5X6qx+0A8lQO1wv1D\ncU9BIz7BBi80QHYKnNM3/3sW21zlkzD0OTYsn+du9iW9nzbbcz8RF1+PWbfN\nmaH++ZYwGC2TtAERINAkaNkOyM+eRoWwrgbl/4eh1GpoRB/W9Ct0XOnPjuq2\nqhk2musyvJ9ahM1yERCYTh5IDeCbiCU+P3H0n7finvnFceBIJkUiYiruEjWw\nfU8VKRi78lKIX7ycnMW2tXW94QpdqPB0BHPHyzowNlYDB05Fnn118DDbtWvP\nhY/syJ0QuYA9q5ZbIu7oBBIDe2RLIn1FBSHTmBz0H5Zh/nL9BJSZghnBagki\ntbfc\r\n=8feO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIV1c5PIhMD+dSNQ5Q4RQilPxJSc6JSU6MftOWBP4v7AiAKTUt8iSze/KqwbyKlx5BwJ9NKlgVt1d3U1dpoJyRQlw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.d7f58c8.0_1639590276919_0.4112749764787329"},"_hasShrinkwrap":false},"0.5.9-dev.3d58c4c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.3d58c4c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3d58c4c.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.3d58c4c.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-OrGbb+Xoct0KfdsmINJtv8GexIxWebAd1w3FhSy/MPiGmX2Pcr30bRt3tHLQRyoOsTzaOMYHWPEYDQDLYwrkEQ==","shasum":"a2696fe8f1f72cb60642a2bda1b3702f820d103a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.3d58c4c.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhumMbCRA9TVsSAnZWagAAMw8P/1xhZZp72nVWw7S+2UJ/\nAKFA9TbbYIPXt7KvpBe+Vdrr2n6glrb3R11zcSdtrgXkuS0XMZEvnI3CkHfS\nq/tjhIke+oLFtakFe/Vbbif0KytxS1YvYQrgV9rtTcimQePjaAefHJ2l49t3\nZ49sQ//3uqWU9fpHQ/Oz8L0as9829g5zjEUvOvdhYu0AiByNvo0keJMJBs50\nON2L+ZM8y98ODF5/5wERKbAV78IveyJEqAzjiWANNWfa+1sVCNqQmddoOKf5\nOnQ8Lg0SbHVKIlaNLeOhMIlbmSGODHc8SuBYlPK8at9/yBEoahAE79a+c1vD\nYVCOhzMT7nTqXnASr4gRD8aotHcx4bGwsZeGmE82nF5i4Jmrri+ykXw2DxUb\nu84qMKDCv4EuYly+fntdx3P4rSnGXeVggJfz/uof/m3HO9/QC5ha28M5LBC9\nSDjdpFVg8Y/p1A32nsYZ3QCYrLUd/RPKX1TED6XGtHJLGzsX3fSuxM2F4g9Q\nKgTEC5qOqucMGWFxJ1Rkw0x6jl3eGB4I/XxUhHruMuOYyWLZ3bKYWC/M4ccc\n2i1wa8xN0Ahf1L+LI8pMct6GSmuZ7qs6sa6SkfYDlbnEkq6xMND70IHuaQaa\nGLfkhfEfMOkV9lWjVJuMN8sOg/4Mf4MRXhRdPz+WMLFVBC7du3lLyw1ajOcO\nVoob\r\n=F7dV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHaSDa4vilJwtseCStD1eujzv4k/pIOglTVuNcmjFw0RAiEAtGtCngrIt1oBMfBAERFLfT34wn+xxPRFq5VJcFpd/tA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.3d58c4c.0_1639605019057_0.8255043806600937"},"_hasShrinkwrap":false},"0.5.9-dev.8919351.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.8919351.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8919351.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.8919351.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-fxM3D8Uv+JqitZr0bvOTBNjQr6jiGnokpx3avbsKOGS2Vwdf+KCXAiKnvmSzqDlejx7DCDSVd1cTZrSpqLXKrQ==","shasum":"b746d9ce7e4ac02bbd83b4acba3412bbd169f376","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.8919351.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwKhHCRA9TVsSAnZWagAApGMP/0eXOJvP9+7A80hEfIEd\njsLB/34RAe9L/AqRGm5q6DI+EvAbQED8J53I27KpDiGYtDLByBDlb64gHfzH\nmNuzZaaQkbz/WlOMosSI4a6OLwtwQTExKBo8OdEwapntWfAgDFGf11GhDCeT\nEC3+Ly+penSrb0ZA1cqfFx3qneJE2gFQjVSWEdysUtSKlTFpJche8SNIvE9c\n3+S90p4hojPA+wxqor6pz37PLj+noXWgT/eS67cHydeVJe1KzypL3fV0/AB6\nN0CD4nucSSFHx2GTxciszWAbvWUbSqZCKQPzZ7aWBBJA0Mk3dmcvewSCpD4I\ngcozMtGj34WksO+1gYiuN0qksl1MDlcSd22BA0C46zLg4+4G7+hFfkequeuG\nd5jnK6mHtuApPAX/gRtl8p6SiIz825CA/fn1xNow7eTNvo0AUMG+2ncHIfy1\nomEtDHep5/JFFnUrodcGwKycvDlcybD3yie+HMqovpMgamB6/xh5l62Q/gsm\nV2oyFjren6eMEUvYpFA6/rQ1tGGaT5MkIKCwfL23YTeZg9DarDx/0x3K6sAl\nhmRrT6FDKO0x7Thevy4tVnvYLY+eg4NVjxQ5iwcli/a+mxyd51OdnaUhDmU4\nLsmeKs+BpBDkSw3ISf+xFyNetZs5YcDJ0y0TZrndyyHnhA9THTpzkVrIpVuQ\nVAf6\r\n=PKlq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDu1YCMLimkCRgSX6R1IwPvBAQJJQMecPhsEMdcn8s3pAIhAIhn/SF2gDfHCnGWgj4TJOjg/4eZizPMbF4Wh6wCrDeM"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.8919351.0_1640015943692_0.42403656927348465"},"_hasShrinkwrap":false},"0.5.9-dev.269e69e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.269e69e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.269e69e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.269e69e.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mV7cSkskNNXg3pB1qWISt+u+4O1RnG3XKrFfubkQQTUVUXu1mXekr5WT1klhZ335UcyPwM6bsaEUgznK86Y57Q==","shasum":"0cc02eee932b4c5704b0448c8d716544a3ba5378","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.269e69e.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwd37CRA9TVsSAnZWagAAnwoQAI1NhpNtjZ1dC4PyYGDq\nfPvidZ3XKantSSjzC+MoucjXkjFh32MFtSWdzo+hiwemQBZEOvlzpPt/vkW4\nYiYgfHXiKWbU7F0BA7b9vL1aiv43hSv21MVMVXcErwcf5g6FqrEJ5JXtxtD1\n4l8MveZDbrMBFJ1rKzJp67lQgSJokdF/w8C2tE0LtdFa48vvhDTk552wcJll\n/xpOhkg+s5BKIR3TgWoDqClgMlEDZUyNEuqUtaIvlsqL9Om5tIv9meqrMnXM\nSDgyqMZdsnBCDpgin74DaA7sXjFGEDX0D74CM0Jk745VxN5ERoL2v8H2wZhp\nKNzEmZAAmv6TlicO7KBf7p7bxhoY7oXl+aDnpnT1qjH++8cbyjgFQwdhhr3r\ncIKdNUREc5VCHUOW2ulEXzzyf2BvYtsrz27kjEgsiDdoE+ivYGmjsYuD3qJv\nGz5U4bmuZGFqwnHUF/NzSZx1PrcBX8XvHMrKcfsOsWbgTkNm2oCijEYrX5ic\ny2AwPuJ57HVAlg5nn3h/Fz+kRE+ZKI6V2pyNemYRyqCpDvuxtmTESJiGAU5m\nNlb4p8r/giNhIAAvIje3AiPLHCJn3jBRB5jYztuHGGpJokRsZCIxtB6R46DN\nkLWJD1W7nZbh5DJdCT4U/+jTKidBcgXu/UNm31Kp+TbCR8tU6u4TOUbKQIZP\nDBO1\r\n=oKRx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFfzn9K5gl9PBhupLzSsuCGo1EdlX+pWd3OI2ARgGfV+AiEA1MUNIzrQUFhqKELUsv8egAjcxldnwjp0xTNhb0Xnsug="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.269e69e.0_1640095227153_0.7287658993238397"},"_hasShrinkwrap":false},"0.5.9-dev.087c350.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.087c350.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.087c350.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.087c350.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-cGORRmyeFWI83XyL7nmPxgISzjS0BUF5NQO5Se5O+Oj+Z4YOdofxZu1uadnuLZeqAofoATKJYr/MX2+JhqAuCQ==","shasum":"5bc21d5b0aa79bb319c38e94d53a65ddbd1306e1","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.087c350.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw0DJCRA9TVsSAnZWagAAVmEQAKAb0EjNlWZ7uF8ZEHLS\n8bBO2oRo645jvYE8GP18RHDWBqSVxxpdRz+rMKlOhyBLq9d6ej2aFfsg342X\nO1Cw2VBmmtulC5hlPw814LiBzP8sZhukiWya1Xl25ns37an0+SsWOXIsibsz\n9O5+//YFaHJ/uk89REdwDVCH8BMcqMxU3tkEiykU8trkWlD8p104eAQu1GYu\nI/IGPc3ICR3WLrgqqwnxsUDUoV7Vq2+McJB6g+JGNkdSmR7vRrt3+IOLZxNH\nDYVZnVOAFvMPWwrOEDAxOLlYnne6dl1l5m40YEK1EjPFJ7ZvCWTmOYmoZnLb\nLs1QDbUzvsgluhLQ2t2NQ7OBCdUM0YnHn56d1u7CbxoAWUztglen3BGWv2SX\nP+78eUn1qjoq8EjbJ3JD6y8KIVArf8oeyfePOtfMqbWv3UrJvBAZzPRcqcko\nlDCImTvVPxhyApEejt4qFH5kkXJ/2Ga3NZT79e2A4azKh/ssGsrqunSSXbHD\noQglR6Q6xuuTSCS50HXik/6PjuAGOhxiUbRFpmhWdU2GKjPI6jUXHefkKz8t\nNn4ZGsNOAHkpuKBhpkX8TSqOzpj9cfmoptorvuAEq8oG4zfPSoS7EO0RERMk\nea7kTJCjYw646SIwT/2lv3j+CL8o54PdyaaDDPpocl+Ear5O8wSRbzpA6QDf\n8ZJ7\r\n=e2Ys\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCndbIQnL11pM6gybKcaHSeQEBGkmQlYyjRdLwouqJzaAIgfboG+LO3bFkUl+X54Ws6USRXsjXbj+hawVERdg5I0d4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.087c350.0_1640186057803_0.03909354339044713"},"_hasShrinkwrap":false},"0.5.9-dev.b8d3bbf.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.b8d3bbf.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.b8d3bbf.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.b8d3bbf.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ptKOJxNAv6h6j13WVRiv5z/0IQTRTiunLMwDusE1NGtINn8/okKI3cXn6Yfojp5uxaTSnNkN4QWDE3OaFn97Yw==","shasum":"418f546451a23a489531f5217364df8c00dd627a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.b8d3bbf.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0tu5CRA9TVsSAnZWagAAQ58P/2kU4B/zsviU/34gqYgA\n308IyB6vZlaufak1fCFnpMrjwQ3Y4FDTjSXGEFnc3ByooBisfAO7ZN4chidW\n8dY2esHkeosuYRIUKlzlce3AOSwf8Bf6RDY6ARtmUPMGkBy9weIpbsWodS7G\nUsdi/+nKgmNCfDU6MKJzcsYy1MvVTdxjNiCAJSCDeUcbG/lPlTsGm284kOam\nRXXnB+Gbg8YYC6gXvO2V1JG4sX1aJHQJ4x0gh3uUrMW47Z3O6OyG6pHrE1uk\nURZpqddoBQOpNNj/AYLHi3jXZ/2XQWpzPCtzvI9yLhLoJfpcw32Jp+bveYde\nVOf542waSUl42foWbbZNQAV4PYpqV0CuLWl+hpw89Ng7TlSF6m9aK7dgtRGb\niSFrqejgccbt1EFD9kGETY5TbzzM+2izM+sLdQvPmke50knXRtEGJVzWbDLv\nSxCFqY90aeQkH8zxC+/rh7XiqR63/e3J3szpUWmx6SjJ9SJdO6s2FfwZqQZ5\nyfgCPWjHh2nzk/d2n6OZVoQPITKI9WMCRCqPb452LCY+sEf0MRTgaNBRCJ73\nB2xXShcT7Tm4Ql9VzRiGU+hqHA9K3N3FHF1xBLbDH0HXVGj2WXiOZCs5gZtO\n+Rwl9N9TnP6hHPD6l43Z1NeAnavX8TYx0E1eog27U1DAb4Qc3TIv2mCDJ817\nhF9M\r\n=NLFd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKVf6rRmqhKdUv5p7yayP0MlYj5+q2qo45MYCfX1JvnAiA0+HKvElgc2Fec8rTcjYxZM90vSsz5ELpLMpLZOm4viA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.b8d3bbf.0_1641208761823_0.20861805002928624"},"_hasShrinkwrap":false},"0.5.9-dev.674f2eb.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.674f2eb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.674f2eb.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.674f2eb.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-+4h7BDlSvwTg8z+e35tS3MqpovyKtArp2SgVDp7BLEYewzai2biK90FRJPLRnqgsSumKWy5m6ICsOM1cP+fX6g==","shasum":"9184896bf7e121d57b6adc2fef1227be879fdb62","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.674f2eb.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1JKCCRA9TVsSAnZWagAAwIwP/Ax2NN97hFQZD19aN5rN\nDo8Btz9J5/rT8x+e4MWhPsC5OGLTQ59hqszK9RZ/oIGFHkmdApuNHv5FZy+g\na/4TJYg0zpMAcaRqZG5YZybCshQDRI7eZuywfJXPG+NLORJO6m1TG29V6YNz\nXp4T2FDDn7E5KL1uhYpKSAgs1jzoAeTZgOxnGTR9ssKQt9CpwlkDZVYwVfjJ\nbELRwhPQsAwNyRcMUbUo60bq+w2IH5wFRaoM3S1uf3G+4K2HH7CAQvqCbkkJ\ntof3R0m4AHAN1Xc9Fm07YWeNUge4XmcuBZRoTh8PmMhHWlTJETCAYD0oP2iG\nO/ojqkFlqf076Xz/SPrUrODHSCiuoBzvJoOvWc7m2eKC6BT2bUZaEGPulFfd\nuQ/qNjDv99IJXYK9GIetqg3n/o7HHkVMuWJV/VIq68BPN0g539zMr1eCt6Cy\nfWM1G8HC+SyXt+ZB6s9qTKmgC2coD5XYcffp6opiEjXr2KHV4Ox1LG9uMMLq\n71syCxnyPfgOOtWIoHbzULVEQbPz+Lg3ri18Tcg4tZ4XwYguVjpAADWlNx5H\n/m+gqXShvW3klBcYMtkh/maS8Tq5tgmydmb24m9Ax1gC0gvizZ5DJxKfEESb\nL9kEOvHDWDkrIWmH8pil34jYF7zmP6YU4SgK/Dp6hA5a+2sKgLOj7IpjmGn4\nj8kj\r\n=N+gc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBttUDkz72zAn8IOTZdAMpawkYZjsghvzyVLLPjWemaiAiEAwYnIDALboGSINEeTh5z3GJv8YjZ+jReYrlZSFQxe+fw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.674f2eb.0_1641321090238_0.05208508824970748"},"_hasShrinkwrap":false},"0.5.9-dev.f015364.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.f015364.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.f015364.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.f015364.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-MwCa6rlQt/5nMl16BA8NDHGYp4/lO1Te1kI98uHM4yGhjkoVHNlY076jxFn+NybAHaCyYK19CYbSblFAQI1jiQ==","shasum":"7b449469a98e474b98c35a36d3ba641fb40f47e9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.f015364.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2DidCRA9TVsSAnZWagAADIMP/1dTdOIW65fUEGpNnruV\n8T8QuRgzo5rwYoTKbUjQwPQ4dOGymrtMevKoFELPZD+OBeM1NkaxcJSB8QXv\nEseZnwxDTkLMQxjqpmTK7BnyiO7dTEPgsnBkg3IbGhbdwofwqouaopPVMXrS\nkoAwdlZNoE/IOTbzxR5A53UZqI9YR4ZsFRw1nTjxwhGAIGVmhO4h9ME3J/bp\nSTzorCwixqIH6veqbwet6itQaHQfZ3ZM7WAUVCzVaUT7F1CNgstauz2Fht6j\n9AIJYwtbZ5QXnM6BZDrbdRwPlSpC+DGYWfG4kaXtOa4FTZZ9F+7EgdrJ9DRj\nqyWpj/UKatgS7MA0LmUsA8uJCRagb/eqA08wAzPaj0UKPK1exUj7wL1frMhP\nj+udK1atWFU4lCIA5I1wFw1kXm04yJnKYlbMC+rjRhxDHS7O7KNBXNR/P8Fq\npQizK/OltE8ZH/Pq+KzuD+ySFyo+hLwuN9sXtlQnxDT0uw+k5x1/vGvhaj6P\nT0svYxb0b0IRc4yzfakjF9iwicT9WP390DLRcEC1+0wRNWYZxeVqfVjyQurH\nSwnvTor5Ivvi0rKny9OvhDbxzNKOMlmdeFhV8NtvXCr1ElPzy0aaHW15zwjq\n1JDqmPglglIE4lpnYlrH/ED3j7A0ezoSIXrAMYnr3RnVP8c27B+93qdrJ4l3\nlMMM\r\n=3vB5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGpnBs7qDCMmnxN1EnB9OpiOkFQuBreILhHrdUedNHoUAiEA6iK+L/oNXFiWiFTbe+bDOvEbMd5F+f7DS/B3ljaf2ww="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.f015364.0_1641560220879_0.15893361375870274"},"_hasShrinkwrap":false},"0.5.9-dev.afac5d7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.afac5d7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.afac5d7.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.afac5d7.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KL0FlsTu1ndSI6sbGObb05opHUD47BeKPYCpewBbLIqvJyk387j/BxksbhbFk8/BsNjA0ZPnzLgnYBggALXlIg==","shasum":"dd596e1feb6ec4f571ce824494156a8a79e48a7d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.afac5d7.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3Z8BCRA9TVsSAnZWagAAJ7gP/0Wc5CDdJSFSu6D3lzNT\nJWsVfKXFzXUpRhDqxXsZfvRwfFgeZVV8Smi+ulrD3jxUF1fv2oJHLJkvy5yO\njIjePOz+CLcrgKAiFP6MiJaiQJsYpbNFu3xVj02Nmw32uwfdYUBMMTazsUd8\nOCq7rW1Hr0ZLEdpYVKbqLBqRDGFqXT0bCDTEBMe31u97CwktposIEqm4uc8V\nnwephFebexMduyMKCOEtuPEqjCdUcaBpt29BrDnychLEolwDYNBO4xLdM+OC\nRcaCm1XHfIBffa2ddoKkd998wENS2G8uDMpxSwMxwlOOJzFuDvjPecjx98jp\n8tHJgLofyrbXAefDZl2SGJti1HpbJN0zTd6W4b8bb52pFt7zGGFwQWMbzJuY\nJGZLQyGvNRf+ioG7vR5VL95ri3sj6LHJM/w/t7ZzvTEx45UU0etLXqdejtCL\npNJn7oRQRugbhLUAxlMY2BjjE/FW+Hax9Cpz6HjOo6Uvfz6+ulI0MHycI2ym\n2tsYkKwGUsZg18OwzujkdSRGVGOv/j/eMm7qdPslePgHcE6/qUkj73BQc+mj\nh8oCIlBzTY9NqT1e+ajGCk/WfAVhADCIh/bpjJvK2n1VKQnNs77fjGrtp8yy\nDzMow/ZZv2nWqaNOR/PHyuYClU4fUls/yadGkLbJWZCZZuHTK4BsztdyYA92\n7SmJ\r\n=tuRz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVvB/ULyHnKQaKL2g9k3VvgcnXmqtx6mrOFByM7HzNoAiEAt6q+qcPxGd94tWSg48/46nNZVVslzUqMNJJf3Y2xwXw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.afac5d7.0_1641914113214_0.3169046589934943"},"_hasShrinkwrap":false},"0.5.9-dev.cbbadf8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.cbbadf8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.cbbadf8.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.cbbadf8.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ryBeCGkEDqgCzR+Vrvj+lM9RwWkpUJ5l4IZaa908oRJuhQTJTJDjTFroO6bFKmYD+CMqDQI8+nWbA4YCmwwPSw==","shasum":"12b105f6573646189d17b53a022056d24bd8e659","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.cbbadf8.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4F5mCRA9TVsSAnZWagAAfdMP/jqXmP0oU7BNY5NXBMkm\n/4linBkJ2qME7+xu7FNcsM6dwy+Kk2HoWdKjhAr2x4sFsgiKzxBi1Bat+/KA\n1Rn0M4JwK0ZfToXauYC9adac1MhNFAcyhW3jEfZMdY6cHdhNqg1GoRgkrlG6\ndS0Kwa34qMk94YO+lkZHnFUWF8WSUhVbLrHoS6advrQYPAKCOJMSe5S+OM3W\nK2pkR5dvBUYtLJbEi/rREsPUDRLZfQJLGE4m4l4ni4s/rfhyrGh7swlUd65a\nTJ/7vpcoc5/Un+hwUoaUr3wrAmbIGLwFzmxyOFP6pBVfE0KP1rCl3hOAQURO\nQOt4hcBsDPXr7qWqNpBDxaUAQJ8GqHACXQYPBv7V5S+YnqzbFCAIM2XHzmlU\ny9MCGrwrgjpP8EAAWUirSbbjK9eTjZxf/GRobjacGaRVXnG7ZRaIMGzy9iKV\n+ix2InTtZlaI2OBurhiPFrV3GfX9a6i2Yb+WFfpu3rwpMVnpcBnIpXvTjXdT\nD9M+DrPVuwByHKX48+PWpL58VmhsEcraozF9SOn1A4KdEXyX/KH+/e3/wG5N\njLVyAg2DRMsYBRNtFT42TjWyAYB6e3i7S+PUAUW9FUchmxq+D9SJlQdzEy4n\n8XxYVVUew4AWhbhMncdOZPhG/y1qj5vRBalsGWsB8E9sljzeZe56W+EbumEM\nhCwW\r\n=knFJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA7iaNqtOYP/au036BjlKkCfPIWw5q9VT8X+BO9vWB4FAiBHqJo6Pj6Ow3SF2He1i3+LB0rhOZf4krKDNqVHiCnfDw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.cbbadf8.0_1642094182449_0.7052406641920581"},"_hasShrinkwrap":false},"0.5.9-dev.783917b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.783917b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.783917b.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.783917b.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-v+dKWOIPWNcO4PQq4RHKs1iApfHaC5n5AInz//58ZgNjpoHgAwjZSnChqnp584GaWtY3Pq5cC6l+0OkgXGUIfg==","shasum":"45fad93f4b0a43e12fa02480c701a469ec15a29e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.783917b.0.tgz","fileCount":35,"unpackedSize":1001282,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4J6bCRA9TVsSAnZWagAAcYMP/167qFBwH8dkyYuYtbck\nZjEWbzbXEWZECBWBLvAg8sv4C1AbzEzT7FHKQqOu26k6CeAH3E60Z6Asux6W\nuJkNlJ1N748Sfx64DPwfiA0Jhl0Sb9JAHV1hUSaBztS1UbrcfJUGGbMWKhP7\nLxgqQd+SRky0ZuRF0eX92Vr0p6nohYHaFoLmD/lgScUTRPCDkSobnJHAcr20\nvQY2fcBVL7l4qwFd0GZ1Uve4dPKggrRLlDxyNDZJ0447Z3Vh3SIoqZzhiz0M\nk1LokF+fmVqmEFBO0VtB+gXixbe38kZbaCHoULj/lKN3AVBl2K0ptVXba1I9\nsiXJeKauAWp+BulNLnTlQ5pnR7AAY70jiQrQ19y5dvFL9HZ6yxtETYevFwRN\nhQF0fxP6/JAdcaXEU2K9GDHtPacuJ/hz+1124t97iW/mr+W8UoS8Z6g4IEyx\nH7tS2hI9S6YzwDt2/1A7U6B1yEMqMjWGJG/PyYwPwOrBC7wnA4kzDxN504WW\n8SGexGlFadyhDny23Jp7dScq2V1tqk33W8YjIHTwWzkCpojOAaVSOwbC/tNv\n4cdYkKLUsLNtzXJmIlDhiWrkifhAX3zlP0VRMIWqvLa0zUZDOt811fXVYipa\nYih/bK6roSty6ZdN3MD4NGx8YmheBOz4f2XtkSXXis8JOvMDqYXolAGY3mFu\nJl32\r\n=67wl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWse5L1u0TVZn5vcAB4xK7EodLMkivku1VALcT6uR3aQIgHu/AHQFsvk3IUsiVmpqcNrClIW4tSgFkoNaPnhff2r0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.783917b.0_1642110619358_0.5378054362580396"},"_hasShrinkwrap":false},"0.5.9-dev.64549c3.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.64549c3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.64549c3.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.64549c3.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Uv4cPWluON0jwLYZBEXjpdJ4hsL5ZpS8Wo+D4EyUbbo4nxfUkbBEYlaoE6zGWUwYNldq4KuTG9CaDCLto2HG6g==","shasum":"47bc0169a1aff678193f89b9ff7c8876673df301","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.64549c3.0.tgz","fileCount":35,"unpackedSize":1001875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4KdrCRA9TVsSAnZWagAAhFIP/1R7E1I+LnNmkqrIW0B+\nvKAFzDij7Q+t1HQD1fVh+FV2LJF/CUikvZgd1pMc9F+5VM0UFDSv5HSI03kU\nRDjV2wZd+WQwgCqF9TgaZ0y5fGgKXmCCf4HKvDroeTK9XHCULaC78zpgXfFj\n/IdzrvNzS6JOaoKLCWyt0J0yAh4lMEVXFbzP5lLx5VpJelqMEhkDulwFzKYx\nUylO2BWtyJQfv4v6i3rYr1TBQlPdig0eaPkG4xMW1jlH7cKe3cjvhIJA3FqM\ncNQEJIu4Qlz8iv6qsn36JpzW8DnaA6ixuvwDEa60ejkMmz5bJOje+mAqYpap\nn1OQ0a9f7Flu/AZfBeT78WUKl9OmWQVnwIRsYMk04Rdf1P/DyiEIwnHZZaNg\nfXl0WTA7r62y5su48Pk0snWtd9PkEIFR6hn5LxpPbQ5Dpbz2VU63vFFiztwO\nny/D6KPyfyXf2igRuyOGmhDD2NbMCZLl/bk/gP4Ew/HqRiVYmaw4m6XsRyit\nb2WKlNnFVVwa3tI9wa3S76TGhhgEZG+x1vez7cSCe2grhLQqBfvTozieBoAA\nHxfV71x6vVMwOiRHy0Fr9VmjdJZFPrZHcWxicCLA2+RLcXV0rPuUnrQ13Osr\nq1R6rgIsMtSpO4Xpos83qp78rF0bRnTi/vWPRWnFCv7AhDsDrjMqTaubbY5l\ngUXk\r\n=01KD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKvlOFni+pZGyjo8Jr8nq3FsU7rnxRZ7L5eo1pWGVNnAiBp7IwZ/wgzZu0YUYVXHyCa9mBUQ9Wby1srdGX9MQxTjw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.64549c3.0_1642112874885_0.36475047605157807"},"_hasShrinkwrap":false},"0.5.9-dev.3f01c4b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.3f01c4b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3f01c4b.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.3f01c4b.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-PbPs1ZOD7RFR0It6twOsvysIe+3o5UX3PX8pmC+ZrlqF5TpPlB1mGQhuz75TybiEJUQTaEiGD0/BnGEfirOogw==","shasum":"e1116d01f8298f11c4eecc9fa579f364a8a5dbac","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.3f01c4b.0.tgz","fileCount":35,"unpackedSize":1001875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6pBkCRA9TVsSAnZWagAAEssP/2hcRJeaXOjZYMcGrSHR\n269vEcwpk7nISuOIbEMq+X5r9nXYkR/djn4FEu7PZi4epZe+SaKwsvN0fKLh\nx8nVBYjbrlZo3xuU/5xUhqiNZ3BOlKaydgIF0UPMJYh5D1RxMshf0VQqbdQs\nw4/fbtcOShuz+DM9DIRSCtuz9m9eWRfwdwpWVJ0VCP69bjCgWtZS5E+bwoE0\nF9AMcay+sHilHL5lwLrLslMzfRjtiiGuOBriytpmGHE1LT8O2xfQJ8HEyQHp\n7rIuJC2OO9ljniYoAn+bHTyhSahrEnMrya4DLqurqqV7A6u543I2QQw0nC75\nsC1IfW0ANueA3JKrdRUeLDObH/7wTrff+28YOu64BGgRP5ixo+z3RWDASE5U\noSxsHPPyd4KqdABK+xCEPcig7Tyn45AA+QipV32okaM9NKGszY4hIyDseTzw\ndtLXbMEWJPVmJ9d5z4dWLpu3BStw5Mygwn9p5Gaq7lLRiZj3FlUJAiqaS9sd\nL1QOrx7B+lKdZSaOjnkA8UF93rQ/eqAa3VuIDwhG8Jwiz/G6q7U8W7uKtfzO\nZlzQi+Kcz01SW9avoMcXFDJSNrWpXinBPyiI/CSEbSmWyDnPWVJRToD90gzU\nG2JVUgmR+e4TjmS2RLp1wsVu9aET3lW5lv9KcMGsIX0V4d7tfY7uVOvqFqXS\nT4Eo\r\n=RYzB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgoc0cQGtFGlqPasWvEf7mWtR9v1dd/hWUvg8aiSJkngIgOLLNbzH6AflTMXFLiTr8OIjX9My2xctLq/v0D2gSLPs="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.3f01c4b.0_1642762340151_0.27436710623950233"},"_hasShrinkwrap":false},"0.5.9-dev.beb2240.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.beb2240.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.beb2240.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.beb2240.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-wKnqYnS7HQoEKDHEHe6d7Q2SSD/XVnw7fa9AdaM5HC43PTa3QEV/wB8X8xGKtatVyOmzImXGJZGvgj+LzX4nzA==","shasum":"cf0bb93b7a062356a52fbfc08e64aa536126e3c4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.beb2240.0.tgz","fileCount":35,"unpackedSize":1001875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6rk4CRA9TVsSAnZWagAAn20P/2yZnZvZpEVQtzZRFLXu\nK90dUYPARjnoDzmYJ5+6UkzTcgYUhHPtk5KR9ZMKwL+Wd+RQC0kjJpLzOHUy\n2NCTalqgT8WqI86EHo5qCTTYyH5Jirli6iUvayrWgVupW4+qqJbWHdL7/pH9\nyCkaroIrD7PbwRONDCr6CpBL3n+fXeDLGfJUssIt8GIcCNUPf6KQijEdVxMq\nZhUq1dw5sO3N9pSebvlNVA6ODdXiDG9gdNyYrHlllK6uw/FrVashkw9dLho1\n9Aay5k9udLIHoZgUGUXz8lxV3sJ37/gGfqCNesc11RC/6CVavKTudTYT1yjo\nyN1noynQJ0QblTJvMQTnvxrF6/n8HRhkELDEuPELO9CCK8p3JLBUjIvcC94l\nakoCYfVHVzFYRJBSpLkXvsfyVDzJVmF5TwFvV8E8zHtY6K77uczZN3lMXilq\nWhFV+RpG3vx0Q0nOFFoE6aTO0ufHxZ5/iOrSoJ8CBCmGrmqLYSBhuPp6CWBZ\n0eUSEQTSUiPu6KYjJ3PPFd3xwRqLTaDXiUIBXOw5PJjZF2CDxOjbNlM2mP/h\nQmbdawaHSLZQil7ak+ceEHw55xu9Jizdac6JXP0KpMnohXTzIL+sBo+8eSQQ\ngxw7ImAyAEUcHc1T+8Hzv9reD5DS9lZ2jep12QYpcFJlH4f57YU1cwyGF2ej\nu5mK\r\n=Eggr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwSvLbkuJCFpDZgp+A0uOecYn8tCG5CbqeZxh4MVZyMAiEAlD8XV0xwyLX6ldJXJug/pNOCGfXLtONBfURdpzjIjwI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.beb2240.0_1642772792578_0.3009566583679488"},"_hasShrinkwrap":false},"0.5.9-dev.c61bff3.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.c61bff3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c61bff3.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.c61bff3.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-JUhSwoa7Z/3RDaiJONMRoW00Mjx/TDqL6kyS6IWXT3FjgWiyd1KSO6xRSy+Luuf/R853fjDGkCJaIisvIrRmww==","shasum":"e459935b32bce0dfee2af464ecc9b998f10d241f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.c61bff3.0.tgz","fileCount":35,"unpackedSize":1007406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6sGxCRA9TVsSAnZWagAAhRcP/iI1Bt7easl1MQvbky7P\nStDZkRLpDxBWeUMAfRBV+dn5QRWWksD9J80uxkS1fptUj/fmwfSM3EGnwaY/\nUGtj4kpo89L7YaipJmB9OE/lAIQRDWMbtfP81cQnj2EesRwqcdSSMPyssUYV\nTFZ19uSDNAPXaqa5LK61zJdqsMPLabNTHbS0VJuKYsx4+Ki4UfsZrYzhQADG\nq2p9hfOIJ/e8dmGiLKrLNbuTts77hXfeF7MHfLokizTjilTOUaM9ORzf3Gsj\nVoOFsXmCtfdI6ujXkVerUKMYj43u19J/nN3sVMSDa2aGnHirlV6ZRlJQ3OhX\nBMRdfeExWEWZj+YryGm1jWq6fjmtZVcvPpIX5isGcq5SomBIXkC3bKo6Oht8\nnA3d0bIcr9HR6KgDKwL0BTfmCkA2FK6O4SV/+cIVYz6MPtHGImpogdgQIjiL\n5W+4utSwbGe7GF/xhjD6wuZYxTGYyObYO4DeGklug7p5I8c1yrvjsbVbX+pk\nKOUfmta9N9sJBuy7ZHW6mlMT6N9m9GGtQQc9QOyfGQE4MlXyFK9KuhI7vFee\na9Qrn63qpoQXdggo6dcglDJPteMMaaPf2p0LfQRjiJ+I9F9CCOrwFJXiuIhn\nN7xPpNL2MQrA5LCCUtWFQFNYMJVlcAvbtrMm0tnTKsKbbqapw2IFZ39LSrAR\nP6CL\r\n=E66E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDEVv6bYrUVXJ4nAQHdoyXgGGODj5EZMgBvrmeaYw6kwIgeLW8yHbdrRh0dDZCBvOpnHz6q1z72iiOWg8PE4FkVtE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.c61bff3.0_1642774961568_0.2235126936977394"},"_hasShrinkwrap":false},"0.5.9-dev.652c1bb.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.652c1bb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.652c1bb.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.652c1bb.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-TEWxrb4Fif/Qd7S1+NGb66IzlVBfCtExKYf/C3O2MOUZCCEVLmGFyfY0KpgSLYVEzpFIV/3cpCKtSuYMCd/iJA==","shasum":"de5aba26725da1b4e63b53ff968dde28e1e5f26d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.652c1bb.0.tgz","fileCount":35,"unpackedSize":1007406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8RTHCRA9TVsSAnZWagAAfnoP+gKFFjRsC/37JgxamOh6\nzdG/2rM+11LBfBy29m6+1NrApXydgXMYHKwFyV+nS6mmekNkGA1wZmCrcu5G\nE7TqGycV5J80UYw1X5ISXyq+96b9TodJvnuhxZlR0NnzwA5O8nOeYXXyPjh3\nXpu1hY2/3WJwprn6TP1R/oYekgYFKGx/Mf/lKrQ31kJWUc8FrdMvffgIcoDH\n9yvGYeYMapjAADKhA7qmeRlnbZhzyb4OCsbqrrurgpuFkNin0LyFwK7fXvw0\nzuxATx3rRyoe9lePk3+2ws+wNAYiHyId0ByxcwpmBMSbGGY1HxE1CSeW6YJR\n6jH5IaNDTDUzcqE/cak5IlxZKwAu/lk9BNFNDXhrZexPLaIGKSEqL48e5tVh\nG5e17er9i5+g+yWV+Nae/0QP+CAgoqurMc/LoIf7P9ogN0XxIr1aXHUOcYtx\nL5yzvzgF33ZQ74foh5s5ieSI0mgEF/bJbKUz/8EFPRqJS4cKUvxL6C0/aI4I\n1bDnUUZNcM2UbwMh+I4q5r384caFGwsyLbYYjipHL2lVLG2N0DWUFZSlLOIw\nMbUus6p/WdKd+wBda9jwCFJoQCJs3GtN6lMV8FKzAASNO0sjBFoL4Z2o2uRE\n6mQea+Fep5Nnh4tqCSxKWVFA30PUNyoGXM9pUl86xLxe6A6Z9kI9R3AlpSJw\nJf3u\r\n=2yub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9WyO2XTGMrpvVwWKudnaI1bvcWr9rRuHJ2lwY2X5ZcAiBEz493X35uCHbvwiDb47mKSkDkxsCtqwD4zGXiD/DZFA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.652c1bb.0_1643189447455_0.1590293562404752"},"_hasShrinkwrap":false},"0.5.9-dev.c3aca57.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.c3aca57.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c3aca57.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.c3aca57.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-YnOGadJz1LcRNqnlayDHqXAyyhuc0RCKofiCZFVMs1gLv08WstO3BEl07XZNWBXTLPMtQ/9c7jli2Co7bjA7sg==","shasum":"9a6912f05771adfb60b64e45e11390e64b979c2e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.c3aca57.0.tgz","fileCount":35,"unpackedSize":1007406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8q8pCRA9TVsSAnZWagAARaYQAJOyE7FnGOajMKUtSb4A\nOXejvyyn4vYXzwdwRj7nnAvEBl4IQl2oTmjhJ3MMOdCDe/5aOh9mxaQaDsax\nUPpj/yNpWYnZhb+oDyfO1kGA5ij2cVTNF4FAAfLX3Bjx+vJaumJcMiQ7a3fd\nfwqTyCQ1T+/K97/OVOo4hOqcJXtfA2ACL3NKAxyWf6C4/hxaHGHyfUt8Ahc6\n39+Fk8YNqcGamrCwng1IiSmQdtB+SnyfKG6Si9F/Bmrkf+2J4EG4BQ+4Bo7v\nA9KjFJIcs2DtJOb2lHIOAsIKONeeRZRJ8XLzLm9JT7PNphGtdwcs2CAFA+91\nEN6Vf8x23PcK4mFAPFiwXE8b/+4EdGAnUgLxojOH7Jug7+2k2Yp+UVQUi/QR\nkoG+TES0+7PvucGAyxvSfAJWxQ4k9vlc1iiWVV9dBmfKSxkXCHIZyJ4U/e5b\njFdyjpnf6kNla1BL2m8XOSa0XMUmuqlnDMr1nDRgY4Fk3FFHthdmDWZLq+cv\nH2hGd96sDnUbHPqgMIqQAZ397NQysYq/n9/zPGYjEOLvrbcjpQ1uyLt7TFcu\nTaH3A/uet1VDsDnXz7Z80EhGpTOh98UUCaUgoqtT8q4HV4zyWG3ilNOVrH4w\nFQhFBW5YU4Sp1Kk3UuAlq4ucFFt91tes55v3DF+1kNw0ZviFga623ctyUVCU\n7qOn\r\n=L4YU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGuS9TW4ylewmfyMnP9XgvpTOY2S1Zw0aUI7ObtOXvHAiEA+I0cF+MXXh4x8iijOTfZ9N5JpaOyBnJDzPy6EVh4KLE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.c3aca57.0_1643294505070_0.38068883477674587"},"_hasShrinkwrap":false},"0.5.9-dev.aed3593.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.aed3593.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.aed3593.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.aed3593.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5T7NfKJMZTgCw4qJvfcR4eNk7YF7XkaiGYpKkVbVY/UCyINWTV70V/wVtSfoOqVskqGWtx2D25tBbzZJ0EsC5A==","shasum":"00fca52a28271ff2cba5da72abaa737ac013c622","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.aed3593.0.tgz","fileCount":35,"unpackedSize":1007406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh88R6CRA9TVsSAnZWagAABNcP/jXswWUquWeW22pT2tQG\nZ+JibDvNg930oQtvSEM5lfeKl1HyQi1xl3A5CrYnfXb2ilGQFq+/mI3RTHnm\nVxxU9sxGO23rMSzxy82aZB6GEQBb6hV3ZQDlatw0vgq4M7RVj4CcKIkd7e1p\niOSZehf/Oh9JnTXu1adTdGwrXDxPhxbL/hUONyFmflL1qzP2Ah9XaxwQ3nDB\nTqmaQLP9Q8znoggqW5h8RcFtX7lGG7qC2n8FAaOJyuesJUOd1jQr3xw2mvBv\n5oSUtWyML30jMeoHm2UCCMfoSDJIjxH6OPOCGSYKc3M93USRHjinkFEF5LvI\nkrGLaYcG5Is6PtgZae7JTO1Xapb4C3zLysODjr6OB0Duo16wOoSTzs60qaQF\nKA/GdiKUSUmnpYhlBkQuOYuYYmwPftt+37+WNgmQ6nIpsYUnPhdjgWQgVzAH\nXQDauSRZMeg07G1zoAs40QAz9IDlsPcyGmrajr1YL8KuMvZLhNqouk1j9eVt\nNl1Cf80Y/bllT22+KsXdqScTofjZp2X4UEpmbRNdIH71hIWOZZCu37f3y8LQ\nNzgaQ9LAfA2Qi+Vh5CR32W/tMhadJmSCXkp+r5wMBQHeKMYFQ1sC/E7M0yNy\nvjYJnu/hZxQxecbPaZVCtf5UJ/ZSZAfxBByb5IqUsWZ1b2F7Ky2WoFKAujL3\nzdRW\r\n=XT73\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXbA6aS7kPTdBlzgq3DA797MkDq30GmblvI3taAJxMpAiEApX5WsYOB8pPRK9OHkuTGq6+TR06XBA/Jl54SCLXZPv0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.aed3593.0_1643365498813_0.8875310499237559"},"_hasShrinkwrap":false},"0.5.9-dev.60ecefd.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.60ecefd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.60ecefd.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.60ecefd.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-YHfazsuUnpxdTi98CGq3lFVvL3PlCO9Mw+xQ1XYvjuNadairFd2LxATswkJGaf9MtPHUZD9QHY8zR9zS3QXUBw==","shasum":"41d8d616b2b1d1743aaf5f2f88ebd802e3127cdf","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.60ecefd.0.tgz","fileCount":35,"unpackedSize":1017939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8+iICRA9TVsSAnZWagAAwBYP/1F72FrTlHrIEn12lUAO\nvei94YEdXabc8eV1Zo3F6yobBz0i5hZM4z5eut9+jZ5wnqaOGquoKwy2vJqE\niV6YnsEAjdsiaOpHXgD9nOZEqiICss6rlziVlfRIYguYlEEE1oPCFUPWRdtI\nhd1Wf1s69sI/tObSXCwnvYu8Sk7bcG8bI7gjWZMJaLGriL78cLV/D6PqYseP\nJfKrSL4qYP6b4U85NM5KbQubSOFzKuNHpstjOMwyDai1VuCJ9VEBiBywGXRh\nsKoR6TN+mE+dCeTQqxsgyavFQunAgvSBP5kubXc6yRkjj5m8EmCVJ7lZ5ZId\nMDVsScr/Xd1WiyapR0oIewri3LdYTApOLHG62kzWnQ0jOsrQvNxFmvQiAQMS\n6VKxIRpP34xi9kMedSc6egvYUaeB3nqr4v1VlF95KnxVXVrktZSKK0ECLo6r\nYY8zFhDmbLkQLVKCEnzaCMOqvqtNS40BGxGXGQClXV2aaJA89YGqD6Zgsvqp\n1rwyThlPVElchN+XJ2aSSrjr1Rway6kaZBsoQtKmgJICU3Ll9KC1KJIKHb3Q\nzSRSL6ghkcoi8Mz62M+DQv2Bd59BT+usXmGx9aLQ55GSE/A1kI6OTbJtGnq6\nczHGgJ806CGgbr4cjQ7pRdp1iN8CgKgGeGWglfONLNBtWNSSTviSC7WAISzk\n+0fm\r\n=SjTd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbZk1YIqDnDvoObqQWohERqgstm4z/gO5RlVhkVSfSSAiEAy61MTz+sqQ8qTxf6Qp+K4oX8sFAv20zCDcdwn/czQTc="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.60ecefd.0_1643374728682_0.3104159658821706"},"_hasShrinkwrap":false},"0.5.9-dev.dc4bcef.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.dc4bcef.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.dc4bcef.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.dc4bcef.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-uyVM5dzeG3jexBuwK15zyFxEEEcLdYQU5xC4rp7t4rOL02/NhcO33K6GlBtqdGOA1dCGZjvjF6Nfd14wGhdy4A==","shasum":"31bcab857cc8409c32884c5da0913ad86c580223","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.dc4bcef.0.tgz","fileCount":35,"unpackedSize":1017939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8/7mCRA9TVsSAnZWagAAY7QP/jsLx/OJ3AAy1lJnnqM4\nbDnOHpItT+b0SLVWiLDT0mI+/bpMEpJAyBXHghc46gnRS74EfIlLBlyzJ4QJ\nLPJhSIYqOauPanLI/0MLkrjPAdHeO0GcO4Q/RuGomAp4HfsxbvKY5r5qsV+n\ncu0VOpeHNnLx3HQUYOMUoX+CeGK25MHXxjx7+lyvlHLzhY70MauL022ekzhM\n2vADrk4X7v9T5sYJSO52G/k1XWalt9Os0GyVg9ILsJow3VqOd++90WLAkred\nQVejOMUHD0b4Eae5KboTEVHhEBb5mEKyPNtrjvB9EB9s7EmrciA2JrXdExLV\nY2+dNAi/PYe9lR5daYtXGs6QpN5AZYWKMPzrDDtwYycvOpGlWoZ7EaQ7X7uY\nY4lPCKF1Z6IhE8Nlpl1TzJckk3oSjuMA5WCTTndXbR44CV0Qj2X6uQKqt0VM\n61PEbpjzqH496oQvgt5AB8LxZ6XnYXmk8SSj4GdFylk3OFGLgI8At08K7DR3\nSRGHJk3x0Cc1JRw12nnc201JrNnHnho7hvmXehySBONk4/hWJSaKKSJqiojr\nC+LnJ4YQbwrGKkMfXUsPw8Zzq0s5JKJk5TiPT+jyMKJ3+DysEL9dSz3w8C5h\nts6A/mxh0dn8iExMII3KWWZ62hG5JCyBVoD1h7CzjM+puLWgM3eW0OlPHcXY\nB8DD\r\n=THPQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkK3dpOIqml1diPdVK1JRr/Z/dmxH9gzhoq+YsRcnVMwIgZcwA58dXjCTZK+M97YRUOKiEiQcBYwEb1PBhfaE2s1M="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.dc4bcef.0_1643380454814_0.3670723645170688"},"_hasShrinkwrap":false},"0.5.9-dev.ca5a00d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.ca5a00d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.ca5a00d.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.ca5a00d.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GAa3pKlTFOX2VXj58IL1OJmuM05Exk1pYLiK9AXPiSqbNF2xn0Xi1UL4frpPZs6wRzj/84Hoc9H3nPRDz4ItRg==","shasum":"6a63661ff9428f5ddfcb627e1e08883f624d9bc2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.ca5a00d.0.tgz","fileCount":35,"unpackedSize":1017939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9AvRCRA9TVsSAnZWagAAEgoP/j1g+I6xXcXhHFOlGZvu\nMQM5efI5BfcLGJrW5Nh6hIwM8+nWBG/YVI7YEVNnfp3g3NxPRpJPSgbH2lu0\nL2In8FkQ0ZMEohW1sDEphe/0jY9mXFquRIHAKey5W5EQa0Dd4UEG6wJ6FKcY\njKCiZIgVSraUAu9Q7IApRthmvmL0By5U6RhhjBF1zU2v0XnM2O8/m1SjfqaS\nOJjp9QYIUhoyk5fNaNWp1P1sbPSifgXM35NdDvQFh5d8k9JhzgTFflC25dG6\nUKKbntsTKz4GWbVLkzh8Nfpb83M6I8xVcvQJvyMvteHejMV9kJBICdESQAvO\n8BRFzH0RWthm7+kr69nFCC/6uavM2fVzNC5M4DPw3y0v1s+R7xcWpYObIpLk\nHcMoP1CQupvV584T8taD6mIz2qbELkiEIQY3kioXB4Ehf931lXaTtYC5SIlR\nx+6+m566WoWtJ53nrtxSq5Oik4AH0ewoV8Jcn1aia6CMk+CP2G+82q7i6VZ8\nKmhoxbvvb4bJkKE5bpMm8kuFiGJMYqLSsGSWmwrRnBOmyhOUA4gRrqRfuQus\njncE8UV3GqBD611exTY+ThDF2qDn5Itg5mmUGwTxljBX9NC0Hu5UKeh+m+TY\nF+MTHrO0aBmUqrX8lH2d+qMdIOMbnpBpGw3e9/U7Jr+PGaT6uoMzcJ36H/SF\nMIdn\r\n=YNLE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDxHBaWKXpHH6InyEUbXvI6eLOhiLhJWA/4gLbCWUgSgIgZ5j3s+YwURCC465k0u5wlbz1+Kz1c0aqQeW3Wr+GbYI="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.ca5a00d.0_1643383761037_0.5733036936880751"},"_hasShrinkwrap":false},"0.5.9-dev.7d85443.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.7d85443.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.7d85443.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.7d85443.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-hb6dUrii11pSbecbOn91bHIgJh7D6XF1wlQOmmvRjRAp8dgmuzvx7RV9AagQUxG/N8yVIpVGgz8GU/slaryIkg==","shasum":"c557c2f439f3ad5a206e2b840579467a13f82744","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.7d85443.0.tgz","fileCount":35,"unpackedSize":1017939,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9CuKCRA9TVsSAnZWagAAxRwP/jUlk8/aXtKQA2ZaGoxt\nekYJsiJYhsqwCeMcjDpk0jmncIqPksa+nPiu8/w8WghlauZtVrQ1cLuDf3st\ng3/22Oa/XefkqstCl1jBDk1VCTsc01EgFBFSaeXIQmtnCxkvOLLmxvsyOeqg\nOlmz/HOlvCjxB1y28xf53ur31ep6mJQ0Eyqtmv0lq9Qbl/K0QP4RzcO3XjuL\nE7IDcrYSDy/QfOof/BqdiXThH37ZtSxpyYwUYNbP7rSh0qgpFxUGVDXFpwcc\n6MMLD9dr+TXTGGgdqHn1P9KwfMhCRK0iMW8KknM+6yQBaV0JnXhhFXWfiIX7\n+4WNj2lLOC4O13oDG7VQtptjASn4Xdp0uo6AWl14jkEYj6OENBu5i5L0hwqE\nozT+V4Uh7XwIhLjmoa1DhYIRyhThbD/GDg0/0Gac4dw/6aNVULrs2ZABG32Q\n5EfBdL7IQAHUSRBp/QJw/YjqSPrXrA3LkkQL4OSdsEYd5+6UlXWahyq1YVp2\ngGFUTduSgHnyt0AVjoepCzkxRlnEzOeTADu1jh3IeXZnjQGGRxTZrG3jRAQL\ncsBPLelSqw3zhSSD0lcN51OmOma6RgqL0csQjMsjt2Jm34eePPWnX8B1OxRx\n6tmaDxxtEp1EhwBTclU7chpEU2YcHGEekLaEscGRmF01gP4jUW/62TiMX1OD\nyDMv\r\n=Pyek\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDi3A6yF6dDzul6K7QYbuGXHw+hUiJwSCLoM8gWveKW7wIhAOrLZ5UklBNrdWI5RHuqb4uqKA7RqXjCjDutSuMGuoFz"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.7d85443.0_1643391882442_0.983331052905152"},"_hasShrinkwrap":false},"0.5.9":{"name":"@superfluid-finance/js-sdk","version":"0.5.9","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.9","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ri0JiA+9/N40juoJjHR8wbIr1KuIhPQ0K3VhxLiQwfdxpEbS9Ub+JrfbpUkPpuLqzo1ZHQ5hhrRpzdo9apxrwA==","shasum":"7d8776405231fc3162053c8c93226980f0a4bdc8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9.tgz","fileCount":35,"unpackedSize":1019013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9DrzCRA9TVsSAnZWagAAi7QQAKRX1HUArwE8E9lR80d3\nPZSGwWMwua3H9QAVQsOjSAuq0ptx9ckHewSsYlHutdTMffPz4Oyh0IgGxgpG\nRGGE/+5qPbkvMcKeWGnlq9vVRiH4lXlvl7eod+y2URmtwLT6ogcCQLvD0yGl\nsX3nnvpw8HLo/OjwKjbrHsAiM9kP0KDvtn57jY7299+amZowjq0q63axqfxc\nHEyHQ5i7582U+I9cbMxF+8XWTRSyTkXs56qZR8NgxrjIMfHcJbFvbl/VsjzC\nKvwZH52gUQ2DPwhiqXfnr3yBj/gu7Dq185OL+IReQwLmxLDuv+TnZKCePUMi\nfnv656gNZydB+HItodHJ8OGIcsvyK8RMHjJdEmhdEh9Y7+Nya1G7uvb03aLB\nLpt89/p1wfvFCWzAVTW5h2/jNOmHBkfekqO/mCLtwEVvL4ZniHH526TdvFMU\nRJcTQYvHzhU3MaQ5UYwZGrpE2ib140zdamDZORLq71DdkCYGGvFCCY8CNo+P\nuiRAxJqr63Ku/T6kwU6L5HNKBq37OQ0ZJMWyzE2tT4CSpAb1LAjbXX+1fD9D\nuFj0jCDPnkvuIOadeNBhUk5IZVL0coZ93mXhvJHPLy+TXz/JtuFNxApPZ9DI\nmh+M9pNmxdSoDP5t+TxTk5L6IfXuxPMx7uzwObNysZD8592qBKFPR4hKHy9B\nv9r2\r\n=1z99\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElu1lXVSRj3v/P3bnS//xTpCM6nSOFr9Xg+OE3nEQ7IAiB4NXPzouSoOvOYinMWQEyDaPzQLOtmwUGFgBPHukcZDw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9_1643395827142_0.5998134401934243"},"_hasShrinkwrap":false},"0.5.9-dev.1ca1d14.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.9-dev.1ca1d14.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.1ca1d14.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.9-dev.1ca1d14.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-rR4eWI2eYtZg3LKcONeYutaH8Gucj9siH3QxDBIQqVwRAjpoTXBI1nrhrACISbaetLjjgztHgisZFo8wx8U00Q==","shasum":"0e8bdbd03a163a2ab5b6c670466ce16efb82c293","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.9-dev.1ca1d14.0.tgz","fileCount":35,"unpackedSize":1019037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EPOCRA9TVsSAnZWagAAuw0P/R2UbTRFMmcLtN25zlw7\nsB5f3h/WH8jRDzdRnT+DQhkCRCNkS7Ij/SMKXYC1ke8uZ9FDAU7hqEd76dXg\nGeBw9qdyJb+2txpRWFMB5bSW6IEapB+Npp49qGpgvSbAuk8HzynZXxGS5BrK\n65Fo0dHrS23iMy4k3uBQ+erDaGpR3kifjt6OIILPTqeriAprGotPOmk/HJEt\n9MR2xBzCjOVcz96IeVLaO+ZOYDFzeG28sEvmIZbH72SDRjWIfZPskg2H9rU5\n6iBHnOhsxM7CvtcxU2B0TbTwSkZXMkyE1WdSu7I/ujp315Djfr6pOmG3I7YW\nnp1YDSFHIYJmDUzn85Ok1QKrw9RdrwPAk3S37d+InMSc0V0XofQ0Llt27qz/\nBiK0LctKqLJ0kmGaJPJAZUMqTqp+wFrRQWAGEgqFIO/KulFsIY9ksY3Aa9gO\n3D2t/JZhQsPNyfw6ny6rcc84HeKmb/C7/VI3gvWcLYCfZ5pdYuyx7FSB3XRw\noyGeHuCa+HI0Tmxkc3oLznQgAIB+zwo5TV+yXPBHo4n8MFKgNW1dBivzChq6\n64xifso78p7J8sfuMyjzL/6jE/B7BVvQsA2AprPW6qcs0Ro+Z6Nci7mGMLoH\na/P+3MILQ/XSZJy3JXFdh9XbZ4BLRHjv3NGIb2S49yx2NH7+hd1QaUmJAVkG\nswd2\r\n=Aa2C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH4HCxaTXmhVsJiu5vOftXAA8sQiGJpfZRZS4FGmimxTAiEArTCpoZaVGU+d+VnTipytsC49TLnnxgiUsTbrI8SDVyg="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.9-dev.1ca1d14.0_1643398094083_0.7631855439080888"},"_hasShrinkwrap":false},"0.5.10-dev.4013181.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.10-dev.4013181.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.4013181.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10-dev.4013181.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-vLEy2MfK6Vjbbv/s9ZlwBLw8mNxVFnmkoOJcPr8A2dUjm12DhnstNjyMvA3SLrkMkEeOGynFSoCmbjxApX4BZQ==","shasum":"126a60fabeb79838c23361325736835335733deb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10-dev.4013181.0.tgz","fileCount":35,"unpackedSize":1019038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9EWOCRA9TVsSAnZWagAACrEP/15xC6tehmbpMLsU2V/S\n4HZ4O7QFq5+bsvOv0Awz5mQNa/+uVAiGcGik/g/9EAmlF5koQpE10hiwBJC1\nEtL246r8jHYuQ0tKaVwdZgZSrR6wtXzI9ymNfhsG5RDQNbz7Yw/hzUYUtbi4\nonEBYlgnl9wpFdMq9mSHwY9Bb+xx9398C3pVdSRBJPqE8x/STYovISOKH3z5\n2Kzzhz4vZwg8ng7HnXIqXd50q4/kIu2A04VAXN1kgzVDMR8qkJ6P+UdJLETY\nrkBdKwlfH65nRtWAFTcDoQPjoafw5/ROHLbXmT1q2Wapahy0JEWN9ZJ4mUhw\n63A7dMFwzZYQFPVE0PeIdy/zSg+TS5LeKNRSVpt8wCGTt0og0dhX1RJUElnL\nyuc9b1CcHs9aebd7rxP/uSTqjfOAL4TfY0FZJQHioq5VJdW37Ta3FgY8yeDH\nYoplB9xIceK+q2kHK3owc2klyjHVM5SdVFaI5FrL+9Ud2awswc1fKpbpKql+\nKnBPta2h3JnliBKizHQIgapy1A9FzIUVT7nRyXhnL3sNgsB3xd2DCw1Icnzj\n7YfQ8WEYrB+KMBZQHLAyAZiDHSTKHgsKPVmn76fkQSaFKMMtjPfs+lFdtsPo\nS5Ge6yAhhfyE+PoywLEaTP8uuTXEA2dTJXPRyKdLTua0ycGCIpbSsUmtTW+Z\nZfuE\r\n=2YnX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjApmX5mdG7oLAPZKgf+LfzFUgsmQjhuAqL9T/XgDnnAiEAw6yle+jjLLGE96i4xQPivoBCN/vECsUaNbvQONtRR5w="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10-dev.4013181.0_1643398542238_0.08580411874485949"},"_hasShrinkwrap":false},"0.5.10-dev.c8cce89.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.10-dev.c8cce89.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c8cce89.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10-dev.c8cce89.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nVrlCYL/dPzKcwfQoSrRmTD2nTw4/qELlb5XQH4foaGex7WoVpDU/QbNarWn0x3o+dh2Eoifd+r0zclO7GqBPQ==","shasum":"e06a9dd59518ee28b7e23bc054dfba39a7f5c9af","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10-dev.c8cce89.0.tgz","fileCount":35,"unpackedSize":1019222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9HkKCRA9TVsSAnZWagAAYQAP/2q+YV+A9ghw0appcXHM\nx6/9UKJw23PVr5E9225h0ZimsRRIt//NrHVNzaa70mKBflq+wXqhhGUb6+LI\nr3txWtSSWdJ7qkF0sNsQysUqqDGRu4enc83QsuhZcAIj7ityhBnHBcl4o2nZ\nIPVxSB7i70XfKQxXHDsOVlUCPnCU+n4amc1nqvc3AQr0cZ/Ir5K4HxslzJoC\nC1BLrir/tuBhaQfxtgk35hyy4Oe3eyB8+UZu9DqXJxNdXEsPxroyd8ZdwWAx\nb3Mu2pNccufREpTxYMNLSCXWVwXAwRn7meuHTAX4WAvZsfHqn/RsML5jw7uT\nimp8KT5JwAwhLQywQJbDMpBurz2zj+1Unv9edMdVEcJE+f5iZUwsq5kvK5lJ\nmFkcx9wkJ85ea6EzVrMovJqAwSXhb0g52gfcCCEzV6giEHPa7KBSp2MEdH0j\n9wnkvibnbgxXLWDelr55j80ZgiKJDWO22Otcs0nDP9KyhQMkd62NJRexwV/e\ny/BMyNG7lCqA65r2v2TloX7dZC6gbzEe7WgPR3QbGglP+4+Cp8JFE9E1FrSl\n8j8ora37bpc4eyo3jbYW7tnq7d/vraQhgucGKTbEZi+1hyvIFmfZWRChIsYX\napSXfyyHdAAXLS7VDGwy2vGgl1fFwRntv5BypWsG4a9JBcQ1ktBz6DtUalol\nMf/8\r\n=NbVn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvxYX3flxImDofOIJe8QLJhK9Mu1MMvrMDQVHwe80RJAiEAq3XHNWqI4p9qpi3eJNHn2zQxuMadO+ACVb8OzBQteeo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10-dev.c8cce89.0_1643411722483_0.576088128720539"},"_hasShrinkwrap":false},"0.5.10-dev.c22ed1e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.10-dev.c22ed1e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c22ed1e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10-dev.c22ed1e.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5pw3yLDSKdVrQlHPcTptkVRNqGUrFKIWggz1lJj6LpkN+8ZPxhoKgSUIDw1zSdTJvutemk8ydwUd4BzRmu2Pxw==","shasum":"2a1cc7ce1096412a4e8a943ae7b06a605fb8b0db","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10-dev.c22ed1e.0.tgz","fileCount":35,"unpackedSize":1019222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh97rYCRA9TVsSAnZWagAAEGIP/3EW/Hhhm+qSxPvnqqJE\nUdIMqImXxMHWVwPpU0BcZSnP1ZsGRKH6hrAhMoy7Kkd05ucMdb8GpN6q/oRr\nitd7ICze1PQCnoOwWT6DEiQdxw1ymiQpxwkjHuQOcl46TpncjDecJQvEelvu\nGzRFfCIrwwdRjbD1ETTmVcw8ita4RMPRjSyqqZ2SX8UhE3fDkEowYYZKhhEc\nN6S4OyH6TxP5BPlppJHCaeIw7EvqkOCSpR2poo1QJoBsbVEfGAVFlRnz8Bug\nuKoDOFdt3SoHBSat2DJuNWHC7pc5R4J2IVwzRzhCmfTUDYclDDu/Yk5KX73A\n9OPB/ZKRzlwShH8zo4kpGncR468VFqq54+4vUxxhh6YLyuk2CZ0C6D+NGvyY\nsDArhbCWHe31/1XDuEFuEwPQ+0kydC61yzt6xn9HKIWF2TcxsloXSM3+I6AN\n9oe5/iREBLEx9jN+cTfjARtBI0y59ZIpw446NqUUh8g05zuEfSqF5ay0Me2s\nZtSQetzIWm84WtZFvgSdr++5fVKL0JNuJu0KrqcQsiIdjAZPS5wilROaHgj3\nY1esqC/h6Jxxtnv21ksioJaypZrUmslRWvYWx2RnXG1mGwzlWQsxCjk0JL8x\nbETehgh5jU1pwsxHzXUVzg8uRVEfA1gIRHta9v31QBO9q1c4589a1A5rIRBQ\npGMl\r\n=jjd6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBonLgX1sWJ1xxtBejmYuTMO/+33fg+Jtcu8bKj8Di8AiEA07HONsVsk1sff5OG+zofXrVaSv3FY4CCxp07K9xrGbo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10-dev.c22ed1e.0_1643625176010_0.02115085056827981"},"_hasShrinkwrap":false},"0.5.10-dev.8729be9.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.10-dev.8729be9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8729be9.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10-dev.8729be9.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-wFBPHCTQldCwplGOBkGLJDMsWLDPNfbkB7Xmekwu2JhGn6JAmzL5h+XXyGGJyNx8y+gbL9jLbaaJyIfgwu448w==","shasum":"1f095fda9192159fad0007c53f6e91369bd2ea79","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10-dev.8729be9.0.tgz","fileCount":35,"unpackedSize":1019222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+BKgCRA9TVsSAnZWagAA9FUP/3WyK6YwpDBeXN+7a2Dv\nt4HFh4aCyEd3tpfPuISYYOVeyWerb/xm3bZp2iII/qbujqBDM9iDQcuhvddu\no2yd+W7XVw30XwSdqh0kVxBQLNcUtN3dXG7Kau4Jk/bl9LQF78Py4PYVs5tH\n30Vc8gIzbFWe4HzHteitFjHvmKoRhg7ErWX6Hhvz1XnaCJGWkbJCe04GIbRc\n8sPiHG1XVIepBHwoxoU7jx+6wodIVxwyQ1GduxJZt55QX0WQul2XlwxG1cO7\nmarVxl9cK6pdJN4pIz7ay5ecIWQPbZmWa7LW4AJPdMN76dYjU2UQVNsF3htG\nGzjU2LVMfWcdqd9LxGKjP82uItWiVCE+v/C3A8ZZ7hYV3aVDcJ7qq31PH4if\n/SPsHCv2TBNRfqZfZ1zAubt7PYTfoCSTobOErUN9WP/NXzBn331O7R7GF63r\n2ImIFvIRgdq33t9RrMZcDJPU9+zBd5NLA9Ayojme+U+GTv8f66jtxoyCiTC4\nJCxYeXnZHDxGuHuKw0Kz8cOG7MJc4z6V11L3V/bxQjFIiDXoBX6ZcIPj87i4\nrW1NwUgF3qbjTs6l9oJduTA+GrUjzppvPcttm6hqFMfw7JUisx/b/AXkEKE4\nr4sim+tUdwJi/hIdsxQiotGn2c3wsqSOjd5x2vzq2AAZoWIVoMfx9WeRsMyh\n51kg\r\n=3C6M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzZ8/mg3KN91U7vwntvqoSLldebOh3FnUB/cdrPRm7pwIhAPuUjZpLtPQH1gpw90w/8QNCRnJikAuhMfVWJfvP5fYT"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10-dev.8729be9.0_1643647648792_0.50561377895386"},"_hasShrinkwrap":false},"0.5.10-dev.5cd6462.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.10-dev.5cd6462.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.3.42","auto-bind":"^4.0.0","node-fetch":"^2.6.5"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.5cd6462.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.21","web3":"^1.6.1","webpack":"^5.64.1","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.1"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10-dev.5cd6462.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-C2dlG4831qvIci2bfq8d8v56fyPiZZOZzvpfBo6mwkKZWZUqgqy5s0y6aHRuyyV2tWmZ3ahj1+lncYFrV1I7Zg==","shasum":"0de4ff76188080679d9731c25c45378a462ff1db","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10-dev.5cd6462.0.tgz","fileCount":35,"unpackedSize":1019222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+B/WCRA9TVsSAnZWagAAeggQAJrZny8d17c1PCKW6NaE\npZjN0n6hYz9uMvBdyAt43BY1T21/WjM6aMI1Is1s4Ke+RqnEjIHUOrQN6AaE\nLTowgEfhFNS8vXsalko/D6XDBnYLr6mjQ1ZbEiZTgylbRB+jjnrYDquEp0MP\npYmXgW5cqLr05BnBNKBLwx0Cewks2MR7/K67wfmwwJD6SsfCscB+bwzu48SE\ngFVtdSh9U4r+10KXXjqBb4Spr86eKIhXnq8YrEqTdqXYXlA0EeVJv7mPgLF2\nuolYLD20HvObUQ9tf7uLSka+1ArmK93oTDU2ZwC4RutHyOcZbSmKkDuxvpHX\nxnz7pW6VB/rHlqgzZFnjABq8x5OKInh6X5JINoRp1blALwA+NX+BaQmP+02g\nfb/7I+IYfrW/KOo8MWDaf3Dk9RmFaFp7MqLq5lW32Sk2LgqoWLO8+qPIRkNK\ntTEEiZJQ8tHf5MWSvuU7319E42zsuqtKM1Sc+Y3z9oJ/kiXsxGrEmt+Q3ndQ\nglpMR89wF76D9Q4/1BgG2HR19HwzKXmv8qAjhYU0EM1RKsL+EWlB5xSwuTM/\nFIRiSv9zPPElAQuSgKNL1ZoPi1HckznFqoNCz9IijYcoyzjRXyd9+tDcPtXH\nkUVlxQH7wMHvdmKXIx55vpxbshx/gNmeImMfsA76nPfH0iVXbaM97YVauOGj\nHlNd\r\n=POo+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXMmImhfNS+6AKd8M+sGlAvEJkabVWdntnEaeyba6OuQIgNJiyn4x/hOGXVrhw9U66zUe8CUXlcrkBQpz5GzxoyEM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10-dev.5cd6462.0_1643651030626_0.65234272080762"},"_hasShrinkwrap":false},"0.5.11-dev.529dca7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.11-dev.529dca7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.529dca7.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.11-dev.529dca7.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2wF9mPZG/SWEarMQdT7/Bq+AUrB1TeiCPYZaUIKJ+Q6sNEq3SXtGbX+9UpFGEf9iT+IBuHtC82cmRyb7aiOlAQ==","shasum":"c837046ab9a8dc73ff2f22ceec092829fb2080e1","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.11-dev.529dca7.0.tgz","fileCount":35,"unpackedSize":1019197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+SXVCRA9TVsSAnZWagAALjUQAJh0L70JG+iAjtv/b6mJ\njN/obcql1GLwyWfACPd1Org9A45QeE6JepBMRGZ/NMmXUoNNtAE/oDpsK22Y\nK02kjBaeXsJQ04E7UfRlE1G7qvz1/fbhDtG+x9qR1dTz1M1lyYXWh+3G01Gp\nvtQhFacecSbm8sI80kMO6ABXuXgh7MWIZez0VPoSd2E5pmdFJgtUCiVpRfUF\nvVTV/JSYg8/zVrukWNRZvVbjyegb30ky/GJwHmdYSA2QFo+8bzPrGJ0c0jyo\nEgLuy0ZV+1eH706yIQ9aCM9qgUV49S1Kjxi+apASOckcE5QULiTJDgG5iGdX\nJ8Y3nefMEm8iromlrcxMV/wa7/086o5tSc0AT2eNEj/TspuODGHPdPbwa3kK\nFgGiSmH9FAhwtyJUMU62qgQsF4QYIvdYU5C4XbAP1t0onNBfOYJk3GbXIdcD\nTXy+WH1gsezYZ0yUA5Zfq9FvsMZyt4xpmybKTIEVNeLPsGRPM+VGFHWt/wi7\nbcugl6/uXEGpVmCXIGfBwfK5ZI+wa8QmebAJRvaG1QWqP4AtCcgJeebYZMw+\nCcnG7abfi+W5cIPLwzlDn9QytjAxL0+jMY7qrokyVnB7wht6ZEDWhjTl1G92\nQSO8isMl03VpEbyAvO0EDEKQEaVgEpNaDI/9l94yo6N6esTG/JzHJUqVnzJd\nDo7F\r\n=8gdQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0R2odvrSZb0W7Db1kYXepSN0N3dq984e6jsZUwr84gwIgHq6Rioh3thl2TEuKUjdam1pzP252/R2VBBCqlTDq+1c="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.11-dev.529dca7.0_1643718101472_0.5114271615081598"},"_hasShrinkwrap":false},"0.5.10":{"name":"@superfluid-finance/js-sdk","version":"0.5.10","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.11","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.10","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4HQ3OiwKAms5sEpxwIBnTZd5Y6QaIo6PH67snT1qahPd8LE0pXZAI0YtcNLGWy0naKJjjn229YJvpDMlTkHOKg==","shasum":"b79166f9599926819c5ccb63b5c1e431e66a318b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.10.tgz","fileCount":35,"unpackedSize":1019174,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+UVRCRA9TVsSAnZWagAAWZYP/2gh2rvHz8zJ7y/hgoud\nBfVSM4s0d/PXE9JIHuGmZ9JkBzpR+k3oNt01a6UuI7NNias53E1CbJtKgc6y\nkowa5IXNlQ0aZm5jtCydMoGMxAddOv5mtF3YfCCYk46PB7Mxz7OdUq3n3wLt\nZMJPNBSs/fyM80EIVBlJSt1vGLqBDoo0fEfVX36Hi3sphDrsoPvLPOYdvwfD\naR+diOANz9aQkY5I6qfUZaSx5OMoPvn/Qc/iJQtCY3EW8wVA3Nps+uPsUAUu\nHjcAmjI2Hbpjp96YVcZ6/U76RwQhjORWyCD3iU0zZSwZ/pnqtWFZStSfmQhe\nk4UbbhM5zKltGrBm5AwyD/jQLHeil4OHQGvc9aapSVtAB9ZgS/Ycas/671XQ\nEBsd05zF2qtd1AGz6J1rHUen9wjepEcLiwowfW5w3EBYMzflijirBwbrdKky\n9cawEFUs6l5Z2jmsl1OxTSO/wJVbksSGwzam7yAAqI41/uYHpMqqta+kHoPJ\nC0mMea8G0SnTCEdm+VtXb00Cz9soCIcCu2aBDhMb0BYpSzCJZG0laHcmYae6\nj/jV3WDQeuWYZ0dPHHqlYD+jztdxcF1TyXHNZXReeY1tYEoyAhQBZaVNRLh4\nMCeDLvzEU6e0rfvmTX8UcqJXvvlGEmU7Ng+gUPuEkODqxQnkfhXkyeQK8Mtx\nc6V5\r\n=JcCd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv400YUROoFpMYli4/1UO09rUTFvLeIRJ8ziYgS6zWjwIgMNA3E109B3cQo/TQyOMrp7YuEO2VJt0ZWViKWa8h+H8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.10_1643726161546_0.7381662435798122"},"_hasShrinkwrap":false},"0.5.11-dev.04f99df.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.11-dev.04f99df.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.04f99df.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.11-dev.04f99df.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-lDo0wuBR8mqimfeRD9QphT7nIJrHfJlh+AVEZXp9H5GF3lnSWWykfYIt94+XFCYsJMnH8eYWt3XU+i1+ASoxZw==","shasum":"bfa18a6acb55d98af7b94e7f9f85593c9825b16a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.11-dev.04f99df.0.tgz","fileCount":35,"unpackedSize":1019197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+V0wCRA9TVsSAnZWagAATVwQAJ906V/nuwYZu1hjI1kI\nVy/rDQGi3a0oHlemayC1QeLueTxhK9K96YEXxb507hyb5RbMv3YH43S9K055\nPhQDwFFlLRgkbazsvKs13MbYI6XRfbiDH7EPTxjNkxByBZjbIF0S8/tQV5Yj\nRfjMNdlkV/z2HAfrQd7/o55NaHNbFaxWcAW5txocGhFl4v42vygOnrgwG6uD\n5VCiuF1BAxETuYHA+QmiGz0navACg4QXeXzKlgVi1t7OFE2J7sBJJ1YAE3QA\nM8uOvKi0riwZf/3XDZSh3uh/vkysMVGhRLC3PjyUEADriR8TH8yEo51Zha6S\nH2SED+BZOO1VcmDd7dALPdboqnMHwbxJVJEHvHysk7Q3g9U8zLL7fwQDwrw4\nFojYZdtbhwfchwxhkrCsEXGWzkMTJfn8Y3fOCYusNY4eNSsU0RdFpvdZObUZ\nhZLkuVRwptnLKCJgvOlj93hXBwsLULsOAmFCzuvv+tjIf1xWpVKh9fU3KBi9\nmIAM/oauZLN1+zkkSQCAV7qt3l+M78DQhUXUd/ySx49pz9GfUY8nP6K94BYJ\nhCgThXkwHFrSWQ49Qo7++9rf26GfXk542g7Hdb8wB8yhpN5U/6O8t0BdRP+5\nbAGNrGtoFSWek23ejdNI0Vdwwte1NjzdcL7D9gJMo5aGliWKS939ZSZueRxx\nTxIn\r\n=lEN8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCHyuixhR7w/LL5bpcdYQhcBj3Fb8N4r/kc83yl8l4K+cCIAeauVMkMzcRAEwkOTpHgMx5XXPklg9QnQcOOXfXySxS"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.11-dev.04f99df.0_1643732272335_0.4211046889137584"},"_hasShrinkwrap":false},"0.5.11-dev.d336964.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.11-dev.d336964.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d336964.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.11-dev.d336964.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-e3jH2jqh7C4AomhJ+Cm/HOCBYmCvOShxfdt5QU5ywoDAjdXNDWyXRFteP+eNnw8AH7O04ATEbzC2oVb5Lxg4XA==","shasum":"bf0e1c767744177216842a373abedc3a6cfee2bd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.11-dev.d336964.0.tgz","fileCount":35,"unpackedSize":1019197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+WpfCRA9TVsSAnZWagAAnq4P/jm/U+Dw/v7qaoWV6S0i\nCMmwtw9MiD2OKJoNRBO7RwTDg7yi8fQ9pTGWHfzT1tQd/jOEyS2nevYPNC+j\nbL7a6DRyKx5/lpwREOVJpamRG8I80eawpdUSduaxH3xK71gssD+mWcpjPWUZ\nWHX3Kvkz6mBv3w7VloVH5xO1G08nYcegnMaFqwwT9T1K+NqoAoyHV8ERYjtP\nYfFtljqSsgyWh0xnUhrnEEn0aPU+fWDrW6T3VkYqW97tVh7CPuiDg2ZX/VhB\nYOkv4/x5zGDcXTsheGYDvPeUe0Gxzt2D2BZTtis1iUicW61zEHnk6gNHfO4b\n3pPV/CWeTrrk0CRBLSOWnhADZMQHv6rrHxZG+KCNSX5FPWBgQM5AG2v9IjVy\neLZOmtsMhYxLCpR3O3Pe9Kq59wT6Fjc7Or60an9mCgy/9U8sCshvHQqky/7S\nMvjn7IpRIxCJ0PpyDIof0WZT1J7WAQMIyi+eKRBcMTYy9rcRA3UiETdvbiRx\nGHr4qjzbNtEBEAqKJ6p3tRFDueUGgY5+qoiPa9s1RIqSaZcK+TDrFUBE861m\nd0b+6gJM+/q10g5IS/fecs/b1yPGJWsbt7YNtMcCLSY3XQ1dYa9OTctChCkm\nV/c+0d4MygIKInxZGQNFY/NFnH/6Dyjj2Yoq+2byYtprzqMrkCY4KBz16rzO\nGts3\r\n=WYk4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRFOz/Q0Oi3UPg6WS1TAO97Rqff910YkY7DtGmU+GJegIhAM/qyMp6KsmXNcutSEmgQKKjSktCbsexRFywra5X4RjS"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.11-dev.d336964.0_1643735646936_0.5654572086657783"},"_hasShrinkwrap":false},"0.5.11-dev.da50fa8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.11-dev.da50fa8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.da50fa8.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.11-dev.da50fa8.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-AbzF+hSSrv6orSwaYUcXzIi2UJRIWPaCivlYQ3HL4skk52ApBQQjfsj9RjbHCifBePRcacbvIFI6AtH4XcYz5Q==","shasum":"f69f9bedd6209d24cc750724b34e37af987a0b8d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.11-dev.da50fa8.0.tgz","fileCount":35,"unpackedSize":1019197,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+r2UCRA9TVsSAnZWagAAviwQAIgNh/yuIOlmE/4bR/1U\nHM326NlKHf66gvtEz3VJE5sKO9+XLqeLwpsB1f3ryt1Crd0rtxc4ur8tJetP\nnoA3Io9AVuoNqoSvPmveERY3YNTKuCgTj8MoULguJPRSsdFxkDpeAhR0fjHU\n2kMRYSl9Y4+RW8XRN1oVSsr7Kh9iYbBNZjbqkLJwoka2f0L4Ykh8/FjZR9SF\nkgnI5unAaGzM4H+Ov7hUnOFvNAVwvlwAnIYe6Aa8VWZol8MZa/1TVg8IIliJ\ngXVrly28H+V9a0jEKniXvGN2Cu4JnfyOMf2cYfH9LUPJZ/QKyc4yuH1xghw1\n8v+H/1GziGeYCANnQyLxuL0ajAlLUwiwWhU2bdsLIXGyFiOnpeqNS8Dr8jbk\nvsEO+3azsrk3qSytLRa0E9+BN1Dyx8b2oYpvrFRNmRIsb2JMnpvUSsSDVN3x\nsNagNdkF52opg/cD0+xlCgCaZwiFAbUb+UVBMkvg0mG1Uw8ER49Xt9kBi/Oa\npvD3k7tzikKO8k9xDYLAeFUYWDARUtRUdfeHqlnnHxxznTmWKvvrPLMxosCi\nSFezFTlzMsrx2tvoRm5IGEOtLCkTHv4u6mjzki2F5uyko/UNaenzIP4xcQip\ncvE5NDShgeb19XpW0FRLjfg4PbU3fD5vo5XLH1sNeZ3JampY2DJXcAw84Kzw\nnhMg\r\n=lNsx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0j6YTBSNxD8tRXgSyei4UoSHf3feh4Ct1MgFk6S6nlQIhALRB99cMOTIcY2hFJzPQapAFdV6+wnDOnywUi4W2DOnZ"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.11-dev.da50fa8.0_1643822484061_0.4722767973871629"},"_hasShrinkwrap":false},"0.5.12-dev.c114d16.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.c114d16.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.c114d16.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.c114d16.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-t+4L1vV6W1UXNlAxSX5n0rFZKKVWedO5wetSiJxn3Kawqdzh+92WCCe3fIx4mf8ncaTBvXUGBKbyVHasrqdQhQ==","shasum":"046f95be7c069a46bc9fcfd5fdbc6fffb6fece51","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.c114d16.0.tgz","fileCount":35,"unpackedSize":1018376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+9FXCRA9TVsSAnZWagAAWaMP/1EM3QI/vP+F0ReU4d4Y\nSDGeerZ5VWYaaF9BK+IHBmYhzdSdx7JpRK+m1oS7p5KCkLEmchayeOAjJzmK\nRDyh3vfuUWOHHgcF+/y1m3bW1FXvRsoTYgRYz+OChJa+VdltzyBBf+no4Xll\nZlJD2vwi6MdoR5k1R/XlquDsh3+viWDKyADgBct9hgZqYilUwR1eXiUpveuu\nLWLVHWTIBjkSe8hEJVTCtdAr6g463xgR6cmQ4y0cQmOBe2nFUNPu2KtdgcZx\nbZjOgxKtdPhz7djTU5G9K0CCyRuGzMYHw95FzRqOcr2QCJ5tYfeSYyjm9seY\n7SXsKatFrBIbNWFL+ei3inmB+kjlW+mCKgGVXSKWaib0IPCZG2WtYAJ4PLlH\n3SbUUTFVP51QbYb4MmqHv7d41D12dc4GO3Fwphck8uM4+4blwRXUf0HB0aUI\nSzLq+py+5bz5wYX9T+x8kvzQqbcXRWKD0edudFi4jirjdQyEc/IUMruhsrU1\nHhQnjSy7XvLnx4Fi6jlqVUyDFduC3ZwI/vphk1zNcN5/LzIGZjcifYqthhfM\nLW6a09xxTnN2OWeddloCOurRiwwJ+fsCZWxbp72hNTAMsWBYqs3VtBWHyx0f\nOmSWKkfOM9/YGLt9UnmSg0Jk4CYHPn/S4r4NFHJNbwkr+HzSDT9WDmSlLqAL\nUKO6\r\n=r8kp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbLC819SXMeXLKPSC2OBiyY1UURJWuy53cMVMowAdXbAiEA27nh0pd4f6GtqwQza9usAu4cflgCVtARKsxHaYos75M="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.c114d16.0_1643893079125_0.2194081513454893"},"_hasShrinkwrap":false},"0.5.12-dev.e05baf9.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.e05baf9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e05baf9.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.e05baf9.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2SFAOLIiqPsg1K3CyQXHAMQNOB0fQ5YyTRh3Mp2YaD54fxmtkN/20Lbces8sl0HPHYlCuZY5wuiEjS9x3rIlHw==","shasum":"9b2cdffc94fb3e71ada39c54aaa62e78f4ad1adb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.e05baf9.0.tgz","fileCount":35,"unpackedSize":1018356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh++f+CRA9TVsSAnZWagAAW04P+wT5c4yTfeonhTWOwosL\nN7ayhas0yoCGC87b0TJGtQyLRDt9Fm/9Pk/FUnYcge2Fi/iKBO0nRZRoDIaC\nMG00sCKYhdNPQSRlmR2O7O0WaIRguTJK3R0F/O9/2C+6QAOIf729C/0do8fa\n2aAIaxrZ9T+QZoPaXWwyQCJ2LSRVEQ/RX9JuDfb6tC+jBAw9m/Um87T8GYVn\ncMte3q8qvW1ryncGYQmVy5VE9K3JhIz7719BVaiwIJW/uzS4E8jbfX8FKz8B\nXMXeVxmiB4piG7J0DmV2cGQgyuT2WysMKuYjf2isCvbiDuiN8vnh8hXqvl4V\n++eskwsEUdm3AjGB5wdCDGTNjHB4lScxk2xBSIjcdx487RUHMhQlSf6MZB8m\nof228rGaVEtWtiNUObkgGQwbVpv0B0WnXur4Pdg+jKEoQnwzPd6RZkF2smIa\nQzcUZGTWx5U1tjh12INAFNK4BXP/HtOToLjPAkkEFpVglwiyRkOzbSgf2s6v\nZZmnXW5YwMn9qFLJBQO7BUkvb5p3OslFZVpFo4mhpYKxpbhY4QOc98fDq2KS\nzPQ8z1DN7tPAAMWJmGAu88HQ7QRaK3bWbgE/I+pOiP6WTZH8s9Ll1S/7wsz0\nxj9xOLRLXWmpn8levjCZiymXRdiLOfXT1b9gsCM80h09SDkBjNjpLsNHXYf1\nH8QF\r\n=+ra8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGM6Vu8NoFQwsXgM9D7Hg84Cw+eTIHz/QmuQ3OOapfDOAiEAgF6yhn4D2iul0j1Q+Xb4aRhh1yoK6FKdysFQq41Rh20="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.e05baf9.0_1643898878177_0.28047858005584714"},"_hasShrinkwrap":false},"0.5.11":{"name":"@superfluid-finance/js-sdk","version":"0.5.11","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0-rc.11","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.11","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-WZ6tFZIZvvD6oAqeJ1JYHmETjBzL2PkiuCusYFL7BCWt+kXZ3/lxSa6kvJdD6ExmGEDfhkPMFMKVygXzgTE7EQ==","shasum":"7b3d9b2de61d2bf9db1d30128f115827ff85862b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.11.tgz","fileCount":35,"unpackedSize":1018333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+/SzCRA9TVsSAnZWagAAUkIP/Rr7Z27Yau+7FDVU+rt2\ns1PaX9k07xX0n91I5nGOGmiMfISNQ/CbS+pYn3F9hWqeFPW0dal/KrSXEWvf\n7ycV7EYrkXVROQF9ox/P7s7pLX6Jh1N2CHOWF+QNMSPadEq6ua7kVhNejO+P\n9PUAgyXn2i64RFc0doH4ZIChRGxBA271vb1TijsY8T03snFxaVItvCEJvnSD\nxEKRSfMgBccHyZdZecwyXxcck1EiuiWqMHSHL2KdavYpJ4H6gHCmL/5JfUBW\nxBVAVJ69igtfoPCLGZ9ddJN0IWno0halSsaAIhgDI5yOb9vgDYYfGRZsNzjB\nHudZvUYOHbL2SQhj/yfyesTJcZ0kKQCD+Z9582aVKksPwJzDdDLfIxrJmfm2\n4N+8mPrVpcJp1RLM91GJkcm/XNwMdX31igdEFLrdVPBEsfeZAob3z443OBYP\nNq+9P1qPSX3rVfWsQbd3XccV8gyJt0hezmlTSpam1kioVmtXOR9uKIIpdynS\nqC4yt7relcoiY5+kXtgJRk53cjwfcQFJqyN94qDUxbuIkvovQho+kb8LR+ed\nFXFhMjU12CuFyZ40atxV2g/WZ28QmeDTDw/MyibPvkuDjyFM90I4oLvZDkko\nvPqJcbh3ZqLI4FGwqB6ZBSClwt4UCtoKuPtpG0NqnNxY8uffrXAzMk191Nk/\nLIor\r\n=XJ6I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdSR/sF2s0zyiSyE04TlZgARSri8WK4PVH+duHTgcR0QIgE/1NGbl/1aGC+3meBtJiHyGpantceAFCBnJaDaDj5WE="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.11_1643902131818_0.27570446425055195"},"_hasShrinkwrap":false},"0.5.12-dev.23493bb.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.23493bb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.23493bb.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.23493bb.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7padVK/3rgscqX5TbAKgYDXIgF/ry+XykDYZj4sj8lRtquK/6lvYjdqhDuJ3tYrfLjb8mToOZBLzGUEU4fBxtQ==","shasum":"ded318ed90c7b7b932166f7be4b091533b3cba4d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.23493bb.0.tgz","fileCount":35,"unpackedSize":1018356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/PbXCRA9TVsSAnZWagAAcJUP/1+rB+qsi7x0OrFYBMwJ\na7JOTDKB1k0qDs2J6xPZsDfBzEnNWFZg+KHAeqEmHRSKK8vp4gU8Ve8J4D3Z\nxtBArzWvkwMckKusLdh7GVplsHcXLqn+9AB2BdQf+eHdHsCaaJonif5SyvL8\nqvhy0sYO54vnUkFsCWBx7xgGgw1m+T9rPl8sB7687sPk/CNFXSXOgwJ68ynA\nyQZC9xHX2Vo9iXzuBTbs6/TBJmRT9IZhv4wc00qvjNMP+e9hzNXhGwLx9HwO\nQvI1EcBo/7drYe6rcsYm4E3tD2ZqhT+GPmQoQrKRcB6PH08ZZzQuC+6xpttS\nNF/o2bDagHkHtHmtez8WJ9jM6k5RlRq+N5P2x7aVP7wwUGyGOeOIaVmTWztW\npPCWSHK/Qp2qhtjc6p46hjguCiY7s4eXoKBAdkyVSa8C2mDdAUpzdzPW0tfw\nnk8FX+0K7szfJds6OBnWQJlBoTMLCUjZrOoLACu15/K9TVGJMEeicp0KtGXP\nhuN7vPis34g6cpZ96mp6iUWEFlhUWeKxIjEuPC+MI2yX6wBMvSGpqc4PQu3s\n2LhcUlJMVmcI/u2yBkA2lgadp+GDGY2LxP9jvoz62pLQoekNJgl+lS/gnjJL\n8lbcgkl1BlP/8c2b3nIjkBx5tMgAkkQhZZH3nfjAtYSyb29MZ7MzZgvzf2as\ni/NP\r\n=yOpY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSq7zRBmGlWN/JvEmP3+R3iR4gB4CiZm7ogBRT+hEAaAiAudsGKZRhReGrm1IgeA43p5s+2FO2S24ZZqNevQe0IIQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.23493bb.0_1643968215556_0.796469833953118"},"_hasShrinkwrap":false},"0.5.12-dev.2366f30.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.2366f30.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.2366f30.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.2366f30.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-rtx/JSOGYXblSGLZciH0f2hTxkRtNKBh8ANKklh0M1iSrh5TmtHWpD0+cRr2bjWQL8u/T8z8TtCmaW8Q4wjz2g==","shasum":"ab11095dc0ddeacd4d53a1baa450371f7f57bd2b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.2366f30.0.tgz","fileCount":35,"unpackedSize":1018356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/Y5kCRA9TVsSAnZWagAAvVQQAIW1BGo6vkXMGBGuK9Xi\nauAXcWKFtAIBYbFnNkFsjwh5+BmGHcHW7qfDsCZlUaTZxJ6pFdomujfQd1Qa\nOQrJGMkHi9cn4id4j9UGFBvpNw8JwEuZZ0VRBbDRKfoI5JNaitmxSVp5p9OP\nys7AprU/2NOVMJ1MassLAJ3kNvRPnt/aFYPai00KOr9K7X0FKLNS08CHXW23\nOoXA8xGoKBzjwhJ/OAny370IIg2VUsf8U9tdzH6gb5x6sZxlQOTLF/M2Y6+7\nEpG7L/HzVj6vytUHa2QFGqIi7/M0c6qhClEvSwPKvHzA0iwtlAJtkqPj/Orf\nCBqm8aCE86G1UKxq69No7qxGN5EVIV+xDkuk16xBTESyTy04669fpZBUuYEv\nj2l21rVI20dyEAYHrsy06l1KpxdWDoWr3gxWlZwHZTAu3929XODeMS5s7jXU\nHgoSZ5PRVkufGN6E+cEmz/SwJiFx0lgXtqsopRP4h2u3Y/ofkwJ9LYT/Io+X\nEbT7ES+Zak5I8C1elEaBVoFjiOSfZCIHlunjrg1RNP1E2M2CYbKnjvSN5od/\nyBDe3n5ylfWPNSaxTriI3IGO8e9dOV1EYHpAod0VivE5hgNhoEJS2rPBwDSk\n3NVQ9Fh4k6uAWmfRQo/L+JwwJVk5nvn2XEerw4tWFw/zoR8nEz3es4LQXIen\n9W0U\r\n=e0Wi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDuimW0cj56nv84w/4mHe9H5Huc3eEZcYUiCd3f1alzcAiEAykxHGmXmuDJMOURgDv+BQmcVuyF6dvACBG8IqZdUzpk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.2366f30.0_1644007012577_0.31492272163104684"},"_hasShrinkwrap":false},"0.5.12-dev.3d367b9.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.3d367b9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.3d367b9.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.3d367b9.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Fj+dnfKuS1f+/OiazXVZG+be5qLEAwTdjZZGmDiT8uA/WPQxHqYYMhkAInJ0mXAHWEv1gRttsBAc6N+VRKHkSg==","shasum":"719688e2c9ad164f4f0a9e66455e9e6b79609584","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.3d367b9.0.tgz","fileCount":35,"unpackedSize":1018356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAVTJCRA9TVsSAnZWagAAwQ8P/2g4rS74DrOLkLH2qE0U\n5qCZgTC/FdrwIaK+RgMzTKS0mUg5z9tpJ9J0igt5k+oi58n/T8KB1cnAz4dy\nuUVRsAkDhKoYxzsq8/811kTR74S5A8oLKcheKchmuJ1uoj1LPUC/wcbRP3Rh\nL2Lx8wPGl3blga4ISCNIZ/gdPwhigkqZspgDeX01H85I8FZRQlPWKIDOYnB/\nYgmGop1qQAXnr+s9a3KeEJpEfSUHH5e/WksC45pCFtz8Y85lBNCrrlJ/RCLS\nhfvH+UTyjSJb9NMXpo1u6KVhhCRwLvY3coKlwU0Bxii6bnVLOxYT3QFcNeft\nwun7s+keUwpFQrruaXT/GXayFS5AJpUwB3ACVfJ4Tfv/jnnwIt2SKvtF7TR9\n05MdsMPQpC2iWYGAKo34oJbsInp35VIGfK0lWaJIP664iWHWSxGfg07ujscF\nVLE3B5H6rovYWLSbcuRKXxmm8CHTIpz9TF3rHYhMCphbV0x4tYH0t3marPW0\n9g7cJZTfuDIVATxN7YAPhrGMdi03kwZXTqTpmZa14/t8dgFByJnkXuP44XVF\n25BnF9BGAOIBm/iRxLseL/yjOHndG3YywvXcrm/s3iEpl7TsF1ChQMhrWEBP\nN52SWKRqFhirg6nOFSP8Rl8y2EH5eVFtdZf3VhswJzYSFKff8qjhVnuMc6SE\n+G4x\r\n=4hiO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEFbT6ixcD7cmrYxC2GuaDiptKD/GiZxazMRSIDw9nNLAiAFeCamUXx5rzYXW+8mqXRyUltbrglrgoRpeoQkR5wRgA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.3d367b9.0_1644254409413_0.5662335251969031"},"_hasShrinkwrap":false},"0.5.12-dev.011356a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.011356a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.011356a.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.011356a.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-37OV3hkeCYGv2lW72sfzU6bLO4g+7Hw3ztRTtNdWbIKu2OyhDRfNWErO+9EBNoX1Q6BsUgIZEbgeGI5iMLYYVw==","shasum":"b629b1605983cae424f2faefd3e9f85edff1c440","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.011356a.0.tgz","fileCount":35,"unpackedSize":1025430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAXGgCRA9TVsSAnZWagAAcVUP/30GfNNoVGiZNCnf0Mk/\n8B9w/Qt2nOoZy5ynF2fsjsZrc61DPhDTIOfAcAQQifHkAJXKz8DNzPuXMFPY\ntTlv8g6zGJp/KPqi1tgtnghCHnFksq/C+YBmxbgj6sEAscsBrsG3sfN2geIx\n2sYM76qqYTmKRlsxs9Wvaama4/mdtWD9SC9tLBFWvZjf/f4PPDyI2lBDyJNx\nidy2zVgAvGluisgQkhaUoYgx9kDhjdcw/X3MmXhHlr7goFI9tZC1qBifsY+u\nHka1imHs6oyQmGEq751ODi4w6kGWNe58RQjIWSo3Hsw4MyCXXdYBUlJLcWLj\nprD9vLhflOv6GUF1CijAr8T/PG5JXuyCuq94SgY3BbOzykDqjtamvrvWtGjM\nNwdYUp2BNFbaVWnddm9IlhvUuNCZP2ziAnnFZ6R3iz5K5q5Ko8BeOXgJ9H8M\n7VufKu67o1hSIaUfDSOfDzXP/VRhWvsRmOenMl8bX8YGC+0aCCwTQa59hFkZ\nijsFeAcp1tquFTta1agBAMtyPj3fijrZ7mcmZWkzgMFd364vkpuSh926NMdb\nCP+rlcNwoGOsADHipov/ifhTamAN2UNYClkBQ8KBCnVaovOszgNZ4Um1j9sP\nGB5c+0Efbo8rZhvDpVJ61I5LSSu69YCG0M8vaTorr7DwgA+4cNCsD3WVsGI0\n+Yce\r\n=Rl3s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqsutRtp+z/j1TTP3D+20NvwD/NUgBvsk81WU22TBSnAiA0MZRxaS05YIUR63hp5cTO8H3vXRlCOUiyuk9UfUlmLw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.011356a.0_1644261792413_0.5278719755889689"},"_hasShrinkwrap":false},"0.5.12-dev.dfb06a3.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.dfb06a3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.dfb06a3.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.dfb06a3.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-8ZZVwKk7Ih44TN8d06yPtqUsvRVcijumsR1H7ggeFaSIFpjRsEXNQ4wK9aZ3qYDmJIloc0Nr/RjN7EQDOWvJ8A==","shasum":"5e8e908d7c545ad5786c72780e4236aaa22b17da","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.dfb06a3.0.tgz","fileCount":35,"unpackedSize":1025430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAXd/CRA9TVsSAnZWagAAiyEP/RR87ovbm+1LO7qjFliF\nzMQUziZmEnSzMp7O4/72Ref+NrD2R3rf9U5aYS/tGAE/PsPTVJ/HcLWCvfI7\ntx0SkjGOtJniw5Hf2HWbpbee4s1IxghlqQTnVJuIb43AYFSGKDPCtLd4QK4p\nrVLFEwOgE1HBE710lqCwvohnSnCz0PQLN2jWMds7jjeXYecgJhx624oekML/\nGioxZ8XoI4bd22Lv81NTQvmkNScdrZag7caDdsxUhx3kvVeZt0qF5rFjuywp\n/gK0nMzeJstZFwudBlWC8fTrXYkcOrUXRHL0RkislLBoUPjFRNVIiXK/VDkc\nEBE/G3wYS1IWg8vHugdPXOPq76fPla3cQ+Mcz+1k4S/5J1vU9kmaL52NeGp7\nFlnpM6i0JSTC695OychIB0oljAo/0gQqQboX5m1YIYMjP1UlFrbXgdt2b0JW\niS1uZ/Bsphs5RJwGjYJ/iG92i2b7KweA7SoqzRbuM4ntUXOGp6DH64+wlhvY\nrYjf9apXC3vwKREnYAexpT1Mj9TO0b6bv8iNUGId3CVDpZPPASPUbZjWy/vL\nNe2SkSRf0wskEq/J7arBGaYibuH6/ppoGYDFeWYxxxfLYDILsceY3xgtwgQf\n2w3Xly+V/VQEJtC/lvhd5LkVbpuyvtwpxV8vQxWGtv2UMLn90ncD7ABEAV4P\nXy7o\r\n=mzwC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH/sEcn/0m8+PhlTA9OJ2tWNViLlGxquPxt9Dp3sFm4AIhAODFpaoD0oik2cg04/kEwwqBDABXl/1mnNanXaM/hycQ"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.dfb06a3.0_1644263295744_0.9460098479480199"},"_hasShrinkwrap":false},"0.5.12-dev.d04426e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.d04426e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.d04426e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.d04426e.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2GGFYehThekfPxhWym1RPm+YRwft3dL2eDt08FMX3hsEaAlA/Y8BQ/0yN8tH6VqSEXxfuJwaPLjCVOB78SbaEg==","shasum":"0512a78c136ceb12b4da27d6278fea00eef2ae4b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.d04426e.0.tgz","fileCount":35,"unpackedSize":1025430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAr/FCRA9TVsSAnZWagAATlwP/R9PXoD6W/BxAZppQms9\nKtJ1pn1L5YU0XXvsbOMjsAoVVTIPeICCOdOnW5dRfP//K4EtjEOK1ofgCUlY\ncmfvwU8oGkZnu5d2EZLTX9TSpU1Tab7g3Y/JGnXRKutziaBv48/FGnUGmWlS\nTdDeQrvLf1j4qCShwVLEDEn7sdgjU1Km7KZz8rFI2jgR6Bh1mgaYCfM69dt2\nUVxbJd6yWPdEPixdiazjSbtczHt5eh3OAhbK651P/5SG4yM4No9yAfcDnnMl\nmlw92pp2eRtL3/uRhHWjBAYiNMPSPjqBFDIXhFHdXIe8p9ARI43S4m9QJXOM\ncI2h+hB4abvlD3ayHxK2HtOOW6CZW+egAg/R4IEKz3y0xerFJNYRWkhL0x8B\n7O2N4X078Tr3pcRCCMKcXTD/tWR/MUfjni75sMcBsPPC7l8ARsZN87uBegEw\ny553qU/hqnrRHKFUjX3QWaCpsALrAeghZXdlHYziNQfYD2xAi44P/FhNZNcU\nN+sndoslUnkUQQbQXiW9p+btS3wVbv7pRLalpMa6SW+xQ3wedq+vywWQAOzm\nhjS84u9OgYM+I1KSvzDiadUg4llThxzgXZr9/JDU7hs2O53hAf3fjwPIETgj\ni/eK3YZCjW9uh6OjefTbWmc2C0lfUt4ow0S2yOrPvMeWlIe3VbPw6zy5e/bW\nwg82\r\n=pCoo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLsURbunCWGpU/jUhjBCJt/zZsm0kMMrnlj5WSz/mnvAiAcNVfSFbn9kyjEp0glfsoHu3QHHD9YDT3IRM01HrjE9A=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.d04426e.0_1644347332918_0.03833064124305596"},"_hasShrinkwrap":false},"0.5.12-dev.133472a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.133472a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.133472a.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.133472a.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-j4GkfWYi0QolmFcUA6OtnjmvX+wHLdp4MSjlB3iWcLUdLgdL+dBg+UsTllogDUFRWHVMXg7s0xLlTUHt0kJc5w==","shasum":"fd007aca0d78e5daaf5bb45c3f0b55acf637916d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.133472a.0.tgz","fileCount":35,"unpackedSize":1025430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAwbuCRA9TVsSAnZWagAAvZ8QAJgr/pzIU+7weHWT2QTO\nV75wpxnBp0KccRP3aFd/KsY1AInQPWcMgmVYy2Gn1710CRD6mqFKfTP8Hkml\nJ62df5gkWRw1vv63KSdJqPNkPqbUydjIClhPhW7+VRjTec85PzLzo4a+lPij\nUoW8hMdLgPBCoGYhF7xTeYttL7mUdzNZx7rt8XCWbtSfGs/kQsEyxFMju1TU\nW65BUk3v1lcD7CXHcNWEVQlucA2dBQ/mhK/vo6S3ZC45XBtix+yhxOUCb/8L\nITJcnxvXuLWheEoZE2++AiRddJjMZgAtdgR6jQvfe6lQfe87NhMT2dwSWv4O\nfDerzTPB20EgbX3mzE9sWiy8wlrybMT4/6rGy3/3yIrk2FUgoma/TKphHczb\nOZ82L3fuEM0B2s1tc2+RZBzF1JNJIkiYL1sgahviF9rNrajn6+bGIg79r2hW\n//+iRW9cdYq93eR6rAQnvHkQCFkCJ+BKLSUfRBDXV97OvdLXnu4FdHOmL+Y0\nGj79OQd8zh/AmVcSeIwyOSOZela2cxhSMlJ+MDNk8sDDxzM0iK33TGAheagQ\nrHzvsSY5aR9J+QyN7dlY/cgLeJ9h2iABPn4sPs86x5V9lDf7zgsLKHkWFLbv\nH+4cFkMGq0WE3YpQY5wIA5l3M7gazRqwILHwBF1qWiGl2/llFbOcURkgCrIt\n/1aH\r\n=2OqE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgUcyk4Fy+1GZAbDcxiHGeqk0kG80UglD0H65SjHfP1AiEAwc0xEtlokBNpTd4ip7iWyLOaRivv1pmNurE2bcz1A0I="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.133472a.0_1644365550219_0.2222425518233233"},"_hasShrinkwrap":false},"0.5.12-dev.8653bf3.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.8653bf3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.8653bf3.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.8653bf3.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-hnqyJmYV9WJD9OjQ7CO0QEr3kDV+7WP3p2X2YlYEWIffsAury0Fb0k/34/K/7h7jtp8gKpVSpRD1JqR0p8TvVw==","shasum":"a1831e9c21fafd597c386e9cc3c958efaed29a50","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.8653bf3.0.tgz","fileCount":35,"unpackedSize":1032027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBL07CRA9TVsSAnZWagAAWFYQAIbYP5Gq1DVzWlzU9koh\nrliEsZIvzQIsbLRJQzwNTxMcocywWamEQBkMP/59xK/mpyM/DXX8kp27jMKW\nUSJaOWavZpyMYsVHDFci5quOHoqsVWEjmY7v/ljx/6zz+n84moFAmRGARjDf\nhCBT+cA16TrXj/zvnkQAhEPCntsnl2ffVdX1A+Ou45RyqGWoqecrMqbhtT/0\ntf295P0iAiZ8dmeBZsTXTxKL9tZorv7bF83QXxBdLqiYjjHJIGl/8jgWTV2n\ncqoONQc8K0GSIQMPaLQW5wlA8KE1KPKpaY7DYphdlDvDgG/v66wBZI0/1tbn\nDB5BrKEejzz2HuApj0qMYnyS30AKdmAX103yx03K8p6JUEitScBnTboJRUxa\nrPcK19z7ywjITrZ/do2x3p7C65dnfCEaDfeOkDr/rDXpmSC/WV73Q3xAAWhV\ngboROX/+g7KTtRPFqn97Jf+vzbRTfRg7gTd4EBPY7tJeBLkfw9T4fRKdJT7q\n2bq4Z6S/nHUXZ0IIkRBVOeIweQ7yDPrhs8RMXPhJ0P4TQVT6jQVNbsxtWpGf\nvjBsxH2qLWDcT+REUAaASWo8n49Ra0gAgALznjrH9s11N5Qpu69aFhGhTDL6\n3yokqpN5g95tEhjqK+vFLeMFtKQgihiI0zQlSSNAHTPJnMeSh40prE5Z2l7o\nnEsz\r\n=xdAU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlapefCPQg/F+0stQIuNouzyk+es6zeiFGumFi49j4PgIgZ/DIsgVI99Rb9gqXNw6sdWXHKlYypA6HAgpaXjVPwwU="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.8653bf3.0_1644477754874_0.45243062483031204"},"_hasShrinkwrap":false},"0.5.12-dev.a9ad3d8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.a9ad3d8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.a9ad3d8.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.a9ad3d8.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-I/kRQVoh3TZ0Dy63ZmRe5AUcKgWPP8ks8/0HCEllSE8sO5/o9CzONj9FMWkQEyd0uI0uKHp/l2FK2eQKGdlWOw==","shasum":"2e2f3762876ae26c738e13e5a985c11074e7693e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.a9ad3d8.0.tgz","fileCount":35,"unpackedSize":1032027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBN+7CRA9TVsSAnZWagAA8YEP/0/990RJcQFUncEII5s0\nRwQyOSw5ysdSma5jMXxw4mnC5gUYQsg20nhw7yt3PUe/eiXZ0kfHOgjMremy\ne2M59k9D2N+tzhunNVNxG7i5FL8DetYIv+mZ4IKEl2xPBzUJ5g0tVe9Rx6ep\n6mSiUNjko4g7+98ToVx5a/UAgLFh2BdYRUkipZ55E9ZruKVwno3+JGu8Y3Ue\nlPu6feEqvrzc9297hqH+xfxsdbJOKBPIWR0Q6GgOxtQfpwJCFnVGtOP9ZgxH\nLH2jy6elZWZf5+gHBJzOJEchRJ3wBShddjpub5+UM2Gwa4A3VKgbaassy6hC\naQdCOs20HIUDFeUENYpoZwH7NPzXipFG7wRKiybljKm+/kpGyuic0Oyn11fk\nM23WIzA3OJgD/BHbgJUNF142gKdnAi3z44wc8yO7sfClBEvrqZq/6cToEupZ\nlz4Qi9Sk4sgcUMT1MGdKrsvpTWHUFmkM8GVS48dFxex56gaJRMmsssdX6okl\nH27t81DiOUsGAmIZ5G4K1AQXRn72tPzQSzwbnNyHvlYFGeoXSebwaY4XuWz+\nM+8BngfGgj/sVwA0cXQHYMT17KS5JvsqKyAkBCGxT8GAxgBzRlR03JzGw0+X\nn0lsva2PGSieidT7Z/9YIf7CtCW2StOZQUy/61SuUsT1wui39hY7gvmfaubB\n6UGp\r\n=Xwid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA19BGKgP/pcwMNkcS11jzaaMZKk13EHqameVO1ZSSbaAiAVBoWPcQP7/R2ovVvCBnc0NHzXbnuCi4TQ9dF6nUwUhQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.a9ad3d8.0_1644486587786_0.11672120421002297"},"_hasShrinkwrap":false},"0.5.12-dev.9212d2a.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.9212d2a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.9212d2a.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.9212d2a.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-tpQRSNoy1+Y8dSg0Yvo0fe6L66QRY9gohMU+mc+CBM9rAD2zD/sXnEq1edmlTuFDd39h0h++0709pYJ50tLELg==","shasum":"2f0dca3acaac1ad968f86019e977e632a6180742","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.9212d2a.0.tgz","fileCount":35,"unpackedSize":1032027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBQStCRA9TVsSAnZWagAApIIP/1Am5A0HfwwrMofhslSc\nORM4muQ13IywvXkIIscgk8X4ix5xRzitbtRvmltKWs4GKE2YdrMRsx4AhyK9\nThM3IuiIreq54MamNO/sSG2T1AGLWuAtKCU+z9Wr5MazxfuSmPyl1oUX3sKH\nUbDfdgzC9KbDW2z5HFUc9Qnxebz43RHzzIQ4VBnc0F9eZbSAv6YHhhFEl0OJ\nF7UAUQOugzeE2UgzKeqlKDjtKo/z0SMuu8/dvzJxrzcY+6Fv1TrCtn/QH73q\nHn1IxiUCArLr+1QbpUA5Wgj4LmzPTSs17pUAe3MCWt9phAgGoQ4ROI8jLvi7\nnAFW7HHvIJGvFxh9LJv1idZlq4ct4gxlBhSJjqggkRxtOPuLyxV277anxSeu\nNXcIi5dZsro/GsFPGrXMeoUQ1WBW6tjkDbI6lPcp2aP1NJ6UQAR/U+e/dLyz\nvhatNW6Knoa3+T+Nr5/x8bJTPdMMAW88Q1VF7KAlIIpTWABfy33XiKodTc71\nukk3pOBnhNncXea0vIOPV/GZjKBzkNQlHw29MQxOyVuwadQaHQAd02U+HHt5\nXOa2c13YElVWa8Jjt/b5h4rzxOBfEMWCRt7sXQl5oSLMzZDI6BhRnFygyhue\naTndUzFWh811GeS/X9pcR4XLckxJQE1zYRrHoXi/j08JUR6O/uD47QiyNLRF\n4zXd\r\n=3JmY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICEWyrQm2o+tedcTLvUzMH0FYcFSFP07dekkYvYm1SOuAiAoppMIMfQgAH495FuixcWzL2nMPqyPB6aenPHLaQYvNQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.9212d2a.0_1644496045534_0.18869976016310774"},"_hasShrinkwrap":false},"0.5.12-dev.e75e426.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.e75e426.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.e75e426.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.e75e426.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-MU30Ah9rKzjJJsvhdc3+Wmhk/jHJznv3AXQANAjcsbGb/GDzzcFD4IG5ao6xNqe4QjKl4/Q+1hVKt8XAyRDuww==","shasum":"bcc0f78473722a0e4aafaaec92eb325f25c3aaea","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.e75e426.0.tgz","fileCount":35,"unpackedSize":1032027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBVBECRA9TVsSAnZWagAADFwP/1j4rKtmVrXDa2fsTdA7\n6Hv/4kq/gubG+Ly51EQXCxsM9ZZCCQCC/9Nc4y/wK9+YomvWRbRoUbKv1Tpo\nZI7scMTzRuQDT1e6zINy5T3jH4Hs2nwA/JTWTuFYJ3oszUhJp6EZVx/jrKmf\ngVn/7PPO/F9jdKPbayffWAcoovWM05DNg1Dm5m443T+rF9UZlvIAtZJoIdIy\nPpGvv5xeMSjlQwxb6q2RTcwWwV6r1e5vsJZuGJR1tAuco2DnPX6+nwwKWKnA\nHd3KVyD5sOIGGLLL8+DKrtOBzINVPzyOZJfF67qXss9ZpIkueX0v8ZwRfEA/\nP3Hq+vb6y/bAIa3326uUZD++cRimHy0BrB0Y1Yd53yVzbp1dWGstoYKruKeO\n19t8q8p1NcEuaWeT+O6uIgvnflvXBUqfcWdjGUTZSe7qb7+O67IpN6aWe0TL\nvxuvE5u0SneCjJGBPuj8wjl1vwsZZvtoVFYcJ/D/GS6+QLFPrsWi9k8qMQsN\nxM7HbD28FgFm7xneYBO/fi3ESHedIQUq1FKDEBRWivHewAoBb/u058r2s1/Z\n2zevzPCaMhcLKSsga1LA0dMwuCccm7jmINUK88nyLMIBOp2yHY6AaanHm/TQ\nDs9E+Evw25LSl31cnnrlozEEf0VkyXBbUmhyc+PExOck7IIjWndIlGtmP91c\nLYeX\r\n=7qry\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCA6Wd2Z5VSd7iTUUNoSJNbgNTH0P4yIML0KrSxYJRYNAIgI4teGm7DgtiUQKBIDhIP40D3BqiHZR/76uA0Jb8pYwk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.e75e426.0_1644515396399_0.6215280845803777"},"_hasShrinkwrap":false},"0.5.12-dev.961d27f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.961d27f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.961d27f.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.961d27f.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-rsDWBTA5iH2fIOu5BFgXprzAWR4G+msNq3QsqfMcE6GoCwmImjTonWwFTO+HrY+LWij/8TzzeCSIz0GPmDpPJg==","shasum":"cc2b45c17c6721d36a97b1d00f82baeb049ddaee","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.961d27f.0.tgz","fileCount":35,"unpackedSize":1032027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDYuJCRA9TVsSAnZWagAAXNkQAI5yi+7U1tNZGY9z2p0O\naGcgR306ISgfKNRU9VTukyPpnSvVlp7fG4WjP7rVgtoz3VP68onb7u52/5/t\nWPkaMLyLttasnMz+C6g8ONo2PwQVmLgd42p5Czydx6/17tnbTWUUznb4XjTX\nCBZhMLffkYxGa8v8QLIdsRfXJm51ifxDxyLJmFlyvK+kkD/htOq8v51DJgt1\nZTyKZlKWMCVhWm/8hmYE+Z7RD0NrL/XgnbyMKpzHH/uqLY75WsE/Drs+yMSF\nqud/VgJTVQ6ctqrHMnRR2dyDVf7qYyyYdbafbRicwpLZz3qaMj2o7A11v/qo\nLc3dfGpKosa7H2m47kXlxumPFCayM5LOsz4ki74CSIIDVc9kpCy/I+dJnEtE\n2321ncaGNZS26PKezrZul2TC9U8wvw4o0F8+L8RZWkKHPjMMWdzaiKfvSCvA\nPGAPL8PwQ1jdhkiIKsQ4jwls92k1wD6xFff1IZFn7iIBQ/snnBENf366De9G\n/DxaNj7ajRHdHsxNQolzBdPE6XnpWZ/F1mCQncIscYqWnCR25aaqBrF8XN/7\nAm0bK3PvZy1y4JpR8pNrWH1UZm8yz9+Dhu3j39WWrpnAHLtiFa+dSqwiECbi\nZSR7xe0FmhSPErcyifbpOHkfybVnhVxRfqwcBo2WQOld45gWHoG0WIOmYUlZ\nVe/w\r\n=hLfX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGT8LijAIucDKOIIjrD9vEMtRNaS+27frvoAxv36y4WnAiACuieLFDLTarHV0CfWVXaRIFKh5nFSmgN+IV7kCc8sYA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.961d27f.0_1645054857348_0.6220848200343816"},"_hasShrinkwrap":false},"0.5.12-dev.177d945.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.177d945.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.0-dev.177d945.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.177d945.0","_nodeVersion":"14.19.0","_npmVersion":"6.14.16","dist":{"integrity":"sha512-R34e3ibAIEk1k4EurX/LILddOgObt0RlNZ3ZWqucaIb6HzSAmki3B0ZiLBDkFD8aLcW1WQl2pX8BeR0kXJ5PvA==","shasum":"aa2a6753416e03c0374dfff34a26e153a6bf9516","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.177d945.0.tgz","fileCount":35,"unpackedSize":1031166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDabUCRA9TVsSAnZWagAAZo0P/2hdaZTeBaQeGYLs0wTW\n3Up9Jd/cNXTsix9gN9ENlymiNPikmXviMYZvSSAxVOfX+XOekPOanB232FdE\nD6xPeh0w+pmYIEtCO89xuSCeQ7pZC0z20L6cmooIVy87UuoetUG7IIiyXLHK\ndk/qQwrFhyB3sGS8m5BTrZMPUPl23huMWGKF/3FGJSTG/CpE2+qg5CLGIwPz\njetDeQZQ/NjdZtmN+fpLvqXQjYSvw2kLuQFK0ebiM4Wc3ClZvO0DsAtc8yV1\nL6EyPxRz9tNuifKktmBZRf2DgMbsSvVrMm/T05BL+wahTGnMd4zL0kWmuwIK\nsDczgmziTY8BVchZd3z8nfSmc77kNvmPviVCGycSO1jcr1BNToyiDOkAcp7D\nP+2KK6q6md+7ByUiUOd8vOBvIkiidXlt8x9MBOhT/MavErMPVqFI9RdZaPmp\nzl2LgLQYcL9gqQaz9IYxoKp2xc+ueH4l+CKDil41W1O3mopBkCP8Gw5epfFz\n9wPcCv5RWhMjfF2PK5cLe4OX9yxxzf2qEwbHwkZfXzCqkHrchpD4SEwdNqvo\nsAM4CrJN1Pgx9vyYz7vzeqxNBZ2Lw1dS54fY7Acn5w7AE3gjdZfbmdjUYfJ9\nz2X146cBDKN9PwT2jDNnZWxO92D4K1vucGb+CWnrQxJhfHbK1eASQIb1DhkD\nUK+R\r\n=JTUk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz8ZVYDSeOonxpgOD2x+WTURAaUb08F4F7d84Jg/OZ+AIhAITpZLkTnNmvRwbf+Bj2P2vxxlmSc01AjHWeFtQMq2sF"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"},{"name":"pi0neerpat","email":"blockchainbuddha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.177d945.0_1645061844385_0.5330919187030796"},"_hasShrinkwrap":false},"0.5.12-dev.2a94183.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.2a94183.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.2a94183.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2a94183e14f807d542ad385fd947e1b5d539fbe4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.2a94183.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-LxsRn9Y5W28Lhh5FDrlYw8ASjYig+We1YWtc3fu7QkU+SJM/2iKJ/a4VTrI6KFHe4hLXWqxjErT+Ds4ATlPBKA==","shasum":"4d779014c6907f11a1e0e957ca3a50395d2a4375","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.2a94183.0.tgz","fileCount":35,"unpackedSize":1031552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH1z+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrIiw//QKyGvi9wQ01rcHQUxjNO6ijN2D/ZVrLE8Hvpq76uHugwTOrM\r\ngVCX2IrWq7vbE3u0LvgMxe9AGFQNqirkmu2uSfhy1p1H7mummVm97yEO/rx5\r\nyEE1RW8ZNgi+2aHUiA9uoge1OOWiKIfXhDyJmMG8JvfmtLGooIC6O8SLxriz\r\n0m950Ep8jl4/RIQa06xXSXG4Z8deAGAidP+uJF8p/DPXkhB/YNzYwd6bZQi6\r\nfl6KhWpGJ4PXTcEj0p6h56erY1TlLTLVbCyj8c06NHFLsEJY4h6ZOYY3HQRH\r\nyEJAVWvco2zd+LOCk5BBbPvg6szQrBI+8x9JVwt4ztEJxqC992aDtQNogPvX\r\ner6+vlvQVyt7ZnvztdJLAxFUT0o++qfatS3GJOu63V4LmbS7p84b8kE3sQRi\r\nsxlc8Z7vw8BPyc42Siw5RymMixPrHSvPQsI66GLSgVBwyMWoPmLrgm97Gruc\r\nk3Xq1mPQDQUkE4QssoypCtYRJhQMlbHAclcabecihWwfePbNvWL3hbg7tF6J\r\nxhRmURxrv7InmM09fbFmKxAKTwORWzR9NzPhEHfZUBX0MSeYO2P2CnHoUUC6\r\nTWHW6fFLbH0GmBADtsGiJPHMYUlZVoOtM/LcgFpCKL/vNeCTFB2iQ1zowDp+\r\n+TngkOlj0aswELqmhVu1ZckE9yJkGcsp+BM=\r\n=aJH4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyaYrIPbp/0UqGGcPl+HQHQTNIsIKufZFVjOG+E3f6PwIhANAgBQLMh6sEsNMJYEVD1MUutkCZ9nbcXOHDXlBFwPVq"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.2a94183.0_1646222589960_0.1586625310424692"},"_hasShrinkwrap":false},"0.5.12-dev.97e6f3f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.97e6f3f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.97e6f3f.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"97e6f3f9e46edb1b84935a9f0324fccf86be8de3","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.97e6f3f.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-ow9+vWdcigKwm/M4MarTebWNBmopFsY8aIHPKVeG4v2GJY1KgevSCW4bUr6IgI+Z88zCdEpkRfZpq/vqh0jt1g==","shasum":"9e5517ba9eb68bd67aa8212dd278942a5a724c0b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.97e6f3f.0.tgz","fileCount":35,"unpackedSize":1031552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiH1/6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqfjw//SzXEYLoi/b80tg6dlcokV2RFg0N9bSGPAtphPkYRqxN3uNmY\r\nmhOE66BwW+/2gtD48zMP1xB6QyIQGiDAiDcz3FTStuz24pv6aB5u55R9cFgT\r\nU3ylILT317IMw/lkZOqGI/5hR5wYvm9ljUff5kHZAv15mSfE8QLyU3CMDxM0\r\noGp+dnj43CRB4HeGujZmYwHEX5tEutrdtmAQA91jYoxsZ6FnZZKSNiu8YsWT\r\n9lLWXbR//Avbxl5T9RzdAzTZy9GWka7RjLgW+m8N4Cq4vo2ShYMZy5pJH7RI\r\npg/Bhc17AmOReWHUMKrT/8TjR6FlIRwbPosraXKps22fPckw0YhNCOhQcHFp\r\nPRuITt5MEOt7Wj2Kxq5A/Q5v58LIl67noW32sTvzmn41DMmEAmwnp9aNGNEE\r\n+6krZSbv3GfOYOsRAHTz5uihhLpgv4J4VdTlGTfTzDBIasvYlX4Z9IaOSUpC\r\n/vmainlRqikDVjH7TPTvTFYKuhW2VmonVJv8T8jlWil2hheBW9Z7bDg+TRs/\r\nkYo9/Hp1ThluBJI/RUkDxMWitFTuCr85/R37N+Gb2w4HFSynuANonKYKPPw7\r\nCZTGa36lRm9kfy37mXTBhwD/y0MemlIE8G8wPAB12kTfQddNJGh9sEVSEu8v\r\n6MD9wOCMcQPSwAvEio3E2XUuPb2z196OV+Q=\r\n=LWDY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA3yT9H7F60PPpdzJNnUAYCllk3jckngJmdR+ikgDmoLAiEAt5AhWzOWpvhoHm5srSYytG5OFV1+ZoUTgYBKfH7MIPM="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.97e6f3f.0_1646223354511_0.7950456559791621"},"_hasShrinkwrap":false},"0.5.12-dev.2da40ed.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.2da40ed.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.2da40ed.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2da40edcaace64aa583908c1ec25f6ad2a978c0d","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.2da40ed.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-DwT53xqU8xr4rsqtXxJIkYd3SMOnpskLAtcNN2mVnmz+av64lbEdvDJcWByRHXvYgH34dbVhtiYcUUyIyB2G1g==","shasum":"c7d758dd2cbb24a517dc2e6d20a0d1cf2062b7e1","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.2da40ed.0.tgz","fileCount":35,"unpackedSize":1031552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIKtNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmod6w//dPvPLeRd8DxyAlaxz6rkyGjQ0+EdiB9sC5By+lMwjV4oynl0\r\nopWchxZZVQvUBg7zc0csqPH2hq8tAn92P5vQCpjVA/T33DHz6S/9PMHFlIYb\r\nJJJt8+ftf0BEXxGbA0ZsCjtuyKaL3Hr1nPqNJVp6rppU3EJI+l6OzMm6ab2I\r\nEj1ZQ+qmt08uYv7BorpozbuE+B0u8fpos+/0ophRnZbnvhJQhRXOvnXlxbFW\r\nplQYBG0nrBjgcBBzZI6A5yqY5jjHze5cr4L7Zn2fa1OBOiMI8GJ/LmBJ07U6\r\nj5V9CdPYl2H4uBZ2mBdZzFG5tRI5RaAHM4vvbjHIQt4H+QEoCl4pAnXaJH9c\r\n1JSGcsTqkrcb7npMavMmXK7gwpoW44I2LAuGE3I9CzMJXi460Ay9keN5dc9V\r\n1l33+axiBLHm+lc+IIHs9ccf2zxKrtEnZxRM3GQ0ELYMwPJrlI5gLJwiO5bb\r\ngIFgAhurIAGFq93o1i2c0urG7jpOh06PDc7ypjSwi9xhxag6ceHCdwtejUBK\r\nwQ4zj1oHSybTk0NYp7aEqL8MSAP9pAyD9HDiIGdZqDSrqwdFo7bvMibzKH7g\r\nbn4ytEZLq4KTOlfGa3GfhMxgltT8Q0g7duRwhnNsxJT9RuOd1crSqfjTXlgy\r\nHA71jekONjE4VvCs1/IDpuIUBNc529wzcWs=\r\n=iBEd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3wBPbBLMKv+DP4QGMigtI0aK+rz5mzxMPttdV4vcDFQIhAKB2C0MT/VgNLa/S1WE1j7XhqJqs/1pclev5oZxTzR5L"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.2da40ed.0_1646308172903_0.0173266489997026"},"_hasShrinkwrap":false},"0.5.12-dev.b2291a5.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.b2291a5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"run-s pre-commit:*","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.b2291a5.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"b2291a5f750ec800c822d996ad43b48a76606ee5","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.b2291a5.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-nxhFMssM41GHMvQKK5FI8AtwcO47rQqw+OU2YgY0AINeTGcg8VA16D664fcb+pznGb1pgc8K9O4+EFIBMzI+dg==","shasum":"11d767b67655de5906193945cf51636e1053d9d2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.b2291a5.0.tgz","fileCount":35,"unpackedSize":1031552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIkhgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrxcw//aDKe1PK6TLA2gikF/gP49B3bveSRhIAlhgx+Qh8bSRb/55QG\r\nu+NDX3+1AxQ62Jb0bq8fuKmsNSAtwSZtx/AfKO6usmXQhUWnNqPkpnCH0cRx\r\n9XazQ2wQZhBaXzdZ1gXUh1B4AZ0c7tB7wGZ6Q5Od5e9yfi1GDbiUQ7chCjFv\r\ntS5PeimNOoEZ2S8BNRRXbFmx1PLYh+bi5YK17kkW0dNU9v/2n+9k+S/izGsC\r\nEPBXCEW3yXHoJW7AYK+7Emow1gnnNQkz6CA0oM5glCuR4mzgtf/QX6wo45zr\r\nB8xA89U50KEBiualkYSlNVYOip9+YYItaVHOy7RaaWE4Vszkba7VB77WnMGd\r\n/MTNKg/wV7jke6V1i2wIzAdMD7hSpq7i+O00AUNuQuJJNFPpuvakyd5UP8jO\r\nhUEIfacf0AbHY/RnJ3CfKxsSv8dDD8BVdu/B7sNT4e/Rr7s+tPg9lwdGf9Id\r\nIrY5UatYARWXB2jh3nS/0g/AY8sMQAEXYNlMge279EUXtQ7caKCsPt8HuGdB\r\nBqO5SrMaS09x6tornl0dy0DLrtGitq5qbK8pkHTQFKRzBNIK4bnDJlxm+rAh\r\nyB6dUW3WiE1R1XF20UK+utCR1qAI6WfxdVJ3vte2AJiparJgudj7NgSBqbf7\r\nahYgmP+RLgL1AFDKC5nZiZbf6nwxx5usnI4=\r\n=t+KU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSYi20vnksTTi11ib+83y7GTmmKik6G+QWRhClqfLK5AiBApdOtsd/jH8vUr56yT2lfksZ7P/uha/WPKrCXz5Yt0A=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.b2291a5.0_1646413920723_0.2078915203394025"},"_hasShrinkwrap":false},"0.5.12-dev.626581d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.626581d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.626581d.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"626581d8e58585826bbdc0e7fcc0e819f3fc53be","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.626581d.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-il9ZPty9O0XYN7aaHBZcXQVye6it95UMlbiFcyRRBw18r/eUQxHjmNfv8TKASyBuRBEgLgRMuPNMOFIkFfTOlQ==","shasum":"e2ffe06ca1b5619487ad396fdc4b9167328d6f59","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.626581d.0.tgz","fileCount":35,"unpackedSize":1031641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ0cFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSzA/+P4f+W6c8NSle2wUaY0T8nLcPaEd8QIM3ptWGBHxDcHdIgHOm\r\nEDSWmYX4Qpf4dWz9HigzgtjmO1LB0ycIFyIYqKDwPFjS98WWqkVzm/O1u5xc\r\nt00Ol70+YFnTK36vTNyJ1jY5FhAnypqsEpGXDe8fBAJLih/+b4cOxnY7GIbz\r\nyTOIRLl7QXyWYRkStRWh00C0U5U8rhH3dWYmudmBhL42RPRGiRcVQLQ+RoCs\r\nJcR4NHKUVf03dmpewSnDLmT9g5EihwDV+045YfIQBaW/7lFnCYyhR55wkqlL\r\nis4MCzEis/gVWlpHGpMQw38AoxWg+xV9+ME0FbZSeykGQSbkYS5KBmbKtJAy\r\nzimodh17DcdfMGpZJ6hwCyn6Gjb7BcanBy8MVA0lGtwRTd7tXz5N6sUkVRxL\r\nuRd8CiT5mO++1cn7qA5+Mka7b5zinJtBXBeLWXRp06LvDq/4zK+CtW0MkIWU\r\nf1TO1s4GTttY+9QzbIFtfrC+wL//orYydcV7lEbYn/bASaCPkgJ9CKtDFTwA\r\niqqojj5m2w3IvzoRqh1vilQuHQYisPOjW5xR64GCoktQrXRniNQp+ZcejQ+J\r\no11y645oQey6gw0uRCOcwR0GGkaa/GWR9McSv2H6s5NlAGP3IbE8Q7xEAZqJ\r\n2KH+8ZFQadVMf/JA9KHAGbwlplK7eKJaNIs=\r\n=n9zg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBular/CotSiNjGrpCHazRyZ0nRXz/wwdzI9S7JSGNqmAiAg0idc+LPgzk0fjXDopl0M3eWfHeOWQNT3iupFJzneKQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.626581d.0_1646741253160_0.07268626447521043"},"_hasShrinkwrap":false},"0.5.12-dev.921e7d4.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.921e7d4.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.921e7d4.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"921e7d41ab4c4c488f007781a1bd3af1503f7611","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.921e7d4.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-xWYND+sFhRfuF+4jqBvxwsyPoGCQJE2xaEDngh+qQ04Rg0Nu/KeOoph4B7EtjDPK1c73/ThR0vWMRDEd51wfvA==","shasum":"2b523ca946e788190c4264ac7543dc620892ae01","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.921e7d4.0.tgz","fileCount":35,"unpackedSize":1031641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ3mIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxHg//dpZ4UbCW/jBboQPHiy4jc/rtQonAQ96bw4XDmPKOThwgVu3g\r\niiafWc5xZUjDqEno1PvYCIzLzrpL2hTVo7w0GUvyoSjEo9skqgb3hbnQyrMR\r\noSCpVU0yM/g6nT5M9bTHlRVep4PyQq1Hkvf7Z8LKHrqVXYVL4dPDMF/f6rqG\r\n49SOJDFEnh/csSr2qzoP9xp6F+5ZBZSv96MycNbqYA7ZDTlmk+uWQ+V/J6eE\r\n2Wz62Gq7G7FRW4ywnz+Vl+fzv+23l5vQkXscjJSvJKJM9vY918o+n/TerDbz\r\n7ongOCqf6kqGtzzDD7d9JFkWX/aenapE4WP1yYfarrR8DtP1XnBblLegeqE5\r\nVrXXry/AQmwi/eVMNB44zqY80p2xsOQVQqaHOlyPzuzzhb7OvTlSSUYbP6NQ\r\n/JC3GFtwhOhMjwqsLxxQeOIg+InjhqaJZyd0ju7EZ4oiibxjOvKiabBVpzMi\r\nMzyUNranmNMoM5QCloM6muzljIcMocr6VglivB/QOnOLTU9DGG73/qvAWIA/\r\n7xpqoxRleqO37JH0/8S1DcklxoxyB+M58GduOBDwGEb0bE1z4xxJOb5eWbrk\r\n4iEwD5ZrI8lesTWnfkDGi7Yn1z1k1MyAiGn6pMB+x8pzO6vX3iPvcK9ARmo9\r\nZerFFmemyreH8S8zAY7xS3v+HZzbnFtTa7A=\r\n=1KOb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxriRO4y356DSHsLhlQUoOt/Jkq5/7ZzghnWmNMQSowAiByhfz2sKRvWVKCw2t2ncGSwPweMvEMUQvv7JCxPJgXPw=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.921e7d4.0_1646754184574_0.9430882670225196"},"_hasShrinkwrap":false},"0.5.12-dev.ccef7b7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.ccef7b7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.ccef7b7.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","truffle":"5.4.31","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ccef7b7e274697f33ea2a8b81ae873f9fb68b797","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.ccef7b7.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-gl/PYE0/9HQbPgunH6inba6XAiG7Z0xJHrbCQxclURqwpFQjLZtJe7TlwknTE43WDAdobWpAydzoK2t7tUBuMA==","shasum":"9e865094aa50711f35731ebd4d1b65d0335fe91e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.ccef7b7.0.tgz","fileCount":35,"unpackedSize":1030593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKIqjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeBg//TaTBQaAILERK89ICWhJCfPkRDr7BaD7pxTDgnXdmHwKVTj8t\r\nlQoMIp2NP5k4IGazsqTAFmBCDAk8+JOmzzAJhx1SzAV6bgTHH3bOxvWsNd9p\r\n3ySjnzdeDoxI7m4R/cRVRiV/05kQMYNcbXJXeYIzm8PVA69S/EKQxJnKWXuA\r\n8rZ3MsAu7+Ix+xD1dpBkUrG75nl6YX1nZAv2r6hB2QdvIkF0T149DHQZT3LP\r\nvZyYiXpCA1yDAhvN+tkdDLg9S53+MtLB/n4oVG1BVgMw8bmTaby5/shrTRs+\r\n72lKHIsIjGGBrTLAn2P6fVWjFGIfRgKSDMUO9aOoi7DJRwLeDmV2uQkOcjLT\r\nGXuWYH6p/v7EVIr0pB/IdGj7Oew6tLcE4F6Ulds9BxKIF5qe1wnNXUXAnZwt\r\nKF/gHlatgIDhlcVq+JTzjpjxxg45BhVSigcIAkh6H2pZN68Tyei7mhyXqozd\r\nvHqYqTb/keQqgxxIOt/gqt3/Icll1Kpl3PUN31pBFcV3JYFax9CyNYS2uP2q\r\nxD6NrM3/WyG0UF0EACb2LAfpv+kuBqHuIZqiE1A7wVrFvcmxziI8tK7N4dcR\r\nZO8jbyYDD/wZvrNCovw+oIrBLTeAutzxRksuHORefY81CsrGM8k84cGorMqW\r\nbuFeSfsNRscjWzk+mqFFmvY1IfZMTO6ybpk=\r\n=fQqP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDljw3r3Er6roPn1eXAFBHgAO7g0YPEHTi/stjRU9f3PAiEAoBs6eWqozQK+gFOtADV75yb8BLo3aUccb6lxEqA3HfQ="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.ccef7b7.0_1646824099558_0.2433309884438788"},"_hasShrinkwrap":false},"0.5.12-dev.37e62a7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.37e62a7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.37e62a7.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"37e62a787f10f159d6c8d2065abfede3df20f903","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.37e62a7.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-frKu9cbbpSk2QYEkcoBzIiZTx3syPUC9OvNjYLpM1fQKL4TFqHmg2idWIP4MnJGhoq7h7z8PT60ubLbkIdx6wg==","shasum":"34c1019a3120a8e53eaf47ce5ff6a8bbb8328c17","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.37e62a7.0.tgz","fileCount":35,"unpackedSize":1030564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK2rBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoseA//dQUyljFHgf8l6knjDBdKUwxYk29oUnraDX7bLWaQ+q8X3w5s\r\nHbwuJIzfcCDJ43eods45Yw+Ik9PCCPwWqIF76s17IBsdlqgPgJY2Ts8idU8F\r\n1fvKAymLEkkandP/3w5CclwhV5VjYvWIpblPbDNIjuFuX/mvfViAfBX/RPW1\r\nDmexqhAbKf5TIGzBjDKA8uspGCcTVQ4R/d6bQ9L6BaaH6goq559cA+uhyzHV\r\ni5gO5c2qsoHfIy17kBdcet0IKu3yh4VtydZggBn0mqIa+Q9RGDULrcSnBzuw\r\nu2DvDB+6fA4JBYHuiOdZCLdQljgklR1ncDhCt2Ki1qolf7q0NXK8hFuyej+D\r\ndz+DGqfMy1jYfSmVjGjGGFfzSFuiWRSRPRYKXNKziuDs4BpFXNGV9fCB7zdG\r\npSY85FU1oblRdMUHV2MVDpVTeyE/21kBrRjYtEbn3RiPllLY5WRSnJwcrWLG\r\n5A40KU1n31qQ0RZkk6H5XbQXJAgATQpIp4Ynf4/gJuriwocAi52pBxKHbwrm\r\nCcHTg3b+Hbsmi3/MahP1+0RoyptcdN3lOu/jkOwWtwQmLksGP6HFoWHdtwXr\r\nY1WVT1HxUpZ5zQYNoAuYdmFTjnKE0i/HLVl74VBtfnHWCkqC793aYPmr2O3m\r\nkl1P94lhhialkhaForiwDPOKVgvVVCsofME=\r\n=5JIt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPiwgcso+5Esag5PCtuc5vvfYB8jbxeNTwteEaB9hLhAiEA1hBEga05oxUk9L6M6lQE0LkxNJnjqmBk96oVMZ0Hsx8="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.37e62a7.0_1647012545728_0.9698109685426513"},"_hasShrinkwrap":false},"0.5.12-dev.5907354.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.5907354.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.5907354.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"590735474c141004b75a3b0bea9de5bc2b115932","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.5907354.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-BT2wz+tH/m35UElCA6nFJYL3CXTBYM4sVqltqgtT/Ioyq7TQ5Cut2adVWjXqBrQ9ERVPj5Cgwn5Lc03IAL3/Pg==","shasum":"7fc54c93b707252a23c1f011f40c5036dcfd1a13","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.5907354.0.tgz","fileCount":35,"unpackedSize":1030564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLOdnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEXA//Xzg8uor8lebbUCvJldFNLgdL1GBpNyOOK7aFW1615d1LsN4Q\r\naJMaGEFuEv5mJSVsFEYiro9hV84fWLssveQxe9Ur/nmT0pH9CaxxwynD99e3\r\nKjNLO9zP2SkxfxKlkC63LL2sxBDH2VK5FkzyzyLfmOuDHdNx9PlAqmYLr4JV\r\n0LHOkGnI0+qt+NsmFd0++aigQ4xiaLASev4Ysy+vm59yB1HU3KZ5AVhIYz+y\r\nOdutacp2b7JXyxX91++faA/q7fjDco1BqTD6MiOjRkZFUS45j1xo/oloDEOs\r\nftNNx0pbiB/7ydzK2QVsv9dYYmoYjSCPv51EMa2kBG/wy4NsUraQLLCLXQcQ\r\n85IfMlTLjZbawfcgVLcH7hXNpz4d5ncnKsY95shkE2Rostv6jiaj/TEUKC0+\r\ne/EVxu+/HIeFz2c1+1z/H3MYkd/R7TOptyNbDhpbnX0EudXr8WHtkbj+5trH\r\nLOoTJ//T60BZLuV5tAlg2vS+3xC0Mmhxb2vx6JuUt+XCvX6dJqFNnbpS6I1E\r\nYv6k/d9MbOH/qi41M/9boQvFkPInYaw4ZmF5vJVovnTMEUS6IDjOt34RkNhX\r\n5UVr6feyBPEs1ADG8W1iT+jTo+eGKL429NDwnCfo7XNvqy7WRJLON63NALab\r\nX7lWrvnUbWUMYlLHJ9NwH3LweN4riN+/FxU=\r\n=HUxg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJKBPkha5542wxLhtn+HdIK+6/2crO6TZJdqndf07fzAiEAu6TQVFExfcfnekYKXUwKbcsO4ZG9JBSyr7Sr88YyyJw="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.5907354.0_1647109990915_0.9417459320344117"},"_hasShrinkwrap":false},"0.5.12-dev.d7224df.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.d7224df.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.d7224df.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"d7224dfb02ff2e59fd360ac26487c4ef85774ceb","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.d7224df.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-HDxppRrMXbfPOiofvZ7omAho5f2PYSe3S5qQA3gEkczNkWZKlOdt/k10OfQSIBwnLVbNh0Ap63KYWAyauo0C9g==","shasum":"90bbe0ae04da7f1d60c59e97dd69e3f9cf369248","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.d7224df.0.tgz","fileCount":35,"unpackedSize":1030564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL69GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3ZA/+PsiPvjh9HacYvApu8ObeFQ4cc1HBzXDTORx1UtMLczYa3aNQ\r\nAi8P67dq8jxo3+aMf2G/V5TKDaf7K5hCELGiWKKtb0g4WQtNlObx9RVMFuqi\r\nfiencbGkA4EiC59Cnb1DvWFpj3UM2R/oCRaM+Rxe1gAJuN21PvZt9HwKNlxM\r\nb/d8Ufl+MA/WLcpxdQhSwIsdVY1QlDEm2QtlvXTJ+7lMldZXcWYc6iwRHEqs\r\nANUDc2NaLCjFlavnIitnroIFfCOsNsC9idSlpdaKKIklipsxSqu+XrTqa4XQ\r\nmcBHC05DcrHv4QdpwRvrAFHYtTfcDpFSe9gxoFxUWq2vqKreE6CV4cSa50jH\r\nhEtL6eOCccyDa9rcKcyiqztF/Wq4X5sJj1BKMJ0A/Xs08AWmh75PvM/ZS4py\r\nqGVl+yI9x7Lt7QB4OZlz2TIYZbmL9D7A5hHZ9kwnDeEk6A+dsudyiziuxViy\r\nQ6Rdi7z7IyYX9CbcDvLHJz6d12RtrHksZdfubtCF0kMw3RyCpDBMSgNIiFu7\r\nEHtx83FG4cFyRdDIDE9u8ZPqy7TgsBWeTyASfUCxiHloaDbFnEgsQsWZE1Q7\r\ndPEt5zeb18JQ8PbabnI8lBm1lwd6+RjD9i0h1JlLrTnD72SXwsQNWw/BqnRT\r\nFZkviNQY8bN0hH89o/FIVjA/3LHMxWwJv9M=\r\n=QTB4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtWMonJ4oFoQkYctlNkNMIwhHgnL+16xiD7UdCdPjihQIgK2zkjczYV3Dh2EO06o7JSzVLPOtdwtDBtJWskBwYej4="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.d7224df.0_1647292230354_0.1292079273998148"},"_hasShrinkwrap":false},"0.5.12-dev.0d5b0ff.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.12-dev.0d5b0ff.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.0d5b0ff.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0d5b0ffd6ae2bdc6a542ece674d55c6d697a3c55","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12-dev.0d5b0ff.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-Z8sWHVPJbHB3mdyMzV+ad+BdZ+kY2rirgVN1Ttqk+ipXpyx+enoUf0kY3dH5VKPIdTyPype5m2o/aU22O/xSKQ==","shasum":"e948726528baeee6c352e1920a4b4283807facd3","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12-dev.0d5b0ff.0.tgz","fileCount":35,"unpackedSize":1030564,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMOyvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmGxAAoRUeYgr8F5NcLeTQ0vBP/6vRIQ9kz8ba6EYz2LnPGK2ijy2I\r\nGdrlkO0mtuq+R+gE8FXGhyexJHDIBfbCy29NneTRNMWA8rKsZ1E/u0Vk284k\r\nR+Svgapfa9xqKSr4rCXFgBRqiQpq0PVj29g799rIgPqPfMsErPXvALIFczuj\r\neXsBCQHfRjgdzn37bjuhk/8AAJABPTfUY99p/5xGm36waiAwlfrhqffceFmS\r\n2ZrgW3YjNe6mBy2k8V2io142jpDIVkyqlsxTed1cjdKbnq20IdNdUyMMrHBM\r\nCbdTjjzlQGTGO3MmILHpNDk3ribV+e7xNLqDoHk8DhRK4bRfUeD1oz6bcviS\r\nHwcm3skA05UdGzNkSaC3cam/jh2mbzNrtcjXmfWK98ubmDwUjig9CLgtLmyU\r\nsuLKQojuN0krYCcbkAg2pOg31u1cj3zi8to3medazIhQug1ocO6eTPk6HDlJ\r\nFvcoPRw+kh82THMXkw0nkuyIyQumXS1dbWsO7rAicHZuLizmuuCFh0RGYz+q\r\nZfWLBt/K8RgiEqCuAQX+jKyCv5n8zPfJhfb2yJv85rukEWvpsKX+91Hhz/pr\r\nIFtb3bQMJWP0/zL2FzpQx26iW66KcH0VPB7OlHQicYzCOvHNLwz+W5C5O/h5\r\nr8zjQpSxJQfRdbpo92EPISCo3XnAHhmaNhw=\r\n=GGnD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjwtdKAElHBeGBultRZclrAYjpPVCxg5Yf6Dn5rWCvuQIgaxrTJnehPSimmXtOFpQFAssBbHa5wS54/pZfc/X+scA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12-dev.0d5b0ff.0_1647373486838_0.6416138760065015"},"_hasShrinkwrap":false},"0.5.12":{"name":"@superfluid-finance/js-sdk","version":"0.5.12","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"1.0.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"gitHead":"fbe38e26929af66bb26a6eeaf759c721b9664f67","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.12","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-2HU5TUMtoZXw0/J+56pZS3rjlxSdduXA8qw/nvzDbX6WU6OuxH1MLDIX8d5QQW92PGYY7qwW+6Jq26FbM8HLng==","shasum":"6e2e1dc948b40b9f0e82019e7c0cc32d91ec7175","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.12.tgz","fileCount":35,"unpackedSize":1031801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMeg9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrowQ//aK/ba8bwCqHy2qVEgNcg7mgVZkhL2EB/PL/gDxFL8teF5c3O\r\nU/Xg52xVBYeEN1nbPC7MyHaG0jDwrY5hlpjm7QnEKNQDS+gbmEJ6IrWtalDd\r\nauGV4xEwnzVcVGSDIMmFwphdhxvzWCix0GgFVZ/Zt4Q04jD1c6tsHislfEuF\r\nzY1e0RaZcBfMWl+pARBCiqRo/xlVmG03D7ttayjm0xgQmN2XG7eXCXsrErvu\r\nXIzGOAPyGgkyvgaPhNZyYpjGIGHtpu+qNDZp6cAa7QLelb0F8nGH83CYGOP3\r\nqizz3M3+vFYRHsQngwUNkR31KwVucpxAya6XRqmqE9BxAFqYvmSD7o13r6YW\r\neWMkNcW29K4PtoW+hbGTnDrPDPuQow1+PV8wdSWxFJ048iHIsXhJPlMTbA0A\r\nghX9RBT2otmR5bn8h8etx8UfJ4CoqUtAXF6Y0d3kDt8GXejBpGt4OqWJ0zT0\r\nBxFEipDhvUiMI5W5wiMGXuSGPg2HLMisi90PZB+LhlNbTJ+5Fq7vWEhgp6er\r\nwlhbLyqYE0slemKKMoU9fOyJ16ZEsdJK2L5fLOCUCk9DGzqXf2TI18Bg7+Bb\r\nm0pZ7p7GltcNfG3yvODReMJ87NGeKsNxonej1AvSoxIFPHlz83UO6Op9n3z5\r\n4n2fF+Ti5eV5ZcpGyr5QtNeAJ7zM16NNM1M=\r\n=4GqU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVrBEvuUiUwVBsZtvXxg7SSxtlTuwVoBU97HACy/S8pAIgQhrg2BFq7BBRxVvlmh18DCld1UwY9LBowWug7159caA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.12_1647437885576_0.39177457521127623"},"_hasShrinkwrap":false},"0.5.13-dev.fbe38e2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.fbe38e2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.fbe38e2.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"fbe38e26929af66bb26a6eeaf759c721b9664f67","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.fbe38e2.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-cBSuLJIYDjNfyqKjjZZ+7pLTvrMUf3uOa6etrqxtbXZuV0m0VQsDEJ3FVGu7fOI7+fuGpzDontOXW4p5jBnrLQ==","shasum":"9c66bc45b12d909b2a71588662c7bed60fd8b0ab","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.fbe38e2.0.tgz","fileCount":35,"unpackedSize":1031830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMfxuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/JQ//SgirdwL+0yRuPu+A4iwMYqJvQE+52VbuS07Sck48E4itDnaR\r\nAcUUICNKpLHxuhaG1vjQl/WZHAFXW941ScY1vMIeAL71KXXzTGoeMxYvmDm2\r\nBmXQGmnsWXVg0aFaIDTewVXVL9BAJQML4VL5/QQuSV9Plz9o7b1LqrGnNsZB\r\n9zch+Bxpwm7m9D9U2cyxGzjJLPmUtrG9qrfgScDIL7dV0owxTwFxUEvnGADe\r\ntBJEQll/JjslinKvFYdn7QsJ/eqO/6ZNweLqUFlQfnn+Ii7jD2xCc6pu+/8E\r\nrgplkA0ws/rNaPAx6Wv9HzzfWhJIsy09UUByfiy7+POH08Rfr/HsmX0RI8VC\r\n42k2BaWHvDFI5173UuLiTDttEHrepvW+5iDjbUe/bT+rKbbJjZOeD29fadVg\r\nEsN/vsibhZaKtMEYsNHSn3n+EbC0t3oMhuUze+nHfcNeUX/WZmEpWrdTAd4A\r\nHcJ7GmVl36DXr6DYrqTRsi0dlLcnKwpP8h6zoL0FVTFxMuXt4+iS5v3K+NsA\r\nX1NdPjgNyE5o4RK1voq3ejzTbEbbpJu9wrX0TM+mWR4vAhMDARtfxcU4CDDV\r\nit/F2FDJN8WsGL2I6rOm3KdgtpbER/yJU0Re1nMCg8POik4ZNhkN00AAsZpk\r\n3huEZIe+icx+X3oOGfqqj3HcIQ/4JpqCr7w=\r\n=jSo4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKRWawnywe13JTl9BdhGLKta1o6N9o0dz6uYOWmjrdxwIgEMkI7wuPkRKjrEkA7jobkIs0IKVf9rpgHoAqckewRU0="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.fbe38e2.0_1647443054484_0.2653661598492063"},"_hasShrinkwrap":false},"0.5.13-dev.eb90870.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.eb90870.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.eb90870.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"eb908704906f0184bdc0aa21e16c7c0cae75183f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.eb90870.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-eCFmS3IappQuYzmHyWtIvi5KwS94zXgvz2UQrdSMHLemVwI17Ut2nA9jj1h2XQjmRKOlKhxGA/GuSz9VJhC4eQ==","shasum":"0a3a0eebc3197ee2d833c95f3e91d405793d07fb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.eb90870.0.tgz","fileCount":35,"unpackedSize":1031830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMf4oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYwxAAj2lxJQ8J1HzREC6SUxaQej8ObKa7frbo24ME0m47ufbaOU2C\r\ngRgzhmqPCn3N5VwUT3h6kx7ttOGPukRaMf4WnBHI5fSRM26peevELGOS6Yub\r\ndu5Jk18JbI7obTA6GOem+vZqyIPbnBKo57NPESx2ahS2y+m9IEYKPdwTbwHV\r\n5UfAw01EEYB2LKp/t3PHNT0LPcDbcwP42J7dBh3WA5NrEpf8OLFP1qxJf9ru\r\nY3skH+/hMGdaOYLeRBEdNGvBP7nmxXOGyW0LRqFW9VY7EOlznUOnC8IfCYSt\r\nt5xQReIPd6P/b27m1+BKqZXih/SNjv6GIRFguUjnJ1AoNDcQwClnNoYzklQs\r\nFd11Sg1XHper6wS27jb+oLMUHlcoo+RumRltRLBvOUw3cRMOFzByYLNKz/fB\r\n6WvOfqmsmm07//Lg9UVCGnuQOfR73gD7JmMHfI51REbUb+uAizA5LZqWBwX7\r\n8/O3VpUu2b8vfJjIZDK8izFJ05xjGcin+enwf+nCNwagcQmK2zY/JzpZgVfn\r\nMJmJzX36GAmYrN20PnxHtnmprAcJutc5EInWbAjj9s/6dMQ9FNhvdmru9lkq\r\nxEJGu8baCQzKtRGTesumhQYjWoDpT6zJ7BCmOudt8WdlN7upfQVuD82zPReY\r\n4VAzdKp74HUhJ1l1VnH0FxZaKA6xlSrFaJw=\r\n=TpeS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChjf411YA/C41TCbCkhW7y/mhzdRST9ULO4sbvAJ+I8gIgUB7kjAEnR53nSg3amOHUurtM471clesXC6WSIkbxuII="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.eb90870.0_1647443496189_0.25962455762362513"},"_hasShrinkwrap":false},"0.5.13-dev.8a25021.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.8a25021.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.8a25021.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8a25021ab19e4fdef7d90d49fd8ca6d925041154","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.8a25021.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-ZWk8tzXG3rU3EsGOgX963asG5HzMSmaZ52vNRwTedlDYIz/EqMmwGmf0i7mqyHu7gJItogtifTXFmsquA7deQQ==","shasum":"e2cf7cb127c91303808a8f39f78a3b761a91f738","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.8a25021.0.tgz","fileCount":35,"unpackedSize":1031830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMghyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQ2g/9GLAUf9LwczwWEkXAF1wGtA+0zSB/f0vrFWIAclN267eSUXM2\r\nKKGvvaSs8weUVpOPmydpRMqaieeS1e/K+C3LlmVNH2ih4rxTHi1auF4uReRZ\r\n6YS+Z4Iwy7NWIkthsC9oq4vTcWRbcW9nBXqziBBohk2mOJzge8OOsphemp6k\r\nlpeDmDnQOBVhzpuWGGBYJdwHTOI8/18rFVWXrapLaXKEevqSxygDA2iTG3gY\r\nJ6akK62Mqvg/KMQDtEx14+0dn8vqtKhM4V49nchDGp2WyKDh9+bBCp2NuOaW\r\nbuuE78rNSiyBPteC6oXthlAhyg6GfG94K/v9A6l/ZjJqKYbVJJ6SFcyNKyOw\r\noDsuLZsAuuhVB5WaoaEy0GL8/I2RohnoIAnm+dnFRFm0goGgNjeZXCCPt2SY\r\nX9h/AttxWgzofjW4k9b1Lvj52eK2fOj/3GtZWonxeEi8OH3YpvzhuA9W2Zxw\r\ndVZKEQzwFIKnmULg3pm99OUrR8i3lwLNNspPv+xk0fVKhIGdxt2qUNdo/8uC\r\n2y8HESfU2byTLyHvpA1MiX6JNXD+PVQOXnzTUVxqV3ZTF93CFqWyWgu06tmv\r\nHAwthQk9xbAiL9JThaa3hM0vr2MG9697WDgDjUCo1KVlEl0o7yGyR8orF1mJ\r\nhBfIYl0XBHtsxs9Jp9uWEwk3W/iuX8r6CZo=\r\n=R8x5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHcERem8TQxAV/YthM5j5cAj11jGU+I35fAtuSyXBu5AIgF2u+968IAxYq4JH7MP5MYsYKYYNSfNNObkdORPROAuA="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.8a25021.0_1647446130157_0.7989734076547688"},"_hasShrinkwrap":false},"0.5.13-dev.33b327e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.33b327e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.33b327e.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"33b327e553231b581da742a5b96084c3f464ba46","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.33b327e.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-1IPvgbhMn7nelXomJyAKTgB0q7Jz31V0NELocCHVrLcFcGeHgA/Uxd2kquhsJgdSOUGRxHl0o/fHul740SPoGg==","shasum":"349082bd506be7da0fbbb0faeea4464cb8475923","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.33b327e.0.tgz","fileCount":35,"unpackedSize":1031830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMx9PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrvbw/9HvPFQZupslkvhIDfrwuftJLKr9mmw9ns37L7ePWBw1GxoJ4Z\r\nJS3XD/mxEK+gBMva4nSF6cWF2AJSrxBa737bkcrEdioHLJiOL8Va1oZvH1JR\r\nacU+tdHPkdfLnve5DmSLo+0EHQrbptefvQCDIrSRh5Ws3wjCpBJmEqweXLqv\r\nmdQ6mbmuwx9nadbyEkjQPVEDzLG0zVtG8g/KaZ/UwgH9nzcmsgI7zRezGK1U\r\nW8RsSNlEGDSUtIBs/1IK04DFr8fyDkq8Ufw/bkvRZnkcEff06MnkesSlDctl\r\nS0+Y99HD01m3AwL4HLQ4GSDoRokOVPbCgs+KuXphXZEzRUEql54vXn9cWdZi\r\ndSERmenOnN3+xq3KoPLYCIr8/3rjdll+OO978uBLNUZfADNIIXJPRKrlebIb\r\nhT81R9gj7oU1U+sNjGU4N90/trjpUZNGok5vlqAfInp0/YL4DBA1GFLrNHSG\r\nKPigI9sBZezpyzz2BtLk4taqQUhgyydF6rodOJoONDB3GC5Ih2CiIN1WnlM5\r\nFZhXFtq2q074mxzFu0MG+hgdoKkITGcjC3JmVooSdPhdBD5/Qo/6ub5ceFzB\r\n4fGadJiD7PJ1xvC5RrlsaZgj7eVxL53/gT61zxyKL2r+n03yTbNxqiwYdNvp\r\n01Rt1Mk2F/M2K3TmLxIfimmrPn6U0mKNEn4=\r\n=xdtL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHppkQU8HykzNpZY8M2alZY8shpEu90JC8fDWId/LdttAiEAqIKWZoIzc9c/mYt1DV9eEaXfsJ5VTo3jmxSRVWf7rsk="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.33b327e.0_1647517519175_0.12543014793328"},"_hasShrinkwrap":false},"0.5.13-dev.a92870f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.a92870f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.0.1-dev.a92870f.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a92870f2e3323471e868b0db07ceb6e12d31e9f4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.a92870f.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-jaOlLGH3Cse+xtbUpRG6DTOFuYdGRI1MbTGPCop182lcNUvU27xk8zcwzKiIw1/v7zxqPqmpxa4wMiR2Fe7QcQ==","shasum":"072aadec80e7a954c3fea9e6b5d8a721bfc356a7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.a92870f.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM196ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqa+g/+Lb/q1aRvrRG3XMfOT5E7Mkq9yLgQIhM9pjRvStUNtCeWcXxH\r\nvSyCNivv8hG7bLvMf0NjkS+jKv+bdhU+sPSPDQY90ef2HJjPH1XA9PkyVDMj\r\nToaVV1LOkFj/yvJmCZt6L8xFsqzwiG2NqS6LZFPgdO1t5rYE5Yr27MZskpn4\r\nzbIOA4FomGv3qyBIpUAFDr8ORnWO/IsBA11lQEIz/xv4GaSwkWpnMVVBXbEC\r\ngU4ZpdTFtWIK4jyCc9O/bCJpJgXMxLrT6sDTRr5bPLP/oSbMVKuJcuJUhiuM\r\nMPDCcNw7cm8oOBGokba5bROOIBnX6kz31IinlHwTOUKb5hxcCUaSVx+OokwS\r\nOAe62eM1c/4BIYJG9iV8DvMgQIa59bCRciekWFOAqLZ9WYJ4WgerN6bBAi9R\r\nd767neE3hfZpOFkzAytAGjeZL6sidZU1HpDq9nuP7VDlv6IsiGQSYufk1WM0\r\nuJaB9c9BldtoSrysCvWS4MVemVqLCMQC25njleWP/VZdFAqBE4x+V8j8FO6K\r\nOZ6TK3vwcfJfCwDVhmPramW8NWbJ4i08H7QxY4RgPi5dsdmttYAbSouEjpYm\r\nTzGlBghqpZxpL7SU4H2BQ7HF7dNQNrvA/8SH/3TJT/+vv/hVQPgWbI91m3o0\r\n7UApH9tOIf04xXkRnzD0KOfbp9e5xjsxVTc=\r\n=RCC6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwZdJuHW6Cb3ovcMOkuSdt/kGgD5i5aUqIwG954/uDqAiBsD2+LpAGuquB2Xu/zZdlxmpyHidrUMv4tnsDjbfbdRA=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.a92870f.0_1647533946600_0.3768011750323381"},"_hasShrinkwrap":false},"0.5.13-dev.2e9df43.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.2e9df43.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.1-dev.2e9df43.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2e9df4366c331cd0889aa619bd710cc23dfac43b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.2e9df43.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-HHTrNmRfJfWlsI0QMVPmYaO9aPlefvHUxdIDLVc4LuaI7P413RMmsIgFqP8q7gTX40rI3ymAOfIoz59mlm2dyw==","shasum":"2694c3af083fd07109c6db2d2f2aabaf3d69d79d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.2e9df43.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiM4PuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRWA//V04Br3Ts09CmnmcVDZMQ3kdiExt7T+CqZD44po+RHtsCti2T\r\nmUL2pkDctXhoF7h/oiwNDRPzjvyL4ff768dEsPEFuNV9ccFqGouxwGez5Lwf\r\nQclwQvNLIrZseN5mPwG58ER9rGNYGdevWFaHS9TtqmtexpPC0SZB3PE94D/7\r\npK1WphBTiVVwDS6rNHWOpp8TNGbKALO8ct3eZOYebP6CT/4chlf0/XuBo3Ux\r\n8yviXyQVt0bh2twWQzND8JeBr+WruN+Brnbo6cGpTDwMCfQCaKoNu8a2vidv\r\n6DjjfxIfFt/BSZTaRLxS2/VBUSpoRDDI6xy37N5BPgRCo1thpxykHXb/JFx9\r\n1D+zamSFEQ+jwJQyr8kum4gnQlxAdyOyK8gBkwodNRJMu+QbSj4cH5vf27Zn\r\npbjoDVRw8Ak9ezMCrlqfwZFVd27G6woGnSNW1MrBsmn0DVnlPRTvWAigKZIK\r\njsxmjVyHY2GUS5kDLc+/pYO3sB8iJYkzAiSBfoeqHMP2TxdK7GiGiiAAk9dU\r\nKy0RckfizgvGE8aJdYC+2KnIuu0MiXK1AJZFHWMeAWmh3ZlaHY1VdCVfjGdt\r\ngo0lDB1w7Me9ZlJoAHFlrCUmVll7z4MzH1bbFmAh30N19er+YLeUZOUg1bc/\r\np8A4sBNu+4vN5p0kK1wyi6AptSWDFXijFjY=\r\n=FRMo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAchy/e+8UbdNIRcnkhHQlOpa6X2B15PIVQPYZfovos3AiAk1zlDJVX1V2OsOew20EQ0wLZNVBg7x9r8TnqNi6vMcQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.2e9df43.0_1647543277976_0.23137131394368193"},"_hasShrinkwrap":false},"0.5.13-dev.a86bfd1.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.a86bfd1.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.1-dev.a86bfd1.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a86bfd102b83d9c41e1b51b5ae3cdd159f60d890","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.a86bfd1.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-TIwDygocl2UNoQUsSwreu2fmdV/eDTQxiBNgLaVPIp30aj/0edzxeoT8dGblh6iHnsJ/SLOpJKn1iWltNfjpOg==","shasum":"e326ba1374c29d39ffd7c2ab77ba3c27e3810fe4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.a86bfd1.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNFn3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrN5RAAj6/DfxpLOW65MIEYSkBgIBZVRZf8hEaYliddzIx4vYM8blcP\r\nQBwp12HcEWTt9Ep7rlQ079RThTnyyzXvj0Bs0JRxVGHBspabmeZUYYZYevAD\r\nFtdKDvJKji4yqalJexLxGmgzz7ssaeDN6YzLsUFrltnkn/HmOSNQRvArpoBV\r\nWRztpouCDeKB4B8voqIKTqtXEHAq2l4r5uAURCCUBOkc4kO+GxLDvpakvgSO\r\nxMyIT+T9xuACS+jXWTUzWjztYhTJIfcVce6UdB9JAS2MMyHiOCBHRAxc38K1\r\nwqKx2qfVrolOhEoYoSHc2X8c3klNWmMy4QMPzVamC+n5ItfJiora1F4EhJzq\r\noRFFeUx4R7LlBTk5iCl8zrJ8K6UpqSm7XRA3jtTb90Wo4lDhFHLripCgAHzg\r\n5YoWGnUywOnJAyyHuTKFWIo07/NtkZ04eBolyfmWPrJE70oIK3brldh75W9Q\r\nlgDset0kkRSLQEiuonSIgTI9lMzW9UggO0hCJDfYJe6EBb13Gh3JCVrUnPJ7\r\nPAUMmcAbesAoW3frMluHwPVxVo0kaIcrMzF66g1m7v2JBPjtfLM85hJtxTTP\r\n/H1XwmjPUndaNocc6qAWrfEnYiIj56mmtm4oh7FKguiHBWHkhD7R4uf2qFlu\r\nFdgA0vk5DB49rp8WgOG3IXSJ+nyP2NwJ+UU=\r\n=bPQP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxAglDXwazkgKb67gK6JinLARnF/IqnJ+/wjD7VrAeuAiEAkCKcOg77Mo9tiAGqoDAqjGMHWVIj04InmjSdJizGEzo="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.a86bfd1.0_1647598071000_0.9184963397083432"},"_hasShrinkwrap":false},"0.5.13-dev.c77270b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.c77270b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.c77270b.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c77270b0b3936399962537b7cd9ba56432ca26e6","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.c77270b.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-yHC29XjHPXWQ7tlm0aVYchDllZyutPRq4yRpr/E4+idHIAnXNsE2NR7PSz3tiucGmHlGHVBImJLJLm35lsd+KA==","shasum":"6a4287f3936967fd3b3e07096f97d071c4227bfb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.c77270b.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNNcjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooeA//Z4jHYNLEuK5LyfLvb/Y3FlaFCkcCkm859tm0X96tCqHqzPHW\r\nfaivneIIOOLBdWxQexA8G/RUFsyWpeJaFIJcYmN1SedhNkSKwZooJVu6mPA5\r\nYMUyh7Cyc/lodeeTwesZxcbJPqOyTwtSVMDPCI/h1C3ewaF1Izabz8oBKH/b\r\nQihyOvoZaHaCbbc9did7vjzG5YjqUcpY54gIhWv866/K/YkhGB40LFlylTw9\r\nQ3NsOBMXLVGOgfon2wn18sdg1PXQgQiNGzpKoikelFJm1HWUHFITb2G5ykbO\r\n14J2C68AtOEnn9LvaGQA/VZfMiir9b1+CAS+dRGG6NNSnGQB1JNGVyOIMRk1\r\nWeNxjVFGfOo3k3EiaBRq5c2GfEYMwpwV2puC4u5ylTCPEZvUChBkrSumLBn2\r\n7ILzYEW66//gRk9761t8mYO+1gXYhEEzc3gR/GMRWO+U01DHhEMPVc77V1j+\r\nv6GeuyngijNSiQoGuB4mTAm9+e3nLnNUkFa1ENY7lmB2Mzz6QIMCSB+lzN93\r\nATvZe+Udjn+4Y/W5vRp4RUDxJxNzgDmxQ8pgEC4TSgHuNqUogE1bU7Db40en\r\n5bXNDuWNgw04nDFDT8IzLie+hKxmJEoymBG4EneDz7YeGHXpyGgdI4hlxOi8\r\nTciX3LKBgc+JO0UJe3RA3EygqADBiwoOCfQ=\r\n=GOPu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlEdTpjiDPVOOpLh5bqaaipNVY3dqKgtH1BaAgMHD9LAiBIGL2i/zZAhp1+RsnfFT4GjK6HhXEfsadPzrjISSZ+jQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.c77270b.0_1647630115620_0.9262153482561188"},"_hasShrinkwrap":false},"0.5.13-dev.fb5b7e6.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.fb5b7e6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.fb5b7e6.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"fb5b7e606d14c7bf717b40ef6f615c934b433d72","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.fb5b7e6.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-3ySjdSNX5mwWYAQOY3BzZngwtklWe4NsBYqdQZkal5GkUy9mh9MMgMyVDO2tNpBTnSkGVb8NK8OlSoUYyNzCFA==","shasum":"1be81ff60e68d5a9de3a0d3e3c43f4808fb8a3c1","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.fb5b7e6.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOw16ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO2hAAg8Qucn4f0uLT2MPq5p51GzspyFYJ7H8rgfneRUsaMKuacK55\r\nj122tfxtAz0ilB2UsMquFext0aXn3ubVMatcV8gxeNGxL7bjxr4NFibVLYWl\r\nog9UD17WXQdXz81EPEL2bNaThetG+aNmERX+0evQhJ0zI0M6FpuSfj1s9QD2\r\nEXcRROkJSYqosZS1ITzyD+zXuEOZop5uwtFoPg1dE+TOv0XXLoacr9ny/IgY\r\n48GrqiTX875VYuO3NXT2ngmVudtv9gYz6SDRGW2+1sFcepEhdk6tmBGBzq1G\r\njf/JMoRCjAXZ4LRTzYMGfGN+U2X2j9UUy6HkknlAWaIEMU0eh8yNU9ydnRMJ\r\nyc405WZ0czSRbmaEfCuzQAYQ7CuWNZSRyaYBZzm19MhBckg+32jYbW0CMaMc\r\nDhoYI9iRQSwP6f67V5ef8G9Kr/nFFRS5UpowK3UPtouizgGQX+++wY3/1N9Q\r\njnRFhfiXMjYlztxxo0DkVYSI4k2nWXN/ZMSlOg06ecaJBAcJzLazC/O1O2vB\r\nl7d54GOpDBC01U9uRZYjMq6RZodm1Ob4z4L+R1B9YrvIL1vWkigKb5TsSQuS\r\nH2jeCPmdNN5BI/W+YwfU/JrUHcAhdm0eaELk6TfW67NagQ6iBfNsHKiJ5KYD\r\ndWVyOe0dT9vOHQ8A59fJLxRKnItey/r2X0A=\r\n=wnjh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWtB89oehdblI3U3KzqypnIVQa81O9w4SeJSZKlkPK/AiAuLuqMLH7i2SYAHxmF+rxKZaXLC2juoumVjAxmtP7aXQ=="}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.fb5b7e6.0_1648037241792_0.7746926175018376"},"_hasShrinkwrap":false},"0.5.13-dev.6e6d5ef.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.6e6d5ef.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.6e6d5ef.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"6e6d5ef213938f8b8b66b3ff787a059d0132ff4e","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.6e6d5ef.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-Szuehw+Xpffv0oxmEOPUL55vV0npUNWv6goMcKbbSb/6LqwiKbcvJP2xMug50Lj9j2HXV/Zvr6xExBoQpW7cpA==","shasum":"b913e3d00e1114a197cb91a9d55489efbfb6e966","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.6e6d5ef.0.tgz","fileCount":35,"unpackedSize":1032808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiPJ2eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRyw//RDn5hghTMmITrGOQk2cETGEuhYGk8imfoolQiU3P1pCAY0op\r\nWyrNtc3ZpxFdLMppLptBn3xz7LfO7+whLypKHmg+P8INJbscg/+Cn/QnlRBU\r\njgus8Jhcm3IA8/OqjyH6+Clpjj60Pi+ZrMUEyoSqG+uLgiswgTIoWgRP0bqQ\r\nX6kGHb89UjnOk++lT0OokGUsyw0ZOOInMwIF0TJEcpVGnEc4htD3afB3O7dM\r\n6H2h4ilhsadXs+kS1hHgVJDWSjMeCcoLsbFhHcCDsSRHoIpPOTXuRX8LGhMb\r\nXB6PJWnRwUYrOzx9/Ewqv4GQS/U9tDBdp4bjtYx0u1p3JNm4yX8pmxG7svr+\r\n2dIV04ojslfjdqHFZMs7Pa92yHj/cvXDVmcxvfz/FfPo7ZispqjBTXfkFAL8\r\nxVp8KoRTmozffq1TExBYtMvzi9AZSnH+rIq1bfKA2FeP4AFomwRnPDDNZzon\r\nG7qzoDjsO/ZD52pK0nGFfTE7RkFXv7j2wEX5HFOXclYbzo3caTRs69quYh2g\r\nCqnORghgutcHXZ0SV8JbuFeLGmCszitItBRr3H8el+vaDyxeTlgwRL6ycYuQ\r\nbIzKAsIGh2dRRGlSFnA99uvCMQkWjDK/fKK3rmYfOnqzjP44Uh3nvt70WoYa\r\nNiF8gy3Hbauz9iOBnv9E3JLc4BXBn1GkvJ0=\r\n=PuOo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1/a5GHJb7w3QkDtEAbQ+l3gDQqbO9Sqg6UoQj6EmVrgIhAOr42QE9W2lPulGIDQC1rZBfxgrRWQKc8yV5ofNfyI4D"}]},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.6e6d5ef.0_1648139678826_0.7988301961338098"},"_hasShrinkwrap":false},"0.5.13-dev.24f280c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.24f280c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.24f280c.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"24f280c0c9f22a25cee79a5a1771b7dd46fa2005","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.24f280c.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-r33ITqm4F1g9jQ8AlA81HbFok4lh3f2lNGQK8SgaGma9juTCfLGcqHv6RSqFcH3BrDANtg3z1eGjjY9+jF4OiQ==","shasum":"fe37ddfde2cc717a172053f93aa4e4651fc91d27","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.24f280c.0.tgz","fileCount":35,"unpackedSize":1034450,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzs9XPjEy8s7BPuPKC6nGeKZs1PdDz1jucRz4CpedBmQIhAMFrPTTFv7fkF7fyye+FQVvYNCXW8hn2nw+vIeIdT81I"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTBLFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppCw/+LSqD3XNbFmYtOzaP5OS9TMQnHo6+OUWCv8iXfuM4Em/WJfxM\r\n541IhB1/jCxteq2maT+qx6bNum3UW61f5A6PuG0eH+h0yi+OkHkfsTqClFhl\r\nLCkG1pmkP9kJudflFn2cHaO7Oh0JL1Un/6DK5q5/WArWJmUv880o7QaErn87\r\n48bDEUjfJkvm+pEEiSIGzovuHIyQghMV0nVEUm+C4dmteOZzimKQY0ZD8W0g\r\nzMEbkbrtwxcUwpYkMRi+n+l3bvmjRLZgIA1hGVSKuXTl0EhfSSOzw3T/BgaZ\r\nzLqgPZhCORFjs+KhGAhDdyDumgsSJ4sS5slmV3WXhjLFvfl/45iIfRz7VLre\r\nxrNeqfFLP9wcVeM1WvGN8F6+ttMtvPQWynzcJv8d2V3Bc44W7SItyCljcDZi\r\nUB+fEBJpY2IgIN0gmRF5a5Npf3RMejs3S39Ar8u+0Y5K7/I9cYhQfiR8RZ31\r\ngOwO/FpQCGrX86fq9HD1oIsCM1DU+nlKG4ZUJNmQfZdmq4EKSSejRYc1Qa+J\r\nOlhmMqVE/pozLxSrZsokLMtHudHiUtOfGeaxNXQqh0mpeTroTfxCQAQaRv9y\r\nzOilgHVstituPz7QTG0H3dsREvls0+C34s0SnXlaByWl3xOOypi5bRA3rSqH\r\nSnGULWixeDDkvsXcd/pIUzrPZRa6DdAsUGI=\r\n=9xVp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.24f280c.0_1649152708949_0.7670396337442014"},"_hasShrinkwrap":false},"0.5.13-dev.9b08025.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.9b08025.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.9b08025.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9b08025e9407e09d87e5339a3ec9a8ebc7559719","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.9b08025.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-c2Z+xsMDGxQlR3x0EYG90aioC9VqefL8vhkrPpDMJGEjLrJvYHqnczkHltJ7VGXbPijvu1ehkk1O6FJRiclsOQ==","shasum":"6cc9246c1a75eff69a70a1cbb9a7f7f2794c36ec","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.9b08025.0.tgz","fileCount":35,"unpackedSize":1034450,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB9akvh4Xnr5CZXBknN04aT3BXHN9ZBnATNTvOs9lfmnAiB3x/w1+rtT8+TjLLRFIOY569qdMnrZQuT8Pb5bjMViDQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTrxzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmonTw//RKl74JvF1cUa15K9QBZHuwprHzuIe8eQgjEbMmjT99EGlCh5\r\nF1FMZhVpdzK34cFfJWdHqrpMRUbH51Nqm+3fTzbs+iiFuoNoMN9YtN0ukk8M\r\n2I5m6EROchK4mzPLeMqUd8+1svQeSR7bjAmbiOOTqix5n8iO+uCET+9SDgbp\r\ngxmW4ECtuPG2XW0Tsp1BrKH0qh5d8+Q14nYrlRPrsbA9Ws6RkuFaLGbmdRqT\r\netAH+ez8bW6m0euuasGEY/dmF8ylvJ/ycJ2v8rAOuC5H+rhcJ6Y0YSRYigIN\r\noOQXeAdAJ3cxQKcAC3/kZ/jbCJNhUAHR7BXQC2fQQneCWv8uXHa+AaK6JhC9\r\n2fAaJyd+4Ba5Ny7eKJFz9l+YwFsD7MiCNTyt42w2dRRJEJWTnicuTPA1UGZY\r\npB8/zLsr41yDTIIq0kPCmhor2EXWbgAbg8oYaLlgcr7sTFRP90zpq3YJC+Ps\r\ngpm2ZXWnW9hdTTcpKGlX04ZHQW4HJ3zGk5/DpCmCpianivPWn/98qVnZYzdk\r\nz3JDIwUs0YxtRvLmUkjRygmaUbtMv3j+4l546cUDU1MEq1iaZjPbUX4aPPfn\r\nHiZBk+c0hiACtYNlposo6m3inhzzj4H+TIYeJBa3pQ901yXlJ1gurC4nQOe+\r\nQwtZbIFlvJ1i4CNN30mYpvKv7hJzjBqN2SA=\r\n=L3tB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.9b08025.0_1649327219293_0.3353807696047235"},"_hasShrinkwrap":false},"0.5.13-dev.ce1e30c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.ce1e30c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.ce1e30c.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ce1e30c5239ab756ebfdfdb4d27ace42b9f2c5b4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.ce1e30c.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-K5k1V/4PWkCPG0M2H9VxTZSDdUcpC+3F1/LLnMv5hm9hTxO1VXCJdrvj94SSVBzgPDg0aRNXk3dxsbbdQmC67A==","shasum":"94ca3a9a692f86de239d30b5e8e1e89e293b0293","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.ce1e30c.0.tgz","fileCount":35,"unpackedSize":1049786,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaN3+4f5b9ZjcJcmYQtuYTaSb/dXrU8x2S93wbi/jJsgIgIbVOUqMO1pBRgZK+uRvgXSdrnBLatmU3zoJlN322Ya4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUAb2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/4g/+JLhVWXBdqFRs9pjgCWoJEl/Gjtyzhc+4BBzBoQXUepO4VKPL\r\nctMYwYoFC6Q2YasKstRRWePPLVaLzrubxBx5nUtpng7HRX5w3viN0zgW2cPw\r\nKKPaRYlpauJGrPKNhs+HYj7gomjo3H7wUrzbHuMMMsumIY2MAq25PAgVlXiy\r\nJ81ke25y/ehktW8CN7GbLIj+gxjsTStGed10fB/jHU1Xcy/71IXZGk4DoL00\r\nGvvgX1KmnFi2PYTFG4yHPXkHyB5fdTP1m1wjQiAOQE9SUyv6pkge8E660bDQ\r\nGHXjjfPkauxyH0FlK0BMyF7yH93Ot7iaQxVPrtgoUXVIOHGDuQ4KIvnEIaAL\r\ngAx+hRpWNrPKJfwBQKwjaQg/cYwAlewtLhcBJ2FgwgoCEnBbVL4W4zsmDlhq\r\nidMpmN8wVDH7iJhDopgwyP6u6N62Dfd0uE4qZvM+D/+SUxa9xkvPirpTUxsR\r\nmYoxSg2sUGnqTMl0bNR8oGTNmHfTIylDtoVgj5X8QUyJD5W9UvCpKNaoFI1X\r\nm54un5COiGDeYhfsIVhWTcGrPYlA2Zp+xM75Dks6wsht8Kp1KG+f0gi+M5Xv\r\nIT0Y0Yo9q7XQ9aKVMF2uQn9RKIqb7LxdLoaqLUMcc2ISJPIwbN+g4iFWKPAJ\r\nZSnTwqBtr2M5H3+5fY/1xfTKK33FygpnHvg=\r\n=vl5b\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.ce1e30c.0_1649411830551_0.5693548579759924"},"_hasShrinkwrap":false},"0.5.13-dev.e6ed873.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.e6ed873.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.e6ed873.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e6ed873fe2f01977e72264ad6c2bc01abf258b65","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.e6ed873.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-YbaoYa2N6RaGbxRIdue3ygnGB1bnItjHanCGPULAep2iBWI4/gwrfQAxXNalIdFpTAWzMItB+qGHMu0w0SkxYg==","shasum":"e32f5073c568dc4fd43db750f9497748eb5253cf","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.e6ed873.0.tgz","fileCount":35,"unpackedSize":1049786,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFMNJKPQSmSXDTC2MBctveT2qTkqQ+v4gOWn4stl7JJAiAeqyjMgheCPyO4G9VOwFGfKwDWMUn1Ts/AIB+GaMYeSw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVWnCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJGw/8D+n/8tiG43qAw8i23x5FyTB3fWHdCz9RzGQE6mtNvTRMgwyP\r\nuKCUZbAMFL2itMMreg35bDVEpH14jjO6ho2VT7XTeElckmD1HzMqFWfRWTYz\r\n2Yva+ZmW7SyWKlnLXOhlQ9l9zdcIeH6g7gPvzGirjEYXkCZy7CkaUvKXDmCD\r\nwPsBeJFpmMZye1UwI97YO1S4YchUvhj+sHIKMSCke34NWN5TNjbGGTr0mR5W\r\nsnbjEunIWHeOse1CSVLvCJRVp26UCST2APFP8ZY7o+MOx6bDsD8kQ+0DVVy9\r\nHkN6UXqgUoslclXEKkKG+GAKHIFhGWmopYNZNiXcYQSKDVh5bTaTQmvmo2Pp\r\nZ8pavNIJg4X1jhSAUQq9D6SmJICIKFh10/U+WI+YmCqmMgdc8YuWaqxZS7wj\r\nnQFk5TlH05bH01xpqb/jixvQQpVEj3/6uU74Oq/mof57dYDBeeW7+DZMAMyB\r\nzJT97vaG4MNPEyBXintA2Y8swNQYoYFIoDZuWwlvlYj906tL44qFXf8vROBt\r\n6u916xgkNJFv6iZ5bLKmUsScrmBjZwAx9YYHmFa4Dt0E9Smn5s9G0aBzHdbC\r\nV4wAjyhyjFwyLKvNBUnsPMQ/Vu3AHVasKVwNKj8QnDk75NSLcv+c7UHIOYsa\r\n/46XN0AC8pFaVi3DZNjGKmXIdIJ8kmyB/AU=\r\n=aapf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.e6ed873.0_1649764801609_0.5416164964395498"},"_hasShrinkwrap":false},"0.5.13-dev.9dad1ad.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.9dad1ad.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.5.0","@ethersproject/hash":"^5.5.0","@truffle/contract":"4.4.6","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@decentral.ee/web3-helpers":"^0.5.3","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.3","@openzeppelin/test-helpers":"^0.5.15","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.9dad1ad.0","@truffle/hdwallet-provider":"^1.7.0","chai-as-promised":"^7.1.1","web3":"^1.7.0","webpack":"^5.68.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9dad1ade9301a47f29cc9cbe4f1337ee62187e4b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.9dad1ad.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-S7fFWm/czFsY9u27ws5JeCI9X2YTYz2I+7uKovL+mVSHfIdv3qX5Zz+xKmsz7hwxmT1uPxSpVG+nLl+IJDBYZA==","shasum":"55227ade33b6bb833b78e8ed91a331b4414240a8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.9dad1ad.0.tgz","fileCount":35,"unpackedSize":1049786,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmNNTkjTf3ErI2YkNxbZQgddeRMPd1+MSfiwTCom/ktAiEA4bWAEOKLJnavVvfW6kBIV7b4zgXVmdSvhhov3n0SbOw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV+9rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCjw/9F8KogtOIvZNFd8LTPN3KJM1M3N+DeQ/I7kSS9GE4w7tceUwH\r\nc1mqbyL4ynyZssrmyd8Yj4VnFsJR8U1tId1AGVtMNdysHpVmM/aHsuE59lQr\r\nKYeuxE34g81im908sNLJ3pvMHrmN0GEKGWk10j4zwWXc68Iq6A5AoJF+wRPw\r\nJ5mReKVwhqL5jwORyhLPI8r1/7okDLsy/3pMqVnaUJh04V1/weSvg1+RlxZE\r\naJF0uHNh7NUbkfFG8Zq1SKweBqsx/oMNS6oep4BBhvko+g+Qp+a4xIRe9pBS\r\n8lbj2sDoOnilqEGZtgMDsBXSV99ehKwRlXEfWAAC+/kJbWyEuU/L4Z6wXU6D\r\njBGcf1rEU7I4EduCGW2HrRC0F1z50+QMVgikW+fmN8LGwcS2F4OgBOvEvbsQ\r\nX9mkKGmduX1/1WK5zW8P9tVAdfX/E0SuD2tpdaxADkMwvCF7dz9Hw80UEdJX\r\nHiGW3n068NyhLmUNMKoGTFstyYBLc91XI3tGKbyKffyh7FRmfEXL6G/hkjJw\r\ne7MZjakmv11d3njw8HkQj7nlOrjoq38sxm91YbtG32K6RTRCDwH6gnywIxdD\r\n21k/TK7Rm6Pm3hdDhH/g2M7B75V0RbOtNO7jxKpucuBdjCT4yoCQozXWjb/P\r\n/jwjsvPuk98hQxIyKoebt2sBOhiY505FprQ=\r\n=Ipr2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.9dad1ad.0_1649930091343_0.07913941509078692"},"_hasShrinkwrap":false},"0.5.13-dev.171c838.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.171c838.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.171c838.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"171c838ddee9b9cdcf47ae5f371f6ac1544aa0e4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.171c838.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-ycz4Bx3cku8f+RuQlpLKOpLxYX4GR9z48MdUcVGQKpgUXQLaGF/t73IqbnON7+ghIwT9HRAGFN/nb+rIPGIKFQ==","shasum":"9c2a7177e138b388953160c4f1293ae8d977501a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.171c838.0.tgz","fileCount":35,"unpackedSize":1049085,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQhAyrPuHXbHiUfGyT8B2oe8mi2mkGbLedE5s3eJP7nAIhANEdRZJ1GFfCBBEfQtF6ghvVM1k1Q9ktZ9LFLFU1OGke"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWDOdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrafA/9FnuykCti+hpg6vlDPNpVaDVj9S2gD9r+Chsx/LTJpbr3uj5Q\r\nlPV56XQxWgOOFq9zcc/ucmBFqImSU8NMidnXucpgq2bPMNXl8n+5vtmhZFmm\r\nZKE5gHO/AP16ImMycgwi9C2fAEBsvKQdTEEyld51FL77bJbWvU9Jg10wxTPy\r\nPE3QNobnw4HFlFTPzdzKQb/lcVMWuWsLjUZ0cKPZQGkgUpqDPP1RTfpz+zn8\r\nbOWmbPBqELJLdqdv9eZiiqGiuwF76x8K9MbCQnSSOcIc9c4C8SoGDPC5RP2Q\r\n2kZ67BmQpapsAaol4pHnJD0kN7luqqlHajXD2lSfPuF0VdzqJOkxDF+tuLip\r\nncn6bV5R9eddviPS4JuLjGpHTNTOQZBshBLKb+9xgz5opUhlDkZYGcQ1iGAy\r\nr7s2LdAQosYQ/AAoQtieY5sMvSCQ6OffWtXwmhGI5+lFgEFK9DrRMPypX8Fb\r\n0uqF9YPikhjhBF9L3nM0TkmgfQUZjsRZ3aRfgRCZ3nS9tXv5djyTXIwJsoyk\r\nQRwrA4zvp1A5dNOE23X9RILSxkjxcQSg2Mxi8SmeQgbAyYLB7jyT2gDeY8q2\r\nrz6Ox+SUJxQ5l431QC480FQ/98UYsFIX160kkl+G7zxamII0MCFZv6D0/q+d\r\n+3vKhjuHzT/GsxotdDIygO/0zGZF+3s/b10=\r\n=ViYe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.171c838.0_1649947549286_0.2172390705826739"},"_hasShrinkwrap":false},"0.5.13-dev.f55b791.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.f55b791.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.f55b791.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"f55b7915ae153cad5737a97592ee4698b5656378","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.f55b791.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-uJUnYXjbXBzllqd0/64dt+73kzzNrQ4jq9p3W6yiGMhfQ/mcWWlrjMBL8Hcs4gU4sxOwVE+0XHectq8627k5qw==","shasum":"43a38615b38d53b31e4cbb54c601b78f9adb8269","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.f55b791.0.tgz","fileCount":35,"unpackedSize":1049085,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNHEDPCqFrawUSApSYqB1Ukh2GUY87PcG00iz3oCbFaAiBPa0uEv53GKD4D/tNhLliiCSX7l/JLaSWG4dNy5Dp9tg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWEhyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqbaw/+KjMHgaagRgKxOiYB8stHcF5ja4LYBySlegvZkZqfz1kiUwDO\r\nknhPAFzxWyo5fNfVEX8dibBgYPo1ucLGjRYXxnKa9ttnsvJF/UNADrpsDZXk\r\nSgtahC9dxHaMDuFhscf4fg0JPKiM9X+H8uVcWU1PMHTA9FlgDFcIVC5b4DvM\r\nW+JYsJ8vIwZLcQwozCQTZH2qJQVjy6y2kYMCAAbJD+YeKxfTBBB/WDbW97rL\r\nlrsRhKk5QmmbAm4+ZZMbOnO5rZ+Hfla4GM/hgdBVblKyJCkmlLI/QgQU5J4w\r\nu8cWlBbFt97JmBVACSBorrLSbE5S6bY1loqvkWSpbRKhhuBtP/8vRHRaG1nW\r\nVEAreJ+PY89Bkj2fdjPwibmSYGA24y5foxsmh6yPyvBFqDr2E24pR9Xi6NFI\r\nRN5MX/H4h2tDKnknx4XJVk/u+BZXREQc+vheeVkbD9S4D43MOl1VgvGq4v3J\r\nhm8olPsTM0DMWsYCxpaUbINx7MbhfKfxKM5dqV/81um+AVPRQsuni6Z1Hdys\r\nsCD/ijk5rl6guFOPNtYwNYfoDU/GccSltN6/L77dVfI4xe9h4n1dudQZxHQM\r\nHWyxiChGIHEXUYcMDd2d2nDN6oDOPueSmiNOAIlYJsGZ7KEnS6MNmmBZ5PeL\r\nbv+CVreAHbaYf/V8V//2/J619f4R2MWihbQ=\r\n=1SiS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.f55b791.0_1649952882434_0.46638395936216615"},"_hasShrinkwrap":false},"0.5.13-dev.ae7db1d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.ae7db1d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.ae7db1d.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ae7db1d7249e1872f96d5907edc0fae3f15371a0","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.ae7db1d.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-gQ5hjvT/4JebkQhAU40Dixmr1xvGtDVGFnctO2vNEk1EC3e8PXkudzrd4ozcL72OZRPKaNil+Z/G8q3TBb2LLQ==","shasum":"09374a8ff4ed221fc544ea19dbf922fca5378134","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.ae7db1d.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9R7X8sQdVuA1pWkFBhq6Y8R4myYmtGsKsoQRg7fFbpAiBKC3hbhbW8AzF0rnNGf/MA/vQn9COmo2GIafplEGtQ+w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXVn2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpclxAAlWHkSqxLD1TPxuw2R++N5yCpgitGhfhFR2YfOnd9qiDeEXN5\r\nn9NeDnRvUJPchGyBrfcIjaIVb2gqt9VoyPepyw7KN0yeStcmF/ntR9iodioy\r\nQEw0J4gFKzuAJ1Jv5UVd5snkuT10137gwgPYp2Ddy3aaVBbbLxd1eH9YmZ4R\r\nqIhjDH9761pWYVXUmH6t+scbW6TYPezs87WgsZKLkeU74+QK9EMvXboaOyJO\r\n8iM25VVE8NIbEhfvcEDyBtK/MYmbGDj1hf7IOmn5XOOWIrwcMvn0zw9wqKeg\r\n8hyq/9PF3C+ngdEBescKpCuLswVNyH6CmwUCUdpJT21+sN5q9iyC3nRxHW7d\r\n+fzmKF0KSi6mwqtu8UBAFnb+DAgfPW64g29zH4b8XPbeNb4T0FlvAGl0V5DN\r\n/jYF9RgOfucHxeZ4Wl9p9O369Jqwd/tyEHd3T3J6yQcPibBNFJFuOjwR8A5H\r\nK/yQPuqMeGNPbjW8tPiC//fLp4amnjVTh12JP19m9gqd1VPAS5nWb1cVb9Yg\r\nwI/AkxS4ttCdCR4PaIfsP63Ny5awm44B5KKckqvSn1s4S/6WOn2mxkPWHyXS\r\nq+ASATcYsAcJ+CPZcr17GIFK4qkAw004FI4pdbeX3NrVeWA/VsjwRqOuBWin\r\nQ4CsxhjGTaCyTv0G1qImQnv6YwwjpAmOTsM=\r\n=SAxP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.ae7db1d.0_1650285046185_0.23638280351998509"},"_hasShrinkwrap":false},"0.5.13-dev.84f366b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.84f366b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.84f366b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"84f366b3d30d242d0a9173ced45b0db227222cb3","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.84f366b.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-xRi0Xk1x1RwifayJVsF90KRUNla3RPmUChEspX3SfisaI9Vj7bRGjr+kwr2ABN/PZO1FVg+zT1nJ0DReGGmkiw==","shasum":"d4b7d86947435483cb313509b353c80c01008128","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.84f366b.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcBRJt/TY+jPWvhstgE6Fdh8ppz1N+eZt7Q5F5hi/9mAIhANNlvCv+Jqeac+hER8CisgVuan0Fva4VFZaM5ATC74C5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXWAjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGuw//dCVhP8+VHMXXSBvkyQHMidXuXrDNFiyyKdwm/vwkWLZAS1dD\r\nQREE5Grhpx+vd9RIC5idlLcDRxVEzppl+BuvRg65Xz8meHUeviI//F8P8I3j\r\nHG27WJXPxpBhZ0tutHWb3uO/XNl1p3lx1SJNSmHo6tbI7LvqGQQwbJcv+HqE\r\nbWtCcEwP0m+ifkPhzmP51kvhRnCYdiGU+vZRP+sfaKgXfdYoOlqT38kqVQ0W\r\nIcc66MYlHhZxC8ISRJylAQ3bHLNkHC0o4CRgoXJW0jrllMVzCMEhYgrSeFQF\r\n1fSNadyGRJjuuAj/p79HjEdotUXTVwljaLqzZYLueyXvN5hjF2v/Nw1tiOA+\r\now/v0fjTKgYbBITydovl6tQc2pf0l1n/1QdUOjEa6nAtizg9+tJSOdrFDhQL\r\n+7LRV0xfBTaOe/ArI3HWq1RTuGp2G0wWYHIa4hQik25zVBWz3KcSSdaP9wdW\r\nAefHZ0GmngdxBHJ2aUz/umgSYk7rHMp7wCHwb4U2XFl4pPKUSF17Wksp/4lX\r\nZ95V9FEqbeqcCXOYvbYCvPFyAIJFz3wFxTi2aTyE47sVoKxqCRafdR9yQljb\r\nC7E0OP9UiNcpf9c/2e5wji0mxgKQMOhQcp09EGvtB/QviJUwKxV1aFJ61zNc\r\nw9jUBwCPGqIvQhKxhFIny50HhMMOgyecqHQ=\r\n=5GfL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.84f366b.0_1650286627014_0.44275209873566723"},"_hasShrinkwrap":false},"0.5.13-dev.0839cae.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.0839cae.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.0839cae.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0839cae1488e9db6c1eac69208bd55079dcf40c2","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.0839cae.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-QnqSlyim1W4WlvaWEGN4lUULQq22Ndt9KikzQVZggX8lJ2Me1Fg/9ccUAMI7Y60YGBVfIs+zyQqJJuRL0xTh3Q==","shasum":"69e827cbcee866f137aa3f6038a7f4203688320f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.0839cae.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa+sUVJhZrhxATQiYMLmGzIboUwgQA5KlYco3Mpsb5JAiEAvrphLD5s3cz+brIIJnAJ4fvE5aDWw7rasWs/EybYCSM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXaimACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEJQ//SHp4/00FgdtEP7KXs14bRFR96kLkeangiV3hknfsXiWIfqFL\r\nUISawuy/2B+qsWPP2v6hFVkDOhrTvgkkVIeXH7zhuEKnASWDzuX4AJAdGOkA\r\n7XHxr+FX8pzazSfueKVvlMq+cebw6zFvixclikpF1AFB2u6Qhpdt8h6e44fk\r\n33zIKV26h/PMh8yft1woJTS6jQjvQ961O5kaWlL9uBGLLP6y9OOmpUmH9m7e\r\ndGDhCBkK4dM6ZyKMAWrkFLej/CIKJrBuidW/wHHH6b0PlGdzFHRcI3Nw9PxX\r\nQsr2IIJ812+WBnMA0MS6Rub75Zk+3tonoP2FpwHpipLnKCkrac8A2RrtqB/V\r\nOqXdhZPL8BAiTBIXU4zCK1VXtouXEovvD5efiPMJDsrGH9FLVVJh9OhsXRrx\r\nypOxPA/5GLbRD6mZH1NgpBO7QC0OWrmIAemmzlj3oqV0iEhg/Ly68LS5eONw\r\ncUojtiH2Yu1KSbVYSLOxUy0xt5BH3ktWvFzm810CIV1Om9FCp8+MlVgIMTc4\r\nPx5hnz5BSVWn8gWkjiX7S6JrcX1VS5xfH+DYquDE+P043wL+pBQHmi0lB7Sb\r\n/xXQ1/R+vCpDxW2DqeNqQZcQ8LdlowTV/z0AdkAmOzkv8qbpoubYsxiBtUQA\r\nMA2xJOZlOTofwbm/fp391TDfHb46VEcFNuQ=\r\n=14u0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.0839cae.0_1650305189871_0.3445275162707373"},"_hasShrinkwrap":false},"0.5.13-dev.5923a95.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.5923a95.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.5923a95.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"5923a9508fc543046ac3e81d74de535f67bb98f1","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.5923a95.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-KX4ztrAcGQebILZirvIFfHfEsc+FjZALzC8ws4HA0ZoKkntGO6IRco3HZsBo6NJrT9J1tKgMdp9L4iAPC9Qgsg==","shasum":"c11bcba6eb87a2492b818bad3e12ce36ba0d5517","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.5923a95.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkwvwcXNfl3Touq4jAFtRgUrWC/jqXdmHwOtrT+QUPwAiBNBXR36bD/jz2o+e0rfY4pO+z8ofb7qtM3t7fFMpN4gg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZtZHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqueA//aybJpMfSfrXQlhFTuhoBkO0cGHIoF8qeAcn67woiGtQS97Dh\r\nQ0cRu+yL47+htYJo0/pwNgxsn7KsJ8FhQNldP7EQw/Ou1iuQDdlvzf6/AG+t\r\nA1IoT9TK8VZoV+FerhmhCB8+ji05uP4+K1f/ROraWlZXoyKC6lCjkHZhCxV6\r\njDfEUQj6CrlSMy75ak5hy9bfxM/UT1P4mzId9BX7SfB5PLdxJT5wivDaqgOC\r\n3jKFenbZYRhBiYkP7TTY6tU8EolNrgx28m80ImjTWgBKOjqD6nYMjDLKSXR8\r\nPLAZd7pQBIyysxb+z9Q5P5OqlvVHGSL9mqmm47iMMofQq8vO/goR0WuUPNLG\r\n3HszBFoONDohSFseXTpzu/7aI7EcrEKmONRW1EpMg42vFs9YrfKFqo0Pw4M5\r\n/gmqJ32n2y2sl9SIRlV0HW+Vwwx1lJkwMyekmGA+Cl5ar8Zmw1FxfnR3drge\r\n0ncOM9XVqWJk7AlQRfin8+s5K8Ew++nHJ0Fq0OK9GeQZGPCZjU0cCM/EUqHa\r\nUxYudewLTXmBOCScdg68bDs4ZG8ffjXirVE4MqUu/DFXH+6hyZ3Di3/kbP7j\r\nFzliJ2jq/mm9fpOEOF1H1P8CPg9xi9+/+gOGjkhqvqvsmURTwXarIjVnasRi\r\nev0S/5EGOc954Qky4Ci3XhpQZfkr+APt99k=\r\n=m0DH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.5923a95.0_1650906695781_0.10838691313129267"},"_hasShrinkwrap":false},"0.5.13-dev.873a0d9.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.873a0d9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.873a0d9.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"873a0d9a8553607edec044f45fa10cda80f1274f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.873a0d9.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-x9Jeo6wQdeTG4U5onl/XhDDW9Cg+EpbUDaR67t5/gtO4eoDSMMr5KzM2SwzSmZmdDndueNU0tqggUjiaE+JbhQ==","shasum":"2c60b5b683bbf990385a4e5ad74ee29bc111cf09","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.873a0d9.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfq4NhTwSPeCqsDg/eef/CuEa4/BUpCQSS1s/JCSMDsgIhAKHVU1TNcVeZC5P6ZdGa30r/ovi6IOVrynnA16DzuzTd"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZtvoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLSw/9HdRKL0aBioHV9U8b2P7ddF9kT7jo9TER4ANNJawxYVSrexZ6\r\nbdDK07bGRG1UkEey2I6LZRX2KYeCY63KU/bI/iaEBOoRPMSAp5u4Yse72zIS\r\nD24clCKu9JR5e7HSWjDfziW8lgbT2RdHTCBQMdNuUEOXDyc0n5F2K6ClWzC2\r\nO8rypZP9DViicwLYCFX6jO7MxaL0+AKkBEhlUoepYsspRNxDY2d7i8YF/oBx\r\nwRvgDs+6jvP1TmqFsxUFUOLeA3abKx5KqK9z28+2TrCm6gGKpojLeFgr0Tq+\r\nYbcqToKVZz79LBAY3IdhtvS8QLisHeyujGCAC+7LuVv/Xcp2nKOxrc42Qqpd\r\ntc8sA77vACtPgshQB/QLhp5u7d0R+9DYx/ydEwgh0Y4eGnoPavSYXAqpvb2b\r\nFN+7anDEwbmSZuM43iYpmmQuMFmK9ixqQsnX0cowgVAt3EgsvMWkK+65ngz0\r\nsk+LVlB7hH3TyYdXo6x9eF1Sm0Azj0kGqx1obc+f0tWFjva4m5sezGcPpUOH\r\nEGlwGTvEOFOKf0iTqk5uoP0gLoSqTQqhQPdXEapOC7vIKS/yAUCc9WYaOiTD\r\nTjrNpLJ/KbHHYX+4NYRmiUu48kkSGrEH0RIg6NxszFaH8p6JbLvkRkKEqVKU\r\njX8jLxyD46rxFMqdcuaYFCOPwfNPEIsSUT4=\r\n=z77C\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.873a0d9.0_1650908136132_0.13168493496700084"},"_hasShrinkwrap":false},"0.5.13-dev.812e77d.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.812e77d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.812e77d.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"812e77dc5eb664ff1dc9a32908d9878d6c977de6","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.812e77d.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-EBKfkhQMc0CEAcY6T8RSJ/kf6O0hFPaZwDlrRnrMZAHnYSE/m5fid0alaLha9tn2vppqW8yjSLycngUJBsUYNA==","shasum":"58e44ad842a48396b80bd4670dad7f3c2d59bddc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.812e77d.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC06Jt4wwTMoPsKFMgWX0SwgotySgzAuE9BPHU0RZ4pqAiBic80FWfV5QIN65lj2ALycL6rWRFESkHL04tezLBkskg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaCL5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoi2Q/+Ir4MwfqzGYhw1YTRXsM+pmCMuEQRC5eGagF5CveNvyTZattk\r\ngZaVZN+FQU5ydpfdh/nXj/t+3dFWEXqbYNpjPcXRGJO8gmmrgD2GGT7TuU64\r\neC1dwEtAFf520zUho2MXffbzEZBev9N5jVQu0wtQ65MrNJgo0PmJ5oCLYz23\r\ndCq1xzqLN5VkEIWQXOie5ppqv6NbBIItKftNiyz7f5DytHmbZaEPqVQYwQ3P\r\nT1t6WOPmlNU4vN54ZuhTXz6NAPwk0USNEfKA1A81fmHRD5XlGZphgnVAVGf8\r\n9ytuXKHrvW4DmOqAsK73i3RlerENq+GJ6NyqzOpqBb6nmX8UkKl/7U+mLH3i\r\nAuJ8FJkyrroScxJZQP/ye61yTVGZROgKSk5kty5l1LxBvSFQGeVcdLC9vaRO\r\nk4z82VpHXLnGzkQ76Ag03lmfKdtv5NIntq8BgZlHIZas5un0bB9mO7r+ed0k\r\nqv0TF+scw2Pt8631b2odyxygR/slr34Djh9HhUFg4EwRQbzF5xfEcsiuVqWg\r\nQXgh9ARn9nxB+j5AYS1wkuzh+pTthMOnxJ+eWDErkn9Fdi4MFtLZjQnjE5iO\r\nCmR37Rp8Iv//l++/fbqMVba4ttoCsBu0MYF6ASlAhJM+2LpxNsf1UNzX6hf8\r\nO+HLJwWhYkYhzT34g502bDpCWzERuxKuDiI=\r\n=Y+zP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.812e77d.0_1650991865742_0.7302883214238816"},"_hasShrinkwrap":false},"0.5.13-dev.9bb2a5b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.13-dev.9bb2a5b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.9bb2a5b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9bb2a5b6f89b7d209c779f673421fb8ad43cda48","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13-dev.9bb2a5b.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-oxy0qet5+vyyWoG162eOcKLrJMML1x/spS6VUCywnhMALqSiEgQiUQX9d3aaj+QeAhDD1Lcgp+HZjxixx/Z7lw==","shasum":"9e1abaa587e759adc86286b5e796d885d43fa460","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13-dev.9bb2a5b.0.tgz","fileCount":35,"unpackedSize":1049069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClw2CI7NHbSCiRv6rtQDvaa2pHbabseMBxUDKdnUJpEQIhAIg/YmB64SSO1n5yQf1FPnPuQrzfp1crwn+Ma+H3XYkk"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaS1VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoScw/+L/Vg9qPMixpPGtTOml8TYtESIpOwgQOenxsJKKqiYBA8TKff\r\nMjFt5dBlmMr2RuDOjLAS4ktr4/3f3A4YH+tZDT0+Jray7iwLBGWN8ZCIr8xE\r\nFtZ7vF+NYwbP4EpWzDICuAUjmIXQpMxJUsrq3A9vUzP0pltLkfMCZFmUtxtg\r\n007djn0oOlOjRCFcUIcOaeNbKJoWF+gr+92BmPTbiL+cmEj8BtMR+A31Cfvf\r\nz7YrW03d91HA4MPnyVjzlFBJ1mVAjltM6MQl3JVaBeMvva1hRsNbNhPHAGgq\r\nyaQSKj4qMTpzCigvri2e/QGAXD4cp7SKsdVCdYcccLWsKj8oh32YLRPO9vEu\r\nHK0BhiAuSVV4ktIRRP4u+cb/NE+u3r1tm6g9srpmXjWKSsHit2gD7dzS4Si6\r\niCg4GAtJWRfq1HKhYs5ZGIr4XhMdG0gQrlrImvpfoyxbOziu9x1hmDjGXTXO\r\nURj2/keNEV2EZ5fVjWsquz8549SQg1ZdYWxpggjOP5owEs5TLAhEtcFsLGYl\r\nJvTaZDJYuhkYi/R/+kEDTLEE759EgZVsz/6bEq1omSn86OD0V/njFiVxdwgY\r\ndrctSHWxzNk6GKAFylEQ4O/7VX4+sHtbYB/hyR5y58XkCArGoyFwCErhU6wo\r\nVF0Llj1zmbqWlFQoJufRjhtcQdcKYU8OawY=\r\n=MKXi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13-dev.9bb2a5b.0_1651060053740_0.12394923918400425"},"_hasShrinkwrap":false},"0.5.14-dev.ab3464f.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.ab3464f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.ab3464f.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ab3464f8ab46c83fa6cce1877b04798dda125bd9","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.ab3464f.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-0JEKIIt8wSYfMVA0bnmU8viLkQ3u7AhphaOtJHfpnZk68l7xh66EiJKmflaWF6t88dJ12AePdrsFxDG7u8ICCg==","shasum":"3521105f5c53db04bd620f177d0938c6f862b9b6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.ab3464f.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDagUcXGeooW1SyGHUOFR2/1h3Y0fU3AJI0CQyBmneI5gIhAM+pgTvFeb5ZOWkpRKq/5GS3TdgViDC9puz9WfWC8bnD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaW0EACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdAw//aJgUyBTbPvI70G92M5LT6e/Ux5pT7/AGyMT07ifHM3XhWv8n\r\nZxhx/opucgx51JROddWerVu5zO1tie+bogTDLfbl1PrgyebriVONtFzGnWeV\r\nw2KCy49MGi29DEJ5AH2DvjHM3VUWQm0uRZ9N+ro3EmAql3lioICnQX9mkNf9\r\nX5MyNTFo1B/nH0xThUa6X5IkgEEiIxCOwpel9+lK5UymdlqVetjquvCS1uqt\r\nTp1jVxTKsmnCKILuKI6lE9N5bJ+kjV3VveeEXIlihaVTJmfKsSyf715ZVR1x\r\nPDr9WHlrDWLFcivViwKwLFUvdPiaihdhnkq4/KDCGjAx6FYCLsUZOZQEfbUM\r\nnWIx/D425UWHe2Y+d0ztoXMToFIPVk3sFdfALug6zn0VzBylwaG5l4zHm00F\r\nfSCceqhBqsmoRxu+mUqajS69MqE4z0gFoPwm1kDn67UyQdp8qFSC6lzIZSZg\r\nxMxwF7eKK8m5ir8R15PpDg8+9af5OmP9zqAbQ+uxr3Oip2ZQVJryTq3xnMPC\r\nzctz2v4Kg57XFFQBndTtswxRC55ShwGnZDS1GrlAfIZ5h2B2/eAXHoflmZKM\r\nCcZdM83dGKZdlrXLqtIDT/OWcFbi6Rwz4CmT9EAAy1ONErRQ6PXWkyDUSGSI\r\n06t76R0LJ8Uop14oVYqYQ/01+h24Yf/o4oA=\r\n=NMHw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.ab3464f.0_1651076356051_0.7977379898279804"},"_hasShrinkwrap":false},"0.5.13":{"name":"@superfluid-finance/js-sdk","version":"0.5.13","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"1.1.1","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"gitHead":"ab3464f8ab46c83fa6cce1877b04798dda125bd9","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.13","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-bkRYFD7aZIVnlxTwJUlViYBq7mXilNvDdBcJhBQ3vFlTPZPrNg+zL319u5C+vQGlkDwtvAD6J6nR0CnuQ0TR6w==","shasum":"eed9f610508705e6a806fd1356b53945ebd6fd32","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.13.tgz","fileCount":35,"unpackedSize":1055422,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9/zMgGqux0O8j+aUyn4Iohu9xxj8Xbm7Zsi/+IYgCzAiAqcImaU32eSyRaQrZEx8gkktVroOYwnuB2+XSV0Mg/ag=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiak5xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Cw/5ADtAV+/pJOKM5KE0ShtV87W1MMBkiHi9ScTRG/pvI97G2QNr\r\ndthfVsEBsfr4GiGx1ZN/q/LUXHm1OADiNVc1J73xF3ZKaMussgirWdfx2WXh\r\nprj4g5R53b7z5YVcpe/eedIQjL54k45lQ/EEFNX7FohGB4xUqSonVaLcaXfe\r\nbTXspnhU64CJjCwDARCnK+TAfXYCgqoPN4T75LSCmLHVIYbi/OYoEVkTzHjm\r\n3um+o7C8GNsSbhk+IXB0oeqCwX6eybvivpvsjsABLhl/99GzsIil7aK9TnUm\r\n7c6YEyVQY+330U+3m2quSg82mzgZ7/9+8IEj6ITqEDm0syImzrkLnrCbW0VK\r\nWtOVrcsM+sIzmOsFDk50bX/ml6zbLVgPHx4EFYjZEmGj/YDrkyPPZoim+6Q4\r\ngMxm6I0XVvMgV3NRAcYBe7NW5SA6Cf7tcm4Dn6zpfr9qrgCnmUPbojNDJVFM\r\n9lsFj2cl7OQCh5xe53YMtUE68fp79jYE4eUEC4zFmKwDE1XoU7jKNMBAmvLi\r\nfro6tRBva2SwDJOmss1k9Um3xuctfy443hW70gBnGbyjWe5YeRf2TSvf6Hur\r\nE6OQ0i3HnE9U3DYIHTwLefz0HunnzjOcdxLB7Xz3tP0lYUZnzYkg3xEKEECX\r\n4lr9BHps/yd4bz5GlaHgy6eLquPjc8Gx3ic=\r\n=tynh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.13_1651134065144_0.7264726402279278"},"_hasShrinkwrap":false},"0.5.14-dev.0f64af7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.0f64af7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.1.2-dev.0f64af7.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0f64af7f0a65b184a2026f05f34c5fe8175985b4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.0f64af7.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-tmPgpMujabzmN1ve5nB3EcWkL5TjJs4+dYDUjF/hL2ygBTmPSVSPns7pRClQ/Ab4UPPzhBKdMSir4b1cJas3Og==","shasum":"f2e26201ea411e483b80fb1b4c7d2268b30cbdde","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.0f64af7.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEhIR5DdHfFDTJAYLJbbbh39UASglYjkwm02wO+t3ngaAiBiDEmUTlvfIdDO9orCy6b9r3uTNGkHBOBpDbCyEjS/lA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiam2lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpF0g//UTjY6M+0lGLS+CMeaW4EOXC97WserTFanymI3AEl3gq6Aq1F\r\nB08+w1Zkjj8sA0W9pO54oOzEWtflDG1Ay5EDNj0X0TK1aPN9Loq1FbOHAVg2\r\nqjiUGXuvsaOCe5RIaeQKSItqhvKJppzArAHwQHeV3/nCzY6zKEogmi8cXz5O\r\ncJf/ycGBG4US7OJEVjtZiNyXdWvNw3KJLK/fgGESsQX/YQ3klM1g7nJIZr4X\r\nOW6qGDX1ia4X4MPLenv3033k4MGTSqu8iL1igh5AHlxX0ZepnAteMDLfdfm3\r\nBG7YjvA10k9sNCte+zv/yOISDDz/tzSXeFlBjTu9/2uzVywUdVFZdgU/lra4\r\nXYwBdNGulu4fAKmOt4Jd+xmlzjz3ej/IUZ6qn0WR9Q0EqUQRJzWKzyG0ph+c\r\nfrDIweAbqzpLDQo56TFjo4OOO4g9GCN5KEuMu+y/UizmH1V4UQLy1yvQBjyW\r\nr1DTObB64Yevn2Yr4pM4JNTUrL2tDkL+imCtRQ3ckW8ZeApMA0GtYihcRgxP\r\nb6kDaHyuc25BbTXF9zkJcCfs/AtmWd1k+P2kOWE6DkzMgYZ7YncKWrEPcYlC\r\nP+BrbpHNWT73VxaDYLTp213O3Tg8OFR4ZJanOfS5MYeFY1AuXHVjswC7o3hb\r\nlTuXITorwiQ8EkbOIG2vEOvgyt7uIyi14Z8=\r\n=cOoz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.0f64af7.0_1651142053287_0.2843978894952697"},"_hasShrinkwrap":false},"0.5.14-dev.23fa26e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.23fa26e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.1-dev.23fa26e.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"23fa26e9f5d9f31d7f919b00b748d3e3e95c6fea","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.23fa26e.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-m/HTl8eXp+kk60Bd0gli6dPPu77GvbtGbiTs8hJ8OoKUQM9+bjyaASMQ4anRhxP6SwhP4KgOYzPOF8EVQ3NZ+g==","shasum":"9d90cae5684c637746c38e0a03df747d8a634453","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.23fa26e.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtLyZ4tlxsQ99QqtHHf0MSQmJ5w33Df9wcED6bM3UHAwIgPynkOBGYbFbRdRmM/bZsIbffvewQAoY5e4VVIsPsfn8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaoHhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrakA/7BalPX9U6k1MdvX5yOP7MwK3c+Zb3LUMm9js0uTCVIqoLWjEd\r\n7xm9jjAVfXZK1LFrlcmA8mD+JpOgbpGFkpm5jcbv3+r7ksAZTw4+yX+sVor7\r\nrWBiWN7exVVb7sXk2tmzotLh0Bg2sO2O0eRQXTSz6qtxt9iBImi25OifBQ0N\r\nkDchUrUUvxFkh8uyrUPWoK+JaOvjuWqaEujO0Frh6hyH9HODSip8P/mQHXY4\r\nM2itl1uL4rhVhxuMad4F1IyRQXnH3hoCNGBfykXZUguf6Gr0r/VWF0mw5Dpb\r\nv5Qj5y7dcC+k/hgNv2neQfk6rG5dZ0DeImKnfvlylMRoSvJTZffkm59+tFUx\r\noUYMhPwKMPW4ktmZPxQqTL9ICp9Nj74P7pkHTA/+Aq1s+snok38Aq4YKgiP6\r\nkTTsPHFZTiTGx6Xlep4pfZOwgq/u42WCun3jk3oc5obtMgxOMn3r0oF22yNX\r\n27/lWXCMc3YvGYWHpTSX6JUaGXpHZ0yGzeu6YUgbc6R+31K8wsamM41M3CSG\r\nOOdMOzuLoMUh1dEymfSBuYXhP7z3EwZtVqxwZh5b97ZIAyUSW02jeqo4e+6E\r\nVPv+YY6YsUNm+c7SZ/WadvuvjIvR06PITbgeYGZlBWBJ/KMQN376iNQXkX4R\r\nZjSGWYw10cwCAWmIZ5GwD+UBaymPUw7f0mw=\r\n=FPv7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.23fa26e.0_1651147233223_0.6899801631348124"},"_hasShrinkwrap":false},"0.5.14-dev.e0371d2.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.e0371d2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.1-dev.e0371d2.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e0371d239411eb0e57fec0ff4868e3209cdf7bf1","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.e0371d2.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-1JY5ZG/FHrcGH8+sgskC69fQD4S5IKW+PGvDp5vvsY5acniCl3fGO0aPe0bhEfKFbA4jSl1f059OhKrvzvibiQ==","shasum":"bf8cbb5214468ac7eb150ac76fd8cfc38bb01862","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.e0371d2.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoZdmYWL/nG9JTisBYw9j/3Q1OCp2raHDjNHQvdhjFLAiAJYZx6JhOQ+FOSupAaLzvdHyEW+nD1ejonLSIEXBT0yg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaqAeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5JQ/+LF99uVmDfcWrSWEhXfJU90KgzEkgaEea+akjAndqE3YW1dTL\r\nljmysOG+G6Mw9k6vxkbEjuIeFxRLuwnIqdPKkiI0EST1ZGWZPDA/qLkcTwrZ\r\nTrocwJrlvzPzJmAWDB79VT1TnQE8tRLFmV3BgvRqyCOdCclU2VT1OSWlHW7Y\r\nJQkNUS9c/gEwWmlhmcpuIpC2r0e+NTpD9loo2WDqu1lUcAQWHPQocirgN9M7\r\nB2TmIkhPZxbaX8Swh3jSYAEFGu7mZQnPvzKJ1C5DPim5KyHT7g/IRVfxU9H3\r\nEVY6HtgJRNeqtdPfmSgrNrkWzP08LiRRzUrv9izy0Gzf63E+hHQISxMafE46\r\n2+DRMzjhfz67SlFGW5Ab2OqFjU9ZuR54Yue/1mDiQq2ncG6LeEDQBRfMmRrX\r\nHbDoM4kEl1Ee89kDrtt9pXjGtC/mevQWkdR0wNRVdho1fEqJceCt4+Ye8+NL\r\ncPjUUOQdiwxpp8cKrtSCAn1cUBbbys/lvEvSgvr8/RM9waKFXTwbsy4ZrX+r\r\neOArahA00tkkzx2JtXvgih+PTh1eamX6zvQrhX4TlReEfJrh6Fi2HOcLgtlY\r\n8LyyNyceyt+EJEX5VtmkKnRZG9xa3h208cy2DIDaN+tA9Gtt5RTqWVyS2iEU\r\ne96If59OA9Jt/qJQKiNhTHTBd03TbU6lR0w=\r\n=xN6z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.e0371d2.0_1651154973706_0.6931519292144663"},"_hasShrinkwrap":false},"0.5.14-dev.4c31a63.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.4c31a63.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.1-dev.4c31a63.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4c31a63a0f61add9db5be33e4edf7ab9732991ef","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.4c31a63.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-6mA3EDxdP3qTEMK43N6i7Qffa5WM6ByzGUmEZI6x8nf7b+g1z5JHILp9DCUnZKjGFluzsuG5mVSYEBqA0bCFCw==","shasum":"a2e11c704adbc1af7b1bce7691365833fcc1deb0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.4c31a63.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXT7aq1ENXVTB2VTqUUgnGEbT43/ji7b9iGXbbHj9/BgIhAKbNbNtydwMdYJ99tloF2i07mw9vVcD7O+cgYLl/eHzl"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJia54kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqArQ//cB4u1zXTfA6LXP7ZisLZzbdNUJqaMOQnx+oEDlUcGuI8VbIP\r\nzmReqzYPAT0fNZYpKp9ePahFDdkuG4CMliK1JeDGYDesxKmcaQw54TDCDfA+\r\nFn3j7OgH8YqXoeLAzdSAsZGLG4dQxxfRieKH00PQGO/hBFVv0qudEaeaMGZv\r\nmDGGkBeHk2uHZPf4/1gOcIUGNeyT/bCgJVAKb1a9kmSSg1X/jTgYCsSc0muU\r\nRiu9VHrfjnDvAWCVJUIIHZNb0cKc7wSErkQSCZsYq8CmmugdKkd4lCc3TiCm\r\nMEyhfKmqua05iF+Brj6gkkbvakkVSg38u81ZwQl+rbGuBUFq244LuPbKzVu6\r\nokrD69m5Zyc058w1/cCnmM3UHUjpYzzpQU14FUG7RWV9HowCq00og275Y49u\r\n1nyFw+/TUd3zze4Z+5kkUqH5GwmNFHsAdWotsEE1fJvtLrbyu4tIJ2NDLwdk\r\nbdxmvcQhiI6V4bJSS8v1lIZH8+mpRGz1cw/03oFgPRDgCKjJywcYoUjqnHw+\r\ndYmMccuH+BOo17OPFvem8jJcxzP5Ny+YSM4x7Yh355ioKRHCTWWQtjclt8uI\r\nCB2HNsSaHYDyfKG8CCfI546WDKW/g/ZAERbrAH9SsL4NQK8yR8ZfmBihLXcy\r\nYHxKMCprJF/5WS+Wo0HQpgq0oSxk3W8Z7Pk=\r\n=6TST\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.4c31a63.0_1651220004597_0.9663711821486827"},"_hasShrinkwrap":false},"0.5.14-dev.90ccb01.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.90ccb01.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.1-dev.90ccb01.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"90ccb012971989cc1546f308dec50fb4d1bdaa0b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.90ccb01.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-1ve988pjC7/7RYp9DXXorN1Wwzm9ELoaGowBvOI7sXoa2JW08yxsF4t8zvVBCYZbaJno7/OzNC+hezRiIKbx4w==","shasum":"9d0c4d49ddc3e1983b659e50f0d3ba3cef7ab0a0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.90ccb01.0.tgz","fileCount":35,"unpackedSize":1055451,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVU8DXLLhPLYDsNux3zOb+tzHHQLUQzLhe86JFjdzYLgIhAIEJt+n4OTczO+9RX5dML0C3ztJbOo4F6TPYzJu9NObf"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJia9juACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGig/8D7D7Ag6XjLR8v3vYuZAAdOhTXvU9x+b5JsuQcZCWZu5YP8bP\r\nfNaatRepxc73GX+I/hGSeczoL33lL2AlV0qzCEUADm4Y268am23F3OLqkeu9\r\nB6OldnCCQQGr2LEg3OvSCKL6J6S2krnz8NuUAr3IGOciiE+56C53f3zc49yd\r\nSqE6zEl5Q7NDWewvdsAtCL+tiR0F0mxzt1GWaq5V0Vbdn/MBevWz/J1AVKzh\r\nxmfwszEnFRQfqY3RdM1r4/FYDFASPeOtR815BwTKrwbwgOdZvh9M/mBU6Thn\r\ndxtY+fqcLgyLpw0JnkPPy6nNMjk2EYss7Je8zoB/FcX7aGY0J7OSxEws+ljR\r\ncSs0AQvIODM6CZjh6d1aCZCg02Uddwo5+UroIVOn/inhbvn30crITxX4IldQ\r\nx9p7q61JjcBP5Qr2cEnj/k2a5+EiPqJzILxJU/kpGzXoPCeDrrlPehbxvwyY\r\nAouAZ2KHMSf9ApEFUky6EEncH3V2AFNVe2qme4Icztl8qLc4RsrjTcKLvHd8\r\nbDzRy1WXMmkPOem4Y15RMmGOjXWrvNreKkNboUvc9oVUJh/PXB/pK2dNuLOy\r\nOjEXGIOGWRRG6uUJV/pOnpU6ZXh+gJy5Xkh4hnPHeStsbJJv40PCuwsmj2oV\r\nbH+lmsGZ1vfCJx//MN6LhTl214OJlDtKNsI=\r\n=LWww\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.90ccb01.0_1651235054738_0.899728749293049"},"_hasShrinkwrap":false},"0.5.14-dev.2bc50bf.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.2bc50bf.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.2bc50bf.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2bc50bf3c376118d25bdcd8323bcc6a0de1c7293","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.2bc50bf.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-dhnM0lJ1MhCdQrpt1hTVXzQxn0fsLWWEAqso4WLm60m8AsOlGErzLziryhYN70FgSFICZXRMs3GG3Z7C2rAweg==","shasum":"f178c8d7ec2babafe2bddb527f64d6155fbc2a9a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.2bc50bf.0.tgz","fileCount":35,"unpackedSize":1054776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFprR/fK1FhekrBwe0XEy6yNt0qLJODvEcLfP/If9q+4AiEA92RFoTpsD7/KcLfQZFDBotqUtzn4EzXSBrkHC1Uy1dw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibO5xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrnjg//bEifOKZMVL64TR4EyTHIQxHZLlNynKCI5fJ+7PBlU4IzftZh\r\ncgAAyw0XpRL/Rt3LYRHL8FVtj79k8zZk95nBrqvMtsdEPIvvxSuIquH5CKM1\r\n/bwbIEKTaKNUw25PLUmrEfXBAdqsC27vycVTtxS5n8rr6zPVPIqKy0lUrgcc\r\nlGUS1iAv/uXgPUgml1cibGWVuSoneBXcV32+FiKBCcJV2iMPgBUyYEM+PEk5\r\nXNw/dgP8eO+PEO2qVJiN+wSaQAIIxLhEeOSllWNOeWv9oz4F8BJwZgBNLcWs\r\nMtBCPSbkwLs9+CAdZH1uLrQb4aa7gwSFd7t2oDHVFHLuF6qAZaamKRgGDRNj\r\nwt9TyE3pgduQQMygX2ujSKD7bx/1N/8F5WbD4UCoFc6utL9FvewTwKjnXspW\r\nvEgqsgRXhiP0gzhqHGWRUbfVkCEz95fIZ0tRN7yLBknDDg63B4n56PfGgfjQ\r\n3T/n/1Fwz6R8Jf0h7sAClu/6HisqkLz548mUFn3SilsO/gVydvAKZXU6M6lz\r\n6aJzeOHdRshJODjBafMihYjOtYJ9KbilpbpYXuN8C9AghbGhSL3aRwet3J+/\r\nSyec99TvxRm2MbmosXP6X5LTHNLpKyzLypa3XdtmT9gatmf46iA9kN7XpRon\r\nNJ6YTcHCgToLcczCoNUgflCwBo/T30jxqkc=\r\n=XY8C\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.2bc50bf.0_1651306097065_0.08759474176482751"},"_hasShrinkwrap":false},"0.5.14-dev.6a8632e.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.6a8632e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.6a8632e.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"6a8632ed207e605e1c9b7e4551c1ef6c5f77a517","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.6a8632e.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-vFN5436NKK0BR1C0n47Kk3fT3YpSmixsn62nz6lkIXMtq/CXWPlAWoGivi2QD5AhBwklOAeqpswhs6vwMml5Ag==","shasum":"1d715a534cc9f730b3ead88da1cee07637995eed","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.6a8632e.0.tgz","fileCount":35,"unpackedSize":1054776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcIALfBZzTpY2qJsQrXRcQKgXy4YmZ1zRQtNHtXF+3YAiBfTS5iIuztKtLo/SxvQHyOlNucFW0yTQt3Azsn51HAdQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiclZ6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrVqg//eb2qQ/K84pNPRgS2XVKHZjIpZduxogfgiqZ9xOyt1VTVQi3/\r\nvZ/2VGSTMx7V+XmHOKAM7uDqU6Kjt7aOx+mmzEpjtmGcEU77r3HrYbm+uHi/\r\nQatYX2yRTuExv/y7rkBOS8FASfX34h8YztXxrSUuoj1gdmFZlnSM50z5S34l\r\nCB0ImjfaJL2xOCTXGCY74uB4Q+geoSIq6jvRhBS74WRMaLLZJyrBqFNMNepq\r\ns6PBm/J2mAP7ehlqhCnc4jaURO9aX/VWC5Vt7YzJ/INR37wTdRiKtFUXlwsp\r\nNIzPd0VXuuzLcuxdlSBt0PgWjrJtGZ0JspUDPBdurGJX47bJVC6M2xJFM/04\r\ntyex5nKOVTSWH95fq9QJipENLwulg9JkK0KGKuTVYUnQVt2a3EahlhmMjyRd\r\nmoLydtjyOLHKtXFx7MOyRW6t8OG1Cy9C2DRB2rav170LdCwlkjGjnC8Ec6TU\r\nE34K3VM/6NAtkNf3a2IMnE1gJ+fE2P74pO+LlV8PNekViuIXq7bNqFrLKgzT\r\nPYQ/2rUUFoAONclt+3iVpEg38yDWUuvSH1vbc2tKuZmCFH7tL0bXyDhh9Pm0\r\nqPU08oxF8ed2ZIusUYIm0gOiWgQYsSY3q3xuIcZ1FTEmbaqyIO3EL0IEDp7b\r\nXo9b+PZTsE6wl7D/bZlQapjvpT/eY4mX7Tw=\r\n=qJwX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.6a8632e.0_1651660410117_0.5069662306206386"},"_hasShrinkwrap":false},"0.5.14-dev.ff14ff1.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.ff14ff1.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.ff14ff1.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ff14ff13042a92e6da9a1befb7ec46865b19cfe5","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.ff14ff1.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-Xo6zuW7IsNOvkD/Vc44XLt3CTp3jdzIMOXeNIUDs/4NsLAfuVomKJSre3nFAnqr100Dh5zasgV2P93/+dZ6dBQ==","shasum":"a7180306419e96950a3838590d11e5c075ec2c8b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.ff14ff1.0.tgz","fileCount":35,"unpackedSize":1054776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLSuxK8/Daoxj/FRb99z28sS3H2SjO3jTNepntOW2IrAiEAmxkHgkET8EtFFrE8jkHTafukQGvpEI3mYs8wZQ1DYbU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicpN1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYQRAAmqUj7bWcNL8gK4+Cv5O6EaFgrSFuFNjk4vroFBnjxyhcvIpn\r\n5YwsQDePQiAXOrbUs7tgAuZyJDJiiuA4Yu/xtTpFx6ZE/mhuhPzdzlK1JP7z\r\nbaOIMjqkq6lvgT4WlAum/aAIPfQZpdsdoLHybUyY1WKAxAjYdxffCLB3eghq\r\ngmA5Xuu4X2jWDnv6rnIh4ZTCDR4/qoGK155+yC6Jjzd3qdRYWS3aC7EGqibb\r\nl1KoJcx4nNjUh+9gwE/EKKzE8kXNOdbl9ZrS37Np0CsJ2Amp6fG9GWVckRW0\r\nrndwJXlJmgmUiE0V0ObwoyhxyGP+huZrOz9ubkmArdlOYNWx0VsOQ4lEMyF4\r\nQxagoG0t2YmGQ1Ye1N4eRev1FTgequXVVIoGEE9Pm3RK6QiQIUhvT5l072ka\r\nKwk9COudF8QOUN6u7osnyGNbANSoRNXpz+LdXPJhJu0QPKTLTDOUjVkzRZvm\r\nAAthoMtqCoXMpW51m4ihit2Bt8XmvPingwqSKIKqNJxpqolApSSEb9qVPg6t\r\nsOiaGgadp7CiUHPGW9XjH1UxWwPdl2va0Be6kttGJiqiCauYHYtRVehgQgJ2\r\nAAzJO2ergBzd/RN3biETPIfPgZf2scSf2YQWztpjMxHKY9R1nPgVSDCbOX61\r\nWuCBB6HqkodRdFuu2hzynKvxGEROufqCCw0=\r\n=quX1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.ff14ff1.0_1651676021465_0.093817634969114"},"_hasShrinkwrap":false},"0.5.14-dev.c9bc19b.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.c9bc19b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.c9bc19b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c9bc19b254ddd6f8c8edc9807fffc5e55a867c13","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.c9bc19b.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-NPBoH/YewjmUoJWklH99GIgPzwFreBdDsjjvLyGbCRN+QnAtBD0zngHJ7BVdvNSxufmV2XZFqL05HpaA0QgCRg==","shasum":"5f0a223380512e8252d0da76d7f3a2be66cb44a6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.c9bc19b.0.tgz","fileCount":35,"unpackedSize":1054776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpJ6RrATEbnRqalAeoenHDgNRtA0GRggCAx5dqTt+Y0AIgSx9b7TB58MKcZRLglnoYLyGlDZQVcvmC9eDYr3OaCIc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicrU6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqihw/9H9QkumdzgH8OojpIOUAHwXx8bPrjmcTxmuFXIRutrW6vxyoD\r\ndGWYMLrQ57aK5FKMnL4xAXgYV6AUQsTCjjPiv90ZPZ/nZJ4rJhebY9Sd9rG8\r\nr3cLr+5WDhp2PLXDvByGkzpcUjWSpgZ7RLleHT0f2q0G5uNgf1LXH8GPtPR1\r\nCQ+aJa1JBuOgyuh+qKHzQnHFX2BgWvNMPx2oQ1EtDEnERG1ir9Zo4znFW6Or\r\n6ogR5J4O+um4JuRQwhXFAis55hJ+H5UtqPYoz3sTICowe/IFzEWZsMbbBdQ2\r\nQY5Z2nJLscmyX0CPH9DK8vhmpfUcWoFR1FuGe0jCP861M3J0b7YzPevR1lXr\r\nXYFk45wFKmXC1Bz1vVG8IR3mHtjSRtxDMnIW01Z1fmVseoDXn2f12ZpGR8p4\r\np0w0j7LPYeUCfTl1t22OxSx6U4E7YFS3ZW04Rmf5s/bWY0EMDgfBN62GxqDQ\r\nYzIzWV2Hk3CY09wdOw3QCf+wV3oVuYJM2/TlNstPtUKyGA/fBzlCkeyWv9AS\r\nAcLTwhCcbjrNR6cgBhr+xsFlCjFbvlzxVYTIp2avBg7xG4g8Hky1H4Re85Tf\r\n0Eu1UJ/z7f8zGkDaobF83I7uIZtYTeKD/UC1cjsPX5MPASUy2SWmCy/9BtD1\r\nnjvURyq7vONfmg3q5w0hQIIDHu5qAA+qzAo=\r\n=EiU1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.c9bc19b.0_1651684666480_0.6700869006990688"},"_hasShrinkwrap":false},"0.5.14-dev.a4c583c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.a4c583c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.a4c583c.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a4c583c6483c362262422917bd21745ef9dbffbd","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.a4c583c.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-gQ1ACFN5I2rFTUdTuqIKMLhQLqVIfNWiuE6Ku2Xsp/c3EspUWPc2JQXIxdDupzP4GG/lVPnPSrco7CXJ7dxZpQ==","shasum":"a100739a4bb732a96b2f4b4135ee741df0a7f2c6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.a4c583c.0.tgz","fileCount":35,"unpackedSize":1054776,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHF541TqNpbHo9SauwFqyfJPhGL0YnmUOiDuXY8bf1TiAiEAym2AA6v/If4Bn+tBump5Pt3vkYZ4ddembRbxNfN3F0E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJic9gdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpH0A/+JoNcnNC14Th9CRM3F/D4SMHSafbLgRMPY+/6GiEQ1JULQTrP\r\n1OM+AhtWGjd5E0ev1tSJ4YVmUvGH4Avn1wW1PAqdhHDW7eVkmGKZ4ZZ9xIKl\r\nYFdVoD5WLL7D14rE+lRwyo2qBpUmlIHCERsKj6S2JMnLKbGPYQ7z6MMmMDBT\r\nrwfwoi1DJ1/FQ9po/Qg2GbxnxRJ9j7lSxFQMmwwO0P/Q44oIhcGYKqNgexT0\r\neKtHh/7aQ5f6qIPysxemvagopVyVvGiUl+eqAmMg75FuL2dkBYJ+EYq+/566\r\nyGu0GL/DOiQK8e+3tMRFB4IcKjpvc1o9baV5pQD2DNXUpVFzfvS23eZbKkv2\r\npChERI6n5snHUvdJM4+XvCX1zKgmPUw4b9cYqIB4Qx0P7R7gMTxiUsl/5QYw\r\nKJlka01U1J0LrpAWJb7Elj7sZ46ehE3RwFoKARrayAuAVSifAjeGJdg5E9mZ\r\nKVRYFt3pw+G9iSFjesFEQ0QNdbuT3r0TNXZmsgcH+rmV77yVUo+fqv9DIyr7\r\nGKEoKAR1bwiH8k/m2XIwakCv1dFa6BoLiVBvJhHF8zeQssA83uHwqj4Ic24b\r\n+Ln0LDMQFFotZuawt7DlOpeTuMJk/DQnxPUqujxU+nyp9dORDUPETgpMYg6Y\r\nFTyG5ckZ6mBBaZWgvHeg0Tz24BZDDOAiiPI=\r\n=Q5dB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.a4c583c.0_1651759133368_0.5632324644263145"},"_hasShrinkwrap":false},"0.5.14-dev.787fef7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.787fef7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.787fef7.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"787fef77efcbe0d3c2193837d4cfe341126cec29","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.787fef7.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-wMdVKNiCfqsW+GLNqRR14Q3KxgvBNvM88rk1OfvuYQR65ctnf0DSwOtr6m23/04YyGCG4b3h0zzZC7h57QasrA==","shasum":"96cca3f84a7cb5ce26010673b7963ff30627b6ce","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.787fef7.0.tgz","fileCount":35,"unpackedSize":1054004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/9hq7i/mu3RC1OsHTfHLBWrIxa1ibXXodVdwb4bTo+AiBxcEEOz6MLDzbmdW/RcncZvM61a2y9qBHEaEDtbu+Idg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidB+dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvHg/+OKKG9YcVsLcS+G/uJcNAAC8P8Of/QrIO/uqgCrBG87HxknmM\r\nXtpsv9AAsYSQGeuIqa9SIwYL1b4x8INfczMH8XKgJ8nNH8HVeSx8yuqYoaEN\r\ne5/QeIZHoTalfrcCyHCaRHERtubpOf5d30YVjxDEhkRdIs+YgCn3a8xkP3UJ\r\nmei58ZiqW5PutD4dSK/2N5s22yKAbAYDn02ZuxBc+Sqlk07oUn/z/tzdpF7K\r\nCV8CC8mxAzcN6G/GUwGDj5Y02ukl4Gv27sweWyIaARl1wTNz03NdeRHovPRE\r\nVNBYyckenQf1olTnmMZyM2SsrHhPh+ocLT9RXIJiaM9KtCaBIhftA69Cgofx\r\nkNShYtCxPVaSKZJokkYcy0+hdMFElDohgzvSY2XVUfgRFuiq/Rp0tYcqV0H5\r\nIygNBi0ioulW5Kbz+a+v5g94byN2fB6ZOevhWUmb9zr6vaqjtMYObw6pmRQT\r\nKmchQWGj7p9nI2ryJqfrZmdd5JtUfRh4nMjjE1eVYigmYw52l8LnXP6Zq9VD\r\n3xOSEdohoMPtPoEIwcNH5/4csxJmodIfPySdNs0wYdsKD1JEWN9yaQIAsMvs\r\nlPAMxllVfzfeJVLt4WGmPgGelB6TYe9zNbps2EgdJYsmGZgKITziYe9Ia3nq\r\n4k4XLpRdGJcwQ/O1CQOJCn9pZFg9Wko+td8=\r\n=23be\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.787fef7.0_1651777437076_0.2297922658353322"},"_hasShrinkwrap":false},"0.5.14-dev.ec379f7.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.ec379f7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.ec379f7.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ec379f799b3b7966c1f4602944c77802da031c58","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.ec379f7.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-OqGvbPXRk2icXSOojgCXjIjsw7asPNGXYv+cFgGXmhw658EJGknoCb5OjV8IpiDO8amKZDkAO3mFVu2XcGERcA==","shasum":"55b7a86d52a0be4446adb27f2d4341acdfc1fb36","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.ec379f7.0.tgz","fileCount":35,"unpackedSize":1054004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICYPEm1UFCvUWoIyXcIPveTGiO+n+J6DMJn0Hh1ZcTr9AiAjJFUj5sbpajE/VpDq6sFlmSnqELD5v68nvXUsCdyTVQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidRgpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPTw//YsA98jN1qCMYZI1CFhKHAxzjXgpwGoXG7rknm/fmWdduirpD\r\nHEfgsgWz/D8tya07pMLNEZZ1pd3oDi5gpwUkCaI5IBfsva/5fP097Zvnc8O2\r\nk1pn/2vtdCgsNQ7SvHs3iM6e5BwVqR17iM1CQ7cx9Is824OiCEYps7HgKcON\r\nd7na8xJOBTtjK0FRDwCMp3V8s0L1YwpNGpc0dAEHIVcekNiaBHRAaHrNw6iY\r\n9P9BpZCrLmeBei9MJgUAqz06ngO2r+8Uq6RlfwkDFThHVa7yzlneUuClXsVg\r\nSQ13mEK+0OGv8opoD8pg0ReSU0RTY4XflAj3aqv61FfUPDJSvM7MelYKG8q1\r\nWYboregWI2ULJwQDwJJ6P9Th/c2HBvyM1ptPqRZRjJyQQuSk/mVmXJy2wqYI\r\nb13a784kFJw0YB7eIoOPdCrXJf8DqGYNb6koJvH6WAun+xTcG8Pp38/aakTU\r\nfrnc+OsGaOPakRWZc1+rWO2XP9ZawysttAWuxk3LEgS3qJFZKt0ufpsOsQJV\r\nFto+6OLeCWZWc3euHSLqDbQUp66eWBE01zht6KrelGxJsnapjGQiMEDIn5wU\r\nmd6VHVndH9BxBYh8d0OnvrpBPTYRfK/6/l3YfTWsLHcQje3YK38hRvG+y7jN\r\n6CtFDOr40xrVya4jbEpdiKi0sxI2QxssY+Y=\r\n=I0gL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.ec379f7.0_1651841064886_0.4129165624711968"},"_hasShrinkwrap":false},"0.5.14-dev.bd59c6c.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.bd59c6c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.bd59c6c.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"bd59c6c270e62d6b1a62761f6bad89de44aa2ce9","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.bd59c6c.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-a5Zh1KFD+xC51rP09oN860H14oVr+E9tJSBRe6d8n33UpIPu5Fv44FylSB6nPHiRFM7PDXzJgEbAaA7IboV6PA==","shasum":"6364ad1bf86aa84214f55c6dc571e902cf7a76d1","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.bd59c6c.0.tgz","fileCount":35,"unpackedSize":1054004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8rcv22Ntlsrap/MSGjGTVMQJ+VM7AuzU26Y+hY1KBWAIhAI+zpxetie1QmuKEuv2YR5gUFa75d9ss1QowsLPEwd7/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidSs3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1NRAAnhC7Rgfh5Kh9B8N07FqwikRjzWt0n8E+Mq0TzywPcQzUChC7\r\npIWMm9LQlnsf5e4pWj7WXYC8jn871pg/8dUgoifH8xTCr7N008gn5OTZRBCx\r\n2Z0a1e8CrJ3fFBcdkq13J/3ohfLZbD36o44DH4U2FDULnrw/+4jJJrWHpaO0\r\n1nYketWEGlkB66d75Yal57vVAjfHxSFr9PfwH35ebNjhzAwstVwK1oFHDeJn\r\nNUFuKcw7Hfv3EIAhIZEkP5D0RsOZTPAroYP2MwYRWQUnSU0228tkgYVG3/XF\r\nQqorU9evbCv+sLmsLGLmdI5haXO+DurbyBRJB5FU4FcpQSF71/D4m1m31AZ2\r\nry0DAGzKWW4AP2xSQhQ0V8RKpn0Syfq0KhKUN7biqLuD9OzyradQxvKOKFtY\r\nNSdUxz7w9Aix+HxVzmwT1csx/xElowqrq4GCQ4pGZZ2v1XBrz/ktB0btShpf\r\na0i9Xng8QkjB38uuBvg37gTjuxQ+S8zzsOOAiBlLL9X+Dj1h6v3/pvq9h0qo\r\nmYEEjdn7YBuFnbF9Vw1FbegvQTuwXAcRqlNuDMC5tkWYjQIpQpCxjQ3KT1Lh\r\n5WL3cHH1+Q0noRf2TR58qBtSctw3Pkcs4IeMUFj2RvGZ3Sp7N3fsQN6d09DX\r\ngJrXL141i6LNo7515lynhLC5YkzpzhUqRtc=\r\n=A7Ko\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.bd59c6c.0_1651845943749_0.42513698330168515"},"_hasShrinkwrap":false},"0.5.14-dev.153bcd3.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.153bcd3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.153bcd3.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"153bcd37abe36a9803fd2543ef0a373125effb24","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.153bcd3.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-AeJVvR6nP25/X8a7bJMsLu3hhxbmj166eh93/xQ3j7rQoxzDjzKPPwwXigxdW++/JKYzs+t/yyIdjrRafMzhpA==","shasum":"ec7c5a231318e15e3d82e21d20ede4fd3979fbf6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.153bcd3.0.tgz","fileCount":35,"unpackedSize":1053540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEY6oZCKPLsfIRiEmnzVzhLGFGUmovrHqV8qKxxbDpo3AiADmOyzNCDiOD8ZOUtXleDM7/OnTY6ql4XvPnxp1LztcQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidVkBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpAYBAAiUDJsnEu+1wY6Qs/12r0qcAAH+Ag+kYcrYt781+lPalqIXzN\r\nGaYkNFZTtfgMFTfbybfYkzUzLmhiQL5lVzo99XiDfd7lZ3fWQak2ov087Gq2\r\nSiCM0eudarOXy4Snv8UvhF6Xn4PATuM7/SnkZrpHniqP4J1zwy7eQMhuvjNl\r\njU/4RmDBJbPXivvnIKJ/3VcNGVXudRomDpvi3A2RzZw3VcHoR0YprgOCFfwq\r\nZiiSGuU7CnVvezQH3t0FhKvpw/p+agqe42ieAdqvB62g2MY97758mhsXZ3m8\r\nmoORj+c4pmKYQXJmNl18EwCLLHoo+09Xrk+BmkCdpOUbD96uyBgo9IuAzVDl\r\n7f56nqNyBnb+Wb/u+OzUrm67sZ/EsNXbgsdrEb+8TOTqLUcxKGvKmuYt1jo3\r\nlkLCxXDZ+YGaXgZL7PKBeeaieIPz2KIopb7aWp6yj+3AER98VmGG/6+pbH7x\r\n8t1F8I+743rfuPTZtv/XWMqFpMTtisfl1M/oZmF01DfcDGB1QATK+3UxW6S+\r\nfX8AUNUiOXViBOJfEQhARjD2h6TRSLMyw8pglOcsdz0KTgz7d3uUVUr33Tff\r\nm3n7Q4q+gUJIHRUdIY4PekgEfYTWvepBQsAZMwvP2M7Fhe2v0PyK8/pTZogv\r\nsRhYRIhqdUIPnLWbKl1VkiMf4We3zv74al8=\r\n=9HY5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.153bcd3.0_1651857665448_0.5716252523440841"},"_hasShrinkwrap":false},"0.5.14-dev.2a22965.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.2a22965.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.2-dev.2a22965.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2a22965314f359b3bdfa0f0dc6f2e55d4cff1e6b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.2a22965.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-PR/9TmtWyeFgLWNr7Lq8OYHrYLAGq095Z8+kXVauENxPWgJBznxOYVbH8lMMCcrbhVvrpW7cID9hJL39K0OE2w==","shasum":"77e333cdc5473aaa707989db626fe396885aedcd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.2a22965.0.tgz","fileCount":35,"unpackedSize":1053540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfBu6srX5satGwpONWXVYXNfxC0VxzivWBE2Vw4nAlJgIgXIm5RbMzlpIb8RPInCaIoRSAXvdXENYZXRB8Wp49+70="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieTg+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpjrw/+N7LnPPtxQk1SX9FuMrfSebAlt9YVApsBcqwgeW2Mshy9/eys\r\n0IfGwttJHtOKrbeqM4MzWwQnrQZqUk5q/bVK/LayZvpQwH1NYN1jj42I/2UR\r\n9ceEBPk4XL/93YT7RT4Fok5DzNiyunOM/ZzxxljVZMAKhu2pKXLpCAd8aJlh\r\ngqG7O/ZrIRPONZON4oNzGLgMPhu4C3VCchvzVXmH6r3TftpfGIZgA7zBleX2\r\nFl7cwaTDSUyY3AJ32Q0iQ/vYBhHKrwgGdng6fRsVoMsK+j03j/P7Wmmy9SFX\r\nCmTN07oJJIcu55skXbenORgkKu8RaRL0WPdwGv6FOzHmn6tzcIo3bjEMNBOD\r\nNn7H/dy2UDpgEJvNocmrVhGzsj6rTCMPTgnjF0M9Kvmp2Zp4upEdPOYVy8yN\r\nOwnVHBO8k121oQS3Us6UGI6CRRyIK1SPFsk0e3S+hvyG0MWRP7C0/LUqVTri\r\nSnb+wyL2IL+EYdNxJPl8xfg8KIL5R9UwuFzE3WwFGPIi2jvpT0OBjhk4239t\r\nirt9gJeT9LVjDtOajewsDwwNNcm46H+YBq3Jy/WrPE3mEKb45z11Flz3NAOc\r\nUoABBSK7LoFHeEhoPWqWip1d/b3+HjsCXCqyRWaj/w+e7V/9VTvFKLYCjgnq\r\nP1USbVv2o8PGwS3pZzuv1cbB6UFGsnBPgPo=\r\n=pfih\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.2a22965.0_1652111422632_0.6912794761308465"},"_hasShrinkwrap":false},"0.5.14-dev.c960cdd.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.c960cdd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.c960cdd.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c960cddcdfc28e21870452be7180de7bd8978702","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.c960cdd.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-3Bkr6gvEGW3rsjh06mPn/yv56ECaw0mUykZn3bLyL/nbfZXucQr5WvrJVMaI/xo2nnsBwdElfYgKK96RGbyp7A==","shasum":"0d72217e0e65044c8916560e3ba66f2d066e53f5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.c960cdd.0.tgz","fileCount":35,"unpackedSize":1053540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8waW9UORABCAbNcW3OTehsbRVL7857OVkWDHqXxWPdwIgbdoYK2rey9a4lIERwDevpQirq+3bt3o4fq7vKN+nQSE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieV4BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlAg//Tj5c+hXjVV43dZGxElahdOf8gOy2VVJVr1RkJrKDTfDxfTu0\r\n6unz3yaFSYP6rUYhU1gkhEmb+7i9V+LaKrepq5Uo7LJ6eQiv5lxkaEtARZTv\r\nn3byMMFNZ2zPeOu7sk7a4WWkSkCfYzE9zaTPHTRjBvUwIlL4i37AX7+Tcvwd\r\namzSw4ejA+KPnHws+fWH6dxmEE+IzpC2Wd7uyhsIPXP+RVz72cSY++Vs1fNE\r\n37x1dLDCJAxErGKShh0jt+ZiSdZ02B0oVE7phm1MoHZjwEcRo9JpxKz89hRT\r\n2tUUVui4N0VwFxxfdppngKXKK2D7oytjMMovCpGkuK8gPSEqGk3mp6bgmTA0\r\nZ872edYxfO68fDvkSFT6ElHFVMn3+sRFpEafWHHUSjsVc5ueYgnhZHBzs8qw\r\n1YD7rTynOB2wCzDVbhVRSpSjuVYxhaA5gexNQEJYyDBu5y54r5jKDvcqjDud\r\nbYIyFjB7/VoL9gFBg8Hi5j4kmLEXv2zyL2qaC5qEkGjnZ3i//DeRmTokk1On\r\ntYr17YAIWZLdI8EdbC58gcCXd97rBhxEMfZ+2J2MHC82SdJurepGblUo72eb\r\n+IOOFE+94w520Y9FPc2+u3Gd6IQD1fP6BMmyYc3HTQEsXe1JpbmgXDYFmACK\r\nXpyJYWGX2AjUjdhmZERLAaYClU2hObuFe8s=\r\n=tLrA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.c960cdd.0_1652121089258_0.970426562767372"},"_hasShrinkwrap":false},"0.5.14-dev.db8e1dc.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.db8e1dc.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.db8e1dc.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"db8e1dc54a4bc6131b0d150625a996bff2cbb67f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.db8e1dc.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-fY8QHZjzjhsuD/HNCcvh/vo0101uLhQWEkkTQtDYYTAigxkjJFuh2lmcEeTlZIb/6VDHUT4KJVC5fIlO6/o39A==","shasum":"c4243402dedbba388111171dbd23a873aae39253","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.db8e1dc.0.tgz","fileCount":35,"unpackedSize":1053540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYzoXEvvbekFWBZR9ScsEEu+m8reWkRmCP+eHniDUl3gIhAJHqgsPnMb+V908GPxAWRjkkndg1z2Zm1H6DVPnUYu4r"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiejLZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqk3BAAmiGVUoILnh2QKSnPBehQMI83YtfbTmS15nW3zXpRb0qcNSFx\r\n5kyG7a0xdtG4ptRz2GUt+VX+KcXYw61DcqpjVSCxAYeVCIh9D6hEfxqqTg7i\r\nazNZmP02uCpJiwluDsVrjN86i8pDIburYisMQ8767MqXs8k3nYF6pjLJgnvx\r\nV/S7Jo5fS7kriuUHaZw82EiNhklEeLhNo/QPXWINQMU/K8O5VizNnkzhzdzL\r\n/UG2+QgYNOb6Jti/98QnxQIlvgS/8UZOQG+kTSltkcINDLa+3eIDFNU8wxsV\r\n4LJ3qYJICzFAWeKhaUzWwuQo0qQbpotA0VfG7l68q9dKsmI9EwBIrzLwwrbq\r\nFo6gFCW20aKEtBrKo1pnM1E+ih1zwb846o59xuWkz7qbKhpit3EK5VRyfJfI\r\n/rBZSWDl+aGxlhhkOXIFLcPm0LRlnydLujliY/V3PvU/YyxPqfHN8XKlglJj\r\nZQIZ9z8XfvCvwDbVITYoTDY0JLxPL5I5rSuWOe97NwQsqio86PAdDvtU8qKi\r\nhGlpwB9BnjdjyQc6yGsugBsEfuHtXKgnf6Zvz4DuY9wnPcsvVoqrRZHQHjp6\r\nF3rYhXnh4zPw95o7qE8eJgfCmceXkjqh7wXLR025k2E56FNe4L9R0esA5L92\r\n9RVnkqTA75UGnIOjZOjFrabAlZ4iSTnZdkI=\r\n=rsaB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.db8e1dc.0_1652175577006_0.15206594382315486"},"_hasShrinkwrap":false},"0.5.14-dev.a77e0c8.0":{"name":"@superfluid-finance/js-sdk","version":"0.5.14-dev.a77e0c8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.a77e0c8.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\n<>{`\\_`}</>\n\n> Javascript SDK for building with Superfluid Protocol\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a77e0c85a27921c1ef0ddbc31bdef8641776d7c4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.5.14-dev.a77e0c8.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ATT0Sw1YdLszQqenjJ5THnTSYCNLyuLutFw81g6qP7pnOhUPBOBGZwZAlw0UgUozalVs7vd+qc9EH0j7JbK8vw==","shasum":"d2d7a232911cfef9ef9b2130185dbf68e1a004ed","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.5.14-dev.a77e0c8.0.tgz","fileCount":35,"unpackedSize":1053540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFW+WeNf4eXOPih4xxH5E4SwuPF8Xy045uSa+ypggrqQIhAOM/VLXTaPNQOMe7P9iAhZna/bIcwzWqdIg7Tm8Yj09y"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJienCEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBJw/+IQYcvuCcj0hp0/QPvy2qEKvwTi6aI5KCsBaT+Cvx9KD0mm8I\r\nkgo3d2/9c1g9DW83BVCfS4rl5d3IpTOHqMO7/7Xo6Zv/7F2XzkSIfWuREP6c\r\npArgwSBa0th0AmrSF7HS4S/DWe+0Ra6HJ9yPHoWgzyvAHByyqQ/rDjaiyrJY\r\nTZjTzZ9FtsTMpos38+v3SoCDpWDinp811IYUcM8WXYJdiW1YCttFbTbciweY\r\n1kRPv0YPV+8n8jQqUtWI2LqYKQHwBn2ch8os3D5JC0I7/gFB687fXAaNljF4\r\nR/jhKoe3Gk9+d4ZoS0hiFgF67ovn5pQXOLO5MIx7qPpwrOdqKUav2F4DhJ3V\r\n7txyelPtx8H3ZPkx1zwbOy6ExL9FxN6MRLOC+KA6WpVRSE8GIm1PNxvIMNA4\r\nZnPxgFhvC6BoS/V8s5W8uLEpZSDsx7HeYWqwxrLwY7gV+PKM3yDd0hhAT++2\r\nWi78Dg3TUMDCfh6XS2O4ehVuNJ5C6Ja96Ttq/EGIL7umvBIYhqfNcfUyKHb1\r\nvmXGf44cnL63fS7daNRqLG1onV6pJJoX44Mjr+BzliO4pCQ79rDc1z12nwL+\r\nOlkR+925++lVZijHZXxE6nyfaN1euHK7aUC5297i9Y8qT39pv2+K0IwhHZ1/\r\n1GlmgO4vgK7n2yC1yd3par5E/E3QOwnWORc=\r\n=Wwly\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.5.14-dev.a77e0c8.0_1652191364113_0.9818405480084567"},"_hasShrinkwrap":false},"0.6.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"1.2.2","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"gitHead":"6fea5a7d6487bc9a6cafbb7b1f13773a5b6ed511","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-VyIAS3WDk9bJ2tXLZYbQOSRZmjxkfEt6QSBFC/vYoouI2qoHW8hv4exfbw+bxL/TdJL1F6+H8wIseU+4feuuDA==","shasum":"308ca60d955b98104ec46a8c7d0f3e8a37095206","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.0.tgz","fileCount":35,"unpackedSize":1054048,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGYyMRwlEv9iHiw2oXoxV4C0izmQEkw1NShSolKKyeBwAiBZyrkJNqxm0/7AKx4FMEmFvhdpDPeuZHeTD7WO5IWMrw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJie3vcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOFxAAhQUb/6YM31AvF45H0X+qa9oLtN2fd7oIlsgkmrXYISga9ADi\r\nmni9GgXgnu72ARefxpm8OCxWuUxboRnvXenlAo2KjBYyvr1pKVhKjphC4uZQ\r\nLGk4cKvFL3SHBNjsCEn6x6M6JMqD0fIZljq5MH0E4C6rZuMFx+R/0KvBSYzQ\r\nXMO0i0rmkybefPT7hQNVqZ5noKppogIICwrUAkbRD2A1okoeuZ02Ld9mZPv+\r\nDEVGgELMr7XELfNE8hzQADMetinc2nZKFuHwS8XsuD0BR1CF80yo5TMpIW5A\r\nfn8hV9N09q6fTkluNmkJpttC2lCP6xyICWTHnuf2w5IbU/PglSlBSpzIaZ5f\r\nOF059Z/1rJQxmSr5REsamRnYJpl2j8bju/ZRbQh1rPNL5pUQKN1/NRDVuF1+\r\nvx+yi6xzQrBqh876Ia3S68m7g6IuE40LF3TZ29IaoIcQ1cL0Bs8BCvizUsDP\r\nS9MUNzPS8OM+tMDmBZcbvyIHLmPEzD2CpXlP0SN7+yBmTTOA5r5C+NNiRAyg\r\nxxInUHq6ndArGw3vyYQnFfrs4YlgrD7y9cUd7M5qzmotNSrtqtGIH16e3dVh\r\nWE872Aivwn8DQT/zVGb0dTWVcaySE+d2T4YhAZI/nX/xfNcYRKnlCDAukGLZ\r\nZzVSqcTw6bKzDVw0jXLh3Zb40kEaWCq0jEw=\r\n=I2fy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.0_1652259804670_0.905648394994943"},"_hasShrinkwrap":false},"0.6.1-dev.8745146.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.8745146.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.8745146.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8745146210688c84187fecb880747623601fa742","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.8745146.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ATYOerCrAqUAUqYzHD5+oksbTXWJMI76SMYV6RL/EkD27/NKtldUEpxEIpYRVrEexhC0b61D1jWgeIwq03Vv8Q==","shasum":"69b1f882252e696f8b10e912197fc15af6d10eb8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.8745146.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2gg41c0hN2HsvQ00c4vEos3MFvgEu65biGZhSoTeUcAIgTQ75+7LyOAwZzuRtYZN1bI2FYWDixGc+WlpGMg94bJk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJie4P2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpxyg/+KRDwt5VspXB9WchXyvsGFq3k6VWvG75oSK9gstrnBRujibVw\r\n54WIXvL6OJ2fh25frJHnFnTP6Eh4NIHTYuXpnhTEnv/J1C2h6N8FA9jB3lr7\r\nuL5It0NygfjLNmqVmAHeD/LZwZktRdvxGn/JHbvqtF3Sr+gGI4cJ7PmocSEV\r\nxwl2BluFATvanag2LCjDYSduC4V+uiYgvhJSkomZu5u2nMmLVhdQNBe6ljzv\r\nuCh5iyfHXNevrfoiSCtTCT2W5sv1Ad5t8YMtwGbjnJGBPtdFC4ZKOrBnqVPy\r\nHcxS2O54hOcQh+6vuIqf+MTaWrmG8SpCDZTFh2ryx2xfZ4TpeKrS/2kWXyeR\r\nyW+GRPTcu3PLQf/HOuwM8bBGMpuZLgtUY1aPqcFxJInRLvvrEpydRUoqZ9Sn\r\nKfKnlRXdXW7u3V+KUwHIbdM0rMb/8bF4fFYiGo13nxhtbq1KsN2Jd57HncQD\r\nk+qgOetD/bF+mwgw97D3gu4W9Jpfn8DF6skGNAOPkQzTqsqPvNhsa6vu8wQF\r\nUKiWTvrDjbITHyol7X8NEVxtq7XetH6O77KuQzHF1W4KswH+LnjVtoHZ6frq\r\n8ekSp7ke1Xg4ZNrbzMtoVRCDkqb+/d1OX/NYd4s+i50OzDavDVzLW+exVET/\r\n1JesZ6ieVY6UMtw/Jj69csd3OyIQN93csPQ=\r\n=44Kg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.8745146.0_1652261878580_0.6062844108094441"},"_hasShrinkwrap":false},"0.6.1-dev.6fea5a7.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.6fea5a7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.6fea5a7.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"6fea5a7d6487bc9a6cafbb7b1f13773a5b6ed511","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.6fea5a7.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-nlyXMEEm3uxA5J8s8twuOAkEmDt2PSqxyL6mTHDZJjoN1tF+k1UsSaDD86NeV83Frw9M0AMp1IoQMvxYMQtJ3Q==","shasum":"97baaaa4d20e4d0abbf3543bfb0f70bd530dce9d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.6fea5a7.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGTdKZTBFF5RDo92TazrZMuXd02Kvf2Av6NDubNn/SwgAiEA9mWYNDNhMMBheot3kBh/VfWoG2jUAgAeVnfIZ0G40dU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJie4fQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqq3w//ZT4hhiwlnxqtf94GWpo7RL6eQMVO6amursyiPdGZ0fWoLkWT\r\nG8tGrGhqSKhVVc9OoUHxR2f5yxQeoS8jk/hgur9va/46Ec3duCQ3EAzK2kUs\r\nyKEipcPWvHtqEgwL7Hpifza4Ni4nIEUr1WiYXsBbB0cPIainLdWqVKTCui+v\r\n7XrIV6+ou6AQDDHolZW1AQR3EbJ9GIbzWykpacEo1YK0U3y3zOASVobUYN0s\r\nJ1VDkJnwr3anFkjBjPxQDidRZUFmSyBvffuN2g5cnKEsbYtBU1aISGQTfh66\r\nB/ePB6FnAuKG+N5iR9GPG0PpsH4s6VsNiis3FydYgDst3BPB7x/9f2DbPSC0\r\nC+czEutH/IszMJWeI4h3zSWUrXN0xpGmw8Qq4O+gJqG/SsMHG8j+H6hrTNzZ\r\n2aXv+pmSPLVY9pJyx4o/RNhrKynP/EQZ64aVSjB1Sa5QwEohS9QrgBZRjQ9p\r\nzhQWtCkjyLl7cMHcNDhC//Y6ALe6SUvyaxEtV+EFf/3sOJpq0efO0gIPYb5i\r\ntxCzSk/2W0ESeYlZBiZ93l7SSBWEh6MF1vrHdFiBfhwzTgziceKRXOVPlRbS\r\nN7D0oAdI/9F7GFjMvrPONRVnFSrIIuEFr6nEggMkrp6VpWC173zmtZaFNmr4\r\nHY3MwOTApYqd2+efFcS2QqWUt33iqp3+2Do=\r\n=f7L8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.6fea5a7.0_1652262863939_0.6696439489980295"},"_hasShrinkwrap":false},"0.6.1-dev.7b08ec0.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.7b08ec0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.7b08ec0.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7b08ec00650ec936b5d8b3a8af03ae9202a754a5","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.7b08ec0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Luuvm31yfA/3F4h82mnR/ZrYXdKr+0OOrmVPc5nu52jhqE0ePaIzpy5rbtcTn23024z1DLpELXxw8BGda73CTg==","shasum":"52c85023f69ae234337fed8e4eed95dd3cc0e847","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.7b08ec0.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGR0mKOW0+aF1cxwQadjnsZsuBIPbUlMGL+uBx7tO2kuAiEArMTqchLPwn/sDW2EhtoyZbJD6tiAi754Sr6hAnQYYD0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJie7HOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1ow//dq/OadpoHCkkR2a82jbw8N/h+KlnEjYPrLyPrt4MbP0xIYjP\r\nVKiaJylqlhv+B6aJUP4RKzCG394Adkv+thXwfCMqCsxr0rtrXkyQ+Vf1kIvk\r\nvHAZI+EyGRVmEm3UK9Pa9XHIVPasJr8jIvxmP0eupBzKaWTywpXH67li/5FR\r\nWdPCZR9aCMvsX74XPMj7BAkpolaIf8jJ49RD+/CSk1M/NRLiph78L15L+8NI\r\nRO4kpWIKVtZb2QkMNUboBviRw9FDB2Qn1koxHlHaIw6Jw2/9Eu6JY1RkFJuN\r\nRGAn4IR8IWALz8ZmtXcCuNH1MrWhuneUuXyYdQJUrkHn0GLUJYM09jTXqOWr\r\nTPs157NHIypHYTtxMLGrWloqlU9twGUfSMD4CDB62ZvwmjiKbU1SDff1qsUC\r\nQ/J90VzVEehbQnLu8i/4G9RoaNge3otuPaQQzOOXDSmJapHQRQFkHxuzv31u\r\nv3JWBkCC89sfPta4WfCBCy6GWAMnZDLPUpwW86wO1fO02YRyk6ElzqL/tLx+\r\nkRA2YPUwLqZ4cHrIXt1GqGZdSut8ucUZ+9QvRPZ/rxDbpwIbrUzMWPmj1bv/\r\nnDMl99yOXBkRAyGjGmdYsu5ryATp91KEZ9XRGYfJzt4tiR3/SVXgG6BqFaCg\r\nH9sOnrCSXsNxHINsfnEs9wQnYWdyIUOfjXc=\r\n=whqv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.7b08ec0.0_1652273614143_0.9079257155647382"},"_hasShrinkwrap":false},"0.6.1-dev.829551e.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.829551e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.829551e.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"829551ee2cef1b19c9679bead918076561d5a329","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.829551e.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-9jqgzzY48SBel921Ie/Plmr4BgHy2Gx7cNAbT+RI1tN+B9uDad6CX7WSKI3he5seiF7p1vuUAXItuhfBWa0WGQ==","shasum":"bb2080ff3489b05f373a25925b588070b6ac59ec","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.829551e.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGf+/J/1YQZbQjJHUsU+QOAJBLGHf0yNaI0EeItoJLJKAiEAgDZcvsduQwOTzlTzNj0McxvJW7pgtjAdl2IfC2UNwZk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifOgXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFvA//XTnbkYX+P0bhcHElFbUgmgVNvad5nhXM3ihS0cCYwb8DcXzQ\r\nmmBMmSE+6mzVHhF4WWR229yA+znEtoi0oJzuekYVQIh7VqIcVINf5VA0+RAY\r\nxQJCNStsWsz267U2kBk4iTgN2YAahSSx7gSl6XBJW3VXu5tbq49h0EG4hHqs\r\nYa/Hx0tBKJTwXhh5EsYdqk96GuQYIiA884IAx+S3t6SOkDDVHfRVTkfcOLPF\r\nHar9yHFER4FPJcbE/haKsD4Nqp7/NvHK0HkzHOpUBqwE9rsAjRyfjSa6pMtt\r\nh8nurvtoUm35ZrrLzfvneLaHdNJ1icanj1CPebUdcV7nJ10n0pMl0DdtJ7Pj\r\nUi5f+wUDQx+M+9PtBAlrkN2EW0QVDk2qF6kzjq7X8U3QQXq1XkfnMxq+bgX8\r\nDC3Sp69IG9ySrGntqFB/SD1o56D7v7UeEJ4NV6pD4TuBBgu1TIkHMxczG0uq\r\nzyAeRT/fYLXcQk0LHew1gofRpdI0MdUON/Pe+m3KkKsPiDDvRcC+ByBudmA6\r\nvxSqn6mF1LD9mMYhuLeh47Ei6hZiKKXMxr0xx+8B26BuGj52Lw7blXKFcdIQ\r\ndN+KT77KpnZQfsBwaNadPzPzcZrAWcriM+XLEmEYEk2a5U45o4dirZGb3FOX\r\nHqot3y5vME0H9ZaFk4/mSMzZZrjannoJJXo=\r\n=72r5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.829551e.0_1652353047526_0.6146713378095361"},"_hasShrinkwrap":false},"0.6.1-dev.d435096.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.d435096.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.d435096.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"d435096c4729eb4caca7dc503524aab69209711a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.d435096.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-jIrUqF0l0VE2Q8YYFYZ42+g1dJKUzHf4L222EiDFDDRCXQx+0H1eUiDzmZWrb4sh9lwHMzjgm9JXg7RV8+wNig==","shasum":"f3da063a33f790bbda056aee63e2cbd974ed3604","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.d435096.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGvYJWSN7B4BoUcd9qA9MrihRlgYPa4USbLjNPebs1HMAiAycY7PwljGXSGJ5gUPajxjJ21DCRTubTN338PivOQQLg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifQQvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqswA//WCFQcm3BpdyMmQDWTNwOhduzNqfpq0L3bFnlkRAHnzing3jX\r\nWiMvseHS+ceHN0EPZMyVwznj3cFjxSNOhg2Q9AzICCmtKPGIUJgY2w5Cd57F\r\nm2IcCzNzbp7fUJW00yIrfgZ2uB5TzOHUYZN7EH1NnrtbgIrD2pK7e51wsSnk\r\n/lbhu5lQOMhO3gdQNkgoDHAQywBFd9CfP6MTWMveKS6bhQlKzlfwbvJuVpT9\r\n7cODHmmgMmdbNIQfpT5qStuFDw4XW/wvMcZLoOUd1k7Ax2dXugh+zdnnxWQf\r\nTLA37U2tXtngCQnwPQgBcCUNCFcQN61F0Yfm/yT9nsAxCvME+aFUtUYigqyh\r\nU7Bhsc2ZrQ1zBmlt/k3N9D0jGwt36hd2PsHiP/+sNH2HfYdIS9s0judtUktk\r\nsKM4o5ASpfvOmiMCpAfyEvLStaYJgDoafsZ5DA/J6AkWNzwQsBnnUOgGsUry\r\nUoPd+iv/f7b9MOQjse6p0ojHeHbeXUwPxoCeuj2wfwL9MPcPP33DuAZ8yCic\r\nr1ce8LP3pVuOwDTLEn07N1wuE/fE8ZG+5eYOe1iET+27bfI5W0Tt+HvbUCjc\r\n4+ClUdjvaK5HFCe5GwYEHT+HArAzPBqPG7Z3C5owl72FPOobciGxoq44Ub6+\r\nHhfYZW5tBltQsp/+cZEBScRVdjKr75ENwa4=\r\n=+9D5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.d435096.0_1652360239115_0.18086086374919752"},"_hasShrinkwrap":false},"0.6.1-dev.f54cc8b.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.f54cc8b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.f54cc8b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"f54cc8b4d25a003d25b771e85b790f947ced7d0e","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.f54cc8b.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-cxH2nnzWVGQTmmINVp6NG1ye5Owp0PpeHUzcRy0zMmddLMyLOz9LzWktDnhF1il1L04sS7+C5gZRk8Vpzku7/Q==","shasum":"8913fb29de894b1f01176a87f3b96ed2b07eb9f6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.f54cc8b.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClgPf1K+qTC3bRgccaD3tJ6pMNl4k1hGKLr0iVTel2HAIhAIR2T3SZIfblLapv+ndymxPeiuD1YrmiKr3gzYz34zLb"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifTEBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9AQ//Z0Jh02sp5f1r8FkDc8z2p/SyGUaAqnY8KDML1JQdUGM6keEM\r\nWibNw/Wvz2XYzUX0PH746XiVOLNpjwSPNr2R9PmXvkzqpJOOKmHlcdmjX+5b\r\nuEMqegTrRUAlDiMev5kgn1+lZcN1DXwlDepvv72AHm+a4R+XuqSvhTbz8ff8\r\noeP502cLZeJ6yf2q7m3vSuTU6Jq36yq+kVB8RkWEyNwHkEbnBaqYB5ucBUBU\r\nCQzag0e56PlihLm9TDL3qxhdeGa0oMEAzWK3MSg3IXFZCte+GIp5l8PoCx74\r\n/kLGt75jl0I43LYOQ3qid+2jxVlLKGwA9sMS5udmG9vQbVF1NhzfQK5NJeGx\r\n9j2DCJcSz1rsaJT77xHoPiTlyCI1dlquawVn9G7Be2qH475dEi5yPb07aTNE\r\nn1GHj5SjtGxjgImyLP2H1oDQvYqUp0wYZ14iXhlf800IaH8JWgADECLPODOZ\r\nPe70Sq/Eh3pqgSYK7YDt2ftRhAtTjO8mxEvTG9WGhLQ+pcKZml6Vyj2vRSqT\r\nstHfkGbtbNG6jtt8O4m2bMP01oPkZ5hFYNetHvpBLxKADCf9UNVHkmx50q6L\r\nRjC8Nm8Tg/jkandV2cmJ0RHpcvFrOzgV7KajU87fUKiPEoam6hLxsQ4Z9Gl4\r\nGe9lPNtlSKWSnsWPxfFL/aJqeMSu/HguTJs=\r\n=yEeG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.f54cc8b.0_1652371713151_0.22211110147008428"},"_hasShrinkwrap":false},"0.6.1-dev.8fbfaca.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.8fbfaca.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.8fbfaca.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8fbfacaf7ecc2a03c0f8e838ab8dc5bc76bd8498","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.8fbfaca.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-bt1r/86DY3NoD7+wv96TfE92rc/MTPg/G3+gYALasaMbSylxJruzFAYpj4Cb29qNiwqNke+kXiDkix4xMjnOXg==","shasum":"1b2b9c48c46b26b542e3fa06c832e2a31a10e283","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.8fbfaca.0.tgz","fileCount":35,"unpackedSize":1054077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAn79+SacQSwwMtk8ABxy8UU8AOZ9ziuk2S5/ZjSugp7AiApukltoFL61seROHlB+RU4GGBxafVS/shGojWmmeFwCA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifTy7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJyg//c+pjZ+NnTqYHD7KEw/GpewqKc97y2Ixem+KYHELYhpmV3Yre\r\npgQV5KGfNybi8RipXJsZtp+S03X8O9YpcTC4F8Cy2SYbWplOmm0fEZoyBK3/\r\nrjznj+ATReCBCvLFbIYCDexqm1Yuul5GEyDCZEjkt6lQq9IuIVZXXcmp0YqS\r\nBKax3CWp6aBl+gIxmepnRpayNhYdeswG8DAJlAyjc/WpVilUk3M+HCqrj+Wf\r\nDT69ExPSk0RqHXabPGDUbKYaoio+NqBdJuxZuI9R6L0GZ7sBpNrQbhOs6Omq\r\n//yKbTflc6rw1Eg8V27sshfuE7sq45SJ6rsBgYXqSD4tdK9F40fkVNQHjJfN\r\nusyTWB4Qaoovo0DSdi6ast7L2Yf4jSof9Sbni5KptgaB2mrE+eyRS2uvObEO\r\n5gBp13S5O8RyQN+TJbjbj3HPpauewxfIUhYrq4LHeR+Re4Cx7RDF12VspezB\r\nI9Gy4t7hIt2Vf+prHKjXR08UJsFu40xT9cRuYnmvnNhHxac85RR45VyZP2Bd\r\nYMO0BjpHC0xFrIzFyczYBYtjDqXFH8C9hDiFss6DuTs0zHsfHw4Um8ylb0Gf\r\n78b20yKg6yttzK7xdq01X0LYofkIaQxuQYTL2/1ShL7BqR7GJaZs9ZQqKcLp\r\niDi5ZUXWB6uLgol6BIcep/ay1ML3fqIDpWY=\r\n=DEPU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.8fbfaca.0_1652374714930_0.6386444053008467"},"_hasShrinkwrap":false},"0.6.1-dev.90b879c.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.90b879c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.90b879c.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"90b879cb5dda258caa0883ca73d7befc4c5446f0","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.90b879c.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-rU3kdLW6DiryDLppRWVhE64m0tbe3FFcCer29Is/3dZl/recWO7uZkoi90jtXJTzMt0EZXsSDO78uCHvcD/atA==","shasum":"0b5901f57ded95b2dea7d62a6459d1b0e3f9413f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.90b879c.0.tgz","fileCount":35,"unpackedSize":1054140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUr7j0xkrkTQt2HSm9hBDTqM0VOtG2AOtjxwRjNjWoJQIhAP0OVuY4NbfYh+suYjakYdz/v/8WmI/Qgowit4hm8u4L"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifk8zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9Bw/9GWMk4/C3nntrYZpv4kMrLsjq8XHUq/uuc+aOuJfguy734ZCT\r\nF7oAGuz/QXUGGxs33frpnddVrPu/s77Ftc/Knmpbvr7dN61oAXofKsddtko9\r\nrJ6rqF6FqhB8F4gCKBF1G3yk2GbHuKWIfuv9Fhs/DU2Yu/MUEer3tMdaBj66\r\nyy0I6AoVGewab1qjY0MJzc2P1kHSBU4U74p17tmCBHYabjznUo6ZpPT50keJ\r\nLlWCL489iz5trFDAq0erC9TUiHCBJfJoFp8iPu+jOCYuOFaCgtigUeirGYg2\r\njoh5AzfMRcTkcsVk2ylC3if4abuoNz00djpWmgtiV9RnrLMPGqIAm7H21lIy\r\nMwFUgK8YvngznKyQUGz2/W/Dg+C6bkd8B42EF1zTgiRjqv0vmBZQs0xPHdp4\r\ngUUYEA/JyK0wEFskt9bFilEOOGcdS0Y/Pxxdu9WDoMNHSl+7/ghtASt9+fMT\r\nwrez/G8whGQG5EIoU0SyT0NHDbykQlOLf+2llOBW0ji4vW2i2AtQ1rWLITAp\r\n6nA9F543ksIJ2yeyUbqRb60/QlKrBU6VPRjRlvgwnu/vXDs/nEUpLF5tnJXa\r\nQufoViMeTicOtHjWxHygU6sqIXrMTed5yY8fEILBK+n8pDaPqhgBmnXdIzRc\r\nP8UqhaLFKyMM220NvIvYKI1cLDtXqGbszE0=\r\n=hfjw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.90b879c.0_1652444979331_0.24817882697529714"},"_hasShrinkwrap":false},"0.6.1-dev.2ee1942.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.2ee1942.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.2ee1942.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2ee19422941a64b29c5bd079fe9e527f71eda17f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.2ee1942.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-haRRU+vXZEIAnYwOfIFB9/YHk1uIwMcJqo/dlzhwJVRr7b8FmyGrHfgfHEnVyNsmtoLXPhb8OrGkeMWdqOTubw==","shasum":"7ee9c773b7bd79ba9efeb01ab5eb0a354af173d9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.2ee1942.0.tgz","fileCount":35,"unpackedSize":1054140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAf0cEYq/skuSkFtAzvKHZBWuRvwarSkFTLV5JxCqZzgIgSzjt5sBl/Hkshod5uS//QLIgKjlkOkuYBwsv2KRxzwg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifmNIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwnA//Y9qL5DE0E7E9cuGpDkyL1O4iIleofgL3VMJriXZ0vJx6waRj\r\nycG88Y7eaJOt46uqu+RHy+4sKcHM3DF+UTE8qTmbdWyYMjnDeuWV7+MVLEp6\r\nYhRp+rdF93DvzId3jXf2PzENTmGDHqaqD3f6u3VEYh8lqr/nqNVbH7MhM696\r\nxvkGjgt7HItOOtCnLnPxQ2a8NIEG+ErY58xask5uwIbn3FRkHAENKLUKAgBz\r\njO4WGg9/jmYwy3+y63GmNSlbT9Pv4LhKlYjQDE2WOI/9rL8cwIGjcypCtBM4\r\nDOhFhdcRWQXHvqCHAWVn+kjiMRwqjohX5QgnMZ9MSuJr+k4QbbHow0+oTsM8\r\nY7gqcMtu66n3hfrodqO1eaYqKmOWT8NTpkULamyT7BDqIn/2NoD5+x7oEisF\r\n8qK74/dQzsQh00TS7Mwy24LJ2Iap1JK/6s4Y4hgcZvmDubYw4XHtbSWqE90K\r\nLpzi89SjnrA6ijpFR5wLcP/yhl6F/mtrBA9sUoZKA/BzTgyTBHeEYi0mqCov\r\nu7YxKAZrfkyQRUiav8jmuPlCbCjLS/AsIv3vjllpx/Sql6Bl6bBI7VLN+qQa\r\nA5ZumdiCHT9oCy+ym6N60PvlBsYjaYJaxOwt5QpikdGfNuh/ADnXlBtRjRRo\r\n0053lldsjeOOct8h3R27tmfCgMKvJYCa38Y=\r\n=lB5v\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.2ee1942.0_1652450120523_0.37451016664408643"},"_hasShrinkwrap":false},"0.6.1-dev.c35a287.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.c35a287.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.c35a287.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c35a287ac6bb8531c6957cd9bb91d04de105c102","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.c35a287.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-6zLr8+GwgZWWO6Cuxy5PaK6RfRDO3z8PG0tYK31wCetr8+/2ldQYzU8Sdi7XRP6/g2YzT2876/9oIdaUrOMpbg==","shasum":"afd7d62cdf9305b31429debeb8979faa2e67f2bc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.c35a287.0.tgz","fileCount":35,"unpackedSize":1054145,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBA8ilSHTd1CJych7HM6sR2x529inSjz8suRm3qxN3x9AiAQPhWOX+C8NNv0sX2/2lH5ixHovJmCE5S046qbDuoZWw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiggkhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzwBAAo0U3dcLCnnk/Wb7mBcs7nk3s78PdONXHe6xK8io+V22aTByh\r\ncX/uQZ/TZ4xZ0v0KUtWNlimLemBTzTPJHemDN3/2qgoOTHZrmPjtQCKJbFMP\r\nAsOKvXhQpcRbZ1eC+u/O9GmwJRk2PQRpVjiKAhzrSYdkYaw2Rnzlv2MaYmmg\r\nHwOm7wUO4t4Zvh7fnlV/zgj8YHThWPfFUjFP02AU9V9IqKUallnlIKypadi7\r\nXcfz20tR6B8hvFQPG0uDFjIjoLYE6MTG7kdrip3BG/TjHlnj8BAMDymtBh8T\r\nfp+3LmLIgNoGRQzMJynEyUCuFlG6itKoBi5shscDCenzJun9Qsoq6hrwKmIO\r\nSo3/AlhiIOAyS7xMRqMKh5J3XqSc8r4nPoNcXlECl+pxxruV2n+6U0bkacXG\r\nFqou4GnGiJEoljIbQbEed9CzX70qkFn5kSZ/W7WB4ImCVmVN5NoWt5BgDYDG\r\n8iqjJLwuckErx3sQk1xLIk1nzJoQzlBL4Y4w9xgIHRhviaF7n/OI/GqPfS/v\r\nPKfkTFaQ30sm27UiDqw2idqGNAI5EZ1ztSICN0ZwyNLUDjbMtIDbiVksrfAF\r\n7CeoB0ozMMEtDiWppvAP7CoLP8/IXBN2EV2z91eyM36Qy+W4vNZ2mEuhG3zi\r\nkEgMm08WbnisoUfNNhzWHL2p42z/oOXsV/w=\r\n=OdkO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.c35a287.0_1652689184958_0.8938646961500498"},"_hasShrinkwrap":false},"0.6.1-dev.d28e17d.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.1-dev.d28e17d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.d28e17d.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"d28e17d888e25b45b08fb8e7b01b1fe60eba4766","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1-dev.d28e17d.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-i0k4//Wp70K4ciOukpnVJAvdCiZzjASODlVXp2+7yUomzXyS58SHhrfxe4YEXc1+7AADVl8bvuY0alXuwo2QZA==","shasum":"11aae52cabc428fdd813dbc6170cf6f14e60c7aa","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1-dev.d28e17d.0.tgz","fileCount":35,"unpackedSize":1054145,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICB19vpKkhU4tUjjARF8ROD/g9qqG7kA1p0I6wTUZVICAiBnISeb/ZMO/dgLJCtPEvIMAR5D5lvVKau0V97FQCyI4Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigkSwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo01xAAho3umapS08ex1ZbvXLKvvXh4Lw75EHyyrQoSz9wLCSStm8IP\r\nGYtlrLMi0okUEnSYIBY9ZxqhGHSgf7Zw6VuMaL/zLMxPRnTO8/QQqXo1iMHV\r\nh2sIAVbsEpe/R0OsdSSBBI4aSx3fI882BGZR/wdXKABnODnLdSyZoFDwa2tM\r\nT54OJuD5Z5y1i15iGoXJaRjEc1uAcVf/kaAsDU720TOQrzTU+t1NAyRFLaSV\r\naE7PJhBi8/+C2iifoVXj+YuBYYRN/dZ3yzDC31dOW1THGs9WaD6veODAnYRN\r\nd3gYKGgQkrekGEOU9D4vYAOKjtK+qSI0kLIWjekzwkdtQ9D60R8/Fap/pImA\r\n+qxoNnrzpPhOAOVSqJCuAlAEd2wZbg2alNeDZmr/nbxPt9kG2q3L+/pBGZW4\r\n/BdAe+Nc6bA5tDyhg5tCxA3Daa1691gIscNNPjm4V1V8ciyvuQFpD0J/iFu6\r\nGP6jgK1q3hMxok6M+xfF67sLCMifBHqmN7SKVRgSj+ePB+4Yx+rwowxYBVd9\r\nRWq901aqhqgWsCcQLvKGkoZ6rCUMJWQr0at8lXHJO8o/L8TVIZj/LXomNccI\r\na+N6d/JhbqOD2ldq1thno8IWoqbUDRb/yj3W/nn691CxRcnmJI8727dMLjrq\r\n1XYfoxzg8rXit5VjG/45nw6mV2VE9CeTKkE=\r\n=zFqh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1-dev.d28e17d.0_1652704432558_0.2518401291143062"},"_hasShrinkwrap":false},"0.6.1":{"name":"@superfluid-finance/js-sdk","version":"0.6.1","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"1.2.2","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"gitHead":"b0d8dd0cc854b32a22913c1bafc76add51742a55","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-wAXKawmYKY6A9ae3+BHFuKgSb6/IxgBP5UshLJDhmAZmVlZallyDzJMnQszq5T3jJM+C+hDaR4+VmThiqcE4MQ==","shasum":"818934788bf320b1f6cb4551ce8cf6a72aa98e21","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.1.tgz","fileCount":35,"unpackedSize":1054743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/bzwuwkX3GZvPKCmu2IhTtg2mwaNpz2bUHB6FU7NIyAiEAn/f7YnhTHqPaPxmbraTQcuk7aRQKGqzoz0nw8XRFNTY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigpifACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqS1g/+IspEv5R9kHZ5hEO75DrrUg8LV5pztBw+E+No1LR0mFiDQrtP\r\nxjVccnZqgVct8wl5+DtUiSzVqmTDOZeg9jYT334+GKt15SGPu8Jm7q4jShaj\r\nfTJqeKVOvkOSRWi/e9GNjEBnwGwBf1qE9RiUXMQpz0V9X3PqUWWnq1cNZ3de\r\nQXUwQl2/T2/u/Yy+XJ18wXcuDYdS1McJRs8AXOAfgu+T3obTpSzxHGu1VNue\r\nM1Xeqmszq1WnuLOrwwJLCZwxPHC+HKAjdOOOCAEoAyURa6+fuXoOOv8BLQxe\r\nvkkpA5qG645y6+flAoen9Vf37v1n+8jQnVUkrTtbJCqn2zkdr7eHSSz5MDCj\r\n0NCj1CGyVeaq3wIu4msgcJHw8snlkwCJUPqMKrbwln/XNK6DplFFaRaaRGW4\r\nf+UbNPuaGFHjH8l/RpJJWS2RhyIEyngocWDSnYGm3WhHI+U/FDBFpjfX/yNZ\r\nR4UB3ty0Rqrp7DEcD4B1fAWfrQamgAlUUHQZKjexbvlZoWwvbi4n5mEiizW3\r\n+wq2fuJOhrwQ2TlG2/PUWg7d+W3bVHc9hdLIspNBMhqDXkhy/0SntimQscvJ\r\nHVwe5CkxYj4NqxhxXXQqP42/Jh3zpc/fmnGD+SOPC3Gggmj0xzrYLPYir3eV\r\nyUwyeA5fS+xmqKLMrkod+TmIYAM9GOXATGc=\r\n=2z9+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.1_1652725919104_0.863368537396489"},"_hasShrinkwrap":false},"0.6.2-dev.b0d8dd0.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.b0d8dd0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.b0d8dd0.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"b0d8dd0cc854b32a22913c1bafc76add51742a55","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.b0d8dd0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-9whym4mFl7L9X+2/7+YtuyuCxr9U97CoiwWF0SFP33z0BTgz7otVjqU+S5v1UdzOSocxBPUS0C8TqZNOfSPGdw==","shasum":"1127b1fe875cb12c9335db85937248db1401c7df","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.b0d8dd0.0.tgz","fileCount":35,"unpackedSize":1054772,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXGsMpImVU6SUOzXtAMYUklBIcFQGHNQoTo0vamMgsrgIgIOqqNvRivLRpRXLqm+pAtLFMGA2J7zOpJEoBefaFbOo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigqYpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0QxAAlUUK1iMESQ6ljNvEthU5/Z57GZsEPUM2V8GqDFdZbsWh789Z\r\njOmNAls7hf/5N54f7yTm3MoFbq/kinXI6+bhf4Bs2SSO8AZpH7qw/Qyf2xe6\r\n3Vx7qsCHS/+4pmGn8AAVBoaH1JBM0mBtbFfbVdKHv/dqDelRthuhO7MLokuE\r\nelmv9AvHnB30TSwgqDVIPXNXt0BjBcbNFGPn3wUoSMMGOhJ5CMpWdIV0D7OA\r\n05XRTAwiEpNCeGr6yczsqes13yFoLa1dOyvvKTzNLgXQZBFf50h9TMQlsG+S\r\ne/o9tEd/pMZlmYdeBUtgc8vjoLZCAI6E/Y4x4Q9l3s7Ilrz3V5pWIlPqDhrb\r\nvylzWrAQuts21ImM+YplYNyKIe9fKaqP1d7tDV16WgPeBAhV7Og0Y9v3NOOy\r\neh4fdwPABwh720HCmJZrBXdxJMBbrnilIRbaDSYVlzIC0lW6zjtyybCGtUVj\r\nfLJKpIIBGQbSMP5CLopbjcPkZfc75dGTTWRh7K8MdVCr+riFCKi0aTK+kP1z\r\nh48D22vJbK/ua4gAx0un0MZz5J8IVzE4kPfpfTOO70WLgmuxP+inLPYU3Aoj\r\nLinRzrQ+dlQ8bgTNgGKe6+uEcpxVWJtE4dwSO5JXgUzLtD7EoXVsUGAcxc1w\r\n7XTwwmwheQI27bgLFcp47lsM80FUAT40GvE=\r\n=0nQQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.b0d8dd0.0_1652729384849_0.890181270697807"},"_hasShrinkwrap":false},"0.6.2-dev.c518630.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.c518630.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.c518630.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c5186302bbed8431d98cd8f24a730183a122c49f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.c518630.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-L1PyWZGTuaT7v4m/ZGTlzHjdyxnCRFI6VXZCemu+RdF2fRF2vtKq/JS7VxZbH5EVI+zgWdWnZnQ8b6TCKvJXDg==","shasum":"f066edeed6750c735d0d2a0af0d0cbe50863e1f5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.c518630.0.tgz","fileCount":35,"unpackedSize":1054772,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtQzLZH94O4V/7GieOViGXpfVxt8eUz4bp85VHBVRYegIhAJFnA6GDlgbRtb5vent+4cdKYKrhfGYIf14e2NaDM0iy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihM4OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmodUw/8COBuPM8N3UvTqrsczxL68N10Y/r1R/Y/geur53r7sICiCw7N\r\n1w9gXfpR39wC+ZCwNfp1VtKrbdtj4O7+nmRtvdD/Hfv3dgY4dpqx8RPj8hAT\r\nC0QVRNai/gHA7tSrnwFXnl8q1/hI9Ieh2D13QLujjk0hwIbbnIJXH6LAZzMp\r\n8S0Y9hRxDf9/ykFCSOprwZ81s0UxrV/vR7D7O5vyXrQ0cx1yM9sd0p7FupSo\r\nLKOoEg1kdEDV1gMRPR1tDrnvr8EzN7rh0Xdg5AO7iJXG5jdoIUKLrGgW39kz\r\nxmnP+PumoGMnV5T5WFVeH3ULvOBsqhmYUHGt14fsYBo+dKQIPBbt/icF1cGU\r\nZrNKUqW0fWseMunibWnPXpVxWEPx9jd2AbbM6bRyEaJvwScbTQykMnC96F/z\r\nNAmvo4Bn0FMBXukH5WhvbopvvxLoi/mm587wZ0QDIUMhw/WN7HIz14akTiZb\r\nKvldyQhIbYgHE2aBxGUUv3D3s6fL26XQZBHnpKg2A8hYfYzf5OtIPswUXvKu\r\nzikNFfmlZ+Sknj3KuC0x4ajzkvnTEi92kqkFlHq3rD8dOVDfkzwGX91JhdXK\r\nNY0tVPHK3dw+J2yfDrruUx4OpDola2xRwUI0ofcXHXlnzVBTMS372hMMtDQ4\r\n/SWVejQPZv7y9ohGZg0yDHTjTvYdIT925co=\r\n=n3XO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.c518630.0_1652870670138_0.12589728703054548"},"_hasShrinkwrap":false},"0.6.2-dev.5073b90.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.5073b90.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.5073b90.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"5073b90a762d08f60a01bfb25ad8333ac3601bce","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.5073b90.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-q4NbGOSsg8iFsliDrJH29kbaug6pW4XZa9JI+foz1EXV9tk/91cJ0n6OpFHqfuLQbJnaMmx8XRWCOU48z7OoGg==","shasum":"08d32c02343ca4c17a4ae7b67bf20f0ac67e73e2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.5073b90.0.tgz","fileCount":35,"unpackedSize":1054772,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO/DANIuI1Rx40Jf3G8q9vCSYLpHDawPa2x1GB9XOFsAIhAIPfTX9gv023TPO7r9+pXDrA95Mb5oNdVlRsLc+eprIp"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihQHWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxQQ/9HdatApVm5lhgHk3rNeH979vCn1jvxCjqc7WDlSK88BMMT+P7\r\nnAFIHipS3Ee78631OWBuBtIsZYVq8Klb5x+6DPdPJ0WpZwJUWcoahQjdidGx\r\nRhUQCyIj0KI/UKKn1LAY0YTm+Sop7Mkznm4PtL/FCknCKBTnevwL+lQrjGzS\r\n+Mu8r9moamXjDjMI0TWhg6zUjV6DWoTKBP1l8Shgz/agzzE5V2iwrbJHogVQ\r\ndb/WR2UJG4Pci9XnL8thbPCis+JkGdlM4V85LA9ddygviZVdR3mfT8u2LBrU\r\nleUB8qp/hF7xZ0GdlK1/803RnAslELcLeM4cln50ujK/6q8i3Msrvi+KYjgc\r\nkIsgnmXxF7SlrenWMT0uACkNiZZ5UpP0y57KCPWWtooUEc/MASFydZc9pXjf\r\nSYSHtSlIMb6MflAvhB8sTi5sjmBwp8VHKBQ/9IljzfPH5x6c5fCNred5HW0D\r\nxmnVsU+mq5fHviupybXklr4W2/5M25FNrw1fDB2g1aGkrEIrwMoMi8/s5H3s\r\ngufCPFOmiqjsRMleTy/FoqOhs8PKHcd2VwtU4xFy3/G7LgsXXYbcDzRADlxI\r\nr3tQqiL57+GO0Tqax1wgMY6xA7PfyPQpTfmkUKj5TPy/AnhjqdNEDKAALvam\r\nVZaSxUttgNIrrdW34PmLeltn2A0ldYzDa8s=\r\n=3Ccs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.5073b90.0_1652883926309_0.04899391312823953"},"_hasShrinkwrap":false},"0.6.2-dev.c2cbb35.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.c2cbb35.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.c2cbb35.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c2cbb35edc2454cc9524129b7407500638a9110e","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.c2cbb35.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-m1Lk9J/NbkKj9KPmYKV4FJSQUFG8whVswNX0toBtz3CNwSJgf1wqo27akWTbSjoqsfD47zwQlImVk+uHSta4NQ==","shasum":"851a3345f502a90a720a8d05f5d00770722a8d73","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.c2cbb35.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFg9f/gDSFLvp4pnBOYaNqoI1DwH9wVF/s+JjThhphPsAiAyKEmi2pPYPGLSaQpSMWm5yeF5i0fQ2/HGakph3GYChw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihhL9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqWew//RSfVu02qAiYYfGm5daictCRNdG3D3YHsl8MedpptmFgsbd1y\r\nnSSUTO86f7PizXjj90taZKVLvU6PEXAUDWckajDHOM22SNnqEOiQaZrJIcZD\r\nqxBItHC9AqczflrQB2kYXZjSoP6XH7NZLOQKmgpkgd5OxuSEUQLztc2VufzE\r\nvXzdRyfiOqRJh/lbEON/K8nxJMVcjfo9cr2lDNAXEKl96LMjft+Q5gWsgIB3\r\n4GiFzXmEEpMs3hUt/hVEzXOBdTPH//WPXDq6SdvhaKaQIHDMXU5pgTxtS5ZE\r\nkE6ldu4xFWgxRvuJReqjPsaQiCTrd9fwP9QNhilHVxl3gRMbO2tMmZoBYGzT\r\nMiNyXYcWItEdoEiOZFYgv6QxPnyhn0U/g2w5VI35JowHyjlJJpvllyTkA4c1\r\ntROg/AtM5G295F3cm0B6qRh1/oZILuLF9Zoq5ZeTlSoJqW41tU7KHQF1gjQ6\r\nLeelQXobWkWJuCNc4sjb58qJ1vPRlOFSpMLJKFO/H4FUQK+fRkJcL/CK8iEm\r\nN+mpRXB/dm5JdT4ZhNT1aA+CbL3nfXrX9NZZo0wo+7075ap4bKtu7i5M6NqR\r\nbpKi92kkW/jf0+9CqYUNzjtWqZHFJOtJzWdSpaCus2KjPSRrwNeVAjsCzYUu\r\ndE31uNwLw9WUds8C3n2vrXGrd78h+DaykKI=\r\n=UQUB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.c2cbb35.0_1652953853497_0.40769954043713885"},"_hasShrinkwrap":false},"0.6.2-dev.9b763f0.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.9b763f0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.9b763f0.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9b763f0e35b88b32fa5d57912681ecc13d6ff1e7","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.9b763f0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-LsXCYa79sATzO11ve5I86YDZJiG5hgbhMXn6KkzxrALBcM51bgfCbdYAG3i35BivD7hsP5TmDTNTGmiP9GJbjg==","shasum":"16c0dbf33068a691de2691760c2949b42beb2667","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.9b763f0.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOXEpWF1bR96pAMJgb1KVcd64Md+tW+NJz/pitRRRXTAIhAJbk5fbKz/u2oEGw/fp8tcHD/S9jkDM8JrCT/E7c62DS"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihj7mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3jw/+P5ml9ZvSkDITKDWAfjZxNCo7dz0Kdy/8v1PsQraPONIDdQbI\r\ndCh56P4SSoI1StAutCrCtlcmZESXg5fD26zKrmgmpt8YRP5112YatJs9tNcY\r\nd1J98etbxlgcCpB+ovgyWivrJRMx85Os1hP2r/fHCSbSsCnvsp+1yqlWN4ta\r\nxEFLUk7MoXyhvre3nWWjcjG3DkLFxkeMtkUoHXYEw87u9OJqSk5G09X8XUrl\r\nON9AiuFWgIK22bf2PIU+iAWfUGE9PSGrzhzOc8IRe9HnWq/xJ5qPOGunqOT1\r\n7cIwYaLE49dyKJwG58e5yvthf9sGpaHYQLEcff/2ULPfzmMjO6o7a6kg4qoD\r\n0bP5dwPm6I+i9G/nbLMi8ImN7en+uAknxvWCPvWVSZabIsLVT5qWry+fIHiN\r\nAeb1WAp0IoBLttoAATnDRWfysLtXSCNb97QNxignQ5BA6l1AW8oTVFTY/1KN\r\n5MNkOU58m8NlbAX2oHBD0N3zyEn2sC4TExl6iDLfx52hhYFF3LzJEGHTC7Lx\r\nm1BJncWZNsbjqVDi+i8BF/oua20ZgJAo12LSJh+JfHUpk5gkReO9tn0y+JX7\r\n1bVK5/Co84if/YYwMG6sieNldmI5lgFTWQGjlK1q415UCjZBBeWtwxCfWl/4\r\nW9ze+HIm8d4MSVTh8lDSwn6Iuq3ohhnBZcI=\r\n=6Xl4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.9b763f0.0_1652965094535_0.768334731863531"},"_hasShrinkwrap":false},"0.6.2-dev.cd892eb.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.cd892eb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.cd892eb.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"cd892eb538875211648dd2af9c547a559cd1434d","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.cd892eb.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-7TfakM8RNv0blfvgfqTauBy/Gd/WU2aUT9sF401UPV4YZsDOJcqHEldngSJ4g9SWL05BZl+PDmQjiV0+v3FEVA==","shasum":"7d1119407bd0a157e0593c49975150e6b7fe5a7b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.cd892eb.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe3to8C6DztL5z9ZP31D/glbUczzZno2miaRNKfjhKrwIhAPkMmtB86XmSfIXOwK3sz4lzCPbihXQ1BfS2espm0bcR"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihlaAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYDw/9E8goriHyBlXOu3xe0hTaR2tBfrImYKA4lD5p8w79qFauqPvt\r\nTBF8bf4kAuRV5DEoltICXGtc5RjNs+VISfGneAYvK6U8llyX8+okDhPt65E0\r\n3OaiqmVIgwyW39Vr21nBkjK8GjJ3WDeDv3DgmOw1cBhHT3lIjdvLvOL5W1cs\r\nKBQF17gvypgXp2i+WnNznOxCaO4SPVOaMelooWfAHjUSr9LlG556VGH5eE9D\r\nz789jSD9CW79Hl7Z0sOVL0B39iQDc/xDiiW/g0vxjUuScXYzb3AahmpwG/Q9\r\nOL3zCJ6f3+7p3t237qtRbgHY57CqU0wJvQE8cNYGpeOSMur0dfJx8TZterhH\r\nDx0wAtbcmYLjl8OqR1DgaWl3XhPAZNsfeQhczwwtSCBFlsZ2l7DlL4daDEMb\r\nIKt+KlRf126nhw7TQjNo1vbLcKoz2eGx0Wwth2dcw4f1v2LXb65hElzI4iHK\r\nJdWg66trnFFyJ+CpGQk5NBBhoQ4rORHl6FyZ+azHbOrV3lwlLGTODRMm21lG\r\nOEcUtEGVnWFezoTAuw7SL58g5+w3NKuHURAk2wHZsvL4Z74FNgFZXX6StUt4\r\nuOAQtGNoZbXK1GLN0KxGWFFXkTYyDiidgB6gDlb2+GoEB4QIkTAaN6hS/pRT\r\nk7f1Rhk1/l7k0deZPCMtRXzuXmXdlYwmW68=\r\n=zRev\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.cd892eb.0_1652971135649_0.047229047531297086"},"_hasShrinkwrap":false},"0.6.2-dev.f8cb3ec.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.f8cb3ec.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.f8cb3ec.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"f8cb3ec72164f0781b257540e98a762c2486db7a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.f8cb3ec.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Xom9IJHu/VUvh2xwzYcFuj/sR0xGk+vUXiV6r0Yd9znR4m0yZ3qDkYYNyfNCJDMFf8Vb+hQpjoKvCg2BDGDomQ==","shasum":"beaec1b974a81ed130d87010cadc65c3bf8a1204","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.f8cb3ec.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+jxuZnhvuSddMaZ/egsTlFgdP0iBqHj3W5n5Q1PHbeAiEA7QgEJnqXMyDetjxrdYhVCSLmfjNITXoRk+OuRd6VJe4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihlwdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmooag//b/jz0hWDvpyWvDmxxlmNBtVVYnj8CbjmhFq5Q1FDADIwDYZi\r\ntcAZIGPP3NcDOVKZ+LMT8UUipjg5zFLpXqUc+xEbB1Mp8Al9/0Az7Vw6K8GA\r\nPTQWJVG2UZGx3+RhW8rqNCZPnsAlIGNZDClusbqSwG4H1Mf4i9+Z/ya9bZYa\r\nbh6snl8yqs6ZYAMFfNetphQfVNYCVkylZy/+0t2Czl3ImJNNn0v/idmYr2Hs\r\n5DELMZgsLCWOAQpOsQ/GHl/c0CQ3WKGZaBauPCGlPeE4nEXkInEH91//bAw0\r\nEgaAkmbBDJOBFJSeZPh7GhaKoOdIXiP0YXAeUWlApZwhAXPtwGdf/FuPZtYi\r\npS9X9BAcGZBX6bxrAjsqVoPWVnYtDbjyY3Yjkm8i0rtkhMJ/Pc9m4DNfvU66\r\nblW6L8KdpaXKB6UROCt75Qg2mgcquFlZdxpTuM/BAG2oKtmVRQE9tzjycskF\r\neBFwkIWbH9WqJ71s5xd9bEzSjkXwmkSA9RWWNMm9DhazneckWe+QgYm8LkTV\r\nIlzYkBsdn9WJmh7dXCp3Qu5rOUYEHFJ/BQvmgP0SQ47FlEm+jlNCYF816C36\r\n435D3GNIxu6F1UrEXzLUEUSlmGU6Yygqxc4gNMbZ14K1LfSRIt325Xc5XEP5\r\nGi6i+cU+xpWbY16ZQk26otsdzr0IwLFUlBo=\r\n=ijs4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.f8cb3ec.0_1652972573705_0.1068031871093329"},"_hasShrinkwrap":false},"0.6.2-dev.7b94c3f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.7b94c3f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.7b94c3f.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7b94c3f1540da94cecf715193c8fb22fba802e9a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.7b94c3f.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-T+fh1rBAYNkV5LflfcCiubLyVuiptuM2buiF0r+xifrQWQZ+fIS6u9APVAoSzXvSrRLuYPg3YBl/RaeldEJUEA==","shasum":"1bf4aaec07061ff4d4684fc92851e96fb8c33eb4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.7b94c3f.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiI+KWOhg68bAywtXSCX2+jMSV3qB6OK0FOZfMOkW2XAIgLxXrw8SaCCh3lsGkjys8AT1UwcEkCm27livCLHKHchU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii7yCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJBRAAohefsezkR3VgW9OVhWxq1K7Y+g8ZayJaxes4gkzak0pY2/Gh\r\nDyqjWwJFI6IiSPEsFGAA+zR/mH2HXk+RgXp4GwYcw2O5Uu3mxdmyB05HnpST\r\n7I6dbIl6ftwAB/a0rzQ+jzv+pCMp7rKU3EeoJ6qde3WpdCTaXsNQS2IXcETs\r\nHdsvA6ED9wsSDYbyWZvd4lUtlf1jexNGGHnKpM4QLPNs6AT3j7vUN6lGDkUh\r\nvPzQfUNdMw75dbd4wn/ip+uUPeSgPcUmm0v1hbv+zMa8XW8fGtwHOjXFL2tn\r\neVrdUKp7vWkC1PbAAV279L96tPIYW+O1c43Eqg+5RAZB0FsyskmF4ZZQlv2W\r\nZ5GMhyr3JvfDg1A+uobvtAdwoop3p2pgadZtSiCI0fotpzuV4Q+Fq54YRg7T\r\nmZLyi1tGdLjca8LdWYP1gNDNl1gZ2e/BckkyQcT18OD3R0U6fPJgEZk0wSmH\r\nL7hafuZHd1FDPcTA1gnruigfjAPip+FCfT605m9NwWMiL685RLzxwRPZqFe3\r\ncPAyNmO5RK0PmbftCciF5PgnSPHa5V/GkrKRDwo5oNx110X2xJrBBsdcaQXt\r\nDnjwXmncke5UN/fpo8znnctzDn0h7MJ6pkRZLWy//90+tf16zsgKGdma/E3a\r\npWvHsWC0lQDsxmgy2BQCiseSxmfTbsWzrcs=\r\n=lMCJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.7b94c3f.0_1653324930564_0.6743457497943395"},"_hasShrinkwrap":false},"0.6.2-dev.895b601.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.895b601.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.895b601.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"895b6018796fa164edf5f5a8f9ea902392551f9c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.895b601.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-M21PQzdlkmvbNwbiDuQwD1q7aW6yJRNwHZmaRH/93irNxyk1WVd/iVK/qbk3VUkqPcdO7jCMYECZeCRC5Au6eg==","shasum":"6131907331fac478bf294c4524377d1e8ef14631","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.895b601.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH50yWW/yKHc4atjCXkV8Xdk6Z4R38sAhtbv9MQPBzNXAiBjBuMvrzjPnyKphlSLLF4EPBUxTy8jKooMuGkT5vflGw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijLwyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrRg/+NEoLaWu0/cGd+X2yf2Vfwxx+Po6xYkcEyWNZZkrMGqaMmDL0\r\nRMj+sR22N9HbYT+dIleFy0M8PX56zTj3+fIqZxGBKlyb8UW5X42Gg1hNuuqy\r\n3ZxGLqCwjWkkN0iwgtH/Pz5sNZVTtd2hIFq+IAzs1v9HiavLRYc7SVLrgHJg\r\nN0RaHFUI/njQ3zkI3ReYqscRo8AwBwaIIqq245+6IC4WCMGTwhkeKIxZkW4y\r\naFgDoS2RdSh+UCrhHIWHzpw262JD/Nymim0/ro+bfbqf6ZDgu33wIlgeSPCh\r\nbH2hNz0g9BncTvnH6CeDLIA0mjfdCOW1fGBXjM11voc8iv5fhlZdOc5DPdLH\r\n206M5Mk/fZDZxGAD0tUSIofQZRYpmcQQmchKRp3fGjIB1xtnMXdL1LCiXD8H\r\n2dvSSIe515DeunoDCeMfmMJXKk4EnGPDxJ/qvLJkjvSU9rjGxusei2O/E8gJ\r\nZx/Jiy6Jat9zlmD96x/7AGzSi7b9GYNzl9jHf/ozgSNKV63HMKQf3ueId34B\r\nmkGcr/DskPwQdv41geGGivVb5Z7S15+3+/Mvu28iC9hvcZV84zJJIpuCEHZb\r\nTt2xqtkEX89UXO573N8g5z5gOz3P4YlZ7UZUY4ngTrjZCmmlQlz0Gm/QJuDZ\r\ngKJnR7Uam4xxxWoEuJgMzIIo48wPdA7NcrU=\r\n=Dpg4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.895b601.0_1653390385959_0.16738952018572784"},"_hasShrinkwrap":false},"0.6.2-dev.b11d6d5.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.b11d6d5.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.b11d6d5.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"b11d6d5e69a5369ec69d5f544cad3a75725a9232","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.b11d6d5.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-EdioEOKJC7OCAohRuw5YpGXMY3fPRyAQp97FmmLk54N7tYTaPZoA7hasBbNczzxIClLjoffCC4DVyQr6uNYZCQ==","shasum":"68349f7174b615ab52584c2e4c53c817408c7007","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.b11d6d5.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHy/fDuifMMR+F7kH+CJLVo+2CQWr2MOKR0jFkyJeDhkAiEAkrUwn0BIlGZKtNYbtvu0KcTbVjfyqwZi7qLVvFtonYg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijP+qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqb1RAAkawEt/Ejam1O7iYs/K1U4O8DUgar3aXGRooUdqSrKDkf5vV/\r\nnVabJSp2AqMrVp7OHaGsSNEUfoEOUUGFXubdMJxbwN2NC0cNg9yGGw+zouLd\r\noDN87ECTShuadnaGzZ61QCECrP8/XaOrZUvhXyq63NfeDL9MaxNfzYpIsOju\r\n1LQ0Ie4LFFow/HwC1Hgu3esIQfDqSC/Q3YXyjQPZLpeOrk1fKk6IgsEhDrvi\r\nQTxgEIUXouaG2uERQa4eIBeZ9l4bNsaphX7XXmy23UTH0BQ+52W2BtZjz12Z\r\nSMcKIy0Ve0UIrT0560DucgnWbNU+qrRDYa8tgxC7Do1vM+YkVVy/wbGogP/V\r\nr3+xswDq4Ng0ZAwtI7d3nzzf4wdDOfEyfmrhkIEVQSor+sMwr1UsoraXCAUF\r\nYgPXS9QFEqhCkldWnLbB7NeXd7zzK3q/5wHbgVpT59p5BWo7wqYFFbZ42mz2\r\n8u/l9JiktExybW4fPr7X/7th+NSDO3dYW/ooB6n1EloAV+lNwHDIy0gu4w5g\r\njtXuXubknATYfh28v/MjOZdvqLQ4sC68gyuN1znaljlf/Avct/ctuLPcAOQY\r\nNbibNoxZky56dbRuK56farPaLEVkp0JeQVD5GYkNvaMNLVnGyPncSdO4HXkj\r\n/odYVppEYiVm5QboqYSsZ6bR27gXZ0sslN8=\r\n=fIwO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.b11d6d5.0_1653407658150_0.7102592739661437"},"_hasShrinkwrap":false},"0.6.2-dev.e59d524.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.e59d524.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.e59d524.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e59d524eb31ee6cb2fa610de74219cbc837cdadb","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.e59d524.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-yefRcETIQ9rsXcjIRsARIgKpvjGi6zcvKmFMJf31c6EZJTqaq9ybpaDPxGTlxuLfz2/mUhNYgMV9vYa82HxpQQ==","shasum":"e5228214609263cf981ce03f524db0b9c166c273","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.e59d524.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGEVJxS3Dc5G56SpRZTJRl9UOOYtUbY86bDpR9Q8bUV2AiApJtogoWUhHhze/ujVvYwp1hlTJQOmrQeS1I2QplYfKQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijRtTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAPQ/+MdMoJ6UUHJSLiOGvbtLLpUxJjvDxYcO0+FwjfGXJULO0ui/E\r\nQURv4q073sFfAduKfLU8Sm4CKBbRwDHoKCtltmn+4vGw9lZbTQb0EFREf3cS\r\nZqtQM8fZqNt0hDvqb3pXqvwBhXEpRsBwneoyxBodLI22NxqoEzkso37J/leA\r\n8fpHjVzOQt14BJoh+DlNXJdnffHNNWoTP1+I0W8gYlmQPGi7Wn4kf4YmFFv4\r\nnv9pTbxaMN5MhhB0vvFXqVKaTRHqjWPTfiIlSn/RcitIzbYLRaLo0y7e/T/j\r\nvPWTlhNhyYegsAbMPdnBYxmCHGrC7HgSK5PjpW0eGBG9159wSmXLm60mjq+W\r\nXc9HTLC6YJPOzQv+X0FznS5amMiZUb2gcWnU5m34HUwz6hl1W9N5d7aOD+sg\r\nffcome12gHONo6ICHg1w5UQZcwUF17t+o3DrTFhTQwXw2bagsZxc0iBVb+/n\r\nJsPQAv5zCfScYZuaKS5c1evhCL2017aTXCx0bw8yw4HeMvFnaFYYyQoY0fC3\r\nYOfrdiYpUTBDFwSlwpFXmzUbGXP/K+VU3l3nCG/s6zcYP9Q8FllciMr+DdrT\r\nK4JNQWXtyRY8pBOAle/R5/RPvXi0TJhRiEYzmVwivpRiKgWj6ArVZd0pS/nr\r\nrlKO6Ei1Wl3yY1bsadI/u8hnr63JcnU4YUI=\r\n=kGCW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.e59d524.0_1653414739008_0.7786558919458741"},"_hasShrinkwrap":false},"0.6.2-dev.c9ab76b.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.c9ab76b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.c9ab76b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"c9ab76b9f445e90846a37c587406f3fca2c80d96","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.c9ab76b.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Ly125GbmZhm4EqAn4AyrfDvEhTLoT8MvCTJ88OcsjcMKYGcJS4n7fM1JZg95ymCjhLAuISzo/m6d5L6KaVAwpQ==","shasum":"51829f3c336eaf3974b684872ca0f28d9662353b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.c9ab76b.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpHOM6yewdokfCFCaBBOZCMsh6mkqTRGkyB1mtf0pZ/gIhAIUNpfQS820XDAmTypmps+WJr/mvHPB+0jduUfPu6E3t"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijfOBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpuZg/+K6EqwuRPy/AIYL0v7q/OMCr04WV6/Xm+sLmfIJtyeUzixgUU\r\nlvTTamQ1saUPyL3JHgBpWVkpRxkA0cii2QTJQG3YbCdW8uhKBm9djA2KADQx\r\nn8xvX7mirEg9I+x0mXl6GeR4456mkxLIX+UZI+5AxP9c0eEjzVHH29GxyykP\r\n/+kjocQmdX5h9CVFV9orYS+/J7byIJ6rILojuBvwC+UfzWRW1YoRcDdcYbR9\r\nBjf3XtyEw8FvvQ6QvlnsEHsaVaNAAz0Adp0huiAvXB4v4HecgpJ3i1+5oGXa\r\nHjxUw41+iOdoNGnrqVIog/7kN9DOb3HCAxA7ysKVZpvtlwsDCQHNhFHIqcjM\r\n6dYIMBL8GfqOFeU5FA2GXN9bkUOVCk8R8qz3TQSh1fZ1gnGvrVWkwvyrFTnT\r\nqtODnFydZp8wJo7Tvh07I2RaDU4CGFzTLhw+RSr4VOTvPFeuBG1l5JQ1p8Nz\r\nXZnDmYc1HaZnLt92l9l0kAacXKO7tT8Kyp1bABW01gILWWpfqTS7qHUXzUri\r\nplx//ZVQOYB7rd2ttblq65CyB2KhLDAZWrK4yt9uc2647A4963QpPG+eWTjA\r\nvCIqV1h1zG+dUpPR+AS6KZ+h4hO2BjC2nbxG661x4nitqI6hMCpabbJ1FLvh\r\n0OJZtOuYcYuFZ2yOCY016yr+WFSYVflq18g=\r\n=fkDi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.c9ab76b.0_1653470081473_0.2864901315925332"},"_hasShrinkwrap":false},"0.6.2-dev.7365205.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.7365205.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.7365205.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7365205e46e4c560ff6e7ab54b3feedb66fb418d","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.7365205.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-2r66zrM0/159izzgKiKpekvGyks2H/JT4cKvPOxFJyvnf8ILU6nexk4eodvW0jy/JTqWpX/8w2+yOSQv1uhmNw==","shasum":"c7b6a9b960c86da5a448b5622bc596e00539cd0c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.7365205.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZSWzGrQhGhVXaNfYrxdaePkhIFpwNX4Oe0nwPuHtb3QIhAPKhuXI7fYXaufviKwgjy4+qBoesYeFn8mnoWTbPig6/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijfs6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrU9hAAl0+1uxJf0BOrVQDjh7GwmGufYUtAl37UP3b6qpACSVI61/49\r\nXq3t//u0HHupsf/x06DEow5YTttRcdfvj1iO6ID+kMGsftvQ3H0VVlWrN+EP\r\nR05LJB+4weJ1CYZAiCkVI6iMRjutQy1ZUwyvRiwtIGZcwSLDPgLCAUy5TbeE\r\nBjuqUzUbrSMSBGEQHaivEEd/oBbbZcTd3eiCgGB2/Mb1NDPOD0CYbctcaicW\r\nNpv04eK75LFklTu6+jBnQKXwL2r1QSO8iByIFqvJn5ktHy1LqgMLRhf232Vv\r\nUBhi2IdBBCeUZQIHndD5fKOts5JAgJkNYP3ujSKWTytq05zk/HJ1nINiAcfa\r\nlflZ15KDa5gvsxWS5ZW4HxlUzAL2u0Yt/lZyEzLgJcQPYnCNaike+5SBtPic\r\nPQLDqS8V00Tan/aVsuPr3NGyyRTwNhrYOpI6CdojS/vpiKWSZynsT8mSYPR8\r\n+/UvuKR5DIrsskbsx6fKhKvtIpGelDybvGsjNC/qodTnhLB4BItTlVHGr0/u\r\npV9Htf7RtKZAHElo04Hckwi0qmA4lhQ7IAfUFQhiZOgar+z6IYa57w1clO/y\r\nIsG5jKK1vF6qNielrqYDoSf9LW5YtC4slxjd9okTTzDwzavA0k7NjJLkl9zB\r\n7Si/AHVSfGJyUjZDNAIpzEgsohDP7igaHk0=\r\n=XTbA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.7365205.0_1653472058473_0.4520227369108898"},"_hasShrinkwrap":false},"0.6.2-dev.3035755.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.3035755.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.3035755.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"30357559e6f095f823a9bc6685495222a61c99fd","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.3035755.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-LWTqb1Oc9cS7//fO4WfwPikgLKdHXcatj9+PPX/PJRKddCoazcyybkxEW2HeMBf6w/pGHn5P2MqnZlrrRVeilw==","shasum":"c6e6867dc6a6a9db9f1d28142c4fb5bf6f111355","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.3035755.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEszKFOBoDuQMHTN5y34CEAOHgDPHpR7v1WXlJ0iLmOSAiBBVPaFqGPjgj/Uj1awggNmXB+O5n1cN7GuY5IgbFoUWA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJij3MpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPFA//Qt+CXN9ays1E1aXUR14MGJXDKiFvUCqmde2W6IJ9qnpHJMyG\r\nE6w5OKQKsw2ujqxSzeM2R3pNxpmdiBmprUsozPuTmzkoPnNSpGAwf5JEpt83\r\nNMCGpBwbRxtN3TUKJL6YM1+d5d84mIlNMyuL1u6W+LzwLwtLEsk83wYQTVLr\r\n5llyMhiPsnKV+OyJDD/pnUyc446nc2QMSa5YJm+oufN3Tby74gID7Yyy7giu\r\ntIR9SlC5WSkzS/irwr3pSQr34LBRJsPWcwm694K8SmYnI1Lj+vN2auwwXSnS\r\nOSclJ+THaxQc3fIUrK3rHZpceqERZqtdPPqCiDGcFX5SbqoDPVY1Nueo8X32\r\nz3B8hvwMRZh5VgsyX3vIf67Has5jGK6vpFzNYk+Q6ZtMsbO8oo6+m3TX2dHG\r\neFcIWKX96cW/BAVbHUU+wVHZzXnDtx/fbM+1nLDbt+IxSy/SB9fCKqCUYWUi\r\nFaGFJq4USEctUVFBp1SZ2MhKFBygEC4lUb48AVoefYtILPYR88rOyON8ORKL\r\nbRbpbuzpa9oGKTiQA6PNMFPrL5u/HxhOUE4Rh3BqG76QJeMLqfd96bacS69L\r\n2saD6vv54syfnZo21HjQPT+mHeqblf7V/YWhLxI9i5/WWN3ygghLvRO4tOLz\r\nrdywEcPdgJs1wMb38glTXg3Ih2lKZ01ko90=\r\n=cQfh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.3035755.0_1653568297145_0.8650065737188062"},"_hasShrinkwrap":false},"0.6.2-dev.3df6de8.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.3df6de8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.3df6de8.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"3df6de84703bd2cf3bfaa7a5bdbef28aa6c44d70","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.3df6de8.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-oCVzg04EVoEMbvzAD+TPFJ4bmgVc++69YiN3RRiwXbFBhtSVUyBOAZjxlpM1rN1WobP0LRXtmc/S52u7e820ng==","shasum":"d576dff1805b9e2022a9776b1ebec8e153190781","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.3df6de8.0.tgz","fileCount":35,"unpackedSize":1054661,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDogQbJjU+0TEbnQy+DAOlJmI47n0TLWp1suE7esJUq/QIgY7kPnbHIg25iF8d4xB3lXK1xkReZhav78bh0Nbubpxg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikJKDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpyeg//Res2NG12HNmWdyWV9Pr1nXtbElJ8ALxEy5Z8YhbLxDGy3+/G\r\nBU31SCVd5TTmtzj0k0BBFS5lGN/hpjLe3234PHBXhyNu17usDDCyZj35xNVo\r\nVTJpyb46SPTlZNKVRKgufgJUeo09g3dCLbRKlm0dExQHiOpFjwbK0Gchp7Na\r\n9ql+62aqxBIz1CyMo4dGk2Q4Uluwa13zMO7DTKCm0nQNYy8BmF91oRP3t4Wu\r\nvcYqkeVMoWwjfmX0bpA6VMyI7UpKSOSQ3HjqdJLP7yTVewFqP1Rzdimf/2xL\r\nuEIYLbIhquh5QDA584g9SWNm2ZRBm6bF+bHBe6cyDgwDCEgqOG9q7OCbAEVY\r\nBo+gVHLoQBNXR1K87t93bIKn5qSQe8xoOAIgj1HUat4lQ8vzEIlEPiD0TeJZ\r\nxMowqK4RyAiMfksnuiMXor2C9jRvrWLtsfjVZgGgycb9ocChsofU1PJ6g9MO\r\nxEk1yS7rtHI9Y/5tolcGJaf0B9bfAiv+mXLWBCnPcoSdUJBXlDNJhSTLRxqV\r\nmXiiNm+xzsJ/aJsMYB1pBP23Y5nEMcrqBpqV5uE6CTrTNKD8oDs5700yBCrz\r\n1ZqBqHTzjV8UNPFBbkjmMstjN1TTSwvu/mEYeN7N9A0HEU8B7X6CPHpphQIZ\r\nYyXIR45dAAjbU4SQw6cOu+B4EJ5v3kK9/BM=\r\n=4knT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.3df6de8.0_1653641859440_0.6568964788315927"},"_hasShrinkwrap":false},"0.6.2-dev.bf0fae9.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.bf0fae9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.bf0fae9.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"bf0fae90d91c381af02942833ab70a633096fb38","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.bf0fae9.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-3G33YbVFyaV2H6HiDZxxPPxO8eVrOQedcuWS1/YW5LGuPiQe6OW0Tb3uxSHIGollTTmxsSEQOmlNk0rrNcAUxw==","shasum":"5eb6a9da2feccb636833e5e262108ce06e9a1670","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.bf0fae9.0.tgz","fileCount":35,"unpackedSize":1054703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFHR18RSViiPlz8WKBCBO3+bq8wugIL3v1YsZBvbST4QIgZnkbnw7LokSK00aLrlfBtvGPEwW+ItebsMN2BCjTBSs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilO2hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8Dw/+Jd6gwqW/trrTj7JWh8VzrcHYOOIhGZgSONfjHDtDJh2qLm7B\r\nHcSkRnjr2+RwCZr0wMFEQeimhS7C8/1JkkAwGaSxt8YvTwbrvWfOKbKGxvw0\r\nh+DALYEri7zHKoAlYRu0MENtLas6JR9mT2fZ9pRK8KYcp04u9alf5YhjdG7S\r\nNCaWxRbJpb0bx+WHuPBtav3Mqz1PI/bciM65XxVtEyB1VgYpoiz19Vv7NDva\r\nI+7xf0u8LW1Jr+fgRUyQY7TZXvpLlSNcI9kCEpc5Rs+BBZLtzLMomZNnuXIA\r\n7P466z6W1z3I89kyc0BEc4MUJ/Fu7llFg0CI+zL9uTrxZXSwnlvQIi6m0+i3\r\nXTFVIULqQgVK1HJyE6NhiwO9wpKLFYAwcaJkH1tmN8kliZQhmWfKDufMj6SN\r\ns/d9AYcgUhoLyMIZblXe/3nvaN8N819gu2b38XJ4goTBseX1zU+emMWQV3xY\r\n0fLaOYkr5ARn76nDuI9QZG0Q8L5f1qrjem+utHCdF9CLK/QuA1Zrs6zMGYgr\r\nH65/sZ7Gs0huAQWLIVG23Xxl47gJu5krUAFx2bARORW0999V1ip3TzCDB7sv\r\nIeZitPR999CoN9N15YgKBQpglaCApO95mQYnB43nPfUHDCr0MaER1NUDN4rZ\r\ntyf0kIW81c9GlDaa0Fpj6W3t5auB7LP4ps4=\r\n=esRm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.bf0fae9.0_1653927329276_0.36960758369040314"},"_hasShrinkwrap":false},"0.6.2-dev.2a678e0.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.2a678e0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.2a678e0.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2a678e07530f5d331344fdc8cb48e5c1d05e53f2","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.2a678e0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-ag8J9H69GYejptmUtSpN9/RTXGf/nb/wpIz2EQBSH5jePek2QbJqn1T+7oiRHgi4UJ1+Yb+4wr4E3WyrElUxcA==","shasum":"6471ef169da03e882fb4739c7ce12e0fe9c00ac6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.2a678e0.0.tgz","fileCount":35,"unpackedSize":1054703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAI2naYYiZG5CCayuSVbpG8j5vWOMrXPjEqcWDFJMl2XAiEAhRVSn9z1t/pImd172MIvwQhDVMmBHGy5AvdhvaypNr8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilfyDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJEw/+MveOWzs5S9xGdzgUiwSf1f2PreOqXkxPde5lc/7Mv5fqwQ86\r\nCnfYECCI0ZdpU96reFobBBU8nk9mWKJB+Co45XQs76AMFcVpAvNFtlAxy17r\r\nG9fbwV5xrdr5xdeFBchRpn9mBnCMfDv7kSgo0EN9S9EykKOO/maT1mRNPy6M\r\nv/Bmpg9hMBvhKZYAKMjtc8qF2vxxG2K++trqQBuop8mxgLYxkgoJe5XsCP+I\r\nfICIrEeh7gGkj/r4Gg1fyX+CKaaFNjxFzjIY4dD5d19M/I1HajJ6VwVVqxqM\r\nqRJubMt8sw1QEkGpuJ3Oli5PgeRmPWfCqZ4jtBprR9dofp+TU4euSRtewTLZ\r\nZNXVV5PN/GY522aDzn3s72B9Mzj7v4aqcuHBwsfnLCZt5t/zFxfyHS/2PJWo\r\nEJocPPfxFEwfc/w6ZyWzGGLFwoHGzMPVWjWi9xESyONDKUXcmbeVbWd5lwxl\r\n/krrXXzk481qNmnTIg7ptfGsS8xOQzt14Kccfp14nCFgKrg5r2B5WNAhrFlk\r\nSd7yFqdAGblIKzqEkA2Tp3duVUtzsIsyYye908BhzcSRJZJMwOwDR+mTmb5i\r\ngRVnvZpcY3K7e9N7BIUk3GAl0XaCWW5UijK/x/B71JFObWS+fD0BF1mQikIZ\r\nad7jUEknBq28XVNVL06xAwVbXUSUZip9Wa4=\r\n=ju3n\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.2a678e0.0_1653996675090_0.8818887351371083"},"_hasShrinkwrap":false},"0.6.2-dev.089010c.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.089010c.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.089010c.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"089010c1403a930c392435ec173dc37c76689cfc","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.089010c.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-rBiqdTzUPswn6rqd2bRaRhZ7E+fXoPXkvAuajXo8UcyG9zXpFPHLh41tGIv+aOJvgtHNs9vIgOiqSOvB00Lq+g==","shasum":"bcc90bad93d9d5c096655f973f327a39ca47b3c4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.089010c.0.tgz","fileCount":35,"unpackedSize":1054703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6/mFcNjwN074LdeC8hLFWPGf5CIy83q7CzXGQ4hCp1AiAEACF/OJRz+zWtKE7btJctDf7CzLQgQ4tW+ctKdE/05w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilpy8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp77w//UmdOQb2BB5W1NaYoZ47vL7VVT5gXhIQMccK2YMln0a5Vdbdj\r\nXOb8Ci1HvyZYHltM0ZvyufegYS9XtP48UlBD2m4wGpin/2rDQvjKYdjI0+rZ\r\n0Z7AH8FQqlsCiW1nh2v1RAeBzCFpQGHdKxOJiCFcxv+WFWhY8+o6JUOohWTM\r\nTyaDCnGP/T0erg0zT0HKQF9YEBOp0zMIoc7w5TldUU5G6nl+E3dNqJeWvHPh\r\nCPG2uYiCMLKwX21/qRS0WONVVcBR8bjCv0fUzopbAPPy5m52NKZjq0EPPAVA\r\nvrydXdd33rqlI8dVrdEkGlBjNP29EYlKMAJ20kcD8Oi6zRaJnAjF1sf1Zmc5\r\nLrN9Nw2AeCbG9XdDxGre5pSDRgzw94lv1iwYKmpGZ6cY+svfaRtlFWTwPgu0\r\nl7UdB0lCpfwSRkKJrv4VXRHZ4y7Y+VuNLIrhEo/sbhWOHzX80Eb9AcUVUs6z\r\nuRVXU7qoiu3+9by5J7waAIscJSyRCOx+eu1gjuiL4QTtwOuSFlRkn6SlK62x\r\nSExLS8/31zesGnWgdLo+7aLzndCXMfP4wpu2C+y1PkqQj1FYIuyT8A6NTV+b\r\nYKF53GtXoMapM+2zNFI7RkWfy0HDywy44M2KeZJHFi4M25kUAA0ci/HSON3G\r\nAgA02kZo/BiR7wGrrx9gHDUvGk+Qn0Pjg90=\r\n=4AyH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.089010c.0_1654037692646_0.8084873951172893"},"_hasShrinkwrap":false},"0.6.2-dev.f94fdbb.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.f94fdbb.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.f94fdbb.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"f94fdbb53d81a45417c6ee51e27b1cd7b89a0b06","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.f94fdbb.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-12cNZut7mGsI9dCio4jjD6l47dFgKkwEG7YMVVDAyXkSrr2uvJRW6/AQpJyPUTz8smZ6XqA1Wx2Fw5c5aqj3Pg==","shasum":"c0768fe89eb153996aac8b5fda51f98abe78a667","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.f94fdbb.0.tgz","fileCount":35,"unpackedSize":1054703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDIuJ4sMG9P+lVZAOROmW81uXGq6i587j9TxwOk+Lo7WAiAQLlf00TWWkksucHakAJK4Rph6PeHdscXBNPlSW+4Qyg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimdh7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq1g/+IWKB0Cq/3k2ekxMsMnAdVdJn1958dIyXfnuyGfQDEboKE1ag\r\noxnOiymWxHRHj4yAYK9/ZS8C6PnzU26ax9cPWbRZPku6DefJfPBbqbxUgUhv\r\nxDgmaUSHLo5n87lNQqOZbhEzKVNQWvhq7emfDmrTYGqxzTw0Dx3z5n8eGSCA\r\nR2dmLaSuKvJgaAUF2pco3Z6O071Rhn3r+W4ae8J9NhmwcpSiKrS2L9BJj0Px\r\nXMzIOP8mpJcTrB1fK9NazRhHG8kUKGUyOxY5yBgfugCpzW9c+TImsb2sc/Gh\r\nVuwKdayVeLt7vCKvN7EtId9BftjhW3+/9n8DzWzdOzucP78Rix2mtmfHHSqe\r\n+BCTIG1KXppwKb2nIsrw1QN9rTyDjGRbVWQc576FsKE7YS3feqRvxkOriCxL\r\n9WrYPW9rHC7QEBNq69W85KJQtT7AISZg5ATSASyNlsGWfontbUjqgWHTvWPM\r\n5HSHdvTslvGFIo8bzU2RLowII5Wc4trxhvUgGNUgsZLeGz6X6VOeOVxpsPh0\r\nU/iQgzGKmiAHLH879PRDBHNGGjIlFrFqCEqxwxcR5IXyxKK6DJKYTNvFsNJ5\r\n349aQUkyAZcNYgMNC6eGzE5JZREigm15va6eC/ie6k7Lk9sFUk1JjZ4MbBjq\r\nqlR0kCpNh5otsZrqDVWLuZT2ykT5oxIAMdM=\r\n=nlne\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.f94fdbb.0_1654249595055_0.39449841307722733"},"_hasShrinkwrap":false},"0.6.2-dev.9e35d39.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.9e35d39.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@ethersproject/abi":"^5.6.0","@ethersproject/hash":"^5.6.0","@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@ethersproject/contracts":"^5.0.0","@truffle/contract":"^4.0.0"},"devDependencies":{"@ethersproject/contracts":"^5.6.0","@superfluid-finance/ethereum-contracts":"^1.2.3-dev.9e35d39.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| ethers               | Object   | Use the Framework with ethers.js (5.x.y)               | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n-   [Ethers.js](https://github.com/ethers-io/ethers.js/), currently the SDK has been tested with ethers.js `5.x.y` versions.\n\n**Example with Ethers.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst { Web3Provider } = require(\"@ethersproject/providers\");\n\nconst sf = new SuperfluidSDK.Framework({\n    ethers: new Web3Provider(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are an adapted version that look like [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) objects.\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9e35d3981bf5429e08d5e4e5e3464a23c49bb114","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.9e35d39.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-EuESg+osngLC6vj2ynlIZLzeamlzqRT3vrJtaE+Dcwvu4mbCzLd4pR9lqIqBCOxDCqsEMj4X4jvqsiUSpKSpRQ==","shasum":"c15d53500c8337982eb05243c12945b07224cffd","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.9e35d39.0.tgz","fileCount":35,"unpackedSize":1054703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGirC4U4TflJ4hnPDQNnpO6we/ZQwwzzC0hb54LXx/XaAiAfrScbFl9pfc1kfrrtEdgZ8IMbRWqQftC1w0z9ljxKbA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinM8hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOmA//WoTkVo95gZSvZMQdW9xrxT4ikYDJT8lGaFBxPwFmgZxwj+i7\r\nva32incthxA6bASXnqKJ7wwMe1TrZfXe6JjBEVQKKStrhFtrmKEU8H3F94kI\r\nu1NfcfdcKtM6aom5Tu5nWtNuAs8+pMz0RXSeDl0IZPGyzshDKVhYgozG0F9l\r\nI+o15JNoQ1QFajD0CG9mThKeKRWyWNVjDuaS+RlXuvttvkRlRuCjIZiTmkTC\r\n62d6QelNVCgtDpHNHDpV/aze/ZHSp1Yo6fSQKEhQBla2hpkOXLb5FNlPR1zx\r\nEY5vx5UtiUaV1tWatbSh5jw4XK3A8r+yOvFeg2z4/Bfirn1N1O+PhAP4RPTl\r\nppyuE4dWn8aOF+UPzFS6lvYX+Rd+wpcbVGTWeDW3QF7PRfcw7+/5yNrCHvZx\r\nz3vnDC1QOxDnLDSNGIVkhUjpXRnh4So6Fs7l6JidkHYWCY7H9AeHzWlXl9UL\r\nQrD4nLlebag/IoPAqi/oANYEob11CQay0ws7HAfWCF1+lwGKm+QLu1a89hWS\r\nS8IASKY1xaLC5afspSU4iNFgQ8WRoRWhZWO9mIxlgyQ8lks4kQjqyg5h6guw\r\nIRhheLmofNC7x4IbzfnGJ5pIbipg/paBlnIjOSMwtULdB/0qJmvJhTtf9ZXA\r\ni6kgCrpzRqyss8EOsyWRYk9Ebr5OiD6xRb0=\r\n=Myvi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.9e35d39.0_1654443809099_0.9305740998948686"},"_hasShrinkwrap":false},"0.6.2-dev.4eebafa.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.4eebafa.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.4eebafa.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4eebafa181a0e1def33aae9fc48d9afa1dd6b672","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.4eebafa.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-vUdOnYvX8mcSlzajgjjEOoSjpeYM3GiexoZsh/AEgJMw05UN2NOsqKnJlJZtzmfTIGQGX4OGzYMvy1XCWVG+XQ==","shasum":"34f1c863c966e0a692ffa88b03d1aed4ea487395","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.4eebafa.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkNoQdGWwwq+PHc5q594SQUoIsj7C5BwDT8lclbqpqeAiEA2j6q64IdTlCjhH4i6R1n88TXkq/YyDiaVYN3YS9OaTc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJindaBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyQhAAma8d1uPH+fc5+wUcM/Mv0Yi9gCRBamlVExx9K43nUz5X+v11\r\n0POmBJIDBOkVMdW9fSqhFYAer4IqGV39HfTvNCQH60sPAcWVwEtTCT9pDqbZ\r\ncNifXlhyClxyYoBkHhRRBYAgbovrJ9R/H3YHN7ufsB44Iln1cLGEf/XUMPbN\r\ns0CVDckd3RipXt9gLc79ee1YjsGyVriNfJsqOMnhRdAZnEs5Dd2AuGwbtDhA\r\nZELyFiMOqdKcOdbO0GlSR5sZZ6EMFjXrJWCg7/gYMvH8cley6QynTW2QuahZ\r\nSP/+z7vH08gLmNpo79y8Hr3QaJhR2TXXA5u80u2ZRa/BFoab4HJJm5qodmuy\r\nWhyMVj22LtvPJU9cKgWToC+OY1GfZ4m6ZOyLVWCL1Sez7SD0saVuXwearIZF\r\nyXJcfIHuI1M9gG/MwLd5wkP/anL3V9aqdY6I1omRC6RLXh+JL/A12J/TYfXs\r\n2MAGIMmCWQ0EVFTIslAmdpJOPnYWwvawf4pnJUlos/ZJ0mFS6DnY21Xxj2Y6\r\nZcvs39lPqhI+xYB2QwlT/cpnj8mQemJlVZ/Kw07D+PWnPZ/E4LwYiZhv+SNr\r\nx2LjDyKTVqNcJTCzqugf44j1BHfimnlgDPXOOFnQrPeOWYcuf919vZeF5sPT\r\nQGqi2jEcYk2nx9Kb8KbQAp8JYOgJt4u8HvA=\r\n=QKQ9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.4eebafa.0_1654511233148_0.2694146233925294"},"_hasShrinkwrap":false},"0.6.2-dev.4ab5d2b.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.4ab5d2b.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.4ab5d2b.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4ab5d2bbae76038541aaf71d823f604e716d38bd","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.4ab5d2b.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-NVx1FoK/7jarjZcLpui1z72u5guW87ttSR41jvJ77jdDhT4V8sr7gw6Xo1rZuuZM7qDMO8axXnuwb+nimYAUQw==","shasum":"19bda949fafc770e3c4553343577a3072cead1db","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.4ab5d2b.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdFJJkt6Ey++nl1z2zXl5+URfjMKiylPBq5F9ib8VINwIhAIYDCRLxX6AfhUHYkQ4sK6MxG43pTPAUoRGr9NBXdP0Y"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJineIrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd+g//YnH1ZENsq1yHK3hJ4kzQUH8DXs7JlREKrgDl3UdllMsCATjB\r\nGg4kVJ8DGNoYiPzyVEeAfP9FxfmAPVylk+ZPfxDc3m9u1vANDVBDAXNHLaVP\r\nxnAatjDCBbObqWOWbiOrBkmbLHPCNIDRRwQHD3zqewdqbskljmm2mAx2CWFl\r\n353f1zVKODnin3wchxK9soTDOLlfHth5kyObpMlZ82KBReSxonvbn47NYmeV\r\nLijEnQ1plfxkS5WQ5ZwdW4iffm2GB8N9gw8Pzi7Ymynx+deFNrjWF/7PGZ/6\r\nyF8Mie6qGlGXumHyLQPCUkCdlJja6uryHW1ZsJoK7NZpwQIyBmxttPq76qL2\r\nbUQ1GJJj4Cj0nmrRm9+NmIuLbeFue/w3tG511I74rhcW8/GEZjcGZFZVrBDn\r\nkaJfXJ6MqmNfcTs0gB5YQzc3TCWEOTRAX35H2b93KvwCIAeic3WFlPmSByVt\r\nG00TE+7aFPZEHoWi858zL3Rel1+OqPPvxuBHg5ViIFFseOkKELHW46Fus8J1\r\n4m1YZVz0XKBCu8G61Q/W402qLqEmdhM2dsrckUa7Czgo1V10qzNMbXJfMYkl\r\nwqOVpBXnnmVEKS0sDc6E4Wewg/mtMXOQZjmfBRBdYkHE2Yc6Ddrrw5ksO/nX\r\nUj3Nx/OtVw82/KtGBIdYX5DfyRMDkLrobjA=\r\n=RSzj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.4ab5d2b.0_1654514219178_0.34778302274320283"},"_hasShrinkwrap":false},"0.6.2-dev.4b89f01.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.4b89f01.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.4b89f01.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4b89f01493f25dc7eebf772a602ee3dd5bb0f3ca","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.4b89f01.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-TndRExJbVun2yXJjXGERoRa5oTQHSGnUlZ/t3FrnZy7PgKNamUCfDwRTnBxhFPTLbI+RHlW47pc3Hoz3HNzrsQ==","shasum":"cfe761ace352388e08b433afe535ea262ede858e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.4b89f01.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDikCO/D2hQesgxM+G3hslT9eCZNCMv19QSsl6g51ChjwIhAKq1pnBFd6fesFW5iiNwW4yo6sgyS34hWagDSLUoBNak"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiniBEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrN5RAAoR/YRv9P2j9EgzmKpmsvCdk5AuOtMJHslABfk+9NPnVDmy7Y\r\npRu2/iA+b+l6lrWwEuzK5Rh/h57sT0Zfo0vRehc8NJOfgBiRHj94GyskpAJy\r\nQbtPtEMaMxOFC/BIhhaJ86+c1JjfA/ijJUSVR+8xuMMi4yg5hH5nPWesbpXp\r\n8F+DwmQ9AIAiWg/ObKSRoMjBgWPRPef3r/DT5OgASXeavEKExh0DxzGdYobv\r\nIRTxOtC6B72WgWGYqBDjuRjoP15joWP83GXCktC3849UH8xhpYoe9y+XGHzD\r\nDyWFkbhR5DoCvs/YNfnEHk3EecpxYjhx+xxOBgqFkvyoL1oWVR7l4CXu0Q9P\r\nxEPDooRvHO9SRti7Gz3fBk9Ed/9invWFl58o0nyX8JmBCLweEE/kV6hPkDEK\r\nE53ehQo3j26xPRupSox4FlWYtAMrRur1W+OSPEOwdNyLil2SLF1nV9TsjHSK\r\n2KScG/vBONllndIVP8agcGZlprWUQqZ+69FgJREupHLUfkRiNO0Fciwdisup\r\nndqECe0g5GEUojiFPpubacV+/cWvZmjGrP2hiap887bj5J3X8mbwXdnxZCQ/\r\nrmsfyS09g6WzF22OILgI3WZ9G2a6yMIeFLg8lRGrYt3fVB6lTUZohtavGDXy\r\nBiieY/6bA2csDEe/BydQ0Kby/chqBlkHbOE=\r\n=Mke1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.4b89f01.0_1654530115830_0.937481666771742"},"_hasShrinkwrap":false},"0.6.2-dev.ace5c31.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.ace5c31.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.ace5c31.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ace5c3186a8880df0e8d9f99db0d02c6fc941ae1","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.ace5c31.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-2oAqRfTVXphDWJcpiRsq/5TES5CHmMPx6e17FWCKykpujdJiVsjKd61Se3c/lP8wAg/y1UadgbOA3XxUF09PHg==","shasum":"5de4e505b41a28ac26f8b235b0e96f124160fcfc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.ace5c31.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHloS5tB6rQDItvCFmdQSBnr1sIvEjuajQv9l0PGsmHAIhAJTdcJl1bY3krXkAriAaAaRr6jxFFndSVWMIT55kuY2u"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinyH7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmodww//Wy2f7eK6QaByxFrEwvqSaSfgTmzhRhphgxHB6hcRJkW6sxhZ\r\nrfBn/5oIFlW2/JRBkWEfyFoAs9KTdeihCM/wft5Ol/pd/8ZnrgFGLCjjWQLz\r\na6QgGBeOomG9QIj4ntD8vUicTKnkGXIqUQ8gT5mbs7RSolx+8Hc8QwL1Cjlw\r\nYi3PKssJJ5rR7OsQwzOzv5atOAoxUvI2KTztzuPshQ/AyLUwYeDH1JgzlHb7\r\nwHAOTkXAzH40ez2CQE71a9LAe/JLexatKcwL3yzCCFjUdQ4fFQcjTc468H/t\r\nfDGTzmiGIpEpRm2VpmbdX9LTU510EK7qx9h0xjctMpWTJF62txbHZMzhUF06\r\ndBWz4VDEjtvfbzW3TWxdg6FaV0rVeQhpXF4uZY1P7KEJ2sJO0Yp23g+QY19x\r\n/LO5nlXcSbIZdYgr8jkpIy8HSj04j4xn2Kit4HHcPRUIm83suF2LdWCfMgAm\r\nDEjXRRhahsWq0tTAHisRFIey9IKtdfdjawAHGKVqNm3e6YDQOUGq8Oa8nFSk\r\n8XmPIjAsBAbjC3GNOL1A1feEZHEEgsZCCRydDw9YZlxWpuCHfx8jSm2gshO0\r\nkQv9GgiuvemVPbi7nMWBVty0YJlA4owhv2pGz/bEb1ZV7WlF9BvZgYTc0pkT\r\nJmm9FW9wrI6NJkt4Ofry3GfeO3IX+e5Ftas=\r\n=COtu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.ace5c31.0_1654596091164_0.738743800183497"},"_hasShrinkwrap":false},"0.6.2-dev.7dc62cd.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.7dc62cd.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.7dc62cd.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7dc62cdf4a65110d8e62cdb7f88534cec29ccf2e","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.7dc62cd.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-cb3EkfMl3cRnwkI7HquqXMUfCs4SY6VMP+8vZNNQ7KswjjsF3cvabkXdaZ+Emy+HlX+vjbqX7bgvgkNdmt/rBw==","shasum":"43dcb06ca6d12cda23dedface76fc8313bc4e2d5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.7dc62cd.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7C1ton+XctwJrZE5zWTm1auEre4gutOI+Xcd78u4eEAiAPlBg1iPgITxGKgG7lVRC+4QasEMNljBBkmn2cXfmE5w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJin2qbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWWA/+ITCLHEDjZaL7maupT4KeAndwM+N43nKNkwX4434MWbEBjQVL\r\nHxEDLBZ1Pqt6jfEUA116GAH436iWs1q/BvuVuLqd0ZCPB02dVD5c/1CxyDwX\r\nuvpTtmud+BdmoiV7CM3eHaDSSjEh4cyzBq14Nh1E0AVkBa3SCBi3tpKbSwgF\r\nzvPuX4PqOhxF+h6PE1oI0Dzsey7W4tub71Zium5OyvbqcVinZr+JnvRkuFVx\r\n1/JUuTmPXmKG4z5PIz/c9KybXPobwAK4ohBZDmOrzhkTeLkLde2aTreK2F7I\r\nAf7WBPJ74ZeHk2XE+DfCAxeR3XlZ/6+vJwJWUg6Ie+dH6EgGT+kSwx+ueVl5\r\nrdIezulro5y8+tWdHH1eT9Wu4J5lCZraQr6tTzMbNtoapjzMnrFMBs3c0vVt\r\neJegfQlCqRdJTZ0uO2BfvApht7HNYV6lwmzcPq93wMBg93EkM+X6RYMBzJ7S\r\nCp4nreTfiz++c7YEEMOOYBRVeaHkYnWK4quJRlwJ5kCGm/BegaKasZu7+Nch\r\njHfJFoZU/tKlOS8nk5hGSC9OdzVL4yG154u5VBMYUqL58kWcx5TYpyCg2ksV\r\n+ybcC3eQf6Tq3MiwOSyODr2mu9bXLiQ8aU0QW74jDk3ToRILHvC+1RCfUaGk\r\nCGppTUflxJ2uN6BdAeDxdxPl9it0lxytF6s=\r\n=aY9W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.7dc62cd.0_1654614683709_0.6796940087610193"},"_hasShrinkwrap":false},"0.6.2-dev.7cac990.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.7cac990.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.7cac990.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7cac9905367997074aef22a88f5d4cc96de83caa","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.7cac990.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-LDkTHE5a+GsdOlunXBGeX7mVXOeOpEuCHZjc4iVYFciciIH6TCH+3KAg3CcrZqKi1cccjiYRszE+jT1uAEKZpQ==","shasum":"bfef75454fd62009b97633ccc9f255a698de5236","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.7cac990.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+sG8cfoA34TBnz4ezSygWSy/jJ2jIJJdY/azGMxze9AIhAMSQR6xZdrlIDbGsB8J8E9qSQUgmIVV+oxo50fpnC7xK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJip5NIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqu9RAAilz7zDJY5LH/ur0GF+7mIP1/kHlLDEEGgcYdU5EYq0RJrgnw\r\ndpB39x1Sp7ETSDFHD8dFkLXZswcbO0jsrgjcTYJaa4QARFJrrPhxshc/pR/K\r\n2ycNTSOFiMy7cUvL8keXhh2sr0kIC8D6b/QqaicHThoROp4vLNpu0sGsI6dC\r\nvGEFUNf/a5viHcVUKvUwouz9ArtBizfspTkfl/xqph5qmQuocEiVb5Lkg8FE\r\n2HzOUWag9NRfsO2IgfVW3NFW+dIjje6y+UKyh3InB4sdDdVYIM/93AVtmKO+\r\n0VPI8hFzelftuDAjjHuFAIZPxQtLnubpF6FfK5cZXWvQ/I0MDD6biQ4pcgn6\r\n1oToi3klNHBvHR9ghGdiPSe67nPTEKPzMgzJoSmmC4ta+at+bUYgBP82RS0M\r\nWPdU5C9pdjmDAb1Apo3Apqx8XpHT9873PK91RzIB9lWVAnPVH+aqk0tORttP\r\nvRwhimfdVs2phTeyIimep1orC5v5DRQe/zYFWqo3vrGd/8KgksjmO931B/cE\r\nGyCuC/6AGIt7GWx3OJD57f3ajonRacAkvCOyuTWxAQCTLb0tqSX8wbSmQmko\r\nCsxq1y9eUdKNkcnm08I6xvi+UOdlON+m2gYy7+pNe3Y4sZx7huMe1Lrj8XfA\r\nPARXivMJ4p9l060t0xTlrOGJVFZvQZ9R88k=\r\n=Zskf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.7cac990.0_1655149384306_0.436785294079606"},"_hasShrinkwrap":false},"0.6.2-dev.4ab56c6.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.4ab56c6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.4ab56c6.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4ab56c6b98f171668045d508a4ae9b33be17553b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.4ab56c6.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-NFHc1cICM3gs/7YdKUkZPweijRpofz7PTOsaGaAACnotxd6LjNRSO1Bv+r9VEMtjBKf1QhEm/2GfRKf7ninKxw==","shasum":"8d5e0e96d3f20ce670d5aa339d4d7894cf315966","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.4ab56c6.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFHYSTQvBc6E28nHfZuqMdUMqOZ7dA+zXL+Ar79xAKyuAiEAzdeVt0qzYcsqFcJoCwpNzAVh3KGcus4TTz6fXGJO6uo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqGQiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqjpw//XGTx85LGwYuMzOMS8WD6+iOp1c9qXtMNa3fE9XC0N8TkH9Oe\r\nQLbUtBH/mjOOBZLU5H93+qzUjM2+VFLQB6qnKgSh7KRPpFqTavY80WYeEcb+\r\nZHFhYwzz2iPH/stjbzs4wmIsc84M6glfS/LyqV9Ok44s+uTsBBSuoV2O1/YE\r\nU9XjQIA8gzmXXwsY7eie8uesjamYnx1Q6vzUJK4H+gg3ZXldEDQGoUan58jH\r\npasFTwy1yKtTMgYDvNFxylsTTv7J+SyHW1PAvjzS0UAdDdotUWTAzb5oT83h\r\nkOuDoXvaLaSB0nwyAuKOfYdfRojl8+pNBdRDkh8ypkq2ojlQGc2ToyXThenh\r\njl+iY41s4Fcy8LsK/W4r0X3kTYkK2iS5x6p3gO2sYisF1rWypx4EP9jeibyB\r\nG8Qk3lKedEyzp6Vq8n4uoyuRTQQ8uKv9XG8MOkBNarbRfxwehepR3XjkWMmx\r\nZVcEJzLfYTcRjqE/Pu+1ylyNEP9owWXYuMEGtWWwKkesPTFxIh/uCU84UGm9\r\nKdCfBVHjFfbPErl4V25eK1/s0670/cKs4CoooYzZzxoQ2RR1b1UlS+h14K9A\r\nHrmuH613Eky+BS5MkqBn2zJZ5MCv1KvXQVUhlr+pXRbJ7U+zCNjzJMdTSGV1\r\nPyuZY2NIKQtsFs3Ckty+sx5g97J247oACSQ=\r\n=WiCv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.4ab56c6.0_1655202850647_0.10018031961620477"},"_hasShrinkwrap":false},"0.6.2-dev.0c84124.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.0c84124.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.2.3-dev.0c84124.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0c8412423adc38471b725e60cc8e804b274d768d","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.0c84124.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-n7Fin6XhVA/OB1y/VpsZvo5durFqWybEaKRUtNAJISFM1fTJSzzXYFNgAEVp/zN4f8M4vxVj3o3KzuhCP/nFHw==","shasum":"9c8611d08d019f0a43c7b5aa0cc835e5d26a4c10","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.0c84124.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFAHRcPjPIse07wt9RrGhawx8wHXgVTzHyM7W2MR8cYLAiAnZjmTuE31xEsSiLVsVBQJmk9MwZMDvt62MI0ln/sWkw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqJI1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoebA//ZZPkXTqzx0cninuStMgUJAMzhJufeOgHc71a0cOuZzpHqC/P\r\njNDaq4aVC9zOANhR+8MLAcBfWeGqHC1Y6BbMp3qzEQag/RH2EBeIDHMckSpy\r\n/Ubnum4B7gpvKst2Dt5IZSfOkyIMVPmbwly2XMx/t2JgYdO1Z3FOnlqhcdNz\r\ng3rP+VbeSibvoz3XYiJWAD063KRpTRpnF30G5DZVlbZCbpHdEliojQ0xMADU\r\nEjAPnw4oOK8fX+5DNHA+cyn9bVO/LN8dA2GDs/PHmOYoEXfbRW72ClMUX43u\r\nH9sxEBp9hB2HoP7hH5sT4DzaPl7QI2dFVn8ql+tED9qVkQPmynqAroHQ1mJ1\r\nQfBY2n+c95zUHzWHNz8se7su7ikNjz5AKrpUNXxpIjYrieqaWvMD2tAABBQN\r\nfxxz+//kN1TMIWnmpDzgWSlIuGeP0cgT0xfJCRwUFyivhCsnc/LIqkJPP0H9\r\nen/qmpcC1fdh/C8TA0cmTuupo4RZdYm0rI9waxhpVucrZUtXM00YobfmfgCR\r\nlhRmjUzH43KKgKEVEmzoLrs3snq3ICOCmnKisyksyfStpPf2LmhCqGRrX0sL\r\nWj8MklhkhIIsAG1jUshHxUmS8sb0Zhp7cGXL5yKjKLtxbnIykH38Yp5jCAr8\r\na5gR58TwmzLsEzYlSueLXu4VjZKfyDo1JRw=\r\n=Azi2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.0c84124.0_1655214645604_0.943875543805782"},"_hasShrinkwrap":false},"0.6.2-dev.b8455ea.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.b8455ea.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.b8455ea.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"b8455eab907c7df228d9155aa4df93b11af61ccc","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.b8455ea.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-dtxt8UjmmScf9mDj1AEtYzYJifak3961/4B9oD6MSt3zppEocfmTSHgXbN7NvOZ4EqfH3M3YEW4Ds2V2ZTn4ag==","shasum":"e826410043149de0960048cc6c394c83cc780b48","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.b8455ea.0.tgz","fileCount":35,"unpackedSize":1035484,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFllMI7kvE9hefchCA86hzwp7va1RdZYnmyWC/RzXhRuAiEA9vjIHmlidJjJDHKPF0kobtij9dSJRBmeSkfgxEYXaEo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqlegACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Bw/+O7V7OwTgPwmz97tIy3s7vtlPQVIIe4gRmwlY58q+8SGV1s0r\r\nI2D0L9MhAzaEzuvxIaTnMrrVt5FHSTUKX6png9TrFk6WxB5Q3YKHTMCYvL4l\r\n5Z5qgbO9mKrcYsMFUkNsAZFrTwYnRLdli6Vy4HOwjSwKl7/AH8JEvJ5Hqkov\r\nwoFhdKkETVZ5CoHpfiu//aKe9pFRWxL9C0c48M/AII9KyqM2EKsKf/GwZHCw\r\n7V6UGQA66d6RgyOIhNWHMNXG9NWIIk3oM79DWTW5UUJrh74xgK6QapsmpdRo\r\n/0CUwxpDjg1nUWpOBhz6KCAWgpMJTn2Db9+TX1/5sdb/6mZzW4nHeGIicJFO\r\nhR0oQ1+x3PlJIiTjSTWSZP4IfnouCwkILVKTp5ug7zXkHVhTyuiLLwWsA8dU\r\n0dVBvTsNmCM0DB8y1/ELB5u1WpXjAZFMDJqr6EClnCeL6YTAZAGZCx8OyH/l\r\nkkAHyvFB57TDX2ANz2I2n9kblfol7y89VxKu+boGQQrz7zztT02LC9hBnrgs\r\n6vuxMWIDjnCUYcBkW+1xRWuWW/k/lgGJaNzOtjchL/+O2nWoigxK0kdI8LLF\r\naEn1HXdjOeUlr8gXrG9ATbMa2LsPwMwitpsOlPk0eu8BTR45tVfDuoxVD/hT\r\n71zIuUSeWoD8vzUAuoRdahTGB+J/FgOusPE=\r\n=uSYW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.b8455ea.0_1655330720684_0.6418921940504454"},"_hasShrinkwrap":false},"0.6.2-dev.ad4bf1f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.ad4bf1f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.ad4bf1f.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ad4bf1fa07a786a5d3615d5c4209d0be6308490c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.ad4bf1f.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-URqCceO4Y6H+A+UQIlbCK8dWiabQ71mw4N/ebirovJlJcxoGLPyVSgFoBCbbMrVPa6V9XiYIooQP9PTS9BA22g==","shasum":"02e6cf947d606ee0d2c8908034350685a8b27265","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.ad4bf1f.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbzgzl94IZDq2o2FyD6Zt0l3PMqh4SWPmXW4BZgynVbAiEA3Qh613q4pCkdasB626LY4xyCI6EelfQyg3jVeHbBmY4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqlscACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNlA/9EiU4kHejFgVyg0ojJ/IzYlJpCB6MybB7DJxsBb0Lsrg6A5tm\r\n3B1QVlnZcYVzEzdo0CSz9cSqf6rHiF2I05Tk5m3fuguXK/BfAScX3bPl9q1k\r\nk3ryW7qyNMe8kzPpPcbRgNAZ5TBANm8ErHWOT1asunrHehvV++YDq0+on+6u\r\nnIPLPx5j0hI3yxRcTyv5sgxqnukFAfaXCmivzAn+59M5SG3bl6SMEvgw7fAI\r\nFuaiQS/LX8Q4P1SafCtEp9/U7kpgeSBzhkgGaM4i2ojsbpAK7WsFM3l9Qs29\r\nSkAPRZaryoR7NDdGFqkRHcl8Njl26Z9FA3I+7TdaObfsBzznBcn02qgrV1dP\r\nRCLZgAQn7qvHJrEjXMp9MssUH2EWPzYPgb/HvM2y83vZZOO+bt6s5xdhSQeB\r\nDD3ZQ/21e7LXST1QP+i9pv0twOfqbV6FmPY9g7WZt2wuM2DRo5AW+nm/j2OE\r\nQ27MB3ygfyn9GM6siyCN0VZKH98v6j3GaCRI1oXpq8uGoFaC9aUYH/PhNX/n\r\nqEEoO3vAvaHU8hU7ZCdZvm5dtuQCc0+Uo46ZjffE4ClU7fjfm1r7Lacorge2\r\nGksXNhPJsNava1r1GqczOBAHRBQdvjdeMEjy0IiM4ol0wEqWF4RS0iMIubz9\r\nRvj2PhUe9spdeQ8VWvZTkSQCNcrRnc7QJDg=\r\n=uuhV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.ad4bf1f.0_1655331612622_0.6364273288773064"},"_hasShrinkwrap":false},"0.6.2-dev.bb04d62.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.bb04d62.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.bb04d62.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"bb04d6218a6920da7be4b6a31531a6d9eef068cf","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.bb04d62.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-A6fx3NHq08nyQnhv3P+5BobEMmZsKLfbQQQs5y6e34pkUSqaMkoQHXndKzcP+UXlVA6QhTO51NNSxYRfmfW9Kg==","shasum":"faa5318680fe542d37edef20a56d9d432e59c3f0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.bb04d62.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBG9vOOi1Ar2HOrCbfItXtj7vwc/wozVlYOqpgJwJX8MAiEAn4Ve7Hflvc2tX+Cu3V0S1RW5WDI69CKrixQ4yQqdDuI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqwODACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrhkg//Rl5jiOeFVFRW5FCCmdR/XD46d9pI2kWU+JgnvlQ0p5PbNAWY\r\n2y0IfD+4ZiTHmyV8i9OZbLSXnfbjsdQX2cMXY/RSyYD8LTJq6egV9mpVlYjB\r\nkdtk8SEYL5dgoSzOv2qX+bD9T59lWQnm++3P102ffCyl2dEvquRF44048x28\r\noZX+qI5pEsDdmJwoeOp6wmKI45mKW0ZlC05bR1YylPIX2nMkBtXgfY3obq8f\r\nimkMONUQT9SItghE+sQwj3PP8bCQC6KvkQGReqBGoCQSIQP7EBI7lB4QqXEy\r\n9o+IPBLNo0ps99rzJL3OnnQSozubCcZUMCUloznhZgI5gah0wQ3M2xg+foZp\r\nVIzgvHVLzJO24D19Z1ao3tqf6TN17lbVCPnKakw6aOHetoGTvcH3OOKjJNcD\r\nz2nF6e/BocJ0eqcA7mYgvEThmDC05sEZbvCcnigTxUuGwNu41E5Dy+ZetmjX\r\nTHbtGdMV/usC9qT1t9sOPwN5U23GDrdkiu++YlCDe1WkplJUNENYuhAzNL8o\r\nAKEgJnxfMmRBh+UbIixlIACNaT4xakrR/aWFZ3qCRkssdqIECyk8vUU5gJFm\r\nNPpOUUuBIp7CBkfSbM5yQ5OTqQ790pCrxiLajv1XU96arzVG/i4bBfVm1DMY\r\nsBMy7nwf217cexFf08Rgy7J1Tq41WmRL8kU=\r\n=+pQa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.bb04d62.0_1655374723110_0.2764038644840474"},"_hasShrinkwrap":false},"0.6.2-dev.a4fdc87.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.a4fdc87.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.a4fdc87.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a4fdc87ad3da50cc93f43af0c27ba9c4c20d5bda","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.a4fdc87.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-ScqOXmMIyEgAV53LX0fRhJFRP/lawwqKKZuqRcj+NS/AAIBSQRrq3e02icEIN8yY0Uk6/D36ZMOC91jrP/lTPg==","shasum":"9695a4b02b4fe21e93c5415a522d635529edf414","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.a4fdc87.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNB7o82eYT+LuOXDnJPRAJeKDOrb955HwAnpZSEoYhAAiEAgS9WIeWt+u6Fut4jnC5ddLT+ROUM66ukK0Uysvr8PCQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirHghACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxXQ//XCMlS3UKkCx17RcQ836WC+Y54qvSitOjJN4r2XP1aZ0krcgL\r\nrBfzMDWECw7D2u3XfVaikpdmWku2uWCYohDecXXZNNmIoOt1JYox6eTOKGAC\r\nH5PS8LuFw6zfgekjq1eLo7UQODB+FxAosegfymlnR6Zrpo38GgYh7Vv2lFcB\r\nxwcnL0gl/WU3Tc0O7PJZvTl8Ybd5OikniGEgQBFR5vegAaMSsU1OK4W4rRU1\r\nGHUgU/ShrG/GpCcONBW19DF6LLXZwbWIHYbxTdBPkBc3jlK3HmeI7KYyUxGb\r\n++eGrvMn8+125AI1HtcCl0VIBalRiQqbwN2FPV4moiG/TklUqLjVYdkizkah\r\nWZ9W2B3z7oGIDz3v6oQTbwTm7t76HS2nN9fhOwPmCCosio0R+hGLSVu2YEao\r\ngETFJOYonD9Dmc0hBUeHtajaXVzakSl6DTvvvGx3f8Fa5enEiNMvJ8ngbK7d\r\nl5jCMRQ82oXqNL8D3kxrwGlYbEVzJCVOP2XiD0cRARp9t6KLc8cZcdsSg44r\r\naYBBwPGVlK/IFY+HW7szAHENOQomBD9E6q2u1myBJBVXwIA2tZTVkC0RnAzF\r\nL0BDSpw4NugKzPniS9B7ehnsHEkkSdGDCK7qaWqYFAtZAP29B5L68kJoI51o\r\naUZ1khFDsCEZ9cF2h5xC1qrmB7iJWoH3DIM=\r\n=D1qm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.a4fdc87.0_1655470113737_0.09125471950146813"},"_hasShrinkwrap":false},"0.6.2-dev.5584c73.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.5584c73.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.5584c73.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"5584c73f7c3688a399c1841746e757e733cd580d","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.5584c73.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-o3AH/ZFX2MImJg2PBRRDmLPCoSY47Cxwryb9iYoRk/e8BcH+yVz+xCOQ/Ij61h7ecT7xOx1vly6YC8EZ8kOTCw==","shasum":"bd198e5444483dbca37fe4147bf2c45044ababe7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.5584c73.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuXiE3ECuROCSHvKjraQEqAw4kHZyQcUgMKYAoRAo98QIgYZ/+7G2a5BNoZF3niiJNDwX83OBiiP5vW3d4rWBIJwk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirHnLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzNw//QmLS33OPyieOptKuP2MWEyZG6S0U+GyAsLvhDj8b0KfGAJ+N\r\nllUven9ZknMeTiaviSjmj2APu9y1aOlYBzshjPeiEnU5DM04MqC8RNWwsZHT\r\nHk7pg/STffjQVWZ6pYmBwWAtpePdN6AJpIoSqlhHoNbLpxSBEx9c9MtFzJb4\r\nSm6Ag7Onojv9UjbQpfm6WBW5y79sYPMTH82A/dgnvQ3JFqIphG1GBn1sPG5C\r\nka/rWSE6UT5VilugbtmHoWgA45Xpq7Lff0BLB/B37cKWOkJMQTokIDAVLfWE\r\nj37zkh2D5Xbmkd7YNxdyDTs9IuN1dkr4oGUCHRn4TEaGjlbGx/+vQ6v1xtth\r\nDy8BR8SkC1WHWDNXyL9BDFyI31iLdvXWjZyEtt8fUBj6VpO+C3UFwTbNHKGd\r\nthqonfC8K1VrZOjrmnheQstjAFaoyhTnC/K8o6hOP3o6igRhi/sRS+vZC+QB\r\nbQsvYHBkJbpHo/aVOn/vODv+E2Anabf1xaIfOsS1TmNQYqqdfqY73YCYTEdA\r\nMtdJNw5mt0dBa1E8jBBNyRkIjDzFJhG9gcVBjJwoKt88s4kaSRa/kNSkhxnE\r\nLtP6kts5J6AzsjUBbzK0BZplIhKZkhtNyL2qxkJDr253+oZxiueopSGXtaqk\r\nHcv1Y3b/gG3q5d9fNQcEGFD536w7rkk15/U=\r\n=Kf79\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.5584c73.0_1655470539768_0.20826119090240036"},"_hasShrinkwrap":false},"0.6.2-dev.7df8a6a.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.7df8a6a.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.7df8a6a.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7df8a6a5ee304c55bf17c11af7e01f6c87f4c52a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.7df8a6a.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-oZ21t7lcuJY8zi5+Zu9BCpFAxlgDn6RHkQ3ISvEYb/p752y3osAGlN2pcnh+Al2Z/eUCFo/b966EkE+JfVDUEw==","shasum":"4a4b25e436ac72e2e866e562e421d70119b6cdff","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.7df8a6a.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQziMDk6hYze8hzAEx7Gqz2gOpp8CLMGxz3ks7rZ18cAiAf2GUST2FkmwvxMXA+8D14Jp4s5w51vP3loX/BxAro8Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisFsfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmomtQ/8CskI1J8dgN8B8OTn1/TCB2qEjl3gcQQTQkQzY0dkBOnpKCj3\r\neOpY4HHl91Z7RLXg4GByoXVXY7Fnnkakz6Eifs9SeiwsiJ7peUop5JY5U5vA\r\nb22gvbKG/FrurWL/j0Glq96ebv53w5DTaHCJMXygvrAI2eE+Jh1cgZTec8Y+\r\nkam63vlkfJWeYKqsEQQ3b/14K0mZAuthqqbvL3SD/WVH3kxapTfz0/w5Tx2a\r\ng5kAynKzwk+S8WOKCwZRqaQgGUp3gI51Q7+5Ml6TMkAWEnTRnSFf497vzBdQ\r\nRgJME44WmDrMRlQDHcWHAdeYYrZAHj8PNl0DV8+bUqKgKdz/8HhafpX0ZJA6\r\n3Z8/FIxQkI7YdmnOLPRZ7VIgtoOBRLPXRApvMz5i1EFgEDA8do3wbkpKRJDl\r\nX4FngGB5CDJMxNY4qPBjbZPTYXG8nXclR/+r7ykTeaZGMXhA8ORx3jqs8Jrb\r\nC/9HEEbYPqfoBZ8qXpXgz6KeTBwRBQ2s20JQ45qAjzhEEFPh287b8mlozahX\r\no6eIRGVYu/aYYIKaY5bR2A4l4/wrCkGU6F6vGiQK1Da+BqYcmnKu3GaGzPU8\r\nVNoypWvprZi55Kl4XPdj+rbjH7u5ieGZX+J3P9Yj3hXemBL9tctfumuuHXR1\r\nt0RQTz+HUt9nuoljhxd2XZiPGmaFeP+2/jU=\r\n=nLk6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.7df8a6a.0_1655724831340_0.8853274581000041"},"_hasShrinkwrap":false},"0.6.2-dev.70e7fff.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.70e7fff.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.70e7fff.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"70e7fff11510a76cf8a870d8cf048c89b132141c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.70e7fff.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-l8huF7Lbvo+nQf8F9PKkhW0tpi92gm981BhKtMMKBLYdV9IAVq39czv56Q6nsXTmarhM/TZl6H89h4lTL8/bHg==","shasum":"506c982e33b7e97e34450c20f9a2f18d7da71a05","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.70e7fff.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAgtNFoI6Y4DYWzB/sStYziMeg92RcK6IvrxF+q3cHLTAiEAnPCMsf2Fiw77MUNB3/pDS30iOXupxCw6F+ysAXrS7CU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisYl5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrV3Q//cbP534uI1X+nqWZpCNdw79eaqKM9/Fr+4TgvKpxuOhWrsm8m\r\nIYkd0S60ZPlN1mMplSL4QIs6AGutop7lv3EhUk381jdnrIgoH2OfMhfU6/q9\r\nCat7ZtebLXV2thaBe+di/R7FzM4wMpVhLhvi2kUs3p/EhZcD47uCB93R+dc/\r\nghlLft2HDLqDxyc22X8iu3GU4Oh5Rgi098CoxFw1O0Hc9cCH4EKuHF0v74e2\r\nOipZRd21AdlnfjOzUD7CFzsIBTxx014RLDSYg3AMQO6ig4+noylZcBLZoVAu\r\nZh75b/31tpd9uQReZOZNQYz/RhGrANmJSQPOzkCzIx8QexKJObDCaIDablOC\r\nKEsHkUwvisSqK2Xh1i3GXz5zP3fkU9KlrI+ZOqtcX6wypvVHqc2enJkiv1/i\r\n9yFK1hjf2knZgygk8clMz4BKhvPhwxsavppGFHtsFmunt5tLnCUBMHtYGIyq\r\na+2AcKgB7OOyxfBbLgxMCqFoxSRtWGQ3CyAC4xspN4k+n7V6AhKhfalTwrdP\r\nPWwyOLqNPecnTAJxb6kg3Bk5o5hkaqsrKPJYbhQkCqzvtqMrMw4RlGHADkkF\r\nAcDvf6jN/i207fDhnOf2/3I0+H1Hqk+2HWCkxQT+c4pRpQygkgoZ1VUA4VqG\r\nD2j2zp8LD3bN1FDpCgE5jKhqFpyx8Gotso4=\r\n=XEu4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.70e7fff.0_1655802233406_0.625150224665499"},"_hasShrinkwrap":false},"0.6.2-dev.8534dba.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.8534dba.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.8534dba.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8534dba06f6040bb31e2db69175ac3097430c528","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.8534dba.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-PjnM9g4kimHHX+6pmrypi4g6Obe5nQZ59sITJFwTfyCFLuN6EZ4mOAuNnsvgSMCltOAslIq3L9/tQ5aNDJKUmw==","shasum":"29ed056fe2ead0c7a04f15f8d0d9c30fd52c135e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.8534dba.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeO3AkDmbHaYBIOuDPeZcWG4My1JQuWboEtpn65UXlQAIgBPtdZi9E/3GPGUrFUxWbzEmQgiSKhYjbvaccbHhLoSQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJistakACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLRhAAmRlufsfUVI1BEx9HqCgs4ZyZujtoLemv743az8WCGOE+uIA8\r\na722PLvzh/huErM7cE6EDViypEMqWrRPzq2/FrQynz6J6r8ghNwUoWuSmppo\r\nh+clbWy7PYjF7sIb6CpOa+5MxlIzMqVBSgwoBGVG/SW47+POOJBYKliEdVHF\r\nFLPTkh9HZGXgc3bR2qtGq4x8FJyXy0RDth/4TWSPEEVwkjeelPUIbyPl4qLH\r\ncZHebK9RVhTZa8SRveh5XDOJJTYmjHax4SMat6u3WNgN5yCJ23R9wfCN5Oiv\r\nTkkWRSodVU4C4JFCf/13E75Ej2zVRVBl1Zppjy/2E9gjCa31YCi9AXPyXIZf\r\nxr5Wsv6Nzap5BYPkM56Uh8MWpIcSpGYGZk1eOL92qtcu0ZlIX1dyQa/ubBUy\r\nmuzoLEllIH3dYFPKVYcJdLayRN16UgHp7NbfNvnwUu28WXlhrWJOY1L3yd6/\r\n/FU4EVu4Xas//Sgeb2YmVp6NWUwGVSOldIjhVVvhT1fNFtQYCH4w5tYFg8LL\r\nC7JdLDaMpHsKYPjlN4dD7r1PGk+mfzczsCsuMegxZxxTNC3R3P1VhSfpD5t2\r\nxBdbjXjpYJ02cz1ZJ5gduxmsQCDv/6mMscsuY0ynjJO+ChP/y1v5wzAykJYe\r\ntPBoJQtBBmct03StTkwZz0M6diKzDVrrZG8=\r\n=GNki\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.8534dba.0_1655887524102_0.21606840710768815"},"_hasShrinkwrap":false},"0.6.2-dev.4e0c77d.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.2-dev.4e0c77d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.4e0c77d.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4e0c77df4e6091fcc3afd970259832374689b2e9","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2-dev.4e0c77d.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-UH5PUjZ4VAYEO/n+nf2Bf8Tyg8QeBZO+GuWkZMGSrDlNpkZDZwOKfr8p4m69LiqsHSHKfkDpCD0a3L2YQmKE2Q==","shasum":"7d5b1f754e1ea7bf4c5911e318b08369976d5b69","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2-dev.4e0c77d.0.tgz","fileCount":35,"unpackedSize":1036264,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBILMStuHAZeUPl6hl++IJtxft9KWFzR9QSN+9un6a4zAiBOuaHMr5aoKTreGiw/Ugmtsimihn8paKvLu6EGNwEX1w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuYVwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrudw/+J4kEXbfnWGPrRpbUBqq0ldC4VMU4TfGwJHBqCSjKe7OX0ZOl\r\n9QKf2LkqFmEYkTzZ9JVg67BqNJiGpTSARY5lmz6KcZQjvg+5iJAYFobAQzfE\r\nwVskvrLnXeZKxw241yPlrDHZq0piYTuOxc2345k1VfGkQjcMYUTLm2QLpmb6\r\n+czhTFduhpdAHv7Tigtd0LFpA1an2z3VM3uKteqPc8M6ook81z52grX42923\r\nH0lZ/KqLcioyW+qGyK+TPCN/tZRgLSwtWAUz3wzr+aMHskGdKgzWiwRCoo21\r\ni8lx4SpHnqzSBnhDMQz0NLLn5PxHGnc/IySuBwoYehW35PpXrw0VsA6lC32D\r\neZH5KOXKa/0iSJ39Lx9t/gIjOpe1g60pBFK+PmtqhodWcwJjG0o7VTd18cRr\r\nC5zMF+wuYbRHXr90bTz39I2d1NFsJ8lVIV9XDxqm1OL3rgDIkz+nr0wQ5SgO\r\nxxL3TjHtYMfSRv0f5Ff0ISJluRkrpmVX/Edw3uuL5RQ+DFv0kR4cT0x1Jqoq\r\neAgp00gLi2uqdhfmJDbht9RvqHxW/4t4P0wTHW2cK4yfv7ITcWLmUo7fkrrl\r\nhqGCdyVdfFg2RrzXu7EhH1sIn+VsbNrsmHZzS2oI51lvqavo+9zEg0+mH4Jc\r\nOzRMrgkUJLGEC38p+1dodY+yltQ6opM2D6w=\r\n=6Lxp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2-dev.4e0c77d.0_1656325488729_0.7015178804482272"},"_hasShrinkwrap":false},"0.6.3-dev.70e4b1f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.70e4b1f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.70e4b1f.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"70e4b1fe40723484fb38c7c6d4490fcaa304ece4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.70e4b1f.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-jPoI4X9aCQsLV6Ic3idVO3I+p82zL5mSOKZCCQqPo+af2um55HI95pIJ7SwCP80uei4s9NcGyHyvnTDmnIzSOQ==","shasum":"071461557263f37731f6e76ee01f3ececa77177b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.70e4b1f.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7hRWoOfUoAQ4np86cfGOBsBEG07oouZqahb/k94ujowIhAJXP10UnFWZ2jRUrp+DQPnpWLfWEsgw8cn3ZgvuIHwZ1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivEGbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtvA//d3NYS9k2mGaS5P85aoS2VodHH8k8+7JUg8YKe6G2sjerqoDv\r\n+65CXAAIkHk/HKEVGHMOKhYpeuZoECNpG9juknpSbM67ZixQL7U/lpAEvFXc\r\nJFMpjYB8EjfqQx3LlxBfhDR3K/1czI6xb4YmMechUqdVgaTmpRgEGHaumvH9\r\nnU7uDFh1Q/FThLgQLYLMb/xVuVzbNPec6b72ItOt6Wf2uPa8MHpV9sYYypNw\r\nhaxO3X9FTQWH9h6gXFmHlb/b+bfTEKy/KlezwrRO29hXEd78oSlgEbHDZifx\r\nDySFA1ygjpW3JcbnSvK9UQH0nEozEYMWMliCcnlgA2fwi/aHw3B5bhE92k3D\r\nDOG+Z2UZ93/DMvgcK+hNCiTN+Pjqz/tfJ/pPPNmYuKhoinbGBgawiTE6nIQz\r\nM42YdtKlIPFqLQAvhQq8testYOmgqmvQZvWD18gm6/sJ836+J3vACkveAu9k\r\n7UsC+IhJ/rDoIwqUTdDeaYmE5B3+JcvcfLW+NBRjm/kvJCBmF6wAyUlbXulN\r\nfUsgI2wMg1zwxeIoKrq0/iljHgwoBBLjCXDSNcEHkIPtcFDqu0rO7a6B6B4J\r\nTAhG65GKSt/indvEwf1VWJptK06D0EVHm8ckuxJE7aNJgC6FL2l/IFoh0yA0\r\ndo/COz6Hz8Qh2I2hKVI51Glo8UDefwrA7+E=\r\n=sSlK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.70e4b1f.0_1656504730818_0.1675704418162527"},"_hasShrinkwrap":false},"0.6.3-dev.6051b03.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.6051b03.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.6051b03.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"6051b033aa6f38b94bbf4ea9d71ed4cb23a1ad08","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.6051b03.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-7LrVo/KVnXEEIEBo7XTBgyYK/khxY3hMx/WrEKI5wfOur9yMY6sVBRE6UBWDGaQ1WoIJ6Kf8iws4Z86s+lCeZA==","shasum":"721429063d6ef55bffb23d51dbefd8db01a87925","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.6051b03.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4DDJbkOvvGlaDYDuv2uOAJpVU9z99vv7D8fWgXIzdMAiBPnV5sB6SqsXNgo8ZviIzOY6Y2Njl8ZcnGMZTJcLzQnA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivERUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgDg/6AgBdqX5Ogtowu79KgGtW+eJnwKIqZXFK4qhj4RFvOacAM6nw\r\n/NF08f0dKurGo/Ql/MtPWEw3L8VrRVHeDyS+209rDSM+wHaCNcJujkPPyVr+\r\nZMv4dAEArOGfpogBgqgo/ShJgm7gTXR/A6XCE3SNJVQfeFW58XoASc8x8P1x\r\nPFcY+HHjD0PrPF8heA03OdMtZAT2ZsHe8f5Z51hRw9LE7zJTRC97RHOqqlHe\r\nrN5Wk+aw9rKyK6Dlzz+JReT0eyjmSDDP26QDXXjG10DC1lxXid7T55o3K8qx\r\n0DNpysxh8qrLvSICxSv5XQ/4Q69pZmqTdaj4ALEhjhh1v/sKBzl9Ll+RPjQo\r\nlT6uJ+Nv00dFsK/8J4531umuDjYZZJSwSyu4Lu8HWKNa23igbssDKkHfwKbG\r\nPdT+/Y3gFLEzC0k2po5o7YO8YDqqlj6vTrp0DijAjvaOy4qICBzVGT8d6QoI\r\nFPLoLhYcnqUqk/C7ye3WqyFKHMyefQ5+61fWaVA9LdX8IiZ7MNxk8RFMZomB\r\nTj4u6iGA/rzRH55sHc+3QCauPKLe8urS35/mKJuwSRxBa/w7B3n1gU/+7kST\r\n8i0i3MrSwhmqMbI5OErhYbHONO4+9+4VtrMp1UngdwBB9gXYwZAtnMX4emsp\r\nYU50fE6AU7V4OpwA6xCScHKOt5HUhf9JKI0=\r\n=6pc6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.6051b03.0_1656505428433_0.7094438909735785"},"_hasShrinkwrap":false},"0.6.3-dev.ce099c3.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.ce099c3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.ce099c3.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ce099c383de040e40fa3446beb0f90c07078fa96","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.ce099c3.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-dKmkISBIQbxRouuTcxBb6Y+qD4AzcUAFJGY08clhlCd20MmKGM/1pqOjc9yBjoyTFhmuxfaicJm+yt6/QXVPJQ==","shasum":"aaddd77f8d37164b8afb7510ab4db8d784a8ed20","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.ce099c3.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMcFwexXhpsenOpXAnk9IhYbUWKovneVj2RSdMfr5jGAIhANTpd7gyMM80DuJNO56b9k5LBPQTCmIYCFxiH+yIDhkJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivEg7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg7A/+LVe4RQrESYSOHqvMsLGQl6TJECdapODO/IiOllXIVakAAhgu\r\ngPRimqlhH4089RbixdoktCICPdj4MyoldEZemwCUHumUt4ASI1NNZvaJAcGu\r\n4zllh4seZB4fYti7X6cdoVSM/UqLUfKWSWLuvIKGWp8AzO1w6GmS9ITnlyp5\r\n2aGbcWYcx7/aackehqHtCVD9AtEt6yWgfj9V+mgVmf7lLdNtvJ3jeays2TOZ\r\nUzVcRvM3LjDJpg+HLEs71I0gO/a07SbU5al5wtpUpFHUsfc5jRzutTMcV4Ji\r\nai6FhqWB9jfBRwFRs7eNb28LTaWeBM0lahEnSNIh4dA/E3mZNo/+TtxLZH+/\r\nyl51r488m8W7m9aFU0GK+nczPV4pnaKHR18ZP6VaiBCQuDi9oH/2+yozQ9dF\r\njFp2ag8I56S3GX4em6lXjb+lUXZM2OxvhMHjP4S6PCeLh0ULD+T030syEV96\r\nO9NeClAbFInQizuDrrv1anBFjm8pL82vWEqolHSkhTSR3SonWV6bDzZSXlec\r\nbD7RkD7yRhkRi1ap4upayF5rbh/ujw3JcdEPr+g1wQExrMjT6MVuRq1EzRoi\r\nDcrFqpQXu/Vvw0cr5iVoNfIYV9CwxrZX3NjQLTramGddxdKBG/P/k7PPcHQ6\r\nHQBnnNNo0P8+v9TNqQS9hW4ozZeX5zlZGMY=\r\n=g/AS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.ce099c3.0_1656506426891_0.17190915811178198"},"_hasShrinkwrap":false},"0.6.2":{"name":"@superfluid-finance/js-sdk","version":"0.6.2","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"1.3.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"gitHead":"15657ec1567e1911201be345788f042d313e2e52","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.2","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-j153Bd88gaarzZY34Wpmg8vG2Uk0JWUHSKx96BRPVmMNgsF+O+NnzrjlVWvfuIuVcAxL32X4nlI5VK7y3U+2cw==","shasum":"71281918d18c784751a921a48a75090c7bcabd42","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.2.tgz","fileCount":35,"unpackedSize":1036781,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCME5040FtQ7YjALfiSOnSs7wL8qFHMwZdwigjED03xWwIhAIE2ehVPuiQvbqGCZrOZxfzeHeRJNuXHSXKFUsxkGon5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivFLqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeGw//WdsbX48s38lTJXZ+BW+aiL9VzBfogEGMtWXefUM4E6unbZea\r\nbGqGnJUVCbg3D7Klz3A+L4AWu6H1T02aPBtjePOQzXIINr391c7NnXBxtdXo\r\nY2WXoLaYsG5QWJ74Iw1Ehe+iA7eSygnB+cyVvrCVBrk9VdYkhchW/Yk+XzWv\r\nFMDoUWboTI3aU4wVnTE5X6aFBu700DliarW3W2Lryb5r1wyZ9Eg3yJGNMzE5\r\nk4S9uzyCdjq30K3M8CrpF7YnaMSnhipVY7T6gmF5azmFs9Qo4liJCF4/ENGp\r\nWEHC6kTO45xUSurhOnJrM86QB7R2ncUCF+CfOGolTT1/m4IKcPk2FxYHTtmf\r\nQOkR4CrBSVcgG+OdffMfWRHCAJlFOXyHKkOKKDkHFvbicV1kGD+yU9aP+xhi\r\nEOeQzzmoqJVhIfk6PBk84HgsfX4I/1eVIAdWlEnIvHY1wOtFYMeS6PL4qSjF\r\nOZ9qIKm76wEnZsT2Tym+U59txMDPVtOx2tQSWGxtYR4VOI8H2cw/UOfxNm+z\r\n2j0IHAlj+RZjSZ6kNIGLdpVdHrcBV8RDvnolw3P4jeQsH6xvM2cdmy08lBx/\r\nlBTYE58S9fZW9a4IUGkAAN06q+wFs8nFRFGC/y0pSJ3HWZlDCMO91lsU8g0a\r\nKfapeMGNqQ/n4Qoam7BQaZA0katETRy2ZIA=\r\n=/8JJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.2_1656509161971_0.48460183932344525"},"_hasShrinkwrap":false},"0.6.3-dev.ff4f866.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.ff4f866.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.ff4f866.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ff4f8667d7e6911701b2d3e739ecfefaec8e2bd3","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.ff4f866.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-agS6uo22h4zV/If0VpEybjPMcGtlxHzHnbzSCYKtMYx0rS3aF69mCz7joP/mmnSUtC3jIcHlEbKdA8n2WzDdTg==","shasum":"1824c5111bd343da7dc9520d6fcab6aa2c716c1b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.ff4f866.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbU6F3A8zxIGNyOCqcqq5MmGIMpTep7j7BAcY7+CsitwIgI5USrnAjjoYLd3pm1gIkQzc3bnpfJ+nLppoMKGqKo3w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivc/eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr70g/9E4Qt67wNMtkAvrRJzSOy9cJ4JB6QY6ibskp7sc2gJQkzrV27\r\nbzG+TZ7dP5xUW/8nVsgy89xlm68vnKtLeNTpKTcBmR8LEGBLjEaqeqCBUTKQ\r\nWvonMYnBsR30rhHicrBtYdj30xcXQWT52xQzv2TBeLtegdFO6j/fdjYpKKhr\r\nG/GcOd5rQRGtNDv754A/oGUTsuE85Kj/ula+fTgcKBpakX5h+wdWb1P58hfP\r\n9euCfC7EdygOjtiA1TORBrzAhQ/f6ThPka3VdATcom5i2NZGfZCsWeY76Qrn\r\n9wTYnB3u+1WPI5f+04lzPu9BRAAz6Mtukrq3OTUKL580HIzm8HmYT1czjjR7\r\nR9a5Bq4/MTVgnxo9au+V4eY6+WkhgTayLDacyAC2HrwHGZrqAZ2XGyjlcHlG\r\npXCBXsVz8Tww7gAjHSOGDVHryuCOpWRbOSDrJ4RqJuzhDOhK2Rtzh1IW4+Nv\r\nnWFz5OJ8j9E5rthSKPoBC0WTBnoypiAbHrzjLCGfeH6aab9WHRfOiwLYnkMM\r\nRstJ1dv79sdXuQfivylaYOWw9vlvZ03b3NUmJTGBGHUBkfyHwwAGvA6hvoA2\r\nPUQpUj0uUV8I7wOd7KoHK+QeYf3H36hKwEKgnkQy2bu/sUr1bs29/uS+etbn\r\nvlLPiJAG5PDcec95a3+sekfPWi1Nzod4tbE=\r\n=0gjf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.ff4f866.0_1656606686588_0.84033400114031"},"_hasShrinkwrap":false},"0.6.3-dev.19b1d22.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.19b1d22.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.19b1d22.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"19b1d222cf7a3f1e9c110cfc4647ceb3789b5af6","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.19b1d22.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-Ykm55pkblWarKRkhdeoFXys7OE43xSzkRma5ezYz7txWtk/qIl8hw2YinbLe47zmO0GC7CARsTKBKKAN1IAqMA==","shasum":"8c029b17d2cd80927ac481d62065152a61486e81","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.19b1d22.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj8qe4A9bNdwK1F0zyHpJyGjoDTVfRiPhFmxEyMi6oFwIgbK7f670o0pD0HFpw1t3s/Ubqc9AaH37pyuI/4hNMAmg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivd3FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzvRAAjR+OKXKfTbeEuzwVUuF9SyQSYvkMXYyeaf8iaRRwXgZFQ/Bh\r\n4cP2qYUG5UfdIiV4U4gu+HtAIrI3zsR1X2OcylV5uSg71FKPMs/Khmmjcylb\r\nK6wGe92pPXZ95a/dCpgcDZkXeUyaZnzx+ZKNHGHHHG0lTPKwf6W3Ul2XKBdp\r\nUQSykqeyzBB2HVKEU/ENCZZ8jJf230aIRgTmPX4p6FP7R+T8jaiZbTY3X2uE\r\nOIrfwtRnoZyw6OIe7ohNuPZLOyTCb2oj6Q5c2o/SGvtk/ubVtDps5mY3j1u9\r\nlFIyNgRYmX2uzfJNGh4hUSrAm9qGwFT2a8aQ3ZpaJaz/fKSPVlYaNm0qbPIM\r\nJi5T1rrOxAEQ4X/iS2tL7vCPMtz6W1RIBAV1lm6YKGLKaNn+EK1CoddgzTfY\r\nSSK96XTv27PsDZB5PyAbJ9+X9/LdsjqjYWOHKZI4C+Tut3ydQbiQu2TQpCbV\r\nXA0pNtI40E1GOOxcidgUiGw18xQ5uYawKzy+2ovC8ZONlF3COBrKA6OwvJ9I\r\nKNPQWTtD50reLQJ4Y3E1SPEOYQpj5tK8kNFkHV++Fr5KMA1G+4YitsrHW9iL\r\nvltiMlMCvrKetMaM29zgRLQOWGjzXaFMfDHvD2atgmeOJI14t05IkXyHF2J/\r\nZZhaYUgZ/NcL3oext24xswKc2qeR0D1+5TU=\r\n=tFPy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.19b1d22.0_1656610245071_0.2691715375029704"},"_hasShrinkwrap":false},"0.6.3-dev.8790736.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.8790736.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.8790736.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8790736be71b6a30cbe0d3238c34a9b6403774c6","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.8790736.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-I32svxwi7eOq0QQHpgMipsgDmKBwjpnDAQ7Zh4HSgPJHKUeSs0bgwC6C2G2gmpjzWZUunWrV2nmfIBrkARqjjA==","shasum":"78da404ae61fdfebf886d4e783b0f2f89c0a564e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.8790736.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbZwINsXIfWwkGejgXZl6OhXWHKld6aTPsSvzABBfmaAiANBEHcDzo+QFNFkO/C5wt1rqVJ7gwxMolE0iFdIZQ9Uw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivd3+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrORw/9EHZKQssf4uT49MrRRX/Zf6BNQDtaGnIS4Q+xJGhQ9TQ0Bnp6\r\nWwsDXIXqmZ0gZvK2X/TMJIsyU9XfZt0+wt5CyzJ3l1Mea+J4ovXQuvHlC+Dn\r\nZNn4wya8AsXVIV+weLmz2gLP/oSp4ZRQhS60q6uEt0ZDb4UNySaEJhh6X5Jn\r\njrsyMrdOwhtIEedLirKPvv4Zp8k2waGY+195rXd2hTSpvwA6OP0HcDpV5GB2\r\nYtU8N+89aEEyshT4VOZUvVGoBH6A2ul2W2MPygSAWBFnMIwFxtSi/titkBVX\r\nQxpldoWuT8rkrD1Sm9usd3syRkaEJb4JVqYCa0DfryEqRDoqAJTKmevABQsR\r\nJXRcaIvPXWG+d3E0lCKHOmCQa2dDkClwdQXbE2Jjthr4xNxifr/osaaCBiYa\r\neE1VqqXfYypOdTgFH/23gRWW/BHhhviEyXnXtIGjf9KPG+nScSMBNkq2HEd5\r\nVrbstimqdZLZA/1gGrFYdD7euDvBRL51IQffzYZzl4NgjAuqFysEjJGRY24a\r\nrAp4KYZSPSCu3vGMAfUXpBikocIh2O+BHv1WVk8m2i9C+DutLT1wvEwM/EMz\r\nXZR5/vxdSBqXfw+aa1JJQejZcIxJK1FEtqPG5OwO5xk/Cw0Latg5DWw3VKdP\r\nS2C83fO1Wgx0e7snTKhLSrHbAevAEsGa4WQ=\r\n=/z62\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.8790736.0_1656610301844_0.845131248831007"},"_hasShrinkwrap":false},"0.6.3-dev.6cf4191.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.6cf4191.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.6cf4191.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"6cf4191a7954ae37866bad83ec0fb66977aa3fe4","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.6cf4191.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-Kt9FZGJYLTO9EMkLrSRjvTyKho2+/sqpx6BjUaPP/j9A9EbknmA/dxnTHm1uqgK0KDyPlL7XK6Et/RanODR3xQ==","shasum":"d547f65f9aeaf7a1ce50a2a0fa89c8798a47e32b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.6cf4191.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuV1/2yZGgow83AssnrxjFdxWWnL2qsF0sVuFmM2dwgQIhAIQVTIFYOVZP+YhtYTguOBChZex0U2IR4H/HrsTvr1jc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwBUHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGkQ//TNEsveGMMc41cGYDAFgf25ugNqzkI0BeguWau5ugRv88ZwPh\r\n5A1eGmBxNyWmuEXSsC7ZMH+WErj833BA5XDxPotXZ+4GCrwyng4KtiAWmLro\r\ndM8VGVsK+ToAJKlgF6AZbiNNrqKF2FY478fPJ+jtTtzBpLzXT5VYrx6ZY8LP\r\nAEOyAEZZRmcHPNmCLBuYBEA6hJ4y5N5ueCY+2lcU+9M3S+qfJKwWf0tKoKTE\r\n0fX+lktezQHYTgwtdrbZDo/mJ7+HnlJhUht7NfN2HUo3+z5lHa5xOH2lkFYk\r\npl0PJE3baHMjbdYqCWEou3PyTO06bF0+OXXJRajfis/QQmtyzRcMvAx/uOIG\r\nRuslqsGkzmjRn9Yu84rKQ/9WyURM5XJ7sxBQdGUDl4MYlRzE+06qC5GTS9DV\r\n7fDAn35h91bvZilQ0sTHgSnRV0Zj8Sbh1YUGmboobw1d5b1qFMXPLBq1xye1\r\nVFf7CIQkZDiGIGyZwg9c3z2pnStVLz3D48uZa2shH/FL+2t9sHuhVSnvivez\r\nHOoHilcaqW+avTt7gTqeOO06c1i5gx3u1i3kc1NqOpUTzelRTEQ/SwP9eSeU\r\ni4gLdPHIgPivaZk9OEmv7nYcDYPs64lDYOYFg9GmUt+vKrbxidjakxccdX8r\r\nTQei1BiqL4R50du78IMGvPs5DxbKCzhPfjY=\r\n=ApEv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.6cf4191.0_1656755462616_0.967776908299214"},"_hasShrinkwrap":false},"0.6.3-dev.62ad4ce.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.62ad4ce.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.62ad4ce.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"62ad4ce65ab64b2c9c4b2d23a96a628487f97289","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.62ad4ce.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-TjLlIYiEy28+RkPH/yhSNuNFZoNKU2UrEzhiO+6UnRwDNO0VEGL2674ENCINrPIunwyuyZ2z246agPla/1ypmQ==","shasum":"2548b50f66238c34527a1f4d74cb16e99a382f60","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.62ad4ce.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGE9zyMQrmK0mGSxMiWVIoxQIT1vG0Kxd+C/UrGJ2D4MAiEAuKBLEEDijvs3ZKC0Cja/LVWIQdPqODVufJkPmWkvS/E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwquLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdKw/7BXHNpixUKMvYVdk4QZ6rs6sePagAX5BUV+5fA3nLOHLgSqAZ\r\nOBJiJ+KXd5VCErdMrQwrQQRWI0nUkf+eRDVOOOy45FjGP0rXFoDwGUAzpgnR\r\noyWAewAvZWh943J4Kvl0S79PSqvG/NES7dmt5ufwr9ZInnMEKvy2l5Ko5ABx\r\nDFuvPj/R+D0bJWCkwjtMvgHlr6ChZG6xrUEymxR9hnU1sqqLtfbGdQQ4gDD0\r\nS19yrhIidRk8niiYpepzlXfOSKhM+90kKTHxnis9O2zO5hXZyJmbON1LCF8W\r\nRegpx+GibLUjzDhQeivUQvTDR3LyEhcP3wKfDTNxxbMT7ilNfHUuIdSpb1Op\r\nH7lCEtLP0EGzFttRI0McQp7eZqS11/YF7WIKl6P1ZgmXIMere5iFf7xg/+/V\r\n+kn5fozy2cYWiIo0VdrbleYNk6dtmVxt47BRgz3nLQUEV+JAS+X3HMiH/Xz9\r\nlYW2skDmSkTJNBoAbtAAPtuh7k3PPBUcd8CF9VZJ13xXKJd70uuC1HZ7aI9x\r\n46p8G1F4qzhigUpu2CrUYRDn/U1HT6kBVfGdALtwlG8vhO1ZhpQaUpVKIgxQ\r\nq61jTBmB2Qz1IClOe6lnzgS9RQ38tw0eom2DNBlaf7XDDg4qRbk4rkKPfNIa\r\nYUfuZ1ri9Qb+B3xB7JY39s3VQc9QGdgzQP0=\r\n=FG5m\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.62ad4ce.0_1656925067770_0.35501621493231617"},"_hasShrinkwrap":false},"0.6.3-dev.73ba205.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.73ba205.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.5","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.73ba205.0","chai-as-promised":"^7.1.1","webpack":"^5.72.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.9.2"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"73ba205c6006a19e31afd47eabb248638bd3f5e5","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.73ba205.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-NHjoI5kLelq0mjVagZk6caHJyDUvn+owNDYpAJP38eUPvXQrDLhPkbwwCYXVmFyEqlofOVb/UaJ69SPwXFpaTA==","shasum":"59d5613fbc7b5a4946480d8c5f0bb0352bd3ca71","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.73ba205.0.tgz","fileCount":35,"unpackedSize":1036836,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/juhEhIgU3FfFdJfXo5WFXr5k1m1AImiyD/ou3oDDAAIhAMd9s9+KyLJBYvrRG34orSUGG3xCxrit7pnRRb/iaIzo"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwsX2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmNw//ZCB08QeUmFg+ajksznw3ymMUwEGvc0MCunsoAoQD9ddff5QQ\r\nhr5IQG/wOEJoj6aCuOKePvGb/Nq4J4eu4PRXwvm+31NsayqSi2Tkl0EioVUR\r\n4fJp1cJ0yCUb303sKTtKE/ad2NGOrmbZcn2sYxa85riiaeSKaATlCYlG8+Hj\r\nr66sOCGRR2uHaIdOLTuH9i2E+x1eHRgZOgLzbZ7Y/w0Wvo/jD4cXxE9WQPt2\r\ne1T85eME+4L4n+1yaVfqxKRCIeTb/KIWSJzyycCL7OGTGeKMPm8G6T4mLr/z\r\nY7SDPVNM04q6JuoT8lakcAc6D09G1KpLrDH0HsgE2ObTe+LYHRj+NIuuNiA8\r\n7wCFW4LbEWv92XnkexzB9I4NdFH4ISama5+lig5iTj9C+7j3ErW9BpPmC4ms\r\n+iJyZ6NpNWcuvRX1pDimfipidiaO3x5uZvGGDyakgTIkCRR3OaVLwH7gbYwP\r\nYKonzaYzOK50ZLVxH4/HeNl2EYE+MR5DIpx7DpLQglcQixvOT1v1N4Wm/4MA\r\nrn4/US/uIA9JyXC7VPt9Viu7C1ZqCs4cp7ucib0Z6Em0oVr56iOvUme7Upe8\r\nMFBSueaYjUn20AqPYb6ghtemA8JS80cZeNLxvlfeFbSWuvWJr78BMOs5r1LR\r\nqVzihPHfvze0SzcVgU2jksgUIWiyTEyN+Ww=\r\n=OmuH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.73ba205.0_1656931830471_0.3822515398986308"},"_hasShrinkwrap":false},"0.6.3-dev.dd9c416.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.dd9c416.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.dd9c416.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"dd9c4163074983af1bd50ffa7dcc29a2b1847d33","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.dd9c416.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-vgvMswR6UCZweq0zD/vNbC33dun7aXiM6yP0YsrOnibDpty+Yl0zEN8Cl8Vp6e9IkXDKxIP3Jvw82q7Bc5SU+A==","shasum":"5ba3ffcb9f363540f3429d6b30cc977d51b958eb","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.dd9c416.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfqzOVevlshzCZ0LNa853f4opL8UcYEBSHz7SB/yUmeAiAEVy1lHe8gedQvrM2hOhXPxDohmmNI3iNO8aBTtBZP5Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiwzsBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqjig/+PDowtSIhVqJiGlmm7+jyPlimavmxtJ6TJ+ZrfEeIEQVYOIsW\r\n4n+9mjaKo79l9/uvF0QRfTKh1z7Rs8X0NL/yYC8Xog08E0DKdaLKnA8HVs5+\r\nu6q4NVKi3Ozb6YKEOwj0gl8syaHjdrUO5ryBB1QQXTwlfQX6FA8jHt3K6xwq\r\nzoHDkKcO/qk8/Qi1ORYc0QOdOAgWzVgeNgJMDrjRxATl8nIVPnytAxLV1T2j\r\nyZXx2Ev/ysJGIOTg3OS6xYBts3kENw5CVIbXjOint3T69XoTxcuJmhrVCoTR\r\niBIsIhOQ6DioQZEQzsNq//q/jRhJsGFjr8AMtCyGDpFhaVp506b01FH7uASt\r\nRbIuGyemQXI0Fjlh4esVtNP4K8fYJmIolojaAmKs0I7UMtAO/QM6rTWzaR0H\r\n30NfnLEtG+kXrSZs/wzjiygnx59LnFypd013xvOn/bBjWjOA9T7u16DsaHRU\r\nIBynYRouWTRZSVQprCfcengl2qsATSTdelYoqUQ4MgjAL37ySPoHYnfC3q+p\r\n12U2Ax8VxWT2NTg+NjJpacCFwCJ5rvAaYfKipVgNuOkm+fL3UHjRZ6A7eC+K\r\nIgo6pVoH3Ld/PDJrehArlZaj/E6PKS1Kuw87pyzkdhIt3dycianjg3UtAbbr\r\nQUW8wPG5B6WA3gYLVkDEhAYQo95b0qUpy0s=\r\n=X6E6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.dd9c416.0_1656961793220_0.6441779409515389"},"_hasShrinkwrap":false},"0.6.3-dev.ab7dc19.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.ab7dc19.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.ab7dc19.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ab7dc193b65f1f7055af966132a8c04a15997f4b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.ab7dc19.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-GH+ea0/3j0lfAaanHBXqA+I7Nr98rlWRJFmLUPO24hCKItBcCvhxVWeW812OQY8tZ1sMUtjz37LfEzVXUTtPYQ==","shasum":"c48369c0bf57d4f8745a3c72b509730a5fa6a0f6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.ab7dc19.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDuJNpdffM2mxSVmQKKYa4hRA3gn5+kBwOBAyvb5h0IwIgYHTX9wdAjQhe+ntkPNk77Sbp2J8MMEVQACXI98CLTQQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixVoTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDgQ/+LaEshxFmp52EMfJc90zXitrCTED33cx8sLzk9ZTeZ3AyRiNr\r\nbJWBlD95+/3RKe2V2J68fdOVhYqDxbDvAeJpPI02d8CcTqWlh8VqnduHudpO\r\nf79ZW/Oqp0ecPLDYRMkyDJ54xSp7PatI+1ZwOzFlbuCGQwQ9jzqrU06AbnwW\r\nF1mPJna0JfCqUj/yBojt6QF6BM/IOCZobcdS4ysvBi8DaINoGEbCTMIs+qRS\r\nEPz/SsMVoWt0+O/zkzXxGo/tjs0rvEm9k5sf6lFsifaM1mXjbdHPDYnmDzEV\r\nJ8uSko8PEfJTKpP5TR3O/NpDAWI5s1IQx0/Y/4so05BDBM4XY6KRIYIici+i\r\nU3erLfA4eTOrJxVkLYTQhcP8E2rp8ueYASll4s3QjyfWiLrdRbg0C8/kf5Tz\r\nF5jaLfYIZR0Lp0YMYTYrQk+/pEWdpZHnVcMseyInR1aGvFVWhytj+/kxLSsk\r\nrd41crfjeBc57b7cMpEC1G86blPx0cFi2zhP9G5LLJssZxzhNn9ZUF49CVEm\r\nUXzEzDRpHUhkWCcYiDa8gLgo3wh8qq7jO+vd04QpjW7PWk52g/udcfb1QfgH\r\niIiY0Cb25eZBQ1XjNPpT1Qqo6NcfoacwWClX3l+g4s2mB7qDzAsdt39U8pZ7\r\nVluKJr4TYPQua4RNYMiuaScftUN2PyiULWw=\r\n=iV0G\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.ab7dc19.0_1657100819432_0.975631129450254"},"_hasShrinkwrap":false},"0.6.3-dev.e19ac49.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.e19ac49.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.e19ac49.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e19ac4949457f4610f4aa722555e8cc2e0d2b5ad","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.e19ac49.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-Q/YYKHQt222xbpB92jV+/AncfvintxoIEC2HoC7c7F3aBw3Y2v3Ieu97XwV1Wq44azDGfwe6wYBH/RESGK1kmg==","shasum":"4e16937e47defe947b03833e7ca6985af6686cff","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.e19ac49.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEE4FiRGA978mADyezEud69IcO9N3bMQMfukhOZf1Cy2AiB+HTfwbAjeZTOBta7PxkCsjZ/jBIswRut+QSjj7T3j1w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixwS3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbQg//UTvBwFoDsrrf4UCD+qWT4HxIu0zsMxZk6YRK/x2iJ0nI8YAB\r\n1EWR9cSpctt+oYtmEpmrhLETSNxtA0MA/EKg/GqAVK4uYOmw5/esCjUh0H2D\r\n4PB4oPpD7s2Lq7dEO/irJ07BQjRF8JCH9ohIYATr1REg0D64BILlSmjo8iR5\r\nxUnzWJt4WT8fSYj6gHNxeu/STbmk0iY+l/YY/cjVWuOLiQCIxKPgEE3rYSoQ\r\nG9dXYXmRx8fyFjT8kU0xpeAkH673lP/eAkIs+/e10BGSllwEKzijMQdul/XX\r\nxJFLyCwm/T874u+sFLD4ccJMYDO2egCIcfUKTWuiCBpNa9nXIJfJ726x9Qjx\r\nn8gcQv4I6GOTvZOQaL0k6nfjmQLlxqv269MlFMGqHUTPTqGLHEhWVUvMynmL\r\nSv3EQ+b/fjs8MueTty4remGlK6JelH1BtJXPGjLplBSPoa+Enr1XWu43UTtl\r\n1phQUdK/QNfRaBucxKqD7pkh8SU7NZU2GSTfjHYb5aAsGclZ2YlGH/804VfE\r\n6TrlOVPtacYa+PVfVdyehI19aFNNReFwfBtm7RN9U+2CCeSe3XfkVepOVidU\r\nTJDN/GyJm2vZ7UDHCJAOvdnKpFrKwIr9qgGgGqoiU4yuAa1zgAIxYnpOq7R1\r\nycCc9ynhrYb4QqouxhBjwAp8AgxoBuJm/Dg=\r\n=mOfl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.e19ac49.0_1657210039096_0.47280696100643116"},"_hasShrinkwrap":false},"0.6.3-dev.53e1b83.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.53e1b83.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.53e1b83.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"53e1b83551987da538271009865a43d46ab9c4b8","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.53e1b83.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-o6l0pP1JKcnYAy+7c0PefIrLGrkSSWtpRASG1TsKuSNXgnWDcLbTLcJridotq7gJvdQNBrAYd8ThJMYUt+i0pw==","shasum":"8efb8c9662b9579bed9f951beb87fb293de5a8cc","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.53e1b83.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFWcz6Wki5nN5+tgDVyBDxYWzil7qnzYpcR+kQVqvzigIgMPImXG7QFiTTXp9FvsKulHWZKJ+65CfM2+TnVX2opXY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyAYwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRxA/8CUOT8VYNe9Y8NQ0yHZnLyzpY4S88x7N3IKyop0qCGlGXx+g7\r\nejxHbqLJmPdwfL1t5qCuXi2MicLOmRHxvA2/qRk7mHaJsVCyctFAzjHFKYY+\r\n1nHZwr5b6e4Fkes4Gcx+SvvOOLJfnUp+W2l7QYhDEzDOxcN6dGZstEdRDBa0\r\ndTspyAhDvalw2qdRvAJKt+PsvclJ8OtWGVwWHaHufCopjoHW4VGUKtV6sf3X\r\nAr59AWFBYKYcnR2Hrh3of9Dn3EMRwptGdABenRUCdwcK+4YVWV+kQKdqqzVY\r\nupLBVqE4MwKolKyxNUIvS4Ey3d4S56i3HTXsE7r06q79eEVnBvZJADmVwKjR\r\nvFj06Qc4bv7q07K7YqAVMQSYFixll+iYiYDXz8gXbeyOuz0N13SopDOtbM/Q\r\njKo/RUNUyT4EvPvVel4hJnvb31bYOEZ0RFdeIFgIjivBlfd9nwjeK7C3HPFy\r\n6/EaB7RvscdhX+SJXJF3ct3S/lOC74hs49BRCUHxwsgV/wglKXO3b8vz3qrW\r\nVj1UJrpj7rMKrmG0WY98TnUyr8YOnZsO218o+aOUkhUpm/AwjamEHIPk6qaH\r\npDk+zkplfwXE1YHu+6IqjJNqtc73E6K/HJCMgIghjfEk4GGBtXp5uIqaMtpc\r\nYe9ZtWcsSP6HXleabTNRLzBxQPZh5xTQuec=\r\n=J5w2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.53e1b83.0_1657275951837_0.3494864595651115"},"_hasShrinkwrap":false},"0.6.3-dev.25182e1.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.25182e1.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.25182e1.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"25182e16c03482c2ed6faa56e43338c52ac9be4a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.25182e1.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-+umvBaaAQJ+0GVV2rtKOVZLfMiNjGHYNGDkLTw95xc0RRz8nQUMbAAvPCg7hCWUricwFq2rBUcSJfHM3xRhoMA==","shasum":"2252b81682800e971a586981c7377c1b533c9f58","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.25182e1.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo1Tk1njmCqEe1OhkqT6gWUFzIwM76XcD+Vslr8ZodoAIgIgKQGVzMuqwMiq4Mwjg3HZ3Oclf2PxNBDB7RhHhoPb0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyFOJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6cw//cR0QHYOREAxYYZ9MrzM0xUtyF+xg6QhMi+Ox5JcEtQx0vIeE\r\nlDm4XDCE4v6+yO/1+znzHEVw+7VL3BY4vP1FgWs/AoUy6ccwDlIvwM7d7ve9\r\no3eF10QN9TzkOpYExTZW3sW2anoiXmOmSyiSbxoVGes/otPG9EvZnZohbphR\r\nPPf2keoWftZ9Tk3CBnSuvMfTc4WBEkVXL0rmTD2ripaXVOMW13ioZsuOVqOE\r\n9oN6dnQxmt49QaqZeEBZ8ALRfGDgjvDm0Yrwxo97L+1gxDx0xRgbe7gp5G7E\r\nrjQOTlYgLv2J8pVH/jWddTAIK+UOOwOmPyrCrrmIUnE+rqRudxPmLNCFmvlI\r\n0GSmNfQBaFA4jVJ+JgetwvKXxfB33s34XFSj+kTrjDqkx70RXWD9FkZxTzta\r\neURqr5JVOvG4dgjNsTv+I/78NMie+CzNvWAqJw81xQ7Zu9lbGjeH8E34a3uG\r\nXJydpATxFd4gi63KtEQ9DPemU16mrSrPCVOHJHErcE/832XzGg38zfNLj6Zn\r\nfHIKygR2ASeRFNb/xIfesHaotPFZSxW7n0WV7wLzvbqQ6woXnQYypgiB9/Mc\r\n13ou6aa7GGCNDAiPNoM/lfxp2s0+AFI7XDvnQd+hUlRbruKGMz60AwoSDK5p\r\npUolAhzkhw49KYOQZyspDa3KAmXDedUwbM4=\r\n=y2NF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.25182e1.0_1657295753755_0.8127136111335358"},"_hasShrinkwrap":false},"0.6.3-dev.81d6a38.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.81d6a38.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.81d6a38.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"81d6a38bc38cd6eb6df7b0143cdd7131fac1d1f2","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.81d6a38.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-YTudS9JfBiLRo9g7rb/I1HI8az/jMzfVZLB9HZq/Sxanuewy0ZgstpOne71SAI+XHjsw3kFueCib1p23jTZ98A==","shasum":"8a0f3187ecba6d31d5b0b9de5ccd5f08f21ac1f6","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.81d6a38.0.tgz","fileCount":35,"unpackedSize":1038826,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClItnOUTN/FPLq7mPDxSY1Qk3yOeMPSB280Ts67s34UQIgULm0/4ufw//rClArrUmQt3TQ21IwLBqydFBpMt2omnA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiy+GeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5rxAAlzYHL2DZA+awDmkHHjevp4yeHb50JpCZs5lgilgCYuemIOYH\r\n4mnCE4B6jKHU/qv3/Sb4nUy8HhgzOm3cHm6Bt+7cjA3LCOdO+VGK25lcRXe5\r\nVsuCgMXx4Od7xQlX3BX4FmDUVG0oXnvb+Rz0ghlGPLMaznyqlO9zIP1B5fAN\r\nmQUqSb+tCC33peDujPjyKTxwiBzvC1muckQVaBWP76v67zf/CQDM+foH7FMT\r\nxf5rsrNrnOsSJTJ0sEBqA2lDPo+8/4GEIrAe8L28hiSSz+fXP+LW4LHzE+/f\r\n1ARPdA3Nl4hfmldCWOvGXBsemZfs+lnwoUWDmnrL1kS4OdJ3cp8sW/tFWTpP\r\nJzETWbXy3+6m8UZEh17CgnGMGgBveCvux3X4FgdzyqhSqtKz//s0+AH+UqKO\r\n26l/xhnZzGWK6xsqJy3LNfo35sesNOsWcrE6+a+ci1S0o1KH11pmaDTz+HRx\r\n4QYS95VcoseqFV4qvn8YmqibwfeTFxjZ3+VSd+3cYX+Hz1a9jHI9QDVAq0vU\r\nYjPC1vQTmcf7eTgcG/bl0CeiUUv6iRpp3/YMlprXxELCtvN+OMHs+C5E9ZLC\r\n0xio6tQEBKpLBInYphD5EPsikLc9be8MDkFVGHPvF5BZbqDxHtTIHChqUniU\r\nFxED3AAYgfmZUHMAQz/emrWUyuaJuT0dgIk=\r\n=diaM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.81d6a38.0_1657528734609_0.0599681359771127"},"_hasShrinkwrap":false},"0.6.3-dev.4106f0f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.4106f0f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.4106f0f.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"4106f0f66197539b596f477b61401cb4f00c934f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.4106f0f.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-od2CCcbDGJPKKuBfhqr1p8oquOBNBJA3bJch/vquhdh2HNVYdQ34io/00yZtS8AokHb6n7lWz5tXycFJc+y6yw==","shasum":"0757ab1433a9eb1b59f489ba19ed0a7cb0d36fb8","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.4106f0f.0.tgz","fileCount":35,"unpackedSize":1039958,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCOrdAmcSvOg973d5abTxeK/86KovG4a4D6QhlZc9W4AIgU9QKhsYhUoQhxc4ROqk+5OOz3ArVImln8ZsIwjxh8ps="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizXPmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSJQ/+JOP/Y4VOMgiaM+ZfGoGRfmOoL1MIlNLZnRlx3KbfDwJevZt7\r\nwXHkDGavAbkMOzOBB3cBs93000e45vdJPSclNIIaS5jwaVHdSmAA0ofIvT+d\r\nrEf3x/epIHfVFv/yYyitucpOTWcKjH2XJ9g315wRxiuaJg7aiqfWjP0WHef7\r\nHQy8iXo28LXm6eC8hZ1BH+UGXasF5JJb0V/9GoXj74lHrqAbdA2PykfsCOAK\r\nLWf14JzlR8mwOLG++hkRTPwDePi0ZvR6kSUIj/sFgVAZCJmSv9q8RtOAU55L\r\nHGrQlCMRdxPjE7bfKozDHo28r97fcEwQCQEFhfBiffeublBUCKg3hJfilrUY\r\njLR4fSgz7qCjV6eXzvPUq1eNo3/kWeAKmKsUgLCdKTfHo9jYgRLt/QV8R/N0\r\n/SXgQgm3IbOnk3yGyVW0mYYDZCia0QyqitDcY3WA6w5gaJiLPEhlfHYz2tVu\r\n0V+VvGILoUn22RL4knuiyDhEINORDV1wKH08tCn/OaoxXZEHBV+lHY8ZZQST\r\nNL+UWjUejCaBq9uUaDDizcP9syqdIhkwISaQmkBy4R/habioMhyBqoRdvGay\r\nE1qfyzeo4KN8iZ2LvfW0DhKZ6jyp8zJCI1ULfvCKk0s3hJe5ZFZ/lchnB1ug\r\n9MtKXfSFKq5ovZHdh057cw8HsmPCuQ1ogeY=\r\n=IUP8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.4106f0f.0_1657631718485_0.7786923971937012"},"_hasShrinkwrap":false},"0.6.3-dev.1a3caa3.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.1a3caa3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.1a3caa3.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"1a3caa398f01c22c49561cb0410ea074538be339","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.1a3caa3.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-i/RbxrZQAOit/mXZbRNUN7FjD+HMQ1oYQVBNbW+8s9vh82/sro5T1dOBTHYtt31eI+LLh3XIx6mry4vwYr/F1g==","shasum":"f67e9aadf2f583b1da73c7cfa75def2b599881c0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.1a3caa3.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJm6BA4fijDTtIFhYAsLJ1gwplrLGXGo7GkQJxK4/sKAiEA9mRtFhy/+BflcJMBsOylPo1v7L+sZdMdTl9b0nj4hmE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizqD2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWWg//VArQ6jDH2r2kU7xdQE97gM1lGNEsl6zNB0/7U4dqq7egP8Yk\r\nHZysNnUeEZTdvgRPQwsyddlm5F9VdRxe9FT1OtNIqWV+7hd0kSqdNc+rWp3E\r\nAPq+/+j+Vv1vvVHzHBx4to6WG/y4ZItfPcqi8Ao0IO/KAEo9cYqhjtjDCt9x\r\noFO41gicd8bV9xpP94srdQiI/shKe2OrvTnck/H6yFcYEnEeRLzogXg9TMWB\r\nGUc41mMQienKDr//to1mK+1nMVSNJHe11uG9vSTt5rjMs7OBZzBmlvwbk45a\r\narPFMJouBrgHtfP/2KA9YKTpgowziFZe+6gzKILoIBOLU9uGyd9uLDHbwQZP\r\n7mcYA2jHLLQTij+E9jqRKx9K9mMhmCDb3cwgvBiqal0fIfOYtL7f7k6llmQd\r\nmnCOQnHKC7PykJ5LdybfignzYu0PyNpB1LFaVoY0F4rETBcnohVuvEDz9JHX\r\nJAksoCXlFQQ6Bq7x42Wt0VkQHoidaij6GfwvO3r4MsfuRBTSvii5gS1vwL2i\r\nrq8Cz7KPQlAcEadgBj012Jmivp8jUXfBm8eWCSgDa/B7UEibzJPUUcKTKJZr\r\nFGpZ9c7dpBmH/qwdjRuz+qkTh+yr78+GajP+1lx7d7k89jkkP8UW4Wp9VE21\r\n6J/sQ90r9jMrHdLD0tHVyiVCG7I8okoDMp8=\r\n=7UKi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.1a3caa3.0_1657708790222_0.5563269238230888"},"_hasShrinkwrap":false},"0.6.3-dev.3b2a6b9.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.3b2a6b9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.3b2a6b9.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"3b2a6b964bbf0726c6c9a78dd75c08a58a9eeb40","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.3b2a6b9.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-9i9Ls+DblDK6yqrEk+Fy0G3zVo4flGm/adFcgijGXO3FshOmzz17jCC6Fs2RCw4NuY6mbZvgVlp/9Z2820zvJw==","shasum":"310ba612548c87f4381d081c319d14bc68f99ac2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.3b2a6b9.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHDyZXe8qHeKwz+3XcoAJV4zyBOf2qO+mYi1z6tqee5AIgIIvr2a3DsqWYhUZB8K4WGOlaSq/JAj4DTbzXsetxfcc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizriSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOkQ//Ze/HzWKhzuR9Nl3dcPbdz0ChQMEYoyXcKCpmW8w4wgAYS5Qk\r\nvO318MYhvezFfxuJXvREsUdWhdGIqdJcbjq7b49kPfCkGp5vggqpUjKEc1zJ\r\nfY8lJ10cXId3F6YRI9RHJVe3fCu0niz/wJWs/UQJ8OY1La9a108DNtFWUJ9+\r\n5bu6E0dcSP/rX4ubRaC/937AaYNHeVvj15QSWQZXz4jshdOypuR/q1KYblKw\r\nhdwIzU6vzCJXQQsksAbaSr0pT9mtDdXBFda9QRsc+zVduP2YCv+0XBrnW2H7\r\noONpFbOzqMOQ6WmhcTr8CYpPp1M4xesAf5/xo7NeXK9ReYpnAsQpK2OrSqp8\r\nokZlMWlZXFQPhaXH0kBWJgX7Up16SNatuXf1YazGC/nTr1hIIIhJbCtomNGA\r\nQPiL94mfFiG1AJl9kmq1dStvhP7x0+WvJLNSE+4dA2G1m1uVAhM+lF6pbz4b\r\nTDdr5RBf4EMUBOJTPONVee9nEzxBZ5VM5omrngk7cppSmaZgn0ye0LDYvo4f\r\n0/oMuzhoQ7N/GJDVSTeXHbAEo5Ok+tMfGPJR18PXacWZr27O8q5pRa5LoWFr\r\ngcimWmj5V+7oJW3j0X9KKfJN5m1TeC0jJPPzwRyOe5ZDdn+eKv0KaisjV3sB\r\nldC5BHJmwr/kFBhe5LebfkzVK+1YxA3SA/M=\r\n=BjVk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.3b2a6b9.0_1657714834304_0.45112189489334886"},"_hasShrinkwrap":false},"0.6.3-dev.cfb8f07.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.cfb8f07.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.cfb8f07.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"cfb8f07f6da7ef210068fb2d574607d3a75a082a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.cfb8f07.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-/YzG3B4xh1+M0U1xogis8uuZ5H8Xhu2OxSkDqAbDK5lskJCQ21mHvkhjRp/Tc4BHlpvJSYezhjL6dfnX6+IjWA==","shasum":"6d70dafa0aa02b29039d0d28ea65e410154b4373","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.cfb8f07.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqD3wh0jUC3d1lSnEaSSdCwCXEUWY4t+NP1BlX8AWYeAiA75XwdyT189ZJGn1orptUb7shuPGe0o9vWj1ZnfGvmRQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1S51ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqsA/8DRaqAX7ovciHKFfsMknrsuY4mpzVHqLISdMnZD30yCFiy3ac\r\ncVXNRBYR0+fQue9ep8RLfF7aNvu+4Yd9ft5hCSwhc9RBwpBP3TAriKvi5I77\r\nYaxDICUeWD2iqIkutIAQz6zYo/8YyYCd6cw+8jn15dWIL6Yd7FfvsiGm5Hsw\r\nXpJMOHu8cUDYN5XZXakZEY6LWzMdBSAW1U6SkYNeCuywc+5BiVvMHWtGZTHu\r\ncHxSGp2g7e6RjLemLM+vzBiGBYcp9bA2oqUb43NQK2oRWmN1mhfoIxiNVe8e\r\ngpj99od2eRGGvKq5FTRdDjyJl+U+5XV+FQ8Sx2RgNMFHY7Xfv1EKpcTVYLcO\r\nXHIKjjDahK/Y5COX93HQsdeKfZLDDLfpTtyhD3s8nbjvBP9Y/iP5j/zyhSP0\r\nf+t4nuHa/I1TQ66SmmC653u8ebwBzSfHk1w6lFd9qltEIM5muQXUqbDAiSWH\r\nC3OaciTVGVD2QAfYjL5aMg9e2QaZKzMd8AnZYaobvInL3IVjcz8jM0n+5I6m\r\nj+bLDuUCpx+z5foyf/qfL5WZMt+TThb8p3D+djsENogmV9hM+PZjcl2Zcstd\r\n7TGjfmbls824IcAazN5EAtmQkLTSKjwLLTti1gpJQyCcD1rfSTENfcFoFjLb\r\nWYSTkAnbqoVSmilkJiBWeelUjHJzfCRfr68=\r\n=mz9E\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.cfb8f07.0_1658138229215_0.7880209671650527"},"_hasShrinkwrap":false},"0.6.3-dev.0b53009.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.0b53009.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.0b53009.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0b53009012bfefe5701fb82b1ce77fcdc080b569","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.0b53009.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-JsGAJkeSsqrfsUzAEapuxV7As7uMLzefcBy2DSNbqRyftZNS3OwCpVGim/yIqaziATWw/m3SUwJ8YZbdXLA0Tg==","shasum":"7a9b3a01479a83c0597027ac91f23077ca5767c0","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.0b53009.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMn/bPwiQsjLVztXRlKXIf+xAowl6NixH/7IyDZ6AQWAiAoptA5ZGd7iWWOK2jaYPV+uTF+sVscOZi7Y0UUa/NJTw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1TUaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBRRAAhSjYbfVFL7iEMK/ye7lXLGeya/REND475xjNHaZKnsvnm+w+\r\nmYj+7KL4il7e31y2fntmq7H85nV01Czg3aR8XK6fy2od1wjo40c21PiQEMyv\r\ntb9L1rNkOCO6ClL0mGrOLnyr7YkvzswzYC8thZFxGcvsyZbAy1jPnSqf1350\r\ncUl15QexNkVlbS2yZ4JE58hCxDzT/ucic7Z8hp5n+l2bNXhmbE5A7yiBkbIt\r\n6zIZGQ2GCiEIu2IhyhTUBWbgRClPYdl/zGwcZG/tSBnHE+/Tt2D5fhv5TsGj\r\nWd8xTQM/qhxl5rz5uYo6KF3bK41oW7+jPMlJvtA6txC7sMy8iLJ611BpT+Mo\r\nd+aim1b3yPFPH10pZ//EYAXz8NAgzTF+lbJjR9sf01nNGi4Edz3QB0sav2FK\r\nQN6y/E1ds9KXRuMU56kEqTvCzidEwoD0rIUwJkH8pWCh576sbpomjrTRBQ0T\r\nFxZecU2fvSOA8OEesJxDcQLuLl14J0OTgRYd+jHypOsDM9y4zj54nepguqig\r\nb5ZCBRxZ8I8n38FXgtpyazLKTYLLEUXo7bIw7yPFpv9SWFbCpFRkJaKWS2e/\r\nWLNPtt2olVop1BgGGhoLIAUOfGqGsLKyLvWTkImYJqRmLEjvG+0QOUubh7Cf\r\nqN0CINaJz3lhK8tpLK2StWepvfHdQsKvvhU=\r\n=Ux5g\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.0b53009.0_1658139930159_0.7806005192346606"},"_hasShrinkwrap":false},"0.6.3-dev.763ca69.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.763ca69.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.763ca69.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"763ca6966046ad0f959aab86d11c5b50c9e00e70","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.763ca69.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-vAURJfoDjaxL21kuBFpiutO9Jgj1kZ9Mfoav4vPKGJXAmzmVopg1RFgynw1I4+26LR1DFnbcXwTGOfzXrLf4pg==","shasum":"94bc8d885304c9657af5dc37b644d76f96f605d9","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.763ca69.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjEBPvdD+ggfxllkWz9Vzi5PIecOji4oMQgF7yxwJ82wIgJJhqvVqcEzUC/lquJvSrwR/chYNeFj/vA/sDXmN+Lls="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1WdPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYMA/8DnysScqXeIXDy0VJ6S3eWnyNrJB1TGkbyWU/ce1eWKos0BSU\r\nyRqNQ1uNTvdam6ZmnSGu1hymZvglz5YzE5XnkFaoG6zdfjWPtx92PCvbnjQR\r\nbbIz1ywjrohiQzjX3vNWoLdPFl/6l6AjVDKy/4heUmVWKnhc/qJRydF9BcNb\r\n4yPyYVRaa7Anfu2Rb0vq5VUr/ujKL6MD2wo4WtElz8htZO37T4wNwh0tS3Qm\r\nr1DXPU+lkjrIXSUwLUqzFV7sHVIXOKBgTtvIRu4nARqT/1jOrd9x2358rSOr\r\npJElF1qhkGGOcvrnB34b8T78AkSH/QFbSxaa9oITt6sN1sqruhNWm2c2KWUo\r\nGL2JKVoKabFcoh4LS5gEH7NjvtKUMIqG0kqC2+OZXnQ0LER98Ek8ArmAAyfd\r\nwcYDyMVVuFBLpcSM7A3VNtdUz3AnBghhahChvCEnV9zKQ10tI1ML/hkgqEXf\r\nlq8vgMLGxFK+fLP9uHFR0JlGcv97g723ho1rz8Dq7Ox0ELgq2bunNLX1hi9u\r\nPxkebtuCclsYYcs7YaTfjQs0Klc9q1983xtUB+EKy8je63TnvU/fRoVIsklw\r\nobaHjHr4tNlWWtFzbx79Z9P+WghQALtSvoTh4tHpJvlw63bYgGL0FVzLmzJj\r\nSjZowWwOhsY7QRsGhBFok8KF+LkQRcPSW0U=\r\n=sDVs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.763ca69.0_1658152783015_0.00872860794600383"},"_hasShrinkwrap":false},"0.6.3-dev.84853ed.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.84853ed.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.84853ed.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"84853edd7cf5fe9802446da9051a996a0caecc64","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.84853ed.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-vX9VwHYj+VHP00RSp3NAuTg1dKGGorvyzhkr4cC7LmDSWEDXc0uKBbKu/xcBSyfOHOcFPj12dRyFDZsv9BVR4g==","shasum":"d4646171a23b9d8313f2c9bbddbe812f11b0a41a","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.84853ed.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXy/tTWLVoR+lHNof9tTejguLxdKVICSPuJr6BewubIAIhAMXLnMsmFLjGSjuej6PBL4z+GcwAaJ9zN0m9EAnbMSpE"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1pbeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoluw/9Fa3W2r2kPEWhzFMzYEoAt2G/xTzu9RPOOmpK1chFRmyNokfd\r\nm8qacaq20Q0B7EKG6E/FQ1Y5d54yBoX9cnvG2zgdYmmBh8DiN7fvJwsmUzdI\r\nvWZQfdSQoXcIm8w63tMk6Cu9N1g6QyHuXK5iC0Isj9lc50vyxcaT9NqIY5Mp\r\nOKFDINeqvQ1+q2fVVVjTp54US0UZdyVNJxt6mQVMHMD/ecQM0kUjxxFfsyHx\r\nl+tx/fzts/6f4lEeXJlUCNr8EHLcaeaYyL/4u2UmHxjhVZiqkYUV1V01v4pC\r\nJWVBcUjd3lCnSA5OQPzif7LADDnj9jSaKL+eDcJ7aSF9TGWGsYnHYMEluuuG\r\nAZdZcamLEF7wLDL5VHyBk8arj1GksFPTddhE/DZfeD0bIoTDjRo3haYlks3F\r\ntFlt164zCm0KRfI8qSnK0b9zZDLorOu7HGA8jRDRyWLRcFxpPbMXZrTwJ7Ms\r\n+7uQzNo2dG9qlhwvBh5D+PAMHdQ9GR7jqmoQUz9H9cZja8tlTLZyywONRXWz\r\nGU0BpyxNbWB3BoSieUZ5aNhrbXuOR1/frridKYImc8lPqqD7bzMiqdVpnE+G\r\nUqyiw0WDnmJTt5nENUBhZVdZTkb9w7sHLTa6d/TxIbLY2GBFaew1hNyWMHoz\r\nHeO6LfTXAtZGaH1j48FA5OYZ0CYujFDU8i8=\r\n=bjjw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.84853ed.0_1658230494164_0.06543126989650694"},"_hasShrinkwrap":false},"0.6.3-dev.0c28ede.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.0c28ede.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.0c28ede.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0c28ede601d4b34752f8107f34afaf83f1f749c5","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.0c28ede.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-LgZvuEbURGNPNlo3JmL8pGqdk0I0tW5bj4E+Fg/lU41Qmsob4CTNznZf09YjeWG1OYAJJhfjzL1DYBRKU5x1eQ==","shasum":"1115373972dae8f37e83b06a4150649bcf1df505","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.0c28ede.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICh1bUXScZt7rtzvq3cy1GhUApIsb3hLygSNsj2JSk9dAiEA1/gW0SfNRbmCKj5slGtEAglLf0tw+mXURchCqcdfGYo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1rAJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpNQ//alBWHw+wfcTTvfrcupIPNglt+yxhre3Wfg9149uGFRYMkG91\r\nhZk8hxQsK44RwS61v7so07hgZVisyjcw1FR8oKpR/jScNJkhmSH9Kpm1xsCz\r\n5AAtF2U2odkEhEAuZwAQj0gsf7OC+fIEc8OLABUO+/MNCWHijub5XwuzJ+IV\r\n5TJRU6NySuVT92A/HPJZscUEfOi5msAZl7dRDWmU6JDo20NMJKEF0vf5fVRa\r\nwTcydqwQ7NjceelSZk/8TzOCz9wFR+vuGmPZqaDqIVLlHlcP4tjeTYgCwdF/\r\nGiJj6xOsfn1gm5kj46eqf3X71iVU/Kj6FpF+lVOYMik29BxivzIWRkq/5MjO\r\nQzav9E+U/s7sMviMVh8KOzEJA11Xs1UHMrPlr3o4iix0dVTJLIqf4eyLIMI0\r\nXnYqP4pmka1JUTu2fHyo88RdV5UTg4VlVxzwNuqE7gIzFDjTfoCBm45tmdnv\r\nsgdsrVPLYIH6XYrn6rIBqhaZ+J0rMIZeFt76C5GCgEwsINI/k2U1qMAKsJsT\r\n0iYINLIuoPQODdgls5PYxXwD79WREXqIsW6Y2LdFwu4/9YV+erhUm9uGdRMB\r\nNe8rIhNzDxuBR4GDcpBGhFPmmCpziB3G+8jLAdgPV6IZZSSFRL4TW9k8FOxC\r\n9wIjbHEaYylYsWHtR+8OGBdVXLlm35WMVY4=\r\n=ggc3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.0c28ede.0_1658236936907_0.35483285297471756"},"_hasShrinkwrap":false},"0.6.3-dev.240b292.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.240b292.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.240b292.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"240b2924961b6cd15a6dbee492546c5a15a8cd4e","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.240b292.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-YeFjlOhTFPXASC3nEaL777hcgV8DzG6raQl3jB/ao5Wxff02k7f1RONUvKHD2skLRjmwEQa1vlLMYW4TwvBUTQ==","shasum":"e3a124bbbead4fd1db404d350ba023637f9c038c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.240b292.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFc40np2rv649ARdfw2/NXK3tepUioRJei4NUsmjtKldAiAU0XvG5iZITJk3d74bUn0cWqdPXmHxNY4EDZ+CgZzLsA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1+DrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMgg//SYiJJle3oCGpxYalgCdlxrWY+dSFVROL62LuTjwIkowVpIiw\r\nIoa0LtAkr0jxkg+1ENMqC06aAOM6PVXtlQPpvYASlqK5KPnpPuIf8aouyteU\r\nnMxMLvzt7Lp2FNqm7wJmc4fZ97HdhZRJ13NiSnmZ37/vhEmlq7B0vQ/AKfyj\r\nxWwZNmiNiJo2EUCgXPn4KeW7CN7XR9fvzCiqcyJlB1N519KK/yQlBkM3iMml\r\nPMS0meVyCiUHAIOkukVwIIypCQq2jF6JE1xZXM1mivUmKgJ/X8U1WUGRgOqz\r\nEtHpjBYdkZ4bCx+jdIdzGVsfimVYgguouA5qyOJZyATTxNelbkgt7uoV3D9C\r\n68iAd83qU7Kb1kwMcWRZpHiLA9m9hRwfNPOVZoSw4HbUMiDIyFWj1daLtDsY\r\nn8tHOO/poTZv3+onWvOFjMrRG1xGwZQPTHBPFDe9iJV9u2dBvCJMevfXOERX\r\np3M+DTGJD3xOY0yGr5X0jGo/UJzb65Uy89CK02oI9rg7xalK4fvQOFgTKEDI\r\nl1ZBGcvTHnwNJmC9TJ5+GrGBUZHcAg8MLbeobY7ZnvxaZURTaGjJNn+Tgw5t\r\n57hUkDOhXSq7cdIh+xcv4CwihGcKAgUhlNSHzISeGl51dPXv9k2t/WkaHFCC\r\nnjfCnstCqaDwY9lfM6kbeV8BdsbYTsk++D4=\r\n=r/qg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.240b292.0_1658314987383_0.36253617950107175"},"_hasShrinkwrap":false},"0.6.3-dev.bba2a88.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.bba2a88.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.bba2a88.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"bba2a88ee1c4924fbd5e02e7f109638026df2fcd","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.bba2a88.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-7WCZ5YRyPngj3JNJssb+3ieEqcxi10+3cFUe5ioqwVejWO8n5FNH03xloW6ccT9kF2iJnyxi5Y5hjmi5iZhRBQ==","shasum":"53bca5e40f9fbd3aa50751fb18150ec3ec184e2c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.bba2a88.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICyKlySVsfKEUAon9siE2/20a/J4nEkTBe82AORB5hfEAiBmLcgu7+xj0Vu2ZP6UpSdv1rBX2yUmFT6uf/62y1plFw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2BnrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEwg/7BV9E6qFjxCrD+mqDwf2m9IQvbimGNl+VhUz7J9UwmpeA7nDK\r\nc7GQuJQuWwhtYZV1f93DDqVUkOcbQfSThOwLkihXDC3Of5/BiaIB9vjN4k6G\r\n7g7xBYAM8rHE5JJFMPQssElEbzQZ7DtNu/kIo5Kc8BDBiN/HO6rlpA+/EPv2\r\n7Gs1uV2nZ68Bff4YlMP6z/ZARNAAF7Xr+8nMTQOxmOXM/9gg52Wrqc/anH4Q\r\nSIo75IHDhIVOmotM+FjFdJL3YYoLfPQ0mtzLYc3TaHXO3gZEU7WT1CimiNYC\r\nLLa9ScKbrZ4AG1qoKDva7vrcLLGz4N21Qxl3mZTDmuc5pNgl5mQfHwzcm+6k\r\nqwkkPr5VZsw4U0WxpEsUx1VFMWER90bhQ2E01wy9g28AEoTTyLY2lWOua8Ka\r\nU3duSxpZimETFdvt/jk51BfMLYx7wIgIaREnUE8NqqQJmZBLkM6k8nlfEBnM\r\nhKSTP4wAvv9QgO8OLESZ1ADywFiwZcpCwbD1gn9srlysTLYuccGS8fNuawMu\r\noF/8ZQ48q3QdV+07Z9nE01tE4UD9bRemjSRjxWxzhPSP+yEEJY+DVHom6L/F\r\n9deYJpmh3DeNu4MAkKyD887vsGkVchuJ763aiP6bc64Ev69uLz88NQcJya2y\r\niCfGGD4y5OhYBhuNhNsAUMrc23CijwzD0u4=\r\n=tWG1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.bba2a88.0_1658329578952_0.8114790802984608"},"_hasShrinkwrap":false},"0.6.3-dev.2ac801d.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.2ac801d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.2ac801d.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2ac801d75260c056f83ec386d46991b046f446aa","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.2ac801d.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-/+h+4K54raz6U9OUl8ozAN5H+v2rbxFfRH3XnIgG+ZUuAeNyDYKnqIj05INhEkD+vC6E59KT430pRLduTCNh4Q==","shasum":"b0ee53d40054a0038ae4c8e4398bef39f1785a41","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.2ac801d.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBlj9RTc+eAPSg4yCKlarrhpr06GkytdfEnX1VXXWsfAiAySW1NQL1L5fxGKIg76xbuWxz/HdFsswVTX3z0AnUiyw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2CAjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Eg//Yk+stYT3yKO8ExNhDLq4bV9ZJbwyeH5/xEbi0EJACTqRzBzR\r\nj0ZGok2fSckb5s5KhzdaSoKl2O7MProe5fC0IhkyQAJ07KsMYnwOul/5HZ/N\r\nc2J6DYtMsvTvveQ7jbYnaia5hmP0pNt9DWj+UzWYkJnVJln6GId6RZLLUXF9\r\nYwG+Z3c5BSSPRHbSb5spzIf1Q6nJuyoonGRZgHfeyZrqhQ30WU/aC+PQSo6d\r\nxIXjL/rxIHDocHcfOPoDksgB3+RtsCRQaVXeCQFoiAuUsg3oiTAoxhfVvL+g\r\n6JM2+N+gPvs7BLo72Zw54MW0euPjXakavHkbRwwdp7Ygm4pHU+lR0CLphTxa\r\nnoK1u5jflBPJWqj3EM4f12xcCD98TJX7W6QXMidKef1RM1qbnLHjyuWQ1j58\r\nIDSWuYUC9cxANVUg1SnAFcwXjWMO2ST1XDT53U8MQlfsOGbc87xP2aUUced1\r\ngL3bsdPZZBng5aadUUYbHT77E6U2rJppKMTt1CViXu2wTAOfJ5Q1aGIAaIp5\r\nb9V1dq5Vt54Ze+o5FDCs5vzUIzFAxXLl8EJeK/KlAbWYysLx8342POeo6bs2\r\nAr6XAEpr4f8sat+/2jbJVUWF5aAQHB5wHl8V/iD+tqdi5vDKDRMGXFuAo1kF\r\nQf+G1bsSQaUNoJ9wvbrPb1FuaNPgjd9qsMo=\r\n=5iaq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.2ac801d.0_1658331171730_0.9330902105470726"},"_hasShrinkwrap":false},"0.6.3-dev.137cab2.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.137cab2.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.137cab2.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"137cab2801807f254e59321a5a1d8983737a37ae","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.137cab2.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-cAPMSZD8WPzg8o4zqVaA51S3xC3vaB/N1qC6FrTWGvwS+OdfxoSDwpNBKTt0PKBGvwPZ5sSE5X5MAfI88vhkjw==","shasum":"6bd3dd4b8e0cf0698f39e411035906f083cbe184","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.137cab2.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvSMtNGvbzm5d5uqtYIgh0o3KDAKT2z1+iTSJNAGNwiAiAORee66U0xtwprxTgVq26nVvv8iPF6WE8e10xwQ3udcw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2R1GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmon7g//eULFn2zHNl5+P7r+SanEHrPVrPwYOExLkB/IviqP2+6hjZDl\r\nWW5o0N19qhUhG7oXMyZJ3OhRddwqebySfpb464vKYudtS2GuRkqcTtWSWZZ4\r\nkCvllRMueBjvjzjPFSvj3kiJJ19TEHzmci1MszPoon4xgb1C15y36IlIxmwV\r\nLbyLPf09WFMiwtUnoZwMCvAFi+HDxIzMfr/uqQkLRLxHEbWTkUSJolhycCk/\r\nNheypqT1L9iyVcSTryyC5RZKTvaIt5CwJZ7NKuWHojUhppzgBJqekQRYbLDr\r\nAq3hl5tJDpNnJUurReyV9sMMZHJPl+lElQWDmJ8knAyKXg21xMX7E6FWilsz\r\nsRWeFCu+8DFss8iN5GjSe44Ek/T/sFasOia+13ocgD/k7DgpfQFylduzRpla\r\noNyaSPjPWqgDtnYAHBIRe8Ni5Qp2kyESwcVaoLTf4UVoOBm5Jx8yGe+ioq0T\r\nk5Tg2vp2fo6bnYa8a59Ed+cxo0epbxped//QZAOAEWkZdTuH6qApaF7wpzjB\r\nohuMq3y6ySnpm7mMwa/6YSksCJFfs0PD7FpOyc/5hjjH/LjcqrjGtl2THEgc\r\nzUjPAXiYfg/oVhYAxjdD1qi8sM0oSqgnEauenkAZPXJNM3J1nWBZUYC5A0fl\r\nslM6s8OGZCkGn/wQoi8Q58YYHK+NIulomzA=\r\n=vGlo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.137cab2.0_1658395974347_0.614164817194156"},"_hasShrinkwrap":false},"0.6.3-dev.7809571.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.7809571.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.7809571.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"7809571d2950b05de02e83dcbe45a0658d281018","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.7809571.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-X32of7UqiCBdpnooJjmkYLH7WQzBAItA6xPKBb4XJKNk8xWkJmXqCquflXzENXNzpLx/4oC0suf0JkwgFchcXA==","shasum":"3e979af65bdc91181fc7649ddb56ea08dcb7230c","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.7809571.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOksri6zgDPRt+4hEJaDUfxw6gND7ddCqQwhYVb6DMbQIhAPWt30Vcuh/eE5CLBewSUwkPCKECSgd2ue2jOFaICymB"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3lhWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFfw//apfAqgTIpCHiIy1WT/zJ+sY21mUDJBb0jItJ3G+i0AtvkAmv\r\nQddhk1nRF2lLJGPXpXWW11LJBe5WnhRQUwjEhxVQ5YZ4OhOWv2QjAgR2aMED\r\ne+svqmmMdaPOFl2mPl/VwD7DiAe4nkmwqzEBTE2t6YoinvKLlZHM8K3YYyny\r\nx1/1saEDQNOniCUS8a1LKUVUN127JGkns4C1FnH6VDDXVw7AIkLRcJu82Kjn\r\nHxHnMf+f0A1ZgF9PthukMxKmRldxiJplr/c+OhvmDlsh9BCJZYkEl2/cb9Um\r\nSs7wsGJ0oNWM+TSWWeQ38QMpCNSLog6ge+pGc22VfGwFFhqCFql9nBXF1wgm\r\nYl5eX2SFn1PSQ7C19LbLhElkMEdrxY6IUw/HkvChJW+GYV0oAT27oKDt3KZN\r\nzqZ5MCfDUBQRZViYgvW3NiHhrsmn7k52C3xAGl3aibmGPJGJae/Sx/MR+VRn\r\n4kyZQDzD1lxCPWOHHD+GW3kXcDTaPyNSZ3D0+edhgMySHEAC68TvxtFbTDcr\r\nsxGZnEIC7pBdxA3bkbJMB8R/sl84Ibm6q8t5WI1thdvjMTpyiRP0USTucByG\r\njPezSN+4Ouuh9n9IoCpCX0k+aJMdNvnPKan9pkKwL7lwR3NAEttj/X0rVg29\r\nZsKvBa2U/FBJzr59RbxsHVwQrPTJJagzznk=\r\n=0eAb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.7809571.0_1658738773812_0.35575119691116686"},"_hasShrinkwrap":false},"0.6.3-dev.f39efb8.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.f39efb8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.f39efb8.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"f39efb8d08c38311efa9663079f9df1d5eb85ac3","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.f39efb8.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-GVKw9ql+1qan/wMUoV6HgZs8zb1MJ80hFfx+6JHlpsQVoV9SnmfDFjskIaKn+7a733jUNdTjzYr0jtzUbCoNqA==","shasum":"24b89d6823f2eb9817c7bdea7f707b19cf9d4065","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.f39efb8.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcTsB/NH1y4SrtFOI8Dx2ODR8e5uKZpHx/z9VJqIhXYAiAV0LS9DJ4CnWpyTlMsYcdi/9+ct0Ir+B11hryUADBr3Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3/RPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+XA//aeX3sw+2CV713oLowYUevOGedZk/I6mfYPfc85264EHAlYJt\r\nADe+SPEcgDdd2rGKa4mqQpJBkv+cYu6bgFMRt4S99hlDTwDX+hHfUcZYiUDm\r\nCMULxvtL4+KFv5E0SEdnoRHeB2zlQFwV2HDUgQe8QYmPXbCn+hKDnSum/Vvw\r\nggz4UOplhlYL7meZFFjCe2WHX2LaiImzpC6zry/aslux62o2A9UUOwJqVuzJ\r\nTF20YZmMhIDeF4r17DkmFDhsPjfvaSuX9OTtbxgRTCXBp27B19aT82Sw3wb3\r\n+tSm+MD7EQIwoDky1TvAhYzB4rDEPyuK6tJP2RWio51/qD/bdZDXFWOZL2v4\r\n9rhLUuGG4SmHrPEvwp0ch9AjvVYFtM1JrRaYHiSouin9LfIBfE8TYMchsh+A\r\nleJauIEFKseanYjWtgWzWmmnbEtTI9aLp1T2ckqusbKcyE1CkOsAfegKm1fd\r\n4kY3/zXEc7VGcnSSU6vTqJPOre0UxotX4BWOM/gRA07rwdT6LG819xO8yTwh\r\noPlibDYh9WV4VQ6cdqPwPJtSKixLBuD4yRWVxQ4oQguklEhNOtc9veOguDGx\r\nfa1P4Dnj7wrPPZ3FNBEu3RMxKT18eP8XwWPC+ymR1zUcvqNDy45aDa3316Fu\r\nE2OvCp4xkP8mR+u64vVjpK6dOaUbIYYfsnk=\r\n=BIuq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.f39efb8.0_1658844239159_0.9647554196189316"},"_hasShrinkwrap":false},"0.6.3-dev.49897f6.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.49897f6.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.49897f6.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"49897f6fd830471ccaccee090c364a3237fbf9ed","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.49897f6.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-TZEN/sDQsVYLmsL8otu8P3mNQ+wApxckmjHM2ANLq6R3u9t0BH5/1aDtQdJyVLIrwJG4A6+11dvAE2Kd+u5ONg==","shasum":"6ab22e2406edb7668b4974373f5cc3dc4663d29e","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.49897f6.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbntwSrJVRFomkxiXooh88b2Dz8mmWWgXbDBtvjHGPjwIhALhZD+zCbwH74lamA7Zlo+IVdUe/p22BnHp+BRXOMQTe"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4AB6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpowg/+P1+WsJFtq46oBgQ8h0c9eRtAxWu43XmNd8ZhRhi+PVQOBxRY\r\n7O3q2TvNV654RL82aHaqWNGV5FNpDAia5Q0Eskr+72kBWRS62PbCmUoELATz\r\n+JmruOembakOSAjMsw2Op8aylq3F8o2kXoNuzkew8u+tdgk6IIT+Ch9bTpj3\r\nWsKlZnEb2BWpTfn85KLzWegfpPEqISNh8vt2ulkCEoHJo8haXEqSyrSj8iR0\r\nTP7GVl880tamRTHO4n/JfjOJ6PdmXfyf2LC2GEG5/a24dSmTrNd1458NpEyc\r\nbuV9l8cbyOqg9vHh7V3W/cfYmyjfajbSEGuDODGxIoxGEiKOutF9XTlnGY2J\r\ni6JLj0VpAO4/XlBx4q2tWbJDvfrKnhsI2dAtzQV6AzDBiH/oW9qld6g0DMJJ\r\nRlxWurDzm5Vtuk/Cngd/g+ks5RgYxi26KKDKatxiOYIRgcmJzoH8sNK7DOdq\r\n5Jzo7n9D9PcfdeUeVXa7XQjsXxDgXApRQUvyB+v4iOj+scGJw2dhWEo6lilC\r\nj6AKS9xFLpKeekCIA+2NNXAa2Hy+WIbH7N1aIOslSE6T/QZA7as/Hp0AGd2C\r\nkH78+StSG94PxHC5+563o88hW/6D55gtwtsqEBaHrtaOMrD4a086CjeCxsNY\r\nY71+EatEluooEb4RFCtKtY+g89/KH871LTI=\r\n=jqHP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.49897f6.0_1658847353992_0.48196386053728046"},"_hasShrinkwrap":false},"0.6.3-dev.d896783.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.d896783.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.d896783.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"d89678354025a16279814d73e3150ed7690afa26","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.d896783.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-E8Oxmo14PYxoxDmfCeOGTb41xcuhdcIL+jpgQoK5BJOt7b6nL0u5UTVOn8eMJsA+FyXMEuvfmD4vHOi9osYsEw==","shasum":"a31a43ed58bac2d33819f5c4e1f18e09c449606d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.d896783.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICvMGx2u+e4qrH8Zsy51fyZsYROxXphNF1oDw25PRymYAiBAUe/G8HT49QFyMcH3sPOmIYueWcZYjlEdynNl/qmC/Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi69C0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpACxAAnwwvjrctZzqHYGDiyjsJMSpQI/IWCAVCXgp1EqvfGe8YQ0ci\r\nOON0DX41NP/9RPjCGGTYa7cee2n+vezUj+L0dO3JEeFyb2p2liEKf+T2nVq1\r\nuh+anjbn5IhjCXr02PIoihV1Hlk2L2maTdxiVd1+J0z+ZJXEXoZMrwiyICIP\r\nVLE8+IJVqJOC/zriFODvgBxkZddLhxXInGKDLIHd10LVTr4t5nhENNeuNmJf\r\nTnseh4NGTLlOeD9d+45V8Db2IO5c4ZoN2uVLT6BgXfKHpibsgLuvEIBwZNpu\r\nqB8qVYKBejgsSKeW8IWzcME8RMWyF/Hc1jza4cX+4R759d43JLEKS0zpiw8n\r\nU8pGtJmPjhU1gO+Td7iYT1sbj92uKMA0s8rb4/eVDDQ8BneZzdMbVi4X/T7Q\r\nMNbBIeu/awmThohWIJUk3X+c/Z9g+NZTNGtvtmx3UMEM5MrdPl6jTgjdRQsG\r\n7Apvz/7eHHNE/wiLoNbqEwIjsDDev+DNXUSlmP0IB+9JEagf+g2a584rH9rv\r\nhNf74e+eh4PW7CkNgAsaL0FWCOIFRyU09PFVed5P/PNDVPbLf4qs97eEc1S7\r\nhlxN1Rz4br1DmFFVQ++LaBc0ftvbKSX4TRRKXlcUJQLNpEioZq4TUy5qkWpF\r\njNV66qy+n67UxW5f2knX14J7FdttNbVOlAk=\r\n=krj4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.d896783.0_1659621556796_0.36386934880226796"},"_hasShrinkwrap":false},"0.6.3-dev.9e7fa81.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.9e7fa81.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.9e7fa81.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9e7fa8147fa5a8ef0f7f3e0c69a2edf8856e414c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.9e7fa81.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-NJCk0JU8bofU9U6k+xMDsYQfC/WMIdyp/qh7AGXPk3e18lkBkQtXYB71AuChpAJmpJXLfMruZQdskwJIP33g0g==","shasum":"b247046d5feb285f6e36af425b2e3385db470c75","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.9e7fa81.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXx+AAf7wDQrtf+LR0RTZguw+8SP2SZJD6+KX/YchA1QIhAOr4KiBUoQ8zK94VxT6SiPFpy3B9n3eZzXlg/hqI1oIK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6+KwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8Ew/+MC0LssDMI3fnBG+Stukz9IKE00rr4kR9lokhV8RdGtihYkKQ\r\nVszms5x+O2zk4BoEBEYDPZdgLOUj4yMLGQQI+UwWJCPpqLvOaTW9lc4NMpOO\r\nhsShDjTRdaAekB1T++iH46QdH9md7ey3hvSwv/+lewanF12DFIhwtn5+ixJe\r\nlTeWvQcnwywM/meYhuAqtvWfk83SjK9puX5v6EpH8jG3TZ2QVa8JGl20BJYn\r\n/ug9F2OhLt3Xn3c7H79H/n3vW55IU5LR5UzDqUOO5f8RfsaKZmt9CYNcVVfo\r\n/8oRJX96kXG6Yi65K2pt00I5bU3aTBTMwT5y8Vi6Jq0J90iH52shDJBFe8cb\r\nziV1KUBpUYUz1KGsA41QOiltcWLZ81FOe0ISLfxf5EMbreZKsr0Kam3KY7Yg\r\neGA5gMVcHDuQvHqTEe9q55FFVq84vEU07vBTmAgI6q4kOkLV1zK9ZsDnG3sx\r\nHDVqnU1VzdTuThymMNMMIWeMO3ocGsJnV1aApn1T3PF0wZDnkYwLoyE/uo1n\r\nX8mJw1BbKLSrUp1WutjDKVK5HUOaStH0gpikKf/QKsY4FCuSVcDcPaWvc/Ax\r\n/DH5mn2N/cLqrfmtXcZZXOytT2o1KrTGZUGoWn3+mxzFff4FDHUjPl4gRW6o\r\nFXVKLVbQfalNEdRktH0qDoaU9Lc7mFhVHBk=\r\n=7Lc2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.9e7fa81.0_1659626160022_0.07782600007878626"},"_hasShrinkwrap":false},"0.6.3-dev.ab0fdb4.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.ab0fdb4.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.1-dev.ab0fdb4.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ab0fdb487f3ce9c0becb1d7951d78c68e3ac2ed3","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.ab0fdb4.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-XqAPRPUMs51/0HPj9QBsW0MkMsdU9+nPakmQWFlJYX4/M7Cnj5+QdR4PFfA0COt0xr/d0SzEspl/UzmJ74NZBg==","shasum":"74063f5fb1cb6d3ed3a094bd28af69db490e4f84","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.ab0fdb4.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO55TSVZFKtmCwubnRbwYd283FJ0QKN4at+DUEQ9ZN0AIhAJGchrKzmwDgOsoSYp4rOWh34w1DOzpoAV1j7Tt7j6xq"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7NknACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqrzw/5AQQrsu1Bva+T7ezX6vuC1SMK2rrgxH1a/4wxpb/YNdVe31rL\r\n/XvpAdcixZwMfMyiY0/rQjRfnNlKusOwYBWBFdnCvNdL4XGcvgVTNVIWtcP5\r\nwZI3tenQsL2OnonNL+1R8aFoTTkTYyj9Hz3aXU8eaRJqlYB0UOci5c58P1kb\r\nHR8P6hDCcYCjtvRJ7Ga3Ke7NNeP6wKtyt7c41RTimiQjt1aC1QrRvZcNmoa7\r\nIAlcqBeSTGgDEUExWjcWrlxpuZdzCSI0PV6XyIhy1zOe8DRACD1NxdbNW0HF\r\naTmc2tTsDwOhsUPLqH20NH8bKMVDFqJ3sqgpMocSBlgdrYn80d+IQOOH1YUG\r\nyB3hsn282xUhoQrHFatVRPg3nYb5+I4T2rwLYZRPJvHSEFdb46pL2bIYSRDN\r\ncIXlQqEJhMMlaEyvIyHTHuaHEOFRNkFgRkFp/6Hz/gIP6nLxGCpdokFz7bun\r\ngwqL7H8e9GxdevwUvB0krcvE3cPoC/WSDy6RSBCrV4ae1qnHrAQCRec/6fYH\r\nVMvgty5sqF6AWQ00Dibddpf2M/nD+MBHLUVvjEThU7ZQwf8Je79KKi7+aybD\r\nxpK29wfcfDthJ/fHpxfPIBaw4204rIfTYx/7RtWpuAXrtGvTn0354W4Dwqha\r\nrapcPED+yCxAGzxZ2CyjvKzdnVZe7PcU8sU=\r\n=x3z3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.ab0fdb4.0_1659689255152_0.44249426683922244"},"_hasShrinkwrap":false},"0.6.3-dev.75a0001.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.75a0001.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.75a0001.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"75a000190fcfb12a8fee6da5b1a2fe198e4f518c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.75a0001.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-3zG8PrkUBrRFleKHOmn9gX1q3FaEt0rPwSE9MV4Gup8AuxGsZHMWtNfvHdbugocON1ZzqwNklPuk6SgFnTo2ug==","shasum":"9620da8cd76c79f28d219295b76106cebc130450","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.75a0001.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu8EsDdS6B1s6CnPPGR+pIEJ8RoodFd7pUQOG9vTJXGAiBxZcf5dA1PdwD00S/jehOlZOx5s9UZJCbnolFNhvhYCA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8O1yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrS5w//RukOZ6S1y27hLgGzG3SPEThJqoezDCml+nw/3mvySicOjDsK\r\n3VV4RKVQLUnUlk5b7aZTdIQW7XCtwYyLKfPY43wjUQVcDZksWJgl00OEosuI\r\ndFsTqUTyiZGrVgzm8La4ERjtGnlLDFFcMf5okYL/b9u3BNHhh8NVWIjBO8LA\r\nBPNggJRBQwggicBzTfsu1SHbZaBejStFD/+WB0VItKidtN/mgQzThx0lvCeO\r\nSBoBYVGpsJlNc0O5wowVMY4UxGy2Ch42t0Bc71ADolMXkUmASf5/htHlgIAF\r\ndQRX2cZUQnz1W+0xVPWEb3+y2zt4XxnUeADHg0Ig5AcZCaL9liTJpdVI2hy2\r\naWis3A5e6/9jZsehy1n6CXNuIbddv21BkXG5WNtIZh/Wdf5Lq8bd8Tp/PARs\r\nCXgY9smnROCRt++SN6km8Iaksb4SpV03/tOaczsKQZYITBBrG5QVKtFm0Fzy\r\nfP3WgPPso+lx0QpGAcwKLY1e+DCWzhSyBH3NI0TUCp3WMaIA4P3lOSw7L34o\r\nQbofIOKQ72uCjGiojFLHCD3C2ILpsUfRofjGzH0Dtm5bPgTA6ysD1yp9EsDW\r\n1yMCXJ7br7LBwsFXRjfjv7NJnE6nn0N0XpiHuTbexn1SWWMFFmiabRg1Wyvq\r\n5w7wnO1FSlfHyQ8FkGzbuIdrdmdPu8CQH9c=\r\n=n4vL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.75a0001.0_1659956594198_0.5668420223806705"},"_hasShrinkwrap":false},"0.6.3-dev.b9b1fe8.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.b9b1fe8.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.b9b1fe8.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"b9b1fe8a419b1fbd9501595141a2f5b9815d3727","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.b9b1fe8.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-HR1foNFL+vqhDaGbFTK3ndhPuNdJixWR1egNxTEsPpB8rd2AMrBqEjNmahnSm7AJMqhK5LwNs3qEQfPB0uwrKg==","shasum":"14e51899ff2cb7e1353304ee2a9d1109f7b54e0f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.b9b1fe8.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCinmds+9XRu7j7aoZBGa/YHeE3d6l34WdFqv5FCu0eTwIhAPHPKNwiwaw6bj6iXqGngN58zzBcYidgKLlkHJklUdBJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8mBPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9Tw//VCch9zFenVkwXlykQ8mU3GZRVwmhWhp9k2hFMyLV40C3HobT\r\ntAOasj+MlWU0qDj09jIVxK0puDdQr1WL8IBDcnIGGdgUfhFemAZlNzrUTT8y\r\n2QrNnBpovlyDa2g88sVCyo9MFh+wzBKDo7OlK5YrLMzk1b0ony2HQhNnmVFi\r\n/eiGeNK9yjkj4d34ymdO4oEVOwafnQAvRau8uLFhjnBBPJ1ik0qgr+JzGN0/\r\nZzHoQOdrR6FO4HgUplooSDRHvrZQkORlS9A4kAMmrpErf6678X0fiUDpLREG\r\nSTyOBZAJSALbYBVY4/+kAO64WFQ0qVhoFXOCFwqfUjSFA28RVAoz31Dxl6CC\r\nzJUaG+MnF+yS1nThUtVVakixGLowoVoPsEprUCfgCwH7uxHdulv9SG4xdOLd\r\nqpFPY0op4lFI/TzCPPvfUU6tw2zwZ4qbHaZeJJqMouQh2LKYKEEAWqE9A51o\r\nDlvMHaT8xFNfrlblJUJDZjgMbuvHcclRiqPuWJPeRPnj79fuDQQ8j7XU9GTQ\r\nDxIC8vGqJNxhFN2sDVLQcWGeF6ArlYT4wgkc4gQdU7HcnFLMthzA538XhIMg\r\nbPAxWeykPSQgFSc18/mrVSthO8tmalTxd+bric6AILHqLieLZ/pa1VrsoS+i\r\nX8hf8EWt6P/QeNOJmvUdYx1STm/7foIEfm0=\r\n=uN3B\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.b9b1fe8.0_1660051534831_0.9839754874077384"},"_hasShrinkwrap":false},"0.6.3-dev.9e9228f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.9e9228f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.9e9228f.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9e9228f6279c5876a99e3afef94b94de030323ed","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.9e9228f.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-DIvVSVIKN7uSqAYOK2bp71LbDX3lKMiR7+qNids5FQrAsL6MAUSZoukYGEZvvPMYfYbFBn/R0uky0IdhR1xRpA==","shasum":"cc172e549ba1f28517c337328bc7950820abcd33","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.9e9228f.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeawVBNFDQY2jEf9lW4v5XwwIRr19QbMG4y0d1vZocXQIhAPeuQQhmZBQGJTBERLN8Ms7ojK2vf2DDhrm8BsDz0US3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8sAwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrxkA//bDnJHBfYDhC0toIlaL3SEW1zGdWUUYrkMwiJ/LiPxfa/7yAl\r\nAh4twjAyxOZxhqTsiE10YZFTxOBW1ta/o5kPPL2DeNx7XYZ+9FcKVFpt3b3a\r\nC5nLPDsdhOxKHNTsEnCeqfrKyOVO4f6qRp6fK0YlKw4GuR9QtEfZh1nzNuRu\r\ntd63kM9PoDDrTyFPmvzjYdE0ZjrYd0cmPgAy0zpyvakIFyN2B9XiLR7A2bj4\r\nc3QZguI+iRwxmyrPFb/OcKgDBqwZnPUYic93907LHp5P2v+hFhheAXiN7Clx\r\nEyTYQ7QY5Bqv2TVAIZZC2vole8bbsTViCbeDfX2H7vCTMkbiR6ctfr3Al7yz\r\nfVRHE3cFuOe0+kdAOaxslqI4QiAdboNz7mpRmlsHjP2U+YgfPovLeCnQc1Rg\r\n3eFsZyrE9eH25gkCJWvlUuKygBM4A2pEZ0rfZEHXc7znLPVzZmGmKmC87eKL\r\n8YJVUUlaH/51G1+auO2NvYx1uwm78QVHR9+YBl0l/xpiQZ63kn/0rNorS9jI\r\nSwrT8AtaAsgX+XG73IvTdYM1tVgq/q79EFpkUH2Sj1L8QfPdi40KkryhSdHO\r\nNcPT9uV4ps8IX0p+u6VNiBFOrrweBPCVNE1VBh4cmGTF3fadmvoNgEDXeBbS\r\nJcPBx6hXH6WaP2YQzoijvdBE0ZS4zvZhuUA=\r\n=cXaw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.9e9228f.0_1660076080168_0.4782942183096923"},"_hasShrinkwrap":false},"0.6.3-dev.0079f56.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.0079f56.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.0079f56.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"0079f5663795f03e900ca098fed54d0625bc2c45","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.0079f56.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-D3ZZcNIXt+ZO+zVT+Ce7Yw3Pf7IY4RZn9h2fF2ZKF5IeayaJ+Zi/mPI1cf6GIvOw0Vql8JdehCXw4oixdMhSng==","shasum":"e54a5877c698942c0f223180e0fd5bca571a1ddf","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.0079f56.0.tgz","fileCount":35,"unpackedSize":1054785,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFTbx6d+YFEnQTJRC0JlBmNb93M9ovv43G8sBAF0pYGtAiEAkTKdwKy/s9mCxhkxtGOnv8M8KmLh/GdruvRoKiKoG/s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi88ERACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotWBAAnmt0BhTgNV5b6QsuNLdc809S3w1doUnoXw5RIO6NQXFYFJGU\r\nFvu4iFj2uj0nxH54J0FCRudzKnuKOiksvPUZVV8zzaruAr7p9LMVWh+w1Jmx\r\nOENTBJD43ZJJfMUxRKRn6Sa9rXu+3Y72fPMonyr+sbxtGCzHahi0Gj4DB3Oz\r\nQRp1fd29D7YaaMOkinzBvUAXAOvbYOhoNCrEXgmhkjOAeQSyE8Tn6gEf7TTi\r\n8AWMGFCO70B0lnUIj2o3gQ2SZZmmoVItgcTOZTS8xo7Yeb7q2+CiJZv2OYwd\r\n8/jUrLo28HKT4mg2JXt/F0Zd/MHprQDjHzUS0LBG3oJaZRxm8Y5hF4sMsntO\r\nyyXXhG3CGNo8+VLP8D+jLpkKtIfyceiklUWg0CAE+MBFCfYn21XgtvFIkcg2\r\ndzMiRXwT0DG1F6/7KUkz/rqLijzkGMYhAKtdROqmGsnD0noLtTzRsUACHwR2\r\nI0DSPTRMFmq2hvFXHQloVTnC3AY7+h4PDzcCUCqk4/FxgrnflFsuxOGsVS0D\r\n1LDI72HNXbT7tsj6ysnvusuKCh2bxPT5iQevlbMAO158y5L73/79BN/7s9Pu\r\nkh7HkegB2+JVDYXte9r7SO31wn8eiAdJ+sYCJ7m/OVrDz6USA87HxyVGeFQd\r\nv9CJqhkl0QPUJWAlHbOw2a/g7pDax4w5TTo=\r\n=jxQu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.0079f56.0_1660141841130_0.5049056547522608"},"_hasShrinkwrap":false},"0.6.3-dev.bf84335.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.bf84335.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.bf84335.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"bf843353466f894fc51ce0416aff3a8edfd5c89a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.bf84335.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-v5/0pb+aV0+6SkJDLwWB4DVXy+Ij3+miknbkdtCJLH5o/twzt2e/vvpKRQJ1gBPnH3pfCSpW88bXI/JKmL3LlA==","shasum":"6923ae7113bf4d8955dfc72c2e794d94f7b1f966","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.bf84335.0.tgz","fileCount":35,"unpackedSize":1054883,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzuX6yE3eYmObM3B5jYO0T180oAbWt2DbPQ5712qn2nAiA4GybGLcmctLRJQWsVAseSy7vAtGgbSDZIDq2TXOBSpw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9P1rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvqA//T+V5Upb/RAq2j4eWGFRwQeRKlfo7beGYFlc7MPXtiv7FARxS\r\nJZBX6ZqConMwUtpxTcDHM9ZMVbQmhUjyqt6DjEP4NdCTbGRALpVAjvQqhjCe\r\nUIr30gyXZM3IhfGlVhoTyQqT9hdQDhOjSWBh8fxMx76f9ZUmXsfBtFG3LtVG\r\niEVsdXicX0rw3yh2w2hWGyNdqbu0jOmJrbRpfzr1LysjJZTckFqAK9w41k0j\r\nTyXaWeDdM6rcPbXc3+dpK3hBQobXwaIWbo+Q22voWsWiZ6KxyUnhWVpvLgGw\r\nm9aRUfBFKT+8f+uQT2fdROY6Kg0TO2txQ9ona3xM6zHo4KwKZB/ot5dZQNU9\r\nmLbvViHKiwvQMWpJ6lOA9H04w7gihWao9SpYBfEpYbaOhjxEUjDRsu2D6Hv6\r\nQtV003aUxtomtzDfGRRDVog7oKC4KxRxo/TlESI4RAiCEHssfyvwTsTyG1bP\r\nyhpcm+JEep61k/x2ZY4YZbxbQs9Q7pXwxsDOwDB/nmX+v6/WxsL5MIpxjk+N\r\nzYtr7ejox0KWev+711e1KwY9rV6gPrnJebFNvC7L7Qwj66QjqRuxKXUw6d+N\r\nibWVhbbcVHmLRaiAuBK6eoU5zZ/sHMORFLsZoAozL/tc1N+2SgCsHp1KNRXr\r\ndaUSpVnZkNDuiApRSqCZyt7adgi0ixESFbA=\r\n=0Sxo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.bf84335.0_1660222826927_0.5024910516478951"},"_hasShrinkwrap":false},"0.6.3-dev.d249828.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.d249828.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.d249828.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"d249828369a5a75c459ef5ca1e7fd9ca80d7fb52","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.d249828.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-Cig0uktgeKGN80kQ2LYJ4yNDxEOWmNx7BrnLegS4pXR6gOHcrdQ6b4rAlKYjsWRz3rNWvumnAW/Oa2viutee3w==","shasum":"478e2a3a92cc1d60428dd5150615d6a198681d1b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.d249828.0.tgz","fileCount":35,"unpackedSize":1054285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxnnKPflp4kKbeIAQotaLvYhExzUK8bL9WnwKk4bD/7AIhALWCPeUDeLziMsOsr47ILff2fbVziCrucP6TnztTAW8K"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+kbzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFpA/9HokTh3smJiAJNyOysHfr+mbSN1iMUV8x9HVweBUFh2Ei4fMO\r\nBdyoU2718fZq//Ztv6s55DBD14W3FaBFFnUz5s73sCTVb4YYQShpNHRWXSIj\r\n/lxQ/lcgO5Rty/i1/Ywf2aHkBfYK+o8bG7KkjXewEqseVaErOzqSYccW4gaa\r\nhDkgLlqdDmBXMixGHrW4tggrwTVFZmAuyRA2EY/vFO6tJv0sMlHg4zIEt+w3\r\nbeVzyp8y2MeN+3b/MQSHrMSMLnzDCP6+7o/ecpFGQO9RZ+yvE6pNhghuR53n\r\nGaUlCSZF4gJHc3+nUYt9OOXCkkqGgv518z7iZHQ2ALFYx47zkEHRe5t3JFq1\r\nUGYGO3GJynA9TmLBqc05uZzs3MUR1lN6TYDmojtbLRn8m2UX08dAZowZW7/q\r\nlJRn2WqdFwjaxwu5iV8Fb7HPpNLzABNalQkG/gRFZW3tmfc3ACeiqBXRiqMj\r\nJ0zEFEKTuCGc0QyrZ80DcsNZfeKiDRJ1q9ioflwp5dADG50KuWXP8SmoP1S7\r\nfQJ+78zEOzrhDFCIpfNBkgz8cuMvP6PZCMeyUmUDv8kplx9x8E6xZAPRmVgC\r\ncXx62uoq8WK4xGvFRumxVtVTTJA0vaXXsv4GOH3k/iwMLNxP691JneMpGFup\r\nNyZg3Pk8CGfMzcSybGyiOJXruot9ZgZ3Iz8=\r\n=/RY5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.d249828.0_1660569331560_0.8310928760262646"},"_hasShrinkwrap":false},"0.6.3-dev.8464790.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.8464790.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.8464790.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8464790646df85259748b6cc065398663366f165","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.8464790.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-tqh4NYUD0jaWlTrlPooTNtA076K0AKr3oWqxOczUjgOTF9UYJ4KEcZMTGxfmRciAZBfvyA7tbRWWOg1LIwl2ww==","shasum":"8166dd331747b4a6d6ec2b39ad5418c87bdeefed","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.8464790.0.tgz","fileCount":35,"unpackedSize":1054285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2UY+X1p+FRrB1zc8nNT/efmR3A0aLFt058o6k7J7+uAiEAz4KqzgsE/2w21VLdROmAsc0sB6a+TMmKElsILCfX3cA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+1s+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNqhAAjXi5+NLOqD0BRootJOOfN9+EfkVYSGdRIPc1wg1JN3AnzI0t\r\n392VW8EVR0AcdyfGqZhl5lZ8oke12HhTiTm9nro3Xc6EVJQaOKyWuQ7dw6HW\r\nw2kr6ObCK4Ubv4+iUuTxOeeE5N+4mI1RMeaBaC4X526t9tt4ttMgGPM8e+qG\r\n9Vsty+8oYGJX8SBRTQs+JcR/qL9gxI6JJJ6C8EOf3L1j46skPMcQTB8O3QFO\r\nBxjMjLwykWSLZv4jFW/ESIPwbtrU19O61+raaMLIfUdR/NUU/6n+wgXkPjhg\r\nspAhxPy8LtPoZ+gPD5UepU5DmeX9b63MeilHjH3jtfowHejbK3AnbD1uA1KW\r\ngtt/RD6nFaUxlB6NpT+xgJgGsVTBN8723hyia/gOOrnE2vlsVOlIOPFA44s/\r\niCmbb/mWI4Vb2btv6hf5UN7qt6PGSdcV+igWzwhzItjivLYOHjxShUxE3t9k\r\nKHUl24YJFt9zXYRG7pI/0v+cCufTPOOc8GZlYtVIT+zu5qQ384dwUq/qh1z4\r\nCQGzXWG05xbcdaChD4ZQurbfYBKM17+f/9qrxHNzkb/nAQCMKMZth5h3kjtF\r\nD0KXiBHXrFqJvAIU8XcyQ5lHMY2H5JlaQRDTrZrkUdwr8rFLtyQ1/vio9qm8\r\nZGIUBxshFSthV2fF8azI9r81Z68g5CT3uKg=\r\n=ctlf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.8464790.0_1660640061812_0.7939049316119975"},"_hasShrinkwrap":false},"0.6.3-dev.3c955c7.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.3c955c7.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.3c955c7.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"3c955c74e7acd1fea5a9b63e25eda798a447c109","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.3c955c7.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-TMLwQfULYNfhjnY0Vdx9iC1jcZRhpwwirGnDAFIfoqXd53AeTzdAfmb8WIUizfJmiFGXDBXaVJBEcG1KgYG1XA==","shasum":"ae74fea2993a5a7866ebd2b115520d3bc7b36dc5","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.3c955c7.0.tgz","fileCount":35,"unpackedSize":1054285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIoWcGRqv574lHRfJ0efqkLTa14Zmy2wej9vATjUR3aAiAI4Hfus8iebP9oRjij2BqEOzxQEXI9q8KYIpEnhARzpA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/CQVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYPA/+ORFtn2RoY63aR3GWxM6I+xQsmE8WcIwmN8jzUU7KqECftapj\r\nuIgQyYRrf4XKWbsJvqWm7z+qKSN/HhZifNlyyf8HCahUz8gnDgMs3AE2O0Ka\r\nY4YH+23J/+fV7wMOEnOSUag2Ja+He9S7eU6YrCWU0s27n3+lQFJKCxqhApIw\r\nL/8KSKanf5Fl0geq/S6Q0BNLl2hV5WeQ+AgrfpPxmPbHwWpdR3IX088vhJ41\r\nj7hAVqRgRJgrSEScyJLAtthAwhzikfHielzZ/qVSqpz7tErLb2mD0Xm6iF15\r\n5brQ86mRHK1XkNOq1vksgGwq5dk/+AwqUUzlQJwUG2vGmRUxt5hLLJrx3FQk\r\nZ4cno0PHm6XGrdQLH7/fo2kszUWzNg4zeCHWYNY9iR4RJ36oOHPALfAJN4FF\r\nHBOavV0+nqUiTbgOfvuYT+ktWjBgUEBtgu7z+H/7ylfWVaifELQXj03uPIPL\r\nw8+uOhObmbgXVtxvCCcuBpQ2ZVUkTRPlXSt7bywAOaDnuo8J0f65d2Zo3x3f\r\ngiVUQ2nWVCDNy+AuSCLUZrLntBmLQaNhc0ZKWjzCWAlDBrqFJbaBd5n2sZxI\r\no/ItN1KZ/t26p/PYFAtMtrK+6Z9nE+59lpsg9lmpGwd7jYHBmbYD6f6NPHEP\r\nTGZsMZ3l3S1Aeo7BbAlFtFK07A6k8BMkSRk=\r\n=KTQA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.3c955c7.0_1660691476767_0.13007586376631264"},"_hasShrinkwrap":false},"0.6.3-dev.a55899d.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.a55899d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.a55899d.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"a55899d1e45b70fd7901f7d18c85bde71f35f93c","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.a55899d.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-fmikKK9rIT0672SCo2VPUNcLHsnXsGmpYBkM5lsEOmy+XnOGIaZuMnCB7P+dqFOB5xSfWl5wnSI6YWHIR94YwA==","shasum":"4de0fe6d90eb5f93d15673b3dcf328e0e3478573","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.a55899d.0.tgz","fileCount":35,"unpackedSize":1054285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFECPn0whLn4UeEFF0kwVKS/1UZpy7iNHZEirVPldBA6AiEAoRV71gxwk0ZiLsizNfbzto9XVjG6FoK8L8SgfUK8p3o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/j6pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpP5g/+M83KUvtDsr7GllDpDSoJ8REJ3inqIwY4N+L6fQ7G6a/HhVIm\r\nEOfeXPi9tFmhWYudbRff+bodIqnN1WmzMqalRVBlquK1wjvArSn5KdxKo6wE\r\nA60nzbd64I6dsQhPkcXPb8khRT89uei63MGKgvFw4jsTESs++4bx6dW9THM+\r\neaXtW7/6Mv/QAXErNJYl05jephlVvtub6YKRIuRgginogrCyV569Ab1m0ewp\r\nboP1tdpz/2j8fNoYF9jvopidf1/1YfytujT3a5298WovrAwFDgpGD3oDre/S\r\n1DaO8x9/Xg4ALgOP/wtnW6mpyf1zaB9TN6xkmrP/1LyIpVyWwgPmVgIwhm8y\r\n8ow+BwSb18TpqOcJV8IqEGIvyK4P/pLUbND1OTdRGscW+2RPdOmFT5PQJgzn\r\nyfgtnx1oVQr+j5PKjOdzmxEdMeukhJeOA7561z0IV7SXNjIxytnO0wBRJqzw\r\nfN6hhKoHmyeQccN9Yb/7vt9m0ewlZBgf7F65Ansyz/XeqgdIBr72w4UNWyLM\r\nx1zZl1pu0+0HSc/R/FHKvbCazjhQpmjg/cwMBkclsFM1Vit+yPuE/Y+BYMzR\r\n9E54LcW1zSxyHHe+AGXT5KN6ILtLlkzlEBBw/8GcfsiotxZL+KMhAkpigg6o\r\nbvDbG6ZAAl+GqHTJ1AKrR6abJhHP3+KJ78U=\r\n=w22f\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.a55899d.0_1660829353167_0.05179281089731158"},"_hasShrinkwrap":false},"0.6.3-dev.2a73012.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.3-dev.2a73012.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.2a73012.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"2a730122dddb144dff3c1d5bc2788017136d68c2","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3-dev.2a73012.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-YwVOL7uwSx/a3NVnx+UB2H9fY3zyAsgXlrImhyssk9fPkT4Bw3CRElI6cr7fsQ6lgmRNO6Fuq1Y8Chfx+r+H+A==","shasum":"e998dba1cbaa08a627ceff0b58dea3e72efd95f7","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3-dev.2a73012.0.tgz","fileCount":35,"unpackedSize":1054285,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICvniwD3pgGF9n2QUUPnBmcunIeCE31n0aXy8Yfx40Y2AiBAiXs2nH8AKKcBdWcQfa+a47OeA1DISMIdoZUOYgv6lA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/5CGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov+w//VWzWBfbfZ+N6RZ6DBI5A6xD0oTR//YE2pIDC1HuESxo9z/zp\r\njqxiTysVl9T1QtEXYR6BisihUsHJ/ttN2dQQGBbJx2R7YtSWSaGFKrEWLT62\r\nE5WBbga1ljDvUJDTDWA2r0TNxQ3yBYUVkYLHYd4BxhFaB9b0+hwQsAi5K1sS\r\nS4bJ85nO9Wf439DEjmHik2bj0TMoFnJrybtPUtq8BXvmh2rGLMTUAwxS2DpH\r\n4tZ/9V5ayuKlWSuXHNckB8uBgySZ8lhTSwd+Vnzubmpz3evONFooeQ60jYks\r\nLbX+N805ECg7Llzxp7bBt7WVihBk2QxrNUmn+jNH2wtpdWyG7aWI9I+MCzq8\r\nKfwkuiNSy2FbEpvWwSrE7y8/ms0pn6wZC8RMlzn8AcZMFkNysFGW0VvEhycF\r\nGTbB0H23n+7ZcRs0po5p9WECuHaEjdRIGiiEDzgJ7VQuAPlmEbc6XNTBy7ub\r\n0PJuLImkFmPVBZmtvluTnl0kcykicLh+nD3OF/pJ3CCvEQpeDAJzv55Cnlny\r\nQ5GXD4uoPusnRnTibgRpT0IcJcfbP58YwNJ0roGt+kU5XYeefnD04cAtCCsb\r\nhgaP7pab72aLY3pc8SOv5tJ8E4MDfQKbm2Poc0n0bJ2AZHHFnTWrgIjFeVse\r\n9EELJNbhu6mfjVzXlvkCM3qTVU4YvuHErbM=\r\n=E6GP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3-dev.2a73012.0_1660915845925_0.4775691797429369"},"_hasShrinkwrap":false},"0.6.4-dev.fc916ff.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.fc916ff.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.fc916ff.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"fc916ffca38749fb79a2a6f22edd3cbadaae7bac","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.fc916ff.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-g56eL+e/eDgw4j/gBe4Jc2EJT+DUulo0n4oIM8YHeyv1+xyghZxx58XL1aKAMO61rPM0DgCT4gbph18IbHIylw==","shasum":"b789471e67bf15c9beb3cc853680f63e977df0a4","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.fc916ff.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIES+VCJuQwjpnqHoRExBAxglUsJCiG3qPT5E2aNz0Fx4AiEA97AVIM3MxgvBYJbtm9pGVxJc5RwYhi6CQ2JBpmzC/7Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAP+nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTgA//e5uRZ+u2NtBDdCrkgo1xsuiXlrNSY+r1z9zYOsjHy94cAm0y\r\nAGnOGzmJu8OcpqpBeetugOaDkHDN7S2FSB0nv7XxFnYLTnu3sDLNNYFG3hl6\r\nWQ9DqBlu2gzs9Xw6deSPVcgfkCL87RyM96ZA9fGw17tm5lhDxas9tc52sg+g\r\n6V9OaRfnzeZm1zoOFcW+qV4vL1UWXFNhgWUN+gUsvOevfTJurgbTAQutsErw\r\nYmdjyOqO59kIDfDsL5BptCgQ4kdcgj2eWPKj3CycLjsliU3/1+fFkNSUH4UO\r\nMlEm9+euWRC1Iwxi2Dalz++/OSZ6JVLcAD72qOMgkJsQPk4Y63HykLCK/G18\r\n2+TkF89zPnbzh7MxoreHJnfafa9fz8lNIcCIC94qrZhHazLorcdzOG9eeOVm\r\nS/+CaG9rwC4RLgWVBla71dKlA95judDCcRdU7KWF41wj1HRjPPnRO8FH5S79\r\nK67lrf1JhLhaWHqC1PmkXW4wSytLcdUbEa2Z4GmDNV6FBfe6VNBBbD1cd5Vl\r\n4o6QkE27Mva4XW4A3rbEGa4WfsrfIwoghXzKA98vgs+xpTXfXGCJUPkS0iJr\r\nTPQy2R5MGUvuAE/5uZ3KLGEdSM7FieIRmwmWhJnpSSprMeB0Xt+Y6s1jD0nw\r\nwepT+7k/iIPsm5v+LW9rH7bFr7yOl3eYwt0=\r\n=3vZN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.fc916ff.0_1661009830799_0.6075615868301258"},"_hasShrinkwrap":false},"0.6.4-dev.ccb1898.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.ccb1898.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.ccb1898.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ccb1898c9bd31049c018c873e5db698748de4501","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.ccb1898.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-uu9TtdpkO5h+83fqttcL7GKnDNzqMqqzhHr5onnsVXl+7MJkXsBxFx72GeY6XV8DSxfEckq8vz7d/aUMp79Cog==","shasum":"3988b43ec1260330e39a615e83f5f24b80819bec","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.ccb1898.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE9ptTgu5dcwTYF+vajvthbhAm9N+xs6tLInIgyUFVI7AiEA4lKpfKCPVS6ezp7mHvhUvIDr6h1jouz7UGV4kTJf6I0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBJYFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqehQ//W0rSKhlHXHNpO5OLobsdVI019dX3ohrcwAzwC86g3Q5cfHw6\r\nDAS7arByeNOmbtHnWFcN7X7u6gg50n5XSfjsird695vPwyghvgW4NX3basR2\r\nPz/M5GEFciwcYNRenNcAH8nmII6GupjJbq6pLb+2tBIlnmyEj+34GpFXo3Lr\r\n+mywSF82V2nFBcucEQKjn7cEOax+Q4I8JL8T+NYc3xl7y9dX6/LvF09eIRAs\r\nXnnUL5sM/pxcf8LqmJwIAfDQcv+Y5HObZl9w42J04hOEjqtEDpPj06q0RRXD\r\nFaayLAAxk2saLiLr5euzXQhQIM2+SjCen08Je77a24iFDQgQwqQcypn7SfJw\r\nER0R0Pp8TJQuRned0dH5RIwqqOgFE6C/Rw1JPcnMGxYfNDnmuQd/HE00NAed\r\nxBCMiEn6ugmL4aV/yIyMudMQPd3M4csY8nlAXc0zKVTJv196Uz4BDzvMKc1n\r\nujowzjQe15Rum1YJpOQpwPs/fiTAppvKfN/9O/HGs3lOAVmK3YnSIggjQzfc\r\npnozey87+FiqUEsS0lDnMGjwrRXImFMVwdM4Y9EBSJqh/5b3WnGZRTfH6TE+\r\n8xXnEozzVfFuyvLYWP119PRxiI17Cp6n3z0Wa2/i410/E42SsbgGaef9SVxE\r\n+Ay6tKmIZRUg7SDFibCHq0QRiy8L8eCGHpU=\r\n=ZYuI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.ccb1898.0_1661244933497_0.8734370554585686"},"_hasShrinkwrap":false},"0.6.4-dev.e55bf9f.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.e55bf9f.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.e55bf9f.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e55bf9f763069da3e3cecd6c9a2a4ee0b9ed231b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.e55bf9f.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-R9BHyzYIUph6Mu/qtBwhAkcCoOdKQ4LMW8bzByZUB7YrjXpQ4wNrJvh1hDiaQQQp0O4axVlKYqL+M7wDrZBLDg==","shasum":"48471ae0bbf147e7d1c41257a5827cc077ad9a7b","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.e55bf9f.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAgNSaDBJrPxn0suBB1dcdQXex/UHkNx2qnuaExxUfXAIhAOfYJYFErXJMRSQ4nDdEohAsHYs1OcEMP+z4xLQzk3ml"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBiacACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrkfxAAlbHKWzlimeacuDdfwaGn579QvXHhfXZWbz2Ve+iHOD8TLu1d\r\n2MY3livQ6jRKsjaou+5GXm8pC70kylK4QEF/K/6IZkBye4rR5i+t68iI3C/h\r\n910fkHge52WRnzIPvIYpVpfB+mB3EcyC3VNGBoxMNleSXae8sCNF2LHYFgJn\r\n2YPg8GBTviXGNFGHc1qjc37skWgpstq20Fqacazu3PvE3O6+fLRgVzoxjdL+\r\nmLHbDg/VXgjEl3oQrzvvLB2H/fto1/4rC22ShuPn8ib8jQzN2RFq5AL/2TQw\r\novA0LBq9oLCHB8A3Csj7Snn7g/iMG8vLKDMnY+lSvAeoibFwTfXBm6fW/23S\r\nZtZKyvYHFNYJnkSPsA2NVJEXrO60GuIpop8v8oYOTuj4JVAYb2qX3E4iRw7+\r\n+b3CgDWzbyWPzhzkV9y4OviLrD98mlJNmO18Nl+v7UVHFbcwc5rRCy6NKmZB\r\nDnHxbqdNu4wtnrYrWUF6tnlUlYp0iMHxcT48Bcfia4deVyOs6fJDo+nXahjx\r\nZf1BePUBd1AC7zD+ozvsamvWySy80zIEityoSauQWFtYWjnJtRuD6AriQhL6\r\n/67f2zdxd7v0SLsTSHA7Uy/wxHuR6EEbhI0ibKV1SJZQTl3JMelmTpf3ExVU\r\nTqmbEwFI7ZN+kMnhrVNhLB8ggk30vO14uz4=\r\n=CvAJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.e55bf9f.0_1661347483857_0.9123028157480526"},"_hasShrinkwrap":false},"0.6.4-dev.aa64b52.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.aa64b52.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.aa64b52.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"aa64b52bcf40e67a2253af66c81ca477f8cec218","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.aa64b52.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-gcBd07MqEe9ThOiDoBYR/C1b2u92D05ip1hi4awd6ctnoFOBBIdvwsg5hZ+/Fn1h5uKEdXWYIEvPZApfAnKaSg==","shasum":"3412d8762091c0edc94439b3848d32482d8f0b86","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.aa64b52.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAlmWUNlxDsC8tkhMO0YhBe12Cy+ur0nTX+NzTxxxpvuAiAjXgA/ucOLPGUcTO6XIc1W3NUACRwCfGZAwjw2GvVhHA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBo3dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgEw//Zwdlt7hrT8qk2oSFSJi5ZOpldOphTkUUt3OMAz3meL1fNzk2\r\nXDyyVlnhQ4OQipBEg6mvK7J+HhKy5mqtoa1jdLqC6pQ/AM/zo7jhUgyOAK7s\r\n2fZ1/HcvuxiNa2YtQX69uTHDhSkSJNBDnexAfVR4BrU9fxH/nruzNgRHn6Hx\r\nY91cKEE7aPsJi9EWRNr+fcoldYCMyedtGsNSv1MOReIparWFh09aI9VPOTW6\r\ncIh8z+qFq/yKnjTjj1Huv7+f6LP3Lm+5DkrSZ6KFTSv7yTewHAWn6Um190Bf\r\n6jRhghbKmSlrAMzg41dC9aqpFRsJ2I4/EjTxsaImHpciUE/IPs3tAHMUjHp/\r\nNfV6Xpx5kS2bogSQU+ZqJVnEqqBRajkPhMilzfasFXxplikN3xnvova2KcG1\r\nJUhc8o6OZHlZoIXjbvk5/svU5Nbz7JEOT9gP2+CX5cEuz0To8Drsfxv/9VhJ\r\nENYKfSGAC5z/12w31DuzfAZGkTzhzG7QdeggxoIR8VhXA44QUOmxsFyFl8Io\r\nHOCSXjmyQpj7NQ2fr4iXqYQ6cM9nUINlb/LMvYZv0S23iAi/gc/SyUl4sSKu\r\n2p2IOaJqVKojzdy/jRRxzunj8nafpEJ+YP1sxc+6M+W4/Cbls5tgdFCbFHC1\r\nEaAFpCg4LkN1tErhaBAfvn2v8UyDweiiozU=\r\n=7kCQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.aa64b52.0_1661373917610_0.2096558172994567"},"_hasShrinkwrap":false},"0.6.4-dev.de7575d.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.de7575d.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.de7575d.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"de7575d83a371cab9e54256773c9629d9d17687f","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.de7575d.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-EdA1Umg37j/hD0GOvGZmZ6bAyezpG69HkB8tRqSTkT7i65Leh9rlWorqKgYBVGBdDeihQWqBcYDtjcjPv2OcAQ==","shasum":"d81f0595cade9b3afe150680e3b0697f209e5ed2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.de7575d.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRjQJNMViuoazGFXO5m9v/3jmsv1N4QYK83+robr8BRQIgenl+wv5tVHmTdLlseevFdvSofJ8zdSa+aIZMW/WUf08="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB4SlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrDmg/9HZP5mDwz7dAHpVJVRYzeJ2Pfkh7+yBjYkc7zO7HISMiT8eh/\r\nmJRmAIx47m468GNohFT6MeLbQvvXopxBh4LBThUrnWu5yVlySBRJy8g1e7WA\r\nTGU8JyXgxXFuCl7EMQpjYeVhvWIKJWsUR5UybHJE6NjFHXO1A4XCp3emtaa0\r\n8Fovh6UnI7pQvPgkDplToura2rvJsh80syGjgDTsi0F5/8ERUHQlxQOFJGya\r\nLX7l3TCqTpiZuPOOh6KDdFxw9S6bSbc0Nw9i1yHAod22uTL9iCNcbFwawAqr\r\nHgQBCFSwPF7TloJHpFWkjCTdZx5SMBJyiXps3vbuFGN/9EZNsKLAH7fuFkSa\r\nBCedY2V+p1585LAYB/EktmMDjp3Q3y4eZcIOCMXQyoUDjvOWRMquETlbCZL9\r\nJ1zML5sF2VsAxknGrhAlsR1IyJPlOQZqd42dXzn4C2MuNRJxb9w7HLcr/JUH\r\nkOUVWGgDR5VQ8qvFefpUy5f6Iu+IhzDv3k5izshIDm5s2+F/xK9F3PzNqba2\r\naPme4ArtNsVgoKWY6LnPQuvfCflckLOzqWw1gRYePz03BLox6RB/e77FGMqC\r\nbvQMjOOVC8gWf2e0uyPjr81rD0H0y0j3M8BuLnsYcyx2NE9bx8E7fJKSn/pd\r\nu9yq5+tUpxMjkkg4yhKcSVVDHrHOSpD/DB4=\r\n=jAty\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.de7575d.0_1661437093436_0.4941596859141919"},"_hasShrinkwrap":false},"0.6.4-dev.381116e.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.381116e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.381116e.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"381116e145dfd7352ae45dcd9e8967586b601b40","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.381116e.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-dICwfVXwZ1WxGt+vD94Fa6ZNBKfY0knjmVcwJgqxvUHtVfXaQG4wcj/PRpIlv+lL/0J/ktuZshS07FONrIJ2Vg==","shasum":"ebe849f9695389606d144be92687a40dddd61214","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.381116e.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA6ATwSBchesH090tmzrrvTNygBXnZHIUP/igCc1CmB0AiEAuCQ9HLTGZSe2W2pl1aF98hU4P+KQppipdoZ2TJd0m5A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCKvEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpR6g//f53I/pKYIcXQ502S02g7/2YvlAy7UeHFQHRXEu3paCgtgsDu\r\nut+6fj84WzZTUB2xIDhIl0/oYSYlLo9CShLIy7zL4XZgbtgKSQK6HfO1QdVg\r\n4/2F5ouAJ86bWMSHWz9LQIS5uUDjzRueiekUFwVEoa9asbXHtGhaT5LwcsO9\r\nMnPcrr2K4AN5NajHBJHw37JBCAhrbjG8h8ANVfDM+qf7EXiz+er05Wflh5yA\r\nDMI6I9AQTU/SWUUaHHxN53MxGNCLBdtAFww99Q2jHVagfGYnmG0qSv2fd8tc\r\n6whTLMeBTHyW2iab9J0msM7dtruCAhZXYZ0Z3t7t9lz+tIFcRjsuPxpm7QWD\r\ngtMayPH7DEFE3PhoGn8scx/vh0tiFax3Ams+QL00uIucJBuHtKKqMqsXLFgR\r\nSDH19ILXx+5SLDuN1BK3jJrHbbyPa72uftYULHI9MVBKE7RT2bgpn4puZZBe\r\nA4WOqkCMTqST4YAdijW4/T6FOZLqOoyKHjUG5Dvs42LpuacJ5WzCDDtCZpPL\r\nAxBU7OLZb+KtQ4kKQsGznQ76Di0IoHpV2eN3f6MiLHkD5EtuHK4pytKDqfeX\r\n5IMB91DOOul4Ug/AANW2vW4YtBDogsFveSGeQreYH9bMJNkdIfl/qB4g2b5d\r\no3CEBcRce9pvL+VdeirGRjwXnF7Pr9TLFb4=\r\n=beoE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.381116e.0_1661512644245_0.5757277320391465"},"_hasShrinkwrap":false},"0.6.4-dev.8696fa0.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.8696fa0.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.8696fa0.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"8696fa0d3e9adb10eacc9810238dd51ccc583940","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.8696fa0.0","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-/MAM40evAtIIsrncj6WGV+FVoF29pgN91qWMmylOgkM8Nw8ehknskkNM07WGNiuKhSUr1FYL8VRg0NHC5mZGmA==","shasum":"fec2d6d2cfa26e3b215cedfa853bc9b4233e8bdf","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.8696fa0.0.tgz","fileCount":35,"unpackedSize":1064491,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTABcozXt4PClWMnlgM3S2gt1D3jQAokWS8d3cl4RBaAiEAwLoEf7ciND/spkfOS5LP5m4nsHf3dDnIXEKlhQPIK/c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDOSnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriXA/9FADlpc3CCJlm3NOuTcrRI4gBfhHa1gJmj+4pH5X/k9lCkiRg\r\nAo9SV9zN8mHXtIYM5fu36/EP1SPpjftAfNRf3o4ctwUWfMgyqoLayYExnxyU\r\nKTGrEWfns212UTwnZQbxDD/gcAlURRkZWkoF3tvb4JGTs21vXgx8jmsQOV0t\r\nYPVlOBB45uXT8ZZrMbjMCaxeFWWhuUW+Swiy2Q+CwUJ8kBxTjIjsqJ97ROEG\r\nu25lHOFcejbT9H6UVvjyksJFyy9lcN2Ug/NAZwABYECZizq1axH6doqfs6DA\r\nqbCpL60Iizf6sLG5C6XUnMlUDkluqanQ4ChpfiHC1RSAR4ba6b+TKKYKWPXZ\r\nA03D/HtFNrlSozg7kK8jX8D6ztBYV1qdTcurXa/JF7EfyJ5iy5XuvXSs0H0q\r\ne3G0IG/lc6jC90gZqVdZ+1GZMLKVneIajLtEwzZ8VbQEAwWl9R1HjkvOOD0G\r\ny97ZOQjnRmraMIBjkb8tBc+WycQABnSeqRqEFDvHkP04Atbr4aY0KisAJEcE\r\nkdd78sPKhXMJ3AHJ8LzbxYb0E2l7lSsVKHF3Ulzk/noKxcSksK755NjKOyLg\r\n4TDWdKXNGeqtFyMJqhvQd9jsEUjM4CgZKXXr0ot0weAt4370WuwiSM6cXhNT\r\n10p3RNQsazp1D0ioaIrB3Mtav+gY/M31bfA=\r\n=2cls\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.8696fa0.0_1661789351379_0.035603017216597976"},"_hasShrinkwrap":false},"0.6.4-dev.9e41aae.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.9e41aae.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.9e41aae.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"9e41aae2008a7b9c15f7b5663d772152e6e41361","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.9e41aae.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-tGSALz3cH6hh4fzHbtl7P12TkQjWWiHGZGjjDFpWBaiwA7RGDpmIuGh0Wapd4C9TG3gPDLi5lSYHbqwM+86oXA==","shasum":"524ce058370276f18749cce17de9e9540c8f2a73","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.9e41aae.0.tgz","fileCount":35,"unpackedSize":1069765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWuF37cXqRguydxPRVlEePZfS8lOK5HkXHp34Pnb0Q4QIgSNHglHeEtpVYsagmFVTFJ4+oxa9DtabBUPAdMwA1JOs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDgrbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3OQ/+LXBiVoI5B40gx0GJNDpCjOYXP7LmUn3WXlbsb/IjSbigxIR7\r\nZUZUJiWAfSjTerrQsl7qc7Iv38i/icqiLINTSm9BqhjXD0oYG9BAe/zBFPgN\r\nZMQb3c/6M8ULLDz3OYOES8FiZWEcgMUHvuJMH9Rg5KYqUI6NiMWdkK01x8+G\r\nvVWET5uCJSI3pItFpTj29GSwmaeKjsUcoDk28pKoGUStN3YblBPYO1Z5TpLP\r\nJdsWdjGac4EoIQkVJJw3TZzSyXWmKvs86OLHeP6baBduORXIPbDMZ10d/PFc\r\nyT/QldJvNuRWvCwfeHSR0dXaNhuzRkkD+w37OLBErWWKrZJCoIEZElGaSVBc\r\ntPHIZd9V5WER18iAroLmYtNH+peE6htOzuIiWuD/HD/L9Rr5yaj1lJBiXD0w\r\nl1J4FM68lsr+mFlrPEX5NdCHlPbM3hLBJSBcwKKo2Xe7rsKk0ISx0e1a0Tmo\r\nkJ9Z9cOSV+EfpvAZLBUYVBS+c2Z5g8YmBICxhANxDJmmnGJQMtIFs6txPoBQ\r\niEz4DYoQ2cbEktMGjEMfGFepAAUUqAyi3mayFp9t+0LvEcQBpb+ps6lK4xiV\r\nhmZ/fjkFUaZJP94+E4fEis+aD109WtSwVFSs5gsZdOcsEucSRkzUSs/6ymqw\r\nUy7F4sLkN21fU2PLHsCYrd46idknFn3bUNI=\r\n=ZrRN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.9e41aae.0_1661864667227_0.9241985033936482"},"_hasShrinkwrap":false},"0.6.4-dev.32db5c3.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.32db5c3.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.32db5c3.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"32db5c334a0c2674320474fbf228972cbf22c79a","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.32db5c3.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-UxN3O0867QK2Fcm2G2mUJUpmRVhNtld5VORqVNlIR90GKbpgCDzTakvd9sUrGtvh7UE1sKRNkF32Tvm1I/UFYA==","shasum":"9145f58fac7493528ea7c9212e54c21ffc195c7f","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.32db5c3.0.tgz","fileCount":35,"unpackedSize":1069765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBo0hr3nF61rfqdaG7MSIq5MMsN9PvffOYFC5n06OJgdAiBlv4rpfOW7+fbssJe2BjI6SJoxLf8rStQ7e9byzlkwOQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDjLBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrfuw//Yw7RHdoU5BDWGAd0jeue0EfGEj2EZHAJc9dyvpw87/GRmoAj\r\n2khCTBDdyIC0FWow/BqL4735SF+r4nu/0jiE7BVeaQrPzMyyRvE2ap4cq8k7\r\nHgBB6cqm1VTIw6BeNfmO8B4CJnUEnEzAZ/D9/8TBhnxl3NTs/CRKfizzbEQY\r\nM7CwhqVyBVKnFkfAWOmmKEDOPU8N0BAAponHw5bt+6G9oXDSitEI8l83GVxj\r\nizPkAGBt6IlvvbXf+fg1NyYhKLAumlqhrgPMwLgLDjI0c08qxl3s0Q9rRkBs\r\neJE4zxHNNcIKGQhvgNUIYVSWvzWuQmZGMRLNRCssNMH7rpj7ObavMY1SEoB9\r\nmFAOR4T/Jn5KzXE0QS1DjUezE5Vc4Hdye1d60uJWvcqS9MDaIrPRm3qoIlYV\r\n3PzFX4z95FXm2gJLQxwX9GGLXG3P0/jgx2dD5Z4W05jBa9OfxwjLzv0tmgo3\r\nyS8TQsefYUM9O1Z5zaEIgj6qVc+yLIxSpKwWBpyiYZzxj0Gyoojj9dMbYCcd\r\n49X7fRf5V3env0XwT1q/BXT4luxCylZFEuQ++/GE/FEGPtytkVNWm1OG4RsC\r\nQiqvOuc4U6pP3I1JOhZ8q5O9mj/oMydNbNcjqFUjsl/yinCNMgduXrbgwFLl\r\ny6F8xnaeJfhDt4k5nHfCc0YxntwMjVexjJ4=\r\n=aoYg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.32db5c3.0_1661874881265_0.7738543409531593"},"_hasShrinkwrap":false},"0.6.4-dev.5081272.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.5081272.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.5081272.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"50812728cf1955e8d840fb784c9d19bcfb3dc806","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.5081272.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-dGCzt4itcLyYTmqSPCOrlzV9FEM654b5OoFBf4vLnqY34mkrpfxz/n5kZX5eg8Z0E5mylWFHbWW6DHIIHgeshA==","shasum":"5072fe7bd48e4fd800aaddede2ee31c117582840","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.5081272.0.tgz","fileCount":35,"unpackedSize":1069765,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXmYNiydk74S86sURpzw18xiM76I9a20ECts7gnck01wIhAMLoWDW4hZQCha3N78XgpalBYs8DjImTk/SvFV3oyrIK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjD0JHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1Nw//Yia8uTLZX78on0L/h6addsXb+El6cw+QN6T9xBun4V9oztXN\r\nERYiggoQuC7I+I0p7kJvaQNNhjB58WekDRQhdj601sElv7TwJSULG64KW9Vv\r\nwpASB7sT7wYA4StQR5yRizPeM9c5R4gkieyjsCyYJHD0zNCts2NDQNtZ2uJW\r\nUvSMlCReBL0s/STvV66QvfdaMw6h9qEsfINS0nFHbACPHXCY8PlNS2ULMhoO\r\nBTGaoymA0txrRKj/fFIeavxbdHgWpl1Ttq10WvSjl9ORYMR+Gzk6x9Gp0U3e\r\nG+YxxHyyRNz+kqmQBaEpTnuQPySug8rDTmw8zgVpNqu/kc6c6vDz4EWkCx9N\r\nojtoUn+my6M9ngQDyEwEkD+Iz3b/Y55rsSqLkCgdzJFxrUwBJmL1cuavdxie\r\nYDWlrGzSQ27nUbCKu+5QEkeiQFqvXBaS57AfWk3ZcYeCAwX5zVTQgi3xoX+l\r\nFnZZo7aA89kgItbjhyiB12etcSBJD596Ml+OZ5i9DJ2LzbZEncG2Wf0fKGQB\r\nbWtkCQ5tlshlVRNwgL8cIF2UsSR1rjQHb/15bKTViK6o53FDhUB2WMXKc+2y\r\niKO4JTWoNC3NWvgvFDKNQty3hkjRlxGI/FQLuXwG2O04eXlxzwkzRQ7hoDEV\r\nRnBi0QOg4ieZQGjZQgQEOQssh1hrGlCPtb0=\r\n=TLp6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.5081272.0_1661944391641_0.17712245339016608"},"_hasShrinkwrap":false},"0.6.4-dev.47b0a5e.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.47b0a5e.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.47b0a5e.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"47b0a5eff2ecbf4767725aa8d58ca74c6f08fe33","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.47b0a5e.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-aa1THPKZdjKisiXemAo/pgTGdyvcDJgyY9P+wj1Kl36IhCcp9Hxr8BogQgwoc91RVi4N3bDEMQZAw0HUTfKSXA==","shasum":"ea8ac7b66e614e1af0f7739d41d9f8143e877411","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.47b0a5e.0.tgz","fileCount":35,"unpackedSize":1089951,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJNGcMi4/faPIgsnvfsN9FnMeC2z1BfPzhgXKo456gMAiAFX9sR05F3+65XcZjjjdvLygD7RX3i4fxpDcTVXt+QfQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjELe8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq36Q/+PsR6eG2tUcHEnpMFY8xJR8w+GczTas3C7kvFhtjIxxVSAW7M\r\nHBI0Iycgb6yRurUa9OCBwkCJS/ijMTVP1HIMMq1OJnNc16x6rqG5OqIKVZZ8\r\noL7NHuoQ8h+T9c+NSbiOncVHJsl4bA9EhVRfyV8yCvEVDR+80vhiq2R7sydE\r\n3RY7JV666RHVIrtcMXBc3aYLSuUlFWOeshhfHsoy0JfGpCRm5VTXRWPg+o/L\r\ncZPa/JcS5koSHgn5UHbVIALqisAxea4jVubhI1gIBjDpqRy06m0WSAtq4v/+\r\n8EItBZsYJGMZh25TTdLBOEAWtcxyYpN2f0R+0Jf+PxX6dyLyF4MKWATtPn1k\r\n9sGzkTNK+Po56X77ze+UieJjd/hDrJehrTOqsaRWVeWjk9okyZlxYJAsD88b\r\nPlNdfE2/yCoc+B8IcdwJAATwMgeMA6TsFZelYhC3cdnLV1SGxb+B+8qqILnz\r\nDnZ+nAilIgCHcQFsnnboDvdH5pu71HRkAiHrMpx5+Mtuer7JgryVwYWpArFx\r\ntqG44FgH0YvtCQl8cvtvemfsyJAFY7KvK+mnzWEAKAXm0imOFlSWdLDL0f8T\r\neBTPTztOaTdURC3MV3S/+CQAxurQtW9ASeCWAcSGFfchVr9iU0Knc/uXttRb\r\nOe6pQUDfYO0nHpyw/TBuj9atE+sPUWhyp80=\r\n=p4QV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.47b0a5e.0_1662039996256_0.4799909755329932"},"_hasShrinkwrap":false},"0.6.4-dev.ddbd8c9.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.ddbd8c9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.15","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.ddbd8c9.0","chai-as-promised":"^7.1.1","webpack":"^5.73.0","webpack-bundle-analyzer":"^4.5.0","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"ddbd8c9c2a72b68400a8d3d709d7a333c8ed647b","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.ddbd8c9.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-NhtyIAmE9WxnHEiz2lR3t1JSa8uEL96j1ueWsbGUkqRm7aInZM9unHLbeoVrg1Zb1mT+g7XW9OJa0gJBcI7g1w==","shasum":"4d30ccd8045e48ff1cea6adfe36e993bd66d260d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.ddbd8c9.0.tgz","fileCount":35,"unpackedSize":1089951,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpM3aRVk+t2LLJjd331Akm4ib3+jiTukO8BsA+1mmIjQIhAJLwLXAvIk8H3v258rtCKHpWu60QyknVuo8dl7p5Ys9g"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjENwlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSFA//ZSSrxocs60j9ABJ0lAbmoqS2QUN4FoOmrOX+zkmpxHTqqWLq\r\ncYlOqMmZrAIZYIc+osRAGXcUe+KRj8WtzR6xYeIsWO+y685MZRZHrXygq8Pg\r\nHjrRTkPV6zUF5U1rmiAnEkJEkVkOpyPCMG336kst4rtPQTJcwN2Oe6616NyY\r\nR1Putt9wm3acGok3H4vYX/GS3Xb01qh6MwmIszjJeoCZMqMI2+B6GGrbADXg\r\n1SVN2NFtITq4PL6uv293dx33W4cU4UIm1HJZrAapE2r70S9aUCaDuz/OR0BJ\r\nfqb/tZWBiudcNeKI0k+lFD5fwX+PPSSU0SGWwYbLPf6xQqzVOcnvAhQlHDbn\r\nP9xzlTk/hUt/FFLs8pTCJis5lrxIXh2yakhDkawgiq6Jq2qvBYPS1gdHWMNs\r\nmz1AiIrU22O6ZyBt342q9Z76IpWsPVp/4J3v9t7cQhwd2DApe5gP6ZR7W8bm\r\nUVX8Gvz5tit/INVzR8J4lbSD3EwrwLBZhw93ZpTfmjLu+2p7I4nq6JjNHybY\r\nkSPdjU+Vm6g1vtATrzZTEvbfmk3SXxGLADEgvvJJKap/LdQhMMKyovKqzXFv\r\nhwevQADdcsJ+HmUF0g0Zz0NM1T9SajFnVuvjrAAR1QRGjj7R5yWHRGCn8Yk0\r\nSWMcudCNvh30EgqCo4paKmfsLm1jghmz9zI=\r\n=lxHK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.ddbd8c9.0_1662049317390_0.3814333171120252"},"_hasShrinkwrap":false},"0.6.4-dev.aec6dd9.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.aec6dd9.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.23","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.3.2-dev.aec6dd9.0","chai-as-promised":"^7.1.1","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"aec6dd9fc4073b1f99da98a53fb53a7680b3a012","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.aec6dd9.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-shpdnHgGVFusAqdmQC8OPmAX/QkYyJ6Ovk/cyDjevQok5//jH87zfzQ0zFBdTK8bmyuvpVuwoYEun0y+16s+ww==","shasum":"9fd31ee1968697c2c3d21b7bcc44ec7d300e10fa","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.aec6dd9.0.tgz","fileCount":35,"unpackedSize":1089723,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAg7CJgUSJuomhhmHKa8jCFJMISM0TfHpIQVrA610c+5AiBJmYbdaUPcae60NrVLDYEb1PWqV08KevbWo6EWfhh5wQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEcc/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqf3xAAi9K21fV3GbuBYVIdkDTyaaYAyPwBEwQA0Gmc7f0nWFjCOvLv\r\nPVc5rgUiK0g/08WdcvhAq4FD4VSkfe0frjRZcdkp12fEkd3CnjJrg7xSZ2Rx\r\nX4TXYV8w2s0EFJSWhK3l04io/E15Wct28qQQhuG5sRAo2+ePrcxH8PlYpzal\r\n+dY29CdT4wtpYvjjrgEjPTj4bq5wvkgYQUSjMSPPv1kR+sek6zpm9pETl8eA\r\neparo8zYAYzoonLEQwJSKNBHJLmPL6Vcl+GKtd2NojlxTOs7KPwxq8p9pPqs\r\nPnv279HANF+bvcRpsl5LzP6rWqgutdH9t5m1+o+yM8Zfifvmoq72Wa6EKW+6\r\ntu1h9WWbTSIgb21uV5QRFW3pZrGo02A/CGmTLH1FIsMJN0W4DkEdU8U7y3O3\r\nZYcj7TsYW+9YNSvUsOn7l+xd7+AD9wf3L8x/b6G2wjX0IhiUZiC+TMTJLcTt\r\nKMacxwW8FOZJ5ZNBoi5a38AMyroIGr6uQ5vo8SQ8zAWmtGob3PY+w5oK6YGX\r\nZsVny2M6AyQdn/1bt+wfpZzqmo9qe3fL1fMWgMmxqw//qeBwFnYb7OYBWiIB\r\n68/XoPfCca+TSl8WKGtJCC/GJnGMVZWHlCAw95xTrAgWVIqA8hq42WLXdlY4\r\nUcvVr9AgXIGZrThpbXIEbwc/2bKbe4Wk47c=\r\n=WcIf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.aec6dd9.0_1662109503077_0.31022828657583656"},"_hasShrinkwrap":false},"0.6.4-dev.e675dbc.0":{"name":"@superfluid-finance/js-sdk","version":"0.6.4-dev.e675dbc.0","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.23","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"^1.4.1-dev.e675dbc.0","chai-as-promised":"^7.1.1","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md","gitHead":"e675dbc28fefbd4b8c69f2d8b2558748484e51a1","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.4-dev.e675dbc.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-3+XLLFsOEgkjD9JUvhCjT9At+SC/FkVbUiV39ySB0788PjSyp4p2JGycyaVGO8VmPjoH5EHmpss43N4xbW6WRA==","shasum":"7d04ed13fb7d58401a21d541ccea390e17b8b1b2","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.4-dev.e675dbc.0.tgz","fileCount":35,"unpackedSize":1089723,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfKnT6d+XsJPPMJSkF2obrOvQH0+JnahTaD6ARITdgmAiB8akHSR9sua8RzXaP0/RuJZoQrwy8lYY7+0xQenpe6Sw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFfsiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqekhAAhJpYfLqatBirl6jlrWR2h9r+XgSq9cRMyQEDCzlzM8VBzDMv\r\nyoexNDUzPxBllqjDrp50PGgKKz8Cu4P3DIMWfItOjAHm4WySYXP5tx3TYaYs\r\nQfALds6h6Oj+s6eqV8WLNiQfH929ZLlGb0yveCM5cswncYmvWiCT9on2sdu0\r\nhp+IYvq/dOaiJe47fXS6/V9GjqUhwmehiVBFhapgfRKVHldPvYN0KqotM8Hi\r\nbBE8UObRh4/KdlMP2o5maEp5GisvqFpm5LI5pqsSK+zdGaVhfaag/b5acZlt\r\nmpzaeV9HgwpshVrV0/k0aqslD7dvrc+emqZ1EI4hXRSeTqEPZbH+3HYpxhfI\r\ntnZ8TMkuzin9UoiK3aDC6K1cpLlGbINpjd5Di+B9scuDH1154IthoIb5kkVj\r\n51c9RnXmUronQS8V0RHMKgQgvmYqAIdTpsq+EuNuP5iEX+l2h+9gVIPgRz90\r\nb0tYIySXLMiMJ4K4IFHR89Q9iSbPz2LgLl47IXEG3yLE3soj2NYTyBxl0Yq2\r\n/8cSLR81YDEq5x7dMkbGT7ASmuWcLhyLyCBxgSpFci6nPy2XbEIArXBKBUDk\r\nQvPHwPsCfcF3Waip53lqonV6t+yufJ2+E2qKB5hOSijtG0TAYaZb7K1mb1gc\r\noZRRE/f8HR0ZrvYDelj09Q3o7rdnNORn364=\r\n=WMy5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.4-dev.e675dbc.0_1662384930680_0.947244088567551"},"_hasShrinkwrap":false},"0.6.3":{"name":"@superfluid-finance/js-sdk","version":"0.6.3","description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"license":"MIT","main":"src/index.js","types":"src/index.d.ts","browser":{"fs":false,"path":false},"scripts":{"dev":"nodemon -e js,ts -i build -x 'truffle test 2>&1'","build":"tasks/build-abi-js.sh && webpack","testenv:start":"../ethereum-contracts/test/testenv-ctl.sh start","testenv:stop":"../ethereum-contracts/test/testenv-ctl.sh stop","pretest":"{ run-s testenv:start > /dev/null& } && sleep 5","test":"truffle test","test-coverage":"nyc --reporter=html --reporter=lcov --reporter=json yarn test","posttest":"yarn testenv:stop","watch":"webpack --watch","stats":"webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json","lint":"run-s lint:*","lint:js-eslint":"eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'","check-no-focused-tests":"grep -FR .only test || { echo '✔  No test is focused.';exit 0; } && { echo '✘ You have focused tests.'; exit 1; }","pre-commit":"if [ ! -z \"$(git status -s .)\" ];then run-s pre-commit:*;else true;fi","pre-commit:lint":"yarn lint","pre-commit:check-no-focused-tests":"yarn check-no-focused-tests","check-updates":"ncu --target minor --dep prod,dev","cloc":"sh tasks/cloc.sh"},"dependencies":{"@superfluid-finance/metadata":"git+https://github.com/superfluid-finance/metadata.git","@truffle/contract":"4.5.23","auto-bind":"^4.0.0","node-fetch":"^2.6.7"},"peerDependencies":{"@truffle/contract":"^4.0.0"},"devDependencies":{"@superfluid-finance/ethereum-contracts":"1.4.0","chai-as-promised":"^7.1.1","webpack":"^5.74.0","webpack-bundle-analyzer":"^4.6.1","webpack-cli":"^4.10.0"},"gitHead":"e675dbc28fefbd4b8c69f2d8b2558748484e51a1","bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"_id":"@superfluid-finance/js-sdk@0.6.3","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-bSeV//KLAyseYwFVMGwrZmmS0iIZWx5FLGEEjXfi0oS42NFomD0MEt+iRyF7o/Jx6/8bfHGMH9I4s8LAWR27bQ==","shasum":"af2ba3ad3ec927c07567f40b9c5b584ab10e9b6d","tarball":"https://registry.npmjs.org/@superfluid-finance/js-sdk/-/js-sdk-0.6.3.tgz","fileCount":35,"unpackedSize":1089694,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0wutW+mKoD/1mw5caaVA3rMbtTB6uhrpm738XoazTJAiAzR5W2SirtIfuXj6DnhZDnGxumRVga0LwPGv+kTYjjRQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFwFyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUIw/+Jrm+GR8z86RGh4pQSbliiwvtd/5so+j/VYaLD+7gjYCCeiPf\r\nrZAZIUEXDwpTs2qmkCGxENtDXTGJuSdtsNKevz6skyQ+GCo5G9dRGuaKm3vn\r\nQ5n3AiJDQb9tFJny7uhp4+ygIlxOfqrysBVK+0ByTCgjo15yTHWv+yGqWwx7\r\n9DE6QZlYhjYnBozrG8JNWA576M0synptSu+0KLmqwBAPd1olTLARHCqyLxzY\r\neSZl2c9stPk5eUbtca4uR9TId1AMHXg9qcamKLDywYQESZ13Zl+rlwmRdOGF\r\nyRY8846/cdNNmGfKqbG3Dm9sqSAwnZcp3mmdNO1WW1rPM6UjXXsOEsR7OknY\r\nd/QmhCHy1vjgvRNUoQjQBwS8iHGYqGew7QFVVhFoewJhLhx4sEdIlvnUeF1Z\r\ntPwObRTqkt15vEkLxUxEeuzrV1CtKsvFl7O41YxN2CaS9KTotRHngNIyYWBk\r\n7LjWAXW8OwAxO5LPcecqxqoEa1bsf+1LvyYBgiHoaKEz0cigjmoWR8Vfw8il\r\nYUIlPUUYQUw4o9RaRKTGB8chbDiVa5HbWm2ag1+2Rnllmzw3o6x6QveWuC1K\r\n2fRfClOtugiiboIrv2afhJPpEsG0ky7pQsSRNi7k1+HMpOA15zQu7L34tC0P\r\nhGZNR6SgVcAD0L7A1BElki2qwuD6qkx4eJE=\r\n=a0mE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"miao.decentral.ee","email":"miao@decentral.ee"},"directories":{},"maintainers":[{"name":"miao.decentral.ee","email":"miao@decentral.ee"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-sdk_0.6.3_1662452081983_0.931363729168827"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-14T12:35:09.823Z","0.2.0-rc1":"2021-01-14T12:35:10.247Z","modified":"2023-05-24T11:43:58.065Z","0.2.0-rc4":"2021-01-14T18:23:30.336Z","0.2.0":"2021-01-14T18:59:50.106Z","0.2.1":"2021-01-15T23:43:47.052Z","0.2.2":"2021-01-16T01:09:45.697Z","0.2.3-dev.9fc570a.0":"2021-01-23T13:04:31.525Z","0.2.3-dev.7d56727.0":"2021-01-23T13:49:29.023Z","0.2.3-dev.bab2b0f.0":"2021-01-23T15:35:07.339Z","0.2.3-dev.f6a8944.0":"2021-01-23T16:09:56.433Z","0.2.3-dev.bc57a16.0":"2021-01-26T13:48:24.320Z","0.2.3-dev.a568aba.0":"2021-01-26T17:11:22.205Z","0.2.3-dev.811c803.0":"2021-01-26T20:06:47.795Z","0.2.3-dev.ec8220f.0":"2021-01-27T22:26:38.586Z","0.2.3-dev.7c6ea57.0":"2021-01-27T23:18:43.979Z","0.2.3-dev.e7adc36.0":"2021-01-28T10:06:44.563Z","0.2.3-dev.9fd100d.0":"2021-01-28T15:14:11.511Z","0.2.3-dev.c531e97.0":"2021-01-28T21:12:37.626Z","0.2.3-dev.50eb675.0":"2021-01-29T00:18:49.327Z","0.2.4-dev.939c83f.0":"2021-01-29T07:58:48.922Z","0.2.3":"2021-01-29T18:27:02.764Z","0.2.4":"2021-01-30T17:47:44.544Z","0.2.5-dev.eb323a4.0":"2021-01-30T17:47:53.124Z","0.2.5-dev.3e0cc67.0":"2021-01-30T19:29:22.265Z","0.2.5-dev.002eec6.0":"2021-02-02T21:53:15.542Z","0.2.5-dev.a48a821.0":"2021-02-03T12:02:18.328Z","0.2.5-dev.f638d4d.0":"2021-02-03T12:47:04.649Z","0.2.5-dev.0dc3687.0":"2021-02-03T15:25:17.477Z","0.3.1-dev.4116854.0":"2021-02-03T18:19:47.050Z","0.3.1-dev.ab25296.0":"2021-02-04T17:09:58.962Z","0.3.1-dev.80d5224.0":"2021-02-05T05:06:46.516Z","0.3.1-dev.2ab0107.0":"2021-02-07T20:09:01.242Z","0.3.0":"2021-02-07T22:35:47.319Z","0.3.2-dev.91c81ed.0":"2021-02-08T01:19:54.747Z","0.3.2-dev.ec60bf6.0":"2021-02-08T11:19:28.188Z","0.3.2-dev.4571dea.0":"2021-02-08T13:26:42.333Z","0.3.2-dev.4f08e3f.0":"2021-02-08T15:32:25.078Z","0.3.2-dev.d164130.0":"2021-02-08T16:54:05.343Z","0.3.1":"2021-02-08T17:18:03.166Z","0.3.2-dev.41f2937.0":"2021-02-08T22:41:24.983Z","0.3.2-dev.88c9725.0":"2021-02-09T02:49:58.426Z","0.3.3-dev.d3f6ffd.0":"2021-02-09T14:35:35.608Z","0.3.2":"2021-02-09T15:28:57.533Z","0.3.3":"2021-02-09T23:14:39.593Z","0.3.4-dev.018eac0.0":"2021-02-09T23:17:24.061Z","0.3.4-dev.a55caff.0":"2021-02-10T19:20:16.206Z","0.3.4-dev.46f8324.0":"2021-02-11T09:10:54.228Z","0.3.5-dev.8c3ef30.0":"2021-02-11T19:28:03.221Z","0.3.5-dev.857ac81.0":"2021-02-12T12:04:26.037Z","0.3.4":"2021-02-12T13:41:35.092Z","0.3.6-dev.1a82c5b.0":"2021-02-12T13:48:53.664Z","0.3.5":"2021-02-12T13:59:49.432Z","0.3.6-dev.51583a4.0":"2021-02-13T14:31:23.935Z","0.3.6-dev.20237eb.0":"2021-02-16T09:34:51.024Z","0.3.6-dev.fa91f90.0":"2021-02-16T16:11:42.066Z","0.3.7-dev.48f8021.0":"2021-02-16T20:38:03.997Z","0.3.7-dev.97fb145.0":"2021-02-19T14:59:54.685Z","0.3.7-dev.8560ac5.0":"2021-02-20T07:27:30.835Z","0.3.7-dev.03ddc74.0":"2021-02-22T15:46:10.343Z","0.3.7-dev.3085235.0":"2021-02-23T19:38:40.610Z","0.4.1-dev.22bf818.0":"2021-02-24T08:12:04.053Z","0.4.1-dev.55b2176.0":"2021-02-24T18:22:25.032Z","0.4.1-dev.25186b0.0":"2021-02-25T11:37:20.253Z","0.4.1-dev.a7dc500.0":"2021-02-26T18:26:19.072Z","0.4.1-dev.6938564.0":"2021-03-01T14:43:24.200Z","0.4.1-dev.895871d.0":"2021-03-01T17:53:34.714Z","0.4.1-dev.ef29ab3.0":"2021-03-01T19:02:49.531Z","0.4.1-dev.b2e433d.0":"2021-03-01T19:05:15.166Z","0.4.1-dev.220bfe9.0":"2021-03-01T19:35:00.792Z","0.4.1-dev.962181c.0":"2021-03-02T12:12:52.753Z","0.4.1-dev.fc65ef2.0":"2021-03-02T13:45:37.434Z","0.4.1-dev.f5e95f3.0":"2021-03-02T18:36:44.934Z","0.4.2-dev.3bddaeb.0":"2021-03-03T10:53:44.103Z","0.4.0":"2021-03-03T11:04:39.980Z","0.4.2-dev.180dbd9.0":"2021-03-05T11:46:32.998Z","0.4.2-dev.a87e48f.0":"2021-03-05T18:17:53.270Z","0.4.2-dev.723dff3.0":"2021-03-08T12:38:26.922Z","0.4.2-dev.78fff64.0":"2021-03-08T21:06:23.343Z","0.4.2-dev.b6e5145.0":"2021-03-09T09:54:01.162Z","0.4.1":"2021-03-09T17:51:28.587Z","0.4.2-dev.e40e62e.0":"2021-03-10T11:36:25.542Z","0.4.2-dev.e5ceab1.0":"2021-03-10T12:09:51.940Z","0.4.2-dev.9dfdccb.0":"2021-03-15T17:04:42.894Z","0.4.2-dev.1291d4a.0":"2021-03-19T17:19:41.004Z","0.4.2-dev.03e2d10.0":"2021-03-22T14:01:08.090Z","0.4.2-dev.ed214bf.0":"2021-03-22T14:07:26.649Z","0.4.2-dev.4db44d6.0":"2021-03-23T20:11:51.095Z","0.4.3-dev.644dc78.0":"2021-03-25T14:58:58.514Z","0.4.2":"2021-03-25T16:23:17.680Z","0.4.3-dev.ab1c34f.0":"2021-03-26T15:35:32.230Z","0.4.3-dev.5ad4132.0":"2021-04-08T13:50:24.179Z","0.4.3-dev.d0e0052.0":"2021-04-08T15:18:46.070Z","0.4.3-dev.af486fa.0":"2021-04-08T15:58:42.600Z","0.4.4-dev.730cbf9.0":"2021-04-08T16:46:08.970Z","0.4.4-dev.b61a962.0":"2021-04-08T21:18:01.644Z","0.4.3":"2021-04-09T14:25:58.457Z","0.4.4-dev.b78e728.0":"2021-05-24T17:52:20.056Z","0.4.4-dev.0e2a60f.0":"2021-05-25T16:23:35.041Z","0.4.4-dev.cc0d44b.0":"2021-06-01T14:04:35.001Z","0.4.4-dev.e20ac6d.0":"2021-06-18T12:06:09.747Z","0.4.4-dev.d84ea02.0":"2021-06-20T16:27:11.290Z","0.4.4-dev.a327a9c.0":"2021-06-22T09:41:36.976Z","0.4.4-dev.44f7b39.0":"2021-06-22T10:39:02.958Z","0.4.4-dev.fd42afb.0":"2021-07-05T12:55:46.347Z","0.4.4-dev.d584c3a.0":"2021-07-05T13:49:06.999Z","0.4.4-dev.e96ad98.0":"2021-07-06T10:37:42.000Z","0.4.4-dev.cf27f60.0":"2021-07-08T11:53:00.321Z","0.4.4-dev.9e35af2.0":"2021-07-09T16:36:40.648Z","0.4.5-dev.ba35ce9.0":"2021-07-09T17:04:09.867Z","0.4.4":"2021-07-09T19:03:27.702Z","0.4.5-dev.17a5688.0":"2021-07-09T20:45:17.845Z","0.4.5-dev.43719e0.0":"2021-07-15T17:12:58.847Z","0.4.5-dev.6eb4952.0":"2021-07-20T09:20:28.465Z","0.4.5-dev.e7765f5.0":"2021-07-26T17:10:03.711Z","0.4.5-dev.91364b3.0":"2021-07-29T15:33:34.530Z","0.4.5-dev.7aebc62.0":"2021-07-30T16:46:32.200Z","0.5.1-dev.6c261db.0":"2021-08-03T17:25:52.846Z","0.5.0":"2021-08-03T18:26:57.549Z","0.5.1-dev.e67a9fd.0":"2021-08-03T19:13:54.630Z","0.5.2-dev.d20e812.0":"2021-08-03T21:59:26.464Z","0.5.1":"2021-08-03T22:08:16.023Z","0.5.2-dev.5662163.0":"2021-08-06T08:47:57.809Z","0.5.2":"2021-08-06T18:35:37.090Z","0.5.3-dev.3900e65.0":"2021-08-06T18:44:04.081Z","0.5.3-dev.48cd899.0":"2021-08-06T19:57:03.548Z","0.5.3-dev.89bba96.0":"2021-08-06T20:08:09.609Z","0.5.3-dev.299b726.0":"2021-08-10T12:09:29.875Z","0.5.3-dev.ec7100a.0":"2021-08-13T20:09:00.196Z","0.5.3-dev.56c62d6.0":"2021-08-13T20:35:47.693Z","0.5.3-dev.059bb92.0":"2021-08-16T15:19:15.198Z","0.5.3":"2021-08-16T19:23:52.391Z","0.5.4-dev.30ff8ec.0":"2021-08-16T20:43:32.282Z","0.5.4-dev.8ae39f2.0":"2021-08-19T15:48:13.869Z","0.5.4-dev.8323943.0":"2021-08-19T17:37:04.488Z","0.5.4-dev.89a1dd0.0":"2021-08-29T20:06:51.089Z","0.5.4-dev.947a459.0":"2021-09-03T11:31:47.277Z","0.5.4-dev.6d01c2b.0":"2021-09-06T11:44:15.162Z","0.5.4-dev.a829c7a.0":"2021-09-06T12:58:09.768Z","0.5.4-dev.38e46e2.0":"2021-09-06T17:26:29.960Z","0.5.4-dev.bebd97c.0":"2021-09-13T17:08:14.727Z","0.5.4":"2021-09-22T11:37:12.644Z","0.5.4-dev.a00bbc8.0":"2021-09-22T12:44:32.197Z","0.5.5-dev.ceb8c25.0":"2021-09-30T17:22:21.426Z","0.5.5-dev.be0c14d.0":"2021-09-30T18:04:01.216Z","0.5.5-dev.585edef.0":"2021-10-04T14:25:51.435Z","0.5.5":"2021-10-05T16:24:14.828Z","0.5.5-dev.a2128ac.0":"2021-10-05T16:49:40.321Z","0.5.6-dev.19b0897.0":"2021-10-05T16:57:13.431Z","0.5.6-dev.19397b5.0":"2021-10-13T13:52:57.455Z","0.5.6-dev.55a6145.0":"2021-10-20T08:32:57.158Z","0.5.6-dev.82023ba.0":"2021-10-26T10:44:03.004Z","0.5.6-dev.0ae809b.0":"2021-10-28T15:51:04.264Z","0.5.6-dev.8a1acab.0":"2021-10-29T08:23:13.908Z","0.5.6-dev.df8c637.0":"2021-10-29T15:06:39.234Z","0.5.6-dev.0384f2a.0":"2021-10-29T15:20:15.637Z","0.5.6-dev.04fda1d.0":"2021-10-29T15:51:56.581Z","0.5.6-dev.6ce816b.0":"2021-11-01T11:37:53.873Z","0.5.6-dev.43e7fdc.0":"2021-11-01T15:35:38.901Z","0.5.6-dev.2ed5aa1.0":"2021-11-04T09:59:24.268Z","0.5.6-dev.8e99262.0":"2021-11-08T11:52:28.401Z","0.5.6-dev.3303a7a.0":"2021-11-09T21:09:40.672Z","0.5.6-dev.041d4de.0":"2021-11-15T15:01:35.797Z","0.5.6-dev.b28955c.0":"2021-11-17T10:03:37.268Z","0.5.6-dev.0515f42.0":"2021-11-18T18:46:52.830Z","0.5.6-dev.fb7dae8.0":"2021-11-18T18:51:59.995Z","0.5.6-dev.a9f9410.0":"2021-11-22T12:54:57.764Z","0.5.6-dev.c4f51ea.0":"2021-11-22T15:49:37.609Z","0.5.6-dev.df73b21.0":"2021-11-23T10:20:43.730Z","0.5.6-dev.ac1b585.0":"2021-11-23T12:00:58.654Z","0.5.7-dev.ec101d5.0":"2021-11-23T12:17:05.261Z","0.5.6":"2021-11-23T12:36:04.318Z","0.5.7-dev.65e7bb4.0":"2021-11-23T14:02:56.489Z","0.5.7-dev.c7199d8.0":"2021-11-23T15:53:04.500Z","0.5.7-dev.0846cd5.0":"2021-11-23T20:43:58.925Z","0.5.7-dev.702671.0":"2021-11-24T13:43:44.069Z","0.5.7-dev.c7fc68e.0":"2021-11-24T22:21:50.327Z","0.5.7-dev.ebe1896.0":"2021-11-26T12:03:00.863Z","0.5.7":"2021-11-26T13:01:51.025Z","0.5.7-dev.9dfd215.0":"2021-11-26T13:08:40.340Z","0.5.8-dev.f475683.0":"2021-11-26T13:43:16.813Z","0.5.8-dev.44acf92.0":"2021-11-26T14:37:27.415Z","0.5.8-dev.251e82d.0":"2021-11-26T15:19:53.327Z","0.5.8-dev.0770a20.0":"2021-11-29T16:50:11.205Z","0.5.8-dev.b79399f.0":"2021-11-30T13:08:28.812Z","0.5.8-dev.5b14268.0":"2021-11-30T13:30:06.808Z","0.5.8-dev.18ff2d2.0":"2021-11-30T14:24:41.600Z","0.5.8-dev.691004.0":"2021-11-30T15:53:41.103Z","0.5.8-dev.88df1a2.0":"2021-12-01T14:59:46.050Z","0.5.8-dev.16594f6.0":"2021-12-01T17:32:54.019Z","0.5.8-dev.7fb5f9e.0":"2021-12-03T17:41:18.395Z","0.5.8-dev.640e6ae.0":"2021-12-03T18:16:37.517Z","0.5.8-dev.86e9998.0":"2021-12-06T15:06:00.951Z","0.5.8-dev.350d38e.0":"2021-12-07T16:41:45.981Z","0.5.8-dev.fa49a94.0":"2021-12-08T12:27:19.607Z","0.5.8":"2021-12-09T10:37:13.905Z","0.5.8-dev.bc1d5ba.0":"2021-12-09T11:04:28.349Z","0.5.9-dev.7bfb2dd.0":"2021-12-09T11:31:40.178Z","0.5.9-dev.8caff13.0":"2021-12-09T15:00:28.993Z","0.5.9-dev.09f628f.0":"2021-12-09T15:26:29.994Z","0.5.9-dev.2c190cd.0":"2021-12-09T15:36:44.327Z","0.5.9-dev.ed7f292.0":"2021-12-09T16:41:06.550Z","0.5.9-dev.e0742d5.0":"2021-12-09T21:55:36.786Z","0.5.9-dev.d7f58c8.0":"2021-12-15T17:44:37.059Z","0.5.9-dev.3d58c4c.0":"2021-12-15T21:50:19.222Z","0.5.9-dev.8919351.0":"2021-12-20T15:59:03.905Z","0.5.9-dev.269e69e.0":"2021-12-21T14:00:27.307Z","0.5.9-dev.087c350.0":"2021-12-22T15:14:17.959Z","0.5.9-dev.b8d3bbf.0":"2022-01-03T11:19:21.981Z","0.5.9-dev.674f2eb.0":"2022-01-04T18:31:30.386Z","0.5.9-dev.f015364.0":"2022-01-07T12:57:01.020Z","0.5.9-dev.afac5d7.0":"2022-01-11T15:15:13.384Z","0.5.9-dev.cbbadf8.0":"2022-01-13T17:16:22.558Z","0.5.9-dev.783917b.0":"2022-01-13T21:50:19.575Z","0.5.9-dev.64549c3.0":"2022-01-13T22:27:55.028Z","0.5.9-dev.3f01c4b.0":"2022-01-21T10:52:20.593Z","0.5.9-dev.beb2240.0":"2022-01-21T13:46:32.690Z","0.5.9-dev.c61bff3.0":"2022-01-21T14:22:41.802Z","0.5.9-dev.652c1bb.0":"2022-01-26T09:30:47.601Z","0.5.9-dev.c3aca57.0":"2022-01-27T14:41:45.288Z","0.5.9-dev.aed3593.0":"2022-01-28T10:24:58.956Z","0.5.9-dev.60ecefd.0":"2022-01-28T12:58:48.853Z","0.5.9-dev.dc4bcef.0":"2022-01-28T14:34:14.936Z","0.5.9-dev.ca5a00d.0":"2022-01-28T15:29:21.266Z","0.5.9-dev.7d85443.0":"2022-01-28T17:44:42.618Z","0.5.9":"2022-01-28T18:50:27.383Z","0.5.9-dev.1ca1d14.0":"2022-01-28T19:28:14.267Z","0.5.10-dev.4013181.0":"2022-01-28T19:35:42.494Z","0.5.10-dev.c8cce89.0":"2022-01-28T23:15:22.668Z","0.5.10-dev.c22ed1e.0":"2022-01-31T10:32:56.155Z","0.5.10-dev.8729be9.0":"2022-01-31T16:47:28.993Z","0.5.10-dev.5cd6462.0":"2022-01-31T17:43:50.762Z","0.5.11-dev.529dca7.0":"2022-02-01T12:21:41.609Z","0.5.10":"2022-02-01T14:36:01.787Z","0.5.11-dev.04f99df.0":"2022-02-01T16:17:52.886Z","0.5.11-dev.d336964.0":"2022-02-01T17:14:07.150Z","0.5.11-dev.da50fa8.0":"2022-02-02T17:21:24.338Z","0.5.12-dev.c114d16.0":"2022-02-03T12:57:59.305Z","0.5.12-dev.e05baf9.0":"2022-02-03T14:34:38.372Z","0.5.11":"2022-02-03T15:28:51.997Z","0.5.12-dev.23493bb.0":"2022-02-04T09:50:15.723Z","0.5.12-dev.2366f30.0":"2022-02-04T20:36:52.732Z","0.5.12-dev.3d367b9.0":"2022-02-07T17:20:09.578Z","0.5.12-dev.011356a.0":"2022-02-07T19:23:12.554Z","0.5.12-dev.dfb06a3.0":"2022-02-07T19:48:15.892Z","0.5.12-dev.d04426e.0":"2022-02-08T19:08:53.088Z","0.5.12-dev.133472a.0":"2022-02-09T00:12:30.390Z","0.5.12-dev.8653bf3.0":"2022-02-10T07:22:35.032Z","0.5.12-dev.a9ad3d8.0":"2022-02-10T09:49:47.997Z","0.5.12-dev.9212d2a.0":"2022-02-10T12:27:25.949Z","0.5.12-dev.e75e426.0":"2022-02-10T17:49:56.538Z","0.5.12-dev.961d27f.0":"2022-02-16T23:40:57.558Z","0.5.12-dev.177d945.0":"2022-02-17T01:37:24.647Z","0.5.12-dev.2a94183.0":"2022-03-02T12:03:10.080Z","0.5.12-dev.97e6f3f.0":"2022-03-02T12:15:54.656Z","0.5.12-dev.2da40ed.0":"2022-03-03T11:49:33.241Z","0.5.12-dev.b2291a5.0":"2022-03-04T17:12:00.875Z","0.5.12-dev.626581d.0":"2022-03-08T12:07:33.337Z","0.5.12-dev.921e7d4.0":"2022-03-08T15:43:04.793Z","0.5.12-dev.ccef7b7.0":"2022-03-09T11:08:19.703Z","0.5.12-dev.37e62a7.0":"2022-03-11T15:29:05.865Z","0.5.12-dev.5907354.0":"2022-03-12T18:33:11.303Z","0.5.12-dev.d7224df.0":"2022-03-14T21:10:30.527Z","0.5.12-dev.0d5b0ff.0":"2022-03-15T19:44:47.004Z","0.5.12":"2022-03-16T13:38:05.741Z","0.5.13-dev.fbe38e2.0":"2022-03-16T15:04:14.695Z","0.5.13-dev.eb90870.0":"2022-03-16T15:11:36.354Z","0.5.13-dev.8a25021.0":"2022-03-16T15:55:30.364Z","0.5.13-dev.33b327e.0":"2022-03-17T11:45:19.327Z","0.5.13-dev.a92870f.0":"2022-03-17T16:19:06.839Z","0.5.13-dev.2e9df43.0":"2022-03-17T18:54:38.148Z","0.5.13-dev.a86bfd1.0":"2022-03-18T10:07:51.152Z","0.5.13-dev.c77270b.0":"2022-03-18T19:01:55.770Z","0.5.13-dev.fb5b7e6.0":"2022-03-23T12:07:22.008Z","0.5.13-dev.6e6d5ef.0":"2022-03-24T16:34:38.971Z","0.5.13-dev.24f280c.0":"2022-04-05T09:58:29.102Z","0.5.13-dev.9b08025.0":"2022-04-07T10:26:59.454Z","0.5.13-dev.ce1e30c.0":"2022-04-08T09:57:10.733Z","0.5.13-dev.e6ed873.0":"2022-04-12T12:00:02.134Z","0.5.13-dev.9dad1ad.0":"2022-04-14T09:54:51.515Z","0.5.13-dev.171c838.0":"2022-04-14T14:45:49.473Z","0.5.13-dev.f55b791.0":"2022-04-14T16:14:42.610Z","0.5.13-dev.ae7db1d.0":"2022-04-18T12:30:46.358Z","0.5.13-dev.84f366b.0":"2022-04-18T12:57:07.161Z","0.5.13-dev.0839cae.0":"2022-04-18T18:06:30.065Z","0.5.13-dev.5923a95.0":"2022-04-25T17:11:35.955Z","0.5.13-dev.873a0d9.0":"2022-04-25T17:35:36.496Z","0.5.13-dev.812e77d.0":"2022-04-26T16:51:05.874Z","0.5.13-dev.9bb2a5b.0":"2022-04-27T11:47:33.919Z","0.5.14-dev.ab3464f.0":"2022-04-27T16:19:16.200Z","0.5.13":"2022-04-28T08:21:05.326Z","0.5.14-dev.0f64af7.0":"2022-04-28T10:34:13.468Z","0.5.14-dev.23fa26e.0":"2022-04-28T12:00:33.418Z","0.5.14-dev.e0371d2.0":"2022-04-28T14:09:34.026Z","0.5.14-dev.4c31a63.0":"2022-04-29T08:13:24.799Z","0.5.14-dev.90ccb01.0":"2022-04-29T12:24:14.890Z","0.5.14-dev.2bc50bf.0":"2022-04-30T08:08:17.289Z","0.5.14-dev.6a8632e.0":"2022-05-04T10:33:30.258Z","0.5.14-dev.ff14ff1.0":"2022-05-04T14:53:41.653Z","0.5.14-dev.c9bc19b.0":"2022-05-04T17:17:46.759Z","0.5.14-dev.a4c583c.0":"2022-05-05T13:58:53.506Z","0.5.14-dev.787fef7.0":"2022-05-05T19:03:57.309Z","0.5.14-dev.ec379f7.0":"2022-05-06T12:44:25.040Z","0.5.14-dev.bd59c6c.0":"2022-05-06T14:05:43.933Z","0.5.14-dev.153bcd3.0":"2022-05-06T17:21:05.635Z","0.5.14-dev.2a22965.0":"2022-05-09T15:50:22.874Z","0.5.14-dev.c960cdd.0":"2022-05-09T18:31:29.515Z","0.5.14-dev.db8e1dc.0":"2022-05-10T09:39:37.109Z","0.5.14-dev.a77e0c8.0":"2022-05-10T14:02:44.415Z","0.6.0":"2022-05-11T09:03:24.766Z","0.6.1-dev.8745146.0":"2022-05-11T09:37:58.810Z","0.6.1-dev.6fea5a7.0":"2022-05-11T09:54:24.197Z","0.6.1-dev.7b08ec0.0":"2022-05-11T12:53:34.293Z","0.6.1-dev.829551e.0":"2022-05-12T10:57:27.675Z","0.6.1-dev.d435096.0":"2022-05-12T12:57:19.302Z","0.6.1-dev.f54cc8b.0":"2022-05-12T16:08:33.433Z","0.6.1-dev.8fbfaca.0":"2022-05-12T16:58:35.083Z","0.6.1-dev.90b879c.0":"2022-05-13T12:29:39.491Z","0.6.1-dev.2ee1942.0":"2022-05-13T13:55:20.672Z","0.6.1-dev.c35a287.0":"2022-05-16T08:19:45.109Z","0.6.1-dev.d28e17d.0":"2022-05-16T12:33:52.738Z","0.6.1":"2022-05-16T18:31:59.356Z","0.6.2-dev.b0d8dd0.0":"2022-05-16T19:29:45.033Z","0.6.2-dev.c518630.0":"2022-05-18T10:44:30.286Z","0.6.2-dev.5073b90.0":"2022-05-18T14:25:26.418Z","0.6.2-dev.c2cbb35.0":"2022-05-19T09:50:53.641Z","0.6.2-dev.9b763f0.0":"2022-05-19T12:58:14.714Z","0.6.2-dev.cd892eb.0":"2022-05-19T14:38:55.984Z","0.6.2-dev.f8cb3ec.0":"2022-05-19T15:02:53.925Z","0.6.2-dev.7b94c3f.0":"2022-05-23T16:55:30.709Z","0.6.2-dev.895b601.0":"2022-05-24T11:06:26.109Z","0.6.2-dev.b11d6d5.0":"2022-05-24T15:54:18.335Z","0.6.2-dev.e59d524.0":"2022-05-24T17:52:19.417Z","0.6.2-dev.c9ab76b.0":"2022-05-25T09:14:41.621Z","0.6.2-dev.7365205.0":"2022-05-25T09:47:38.643Z","0.6.2-dev.3035755.0":"2022-05-26T12:31:37.428Z","0.6.2-dev.3df6de8.0":"2022-05-27T08:57:39.581Z","0.6.2-dev.bf0fae9.0":"2022-05-30T16:15:29.394Z","0.6.2-dev.2a678e0.0":"2022-05-31T11:31:15.277Z","0.6.2-dev.089010c.0":"2022-05-31T22:54:52.815Z","0.6.2-dev.f94fdbb.0":"2022-06-03T09:46:35.197Z","0.6.2-dev.9e35d39.0":"2022-06-05T15:43:29.250Z","0.6.2-dev.4eebafa.0":"2022-06-06T10:27:13.398Z","0.6.2-dev.4ab5d2b.0":"2022-06-06T11:16:59.413Z","0.6.2-dev.4b89f01.0":"2022-06-06T15:41:55.985Z","0.6.2-dev.ace5c31.0":"2022-06-07T10:01:31.328Z","0.6.2-dev.7dc62cd.0":"2022-06-07T15:11:23.933Z","0.6.2-dev.7cac990.0":"2022-06-13T19:43:04.523Z","0.6.2-dev.4ab56c6.0":"2022-06-14T10:34:10.773Z","0.6.2-dev.0c84124.0":"2022-06-14T13:50:45.787Z","0.6.2-dev.b8455ea.0":"2022-06-15T22:05:20.855Z","0.6.2-dev.ad4bf1f.0":"2022-06-15T22:20:12.800Z","0.6.2-dev.bb04d62.0":"2022-06-16T10:18:43.270Z","0.6.2-dev.a4fdc87.0":"2022-06-17T12:48:33.926Z","0.6.2-dev.5584c73.0":"2022-06-17T12:55:39.912Z","0.6.2-dev.7df8a6a.0":"2022-06-20T11:33:51.495Z","0.6.2-dev.70e7fff.0":"2022-06-21T09:03:53.531Z","0.6.2-dev.8534dba.0":"2022-06-22T08:45:24.219Z","0.6.2-dev.4e0c77d.0":"2022-06-27T10:24:48.874Z","0.6.3-dev.70e4b1f.0":"2022-06-29T12:12:11.017Z","0.6.3-dev.6051b03.0":"2022-06-29T12:23:48.600Z","0.6.3-dev.ce099c3.0":"2022-06-29T12:40:27.153Z","0.6.2":"2022-06-29T13:26:02.170Z","0.6.3-dev.ff4f866.0":"2022-06-30T16:31:26.733Z","0.6.3-dev.19b1d22.0":"2022-06-30T17:30:45.373Z","0.6.3-dev.8790736.0":"2022-06-30T17:31:42.017Z","0.6.3-dev.6cf4191.0":"2022-07-02T09:51:03.451Z","0.6.3-dev.62ad4ce.0":"2022-07-04T08:57:47.905Z","0.6.3-dev.73ba205.0":"2022-07-04T10:50:30.584Z","0.6.3-dev.dd9c416.0":"2022-07-04T19:09:53.503Z","0.6.3-dev.ab7dc19.0":"2022-07-06T09:46:59.620Z","0.6.3-dev.e19ac49.0":"2022-07-07T16:07:19.295Z","0.6.3-dev.53e1b83.0":"2022-07-08T10:25:52.054Z","0.6.3-dev.25182e1.0":"2022-07-08T15:55:53.904Z","0.6.3-dev.81d6a38.0":"2022-07-11T08:38:54.808Z","0.6.3-dev.4106f0f.0":"2022-07-12T13:15:18.610Z","0.6.3-dev.1a3caa3.0":"2022-07-13T10:39:50.464Z","0.6.3-dev.3b2a6b9.0":"2022-07-13T12:20:34.608Z","0.6.3-dev.cfb8f07.0":"2022-07-18T09:57:09.382Z","0.6.3-dev.0b53009.0":"2022-07-18T10:25:30.360Z","0.6.3-dev.763ca69.0":"2022-07-18T13:59:43.189Z","0.6.3-dev.84853ed.0":"2022-07-19T11:34:54.325Z","0.6.3-dev.0c28ede.0":"2022-07-19T13:22:17.094Z","0.6.3-dev.240b292.0":"2022-07-20T11:03:07.552Z","0.6.3-dev.bba2a88.0":"2022-07-20T15:06:19.057Z","0.6.3-dev.2ac801d.0":"2022-07-20T15:32:51.966Z","0.6.3-dev.137cab2.0":"2022-07-21T09:32:54.585Z","0.6.3-dev.7809571.0":"2022-07-25T08:46:14.032Z","0.6.3-dev.f39efb8.0":"2022-07-26T14:03:59.439Z","0.6.3-dev.49897f6.0":"2022-07-26T14:55:54.242Z","0.6.3-dev.d896783.0":"2022-08-04T13:59:16.965Z","0.6.3-dev.9e7fa81.0":"2022-08-04T15:16:00.241Z","0.6.3-dev.ab0fdb4.0":"2022-08-05T08:47:35.332Z","0.6.3-dev.75a0001.0":"2022-08-08T11:03:14.522Z","0.6.3-dev.b9b1fe8.0":"2022-08-09T13:25:34.979Z","0.6.3-dev.9e9228f.0":"2022-08-09T20:14:40.429Z","0.6.3-dev.0079f56.0":"2022-08-10T14:30:41.306Z","0.6.3-dev.bf84335.0":"2022-08-11T13:00:27.032Z","0.6.3-dev.d249828.0":"2022-08-15T13:15:31.715Z","0.6.3-dev.8464790.0":"2022-08-16T08:54:21.982Z","0.6.3-dev.3c955c7.0":"2022-08-16T23:11:17.137Z","0.6.3-dev.a55899d.0":"2022-08-18T13:29:13.438Z","0.6.3-dev.2a73012.0":"2022-08-19T13:30:46.106Z","0.6.4-dev.fc916ff.0":"2022-08-20T15:37:10.981Z","0.6.4-dev.ccb1898.0":"2022-08-23T08:55:33.853Z","0.6.4-dev.e55bf9f.0":"2022-08-24T13:24:44.051Z","0.6.4-dev.aa64b52.0":"2022-08-24T20:45:17.856Z","0.6.4-dev.de7575d.0":"2022-08-25T14:18:13.616Z","0.6.4-dev.381116e.0":"2022-08-26T11:17:24.472Z","0.6.4-dev.8696fa0.0":"2022-08-29T16:09:11.510Z","0.6.4-dev.9e41aae.0":"2022-08-30T13:04:27.471Z","0.6.4-dev.32db5c3.0":"2022-08-30T15:54:41.409Z","0.6.4-dev.5081272.0":"2022-08-31T11:13:11.854Z","0.6.4-dev.47b0a5e.0":"2022-09-01T13:46:36.513Z","0.6.4-dev.ddbd8c9.0":"2022-09-01T16:21:57.575Z","0.6.4-dev.aec6dd9.0":"2022-09-02T09:05:03.252Z","0.6.4-dev.e675dbc.0":"2022-09-05T13:35:30.895Z","0.6.3":"2022-09-06T08:14:42.238Z"},"maintainers":[{"email":"dev-admin+npm@superfluid.finance","name":"superfluid_finance"},{"email":"miao@decentral.ee","name":"miao.decentral.ee"}],"description":"Javascript SDK for building with Superfluid Protocol","homepage":"https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk#readme","repository":{"type":"git","url":"git+https://github.com/superfluid-finance/protocol-monorepo.git","directory":"packages/js-sdk"},"bugs":{"url":"https://github.com/superfluid-finance/protocol-monorepo/issues"},"license":"MIT","readme":"<h1 align=\"center\">Welcome to @superfluid-finance/js-sdk 👋\n</h1>\n<div align=\"center\">\n<img  width=\"300\" padding=\"0 0 10px\" alt=\"Superfluid logo\" src=\"https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png\" />\n<p>\n  <a href=\"https://www.npmjs.com/package/@superfluid-finance/js-sdk\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@superfluid-finance/js-sdk.svg\">\n  </a>\n  <a href=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/tree/dev/packages/js-sdk\">\n    <img src=\"https://codecov.io/gh/superfluid-finance/protocol-monorepo/branch/dev/graph/badge.svg?token=LJW5NDGEJ9&flag=js-sdk\"/>\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" />\n  </a>\n  <a href=\"https://twitter.com/Superfluid_HQ/status/\" target=\"blank\">\n    <img alt=\"Twitter: Superfluid_HQ\" src=\"https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social\" />\n  </a>\n</p>\n</div>\n\nJavascript SDK for building with Superfluid Protocol.\n\n### :warning: This repo is deprecated :warning:\n**Superfluid SDK project has been modularized, for similar functionality use [`@superfluid-finance/sdk-core`](https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/sdk-core) instead.**\n\n\n### 🏠 [Homepage](https://superfluid.finance)\n\n### ✨ [Superfluid App](https://app.superfluid.finance/)\n\n### 📖 [Docs](https://docs.superfluid.finance)\n\n# Important Notice\n\nWe will be deprecating the JS-SDK and stop providing support/fixes in the near future, so please use either:\n-  [sdk-core](https://www.npmjs.com/package/@superfluid-finance/sdk-core) which can be used for both front-end and back-end dApp development, this can be thought of more as a thin wrapper of the protocol contracts and is unconcerned with state.\n\nor\n\n- [sdk-redux](https://www.npmjs.com/package/@superfluid-finance/sdk-redux) for building production-grade front-ends for dApps with state management, caching logic, transaction tracking, react hooks and much more.\n\n# Usage\n\nHere is a quick look at using the SDK.\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst Web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n\n// Constant Flow Agreement\nawait bob.flow({\n    recipient: \"0x123...\",\n    flowRate: \"38580246913580\", // 100 tokens / mo\n});\n\n// Instant Distribution Agreement\n// - More utilities coming soon. See the docs for now\n```\n\n## What's In the Bag\n\n-   `sf.user`: A helpful abstraction that should handle most of your needs. See below for more details.\n-   `sf.host` : The [truffle contract instance](https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts)\n    to interact with the host contract (Superfluid.sol).\n-   `sf.contracts` : The [truffle contract](https://www.trufflesuite.com/docs/truffle/reference/contract-abstractions) objects loaded by the SDK:\n    -   `IERC20` : The ERC20 Interface.\n    -   `TokenInfo` : A customary ERC20 token info interface (name/symbol/decimals).\n    -   `ERC20WithTokenInfo` : A combination of IERC20 and TokenInfo.\n    -   `TestToken` : A ERC20 Test token.\n    -   `IResolver` : A simple resolver interface to locate different versions of the contracts.\n    -   `ISuperfluid` : The Superfluid host contract interface.\n    -   `ISuperToken` : The Super token contract interface.\n    -   `IConstantFlowAgreementV1` : The constant flow agreement (v1) contract interface.\n    -   `IInstantDistributionAgreementV1` : The instant distribution agreement (v1) contract interface.\n-   Token factory helper functions:\n    -   `sf.createERC20Wrapper`\n-   `sf.resolver`: The resolver used by the SDK.\n    -   In test nets, there are some test tokens can be located with the resolver:\n        -   `fDAI` : The fake DAI. `sf.resolver.get(\"tokens.fDAI\")`.\n        -   `fUSDC` : The fake USDC. `sf.resolver.get(\"tokens.fUSDC\")`.\n        -   `fTUSD` : The fake TUSD. `sf.resolver.get(\"tokens.fTUSD\")`.\n-   `sf.agreements`:\n    -   `sf.agreements.cfa` : Constant flow agreement truffle contract instance.\n    -   `sf.agreements.ida` : Instant distribution agreement truffle contract instance.\n-   `sf.cfa`: The constant flow agreement helper class instance.\n-   `sf.ida`: The instant distribution agreement helper class instance.\n\n## Initialization\n\nDuring initialization, the resolver will be used to fetch the correct set of contracts based on the `version` you provide\n\n| Argument             | Type     | description                                            | default   |\n| :------------------- | :------- | ------------------------------------------------------ | --------- |\n| version              | String   | Release version of the deployed protocol               | v1        |\n| isTruffle            | Boolean  | Use the Framework under the native truffle environment | false     |\n| web3                 | Object   | Use the Framework with web3.js (1.3.x)                 | undefined |\n| additionalContracts  | String[] | additional contracts to be loaded                      | []        |\n| tokens               | String[] | List of token keys to load from the resolver           | []        |\n| loadSuperNativeToken | Boolean  | Load super native token (e.g. ETHx) if possible        | false     |\n| resolverAddress      | Address  | Force resolver address                                 | undefined |\n\nYou also need to choose what web3 framework you plan to use, currently we support three modes:\n\n-   Truffle native environment (developing using `truffle test|exec|egc.`).\n-   [Web3.js](https://web3js.readthedocs.io/en/v1.2.1/), currently the SDK has been tested with web3.js `1.3.x` versions.\n\n\n**Example with Web3.js**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\nconst web3 = require(\"web3\");\n\nconst sf = new SuperfluidSDK.Framework({\n    web3: new Web3(window.ethereum),\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type.\n\n**Example with truffle native**\n\n```js\nconst SuperfluidSDK = require(\"@superfluid-finance/js-sdk\");\n\nconst sf = new SuperfluidSDK.Framework({\n    isTruffle: true,\n    tokens: [\"fDAI\"],\n});\nawait sf.initialize();\n\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAIx.address });\n```\n\nThe exposed contract objects are of [`truffle-contract`](https://github.com/trufflesuite/truffle/tree/develop/packages/contract/) type loaded using truffle `artifacts` object.\n\n## :bust_in_silhouette: User\n\nCreate a new User object to quickly create and modify agreements.\n\nExample:\n\n```js\nconst bob = sf.user({ address: \"0xabc...\", token: sf.tokens.fDAI });\nconst carol = sf.user({ address: \"0x123...\", token: sf.tokens.fDAI });\n```\n\n### `user.details()`\n\nReturns details about an account.\n\n| Argument | Type | default |\n| :------- | :--- | ------- |\n| n/a      |      |         |\n\nExample:\n\n```js\nconsole.log(await bob.details());\n\n> {\n    cfa: {\n        flows: {\n            inFlows: [\n                {\n                    sender: \"0xf17f52151EbEF6C7334FAD080c5704D77216b732\",\n                    receiver: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    flowRate: \"38580246913580\"\n                }\n            ],\n            outFlows: [\n                {\n                    sender: \"0xC5fdf4076b8F3A5357c5E395ab970B5B54098Fef\",\n                    receiver: \"0x821aEa9a577a9b44299B9c15c88cf3087F3b5544\",\n                    flowRate: \"19290123456790\"\n                }\n            ]\n        },\n        netFlow: \"19290123456790\"\n    },\n    ida: {} // Available soon\n}\n```\n\n### `user.flow({recipient, flowRate, [, onTransaction, ...]})`\n\nCreate / update / delete a flow to the recipient. Enter \"0\" to delete a flow.\n\n| Argument      | Type                           | default  |\n| :------------ | :----------------------------- | -------- |\n| recipient     | Address or another User Object | required |\n| flowRate      | String                         | required |\n| onTransaction | Function                       | null     |\n\nExample:\n\n```js\nconst tx = await alice.flow({\n    recipient: bob,\n    flowRate: \"38580246913580\", // 100 / mo\n    // OPTIONS: See ConstantFlowAgreementV1Helper for more\n    onTransaction: (hash) => {\n        txHash = hash;\n    },\n});\n```\n\n## Closer to the metal\n\nYou may also use the helper classes and functions instead of the `User` abstraction.\n\nThe helpers are usually considered thinner wrappers of the underlying contract calls. It is suitable if you want more control and customization of how to interact with the protocol.\n\nThe available helpers currently are:\n\n-   `sf.cfa` - Constant flow agreement helper.\n-   `sf.ida` - Instant distribution agreement helper.\n-   `sf.createERC20Wrapper` - Create a new ERC20 wrapper.\n-   `sf.batchCall` - (TBD) batchCall helper.\n-   `sf.callAppAction` - (TBD) callAppAction helper.\n\nFor their documentations, please look into their code comments directly.\n\n# Contributing\n\nContributions and suggestions welcome!\n\n## Module packaging\n\nCheck the module size and dependencies:\n\n```bash\nyarn stats\n```\n\n## Testing\n\nSince testing can take a long time to execute, you may want to use the [execlusive tests](https://mochajs.org/#exclusive-tests) feature from MochaJS to isolate only the test you want. For example:\n\n```bash\n# Only run User.test.js\nnodemon -x npx truffle test ./test/User.test.js\n```\n","readmeFilename":"README.md"}