I am creating PDA accounts which have seeds consisting of user-wallet-publicKey and a static-text
In frontend I want to show either user-data if user already created his account or a button to deploy new user-related-pda-account, for that I want to know if user already created / deployed account related to him or not
I am generating PDA-address in frontend like this:
const timerProgram = getTimerProgram(provider)
const [timerStatsPDA, _] = await PublicKey.findProgramAddress(
[
utils.bytes.utf8.encode('timer_map'),
provider.wallet.publicKey.toBuffer(),
],
timerProgram.programId
)
I am searching for function similar like this
const isExist = await isAccountExist(timerStatsPDA)