Endpoints
Create Stream
#[payable("*")]
#[endpoint(createStream)]
fn create_stream(
&self,
recipient: ManagedAddress,
start_time: u64,
end_time: u64,
can_cancel: OptionalValue<bool>
) TransactionPayload.contractCall()
.setFunction(new ContractFunction("ESDTTransfer"))
.addArg(new BytesValue(Buffer.from('USDC-a2sd58', "utf-8"))) // streamed token identifier
.addArg(new BigUIntValue(TokenPayment.egldFromAmount('100').valueOf())) // streamed token amount
.addArg(new BytesValue(Buffer.from("createStream", "utf-8")))
.addArg(new AddressValue(new Address('erd1aaaa.....'))) // recipient address
.addArg(new U64Value(1674158572)) // start time
.addArg(new U64Value(1674159572)) // end time
.build();Claim from stream
Cancel stream
Claim from stream after cancel
Last updated