Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • LevelUpgrade

Index

Constructors

  • new LevelUpgrade(programId: PublicKey, connection: Connection, wallet: Wallet): LevelUpgrade
  • Parameters

    • programId: PublicKey
    • connection: Connection
    • wallet: Wallet

    Returns LevelUpgrade

Properties

connection: Connection
program: Program<LevelUpgradeProgram>

Methods

  • addUpdateAuthoritySignature(tx: Transaction, signingAuthorityAddress: PublicKey, signature: Buffer): Transaction
  • Add update authority signature in the transaction.

    Parameters

    • tx: Transaction

      Transaction object where signature needs to add.

    • signingAuthorityAddress: PublicKey

      Signing authority public key from which secret key transaction is signed.

    • signature: Buffer

      Signed transaction message signature.

    Returns Transaction

  • getLevelUpAccountPdaAddress(nftAddress: PublicKey): Promise<PublicKey>
  • Get the levelup account PDA address.

    Parameters

    • nftAddress: PublicKey

      NFT address send as seed for getting the PDA address.

    Returns Promise<PublicKey>

  • getLevelUpAccountPdaData(levelUpAccountPdaAddress: PublicKey): Promise<any>
  • Get level up account data stored in the PDA address from the on-chain Solana network.

    Parameters

    • levelUpAccountPdaAddress: PublicKey

      PDA address where data is stored.

    Returns Promise<any>

  • getNftLevel(nftAddress: PublicKey): Promise<number>
  • Get NFT Level from the NFT address (if nft does not exist on the network then it will throw the error "PDA not exist")

    Parameters

    • nftAddress: PublicKey

      NFT address which level will get.

    Returns Promise<number>

  • getNftLevelOrDefault(nftAddress: PublicKey): Promise<number>
  • Get NFT Level from the NFT address (if nft does not exist on the network then it returns the 0 by default)

    Parameters

    • nftAddress: PublicKey

      NFT address which level will get.

    Returns Promise<number>

  • isLevelUpAccountPdaInitialize(levelUpAccountPdaAddress: PublicKey): Promise<boolean>
  • Get info is the given PDA address exists on the Solana network.

    Parameters

    • levelUpAccountPdaAddress: PublicKey

      PDA address which info is checking on Solana network.

    Returns Promise<boolean>

  • signTransaction(tx: Transaction, secretKey: string): Transaction
  • Sign the transaction and add the signature in the transaction.

    Parameters

    • tx: Transaction

      Transaction object which needs to sign.

    • secretKey: string

      Transaction signer secret key (secret key in base58 string).

    Returns Transaction

  • updateLevel(nftAddress: PublicKey, userAddress: PublicKey, newLevel: number, signingAuthorityAddress: PublicKey): Promise<Transaction>
  • Create the level update transaction object.

    Parameters

    • nftAddress: PublicKey

      NFT address which level needs to update

    • userAddress: PublicKey

      user public address who's going to sign the transaction and going to pay for the transaction fee

    • newLevel: number

      New level of the NFT

    • signingAuthorityAddress: PublicKey

      Signing authority public address which going to sign the transaction

    Returns Promise<Transaction>

Generated using TypeDoc