Zebec Protocol
Search…
⌃K

Withdraw Streamed Token

To withdraw the streamed token this function is useful. In this function only the receiver is signer i.e only the receiver can withdraw the token.
// Native Token
​
const response = await native.withdraw({
sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9",
amount: 0.5,
receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs",
pda: "FMBLNb3KD1u4pXhDzQQAqVanEqu6yCsD2wMjdARFbbtK",
});
console.log(response.message);
// SPL Token
​
const response = await token.withdraw({
sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9",
amount: 0.5,
receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs",
pda: "FMBLNb3KD1u4pXhDzQQAqVanEqu6yCsD2wMjdARFbbtK",
token:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF',
});
console.log(response.message);
​