Function holderAddressWithSeed

  • Generates a program-derived holder address using a randomly generated seed.

    This function creates a program-derived address (PDA) for a holder account associated with a given Solana wallet. A random numeric seed is generated and used to derive the address with PublicKey.createWithSeed().

    Parameters

    • neonEvmProgram: PublicKey

      The public key of the Neon EVM program.

    • solanaWallet: PublicKey

      The Solana wallet public key that owns the holder account.

    Returns Promise<[PublicKey, string]>

    A promise resolving to a tuple containing:

    • PublicKey: The derived holder account address.
    • string: The random seed used to generate the address.
    const [holderAddress, seed] = await holderAddressWithSeed(neonEvmProgram, solanaWallet);
    console.log("Holder Address:", holderAddress.toBase58());
    console.log("Seed Used:", seed);