Zebec
Search…
Start Streaming
Start streaming helps to initiate the stream , for this user should decide start time , end time , amount and receiver before streaming and pass parameters as :
// Native Token
const response = await native.init({
sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9',
receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs",
start_time: Math.floor(Date.now() / 1000) + 80,
end_time: Math.floor(Date.now() / 1000) + 150,
amount: 0.5,
});
console.log(response);
// SPL Token
const response = await token.init({
sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9',
receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs",
start_time: Math.floor(Date.now() / 1000) + 80,
end_time: Math.floor(Date.now() / 1000) + 150,
amount: 0.5,
token:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF',
});
console.log(response);
Note: Returned 'PDA' should be saved for using stream methods: pause, resume, and, withdraw the streamed token.
Copy link