Skip to content

Commit

Permalink
SuperFluid Create Stream Example (#140)
Browse files Browse the repository at this point in the history
* changed amount and added comment
  • Loading branch information
vignesha22 authored Jul 4, 2022
1 parent f11df09 commit 6225bdc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions examples/src/17-superFluids-createStream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { utils } from "ethers";
import { BigNumber } from "ethers";
import { NetworkNames, Sdk, EnvNames } from "../../src";
import { logger } from "./common";

Expand All @@ -17,11 +17,17 @@ async function main(): Promise<void> {

await sdk.computeContractAccount();

/*
* Make sure that the amount is not too low for the estimate to fail.
* If Estimation fails, you will receive all parameters as null
*/
const txnData = await sdk.createStreamTransactionPayload({
tokenAddress: superTokenAddress,
receiver: receiverAddress,
amount: utils.parseEther('0.1')
amount: BigNumber.from("1000000000000"), // amount in wei
})

logger.log('Transaction Data: ', txnData);
if (!txnData.error && txnData.data && txnData.to) {
// Submit the Transaction data using Etherspot SDK
await sdk.clearGatewayBatch();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "etherspot",
"version": "1.33.9",
"version": "1.33.10",
"description": "Etherspot SDK",
"keywords": [
"ether",
Expand Down

0 comments on commit 6225bdc

Please sign in to comment.