const umi = createUmi(connection)
.use(mplTokenMetadata())
.use(walletAdapterIdentity(wallet));
const mint = generateSigner(umi);
await createFungible(umi, {
mint,
name: 'Name',
symbol: '$Symbol',
uri: '....',
sellerFeeBasisPoints: percentAmount(5.5),
decimals: 3,
splTokenProgram: publicKey(TOKEN_2022_PROGRAM_ID),
})
.sendAndConfirm(umi)
.then(() => {
console.log(
'token created (',
mint.publicKey,
')',
);
});
here is mint code:
await mintV1(umi, {
mint: publicKey(mint.publicKey),
tokenOwner: publicKey(wallet.publicKey),
amount: 10000000,
tokenStandard: TokenStandard.Fungible,
splTokenProgram: publicKey(TOKEN_2022_PROGRAM_ID),
}).sendAndConfirm(umi);