Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix: remove subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
cinlk committed Mar 25, 2022
1 parent 9278317 commit ff50982
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions airdrop/api/pangolin/airdrop/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,7 @@ async function transfer(chainName: String, address: String): Promise<TransferRec

const txHash = await api.tx.balances
.transfer(address.toString(), AMOUNT * 1000000000)
.signAndSend(faucetAccount, ({ events = [], status }) => {
console.log(`Current status is ${status.type}`);

if (status.isInBlock) {
console.log("transaction with hash " + status.asInBlock.toHex());
}
if (status.isFinalized) {
console.log(`Transaction included at blockHash ${status.asFinalized}`);
// Loop through Vec<EventRecord> to display all events
// events.forEach(({ phase, event: { data, method, section } }) => {
// console.log(`\t' ${phase}: ${section}.${method}:: ${data}`);
// });
}
});
.signAndSend(faucetAccount);

return { tx: txHash, preview: `https://pangolin.subscan.io/block/${txHash}` };

Expand Down

0 comments on commit ff50982

Please sign in to comment.