Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7925

Allow a holder to freeze/thaw their own SPL token token account

$
0
0

I am looking at developing a dapp that rewards holders based on the length they keep their associated token account frozen for.

I have tried the below code in my nextjs/react app, however I can only get it to work when authority and the wallet connected matches the token update authority address.

const { sendTransaction } = useWallet();const { connection } = useConnection();const transaction = new Transaction().add(    createFreezeAccountInstruction(        account,        mint,        authority    ),);await sendTransaction(transaction, connection).then(async (signature) => {    console.log("signature", signature);});

Is it possible for a token account owner to freeze their own account and if so what is the best approach to doing so with a dapp environment?


Viewing all articles
Browse latest Browse all 7925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>