Zebec
Search…
Initialize Native Token
For initializing transactions, we need to send the sender address, receiver address, amount, start time and end time in epoch timestamp.
const sendTransac = async () => {
const data = {
sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9",
receiver: "FuEm7UMaCYHThzKaf9DcJ7MdM4t4SALfeNnYQq46foVv",
amount: 1,
start_time: 1637182627, // epoch time stamp (unix) Math.floor(Date.now()/1000)
end_time: 1637192627,
};
const response = await initNativeTransaction(data);
console.log(response); // pda should be saved.
};

Initialize Token

const data = {
sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9",
receiver: "FuEm7UMaCYHThzKaf9DcJ7MdM4t4SALfeNnYQq46foVv",
amount: 1,
start_time: 1637182627, // epoch time stamp (unix) Math.floor(Date.now()/1000)
end_time: 1637192627,
token:'2ibSirDWk5P68ZKmQQSxUMtiWQFRuanpPfMfaYzxgSRv' //token mint address
};
const response = await MultiTokenStream(data);
console.log(response); // pda should be saved.
};
Copy link