Update spl_mint.ts

This commit is contained in:
Dean 利迪恩
2023-08-15 21:02:45 +08:00
committed by GitHub
parent b9ac3bf408
commit 662db94f65

View File

@@ -16,24 +16,14 @@ const mint = new PublicKey("<mint address>");
(async () => {
try {
const ata = await getOrCreateAssociatedTokenAccount(
connection,
keypair,
mint,
keypair.publicKey
);
console.log(`Your ata is: ${ata.address.toBase58()}`);
// Create an ATA
// const ata = ???
// console.log(`Your ata is: ${ata.address.toBase58()}`);
const mintTx = await mintTo(
connection,
keypair,
mint,
ata.address,
keypair,
1000n * token_decimals
)
console.log(`Your mint txid: ${mintTx}`);
// Mint to ATA
// const mintTx = ???
// console.log(`Your mint txid: ${mintTx}`);
} catch(error) {
console.log(`Oops, something went wrong: ${error}`)
}
})()
})()