Created
September 18, 2021 11:37
-
-
Save madhavanmalolan/d6e01a7e43887899bc39dc32a8576a56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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