Skip to content

Instantly share code, notes, and snippets.

@madhavanmalolan
Created September 18, 2021 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhavanmalolan/d6e01a7e43887899bc39dc32a8576a56 to your computer and use it in GitHub Desktop.
Save madhavanmalolan/d6e01a7e43887899bc39dc32a8576a56 to your computer and use it in GitHub Desktop.
const subscribe = async () => {
const provider = new Web3Provider(window.ethereum);
const sf = new SuperfluidSdk.Framework({ ethers: provider});
await sf.initialize();
const user = sf.user({
address: await provider.getSigner().getAddress(),
token: '0x6fC99F5591b51583ba15A8C2572408257A1D2797'
});
const flow = await user.flow({
recipient: '0x89Ce0f71D7387a580c6C07032f74f393a65d77F4',
flowRate: parseInt(0.01 * 1e18 / ( 60* 60* 24* 30)).toString() // 0.01 wei per month - paid every second
});
console.log("Flow", flow);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment