Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • GameWalletLib

Index

Constructors

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

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

    Returns GameWalletLib

Properties

connection: Connection
program: Program<GameWallet>

Methods

  • addFeePayerAndRecentBlockHashInTransaction(tx: Transaction, feePayer: PublicKey): Promise<Transaction>
  • Add signature in the transaction.

    Parameters

    • tx: Transaction

      Transaction object where signature needs to add.

    • feePayer: PublicKey

      public key of the address which going to pay the fee.

    Returns Promise<Transaction>

  • addSignatureInTransaction(tx: Transaction, signerAddress: PublicKey, signature: Buffer): Transaction
  • Add signature in the transaction.

    Parameters

    • tx: Transaction

      Transaction object where signature needs to add.

    • signerAddress: PublicKey

      Signer public key from which secret key transaction is signed.

    • signature: Buffer

      Signed transaction message signature.

    Returns Transaction

  • createAddDepositSupplyTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create add deposit supply transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createAddDistributeSupplyTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create add distribute supply transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createDepositTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, depositFor: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • create deposit transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • depositFor: PublicKey

      public key of the account which deposit is make

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createDistributeTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create add distribute supply transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createDistributeWithoutUserTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create distribute without user transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createInitializeTokenConfigTransaction(tokenDecimal: number, isPaused: boolean, canDeposit: boolean, canWithdraw: boolean, canSpend: boolean, canDistribute: boolean, isWithdrawServiceFeeEnable: boolean, withdrawServiceFeePercentage: number, isSpendServiceFeeEnable: boolean, spendServiceFeePercentage: number, isDistributionServiceFeeEnable: boolean, distributionServiceFeePercentage: number, isMinWithdrawEnable: boolean, isMaxWithdrawEnable: boolean, minWithdraw: number, maxWithdraw: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create initialize token config transaction.

    Parameters

    • tokenDecimal: number

      decimal points of token mint account

    • isPaused: boolean

      is program is paused

    • canDeposit: boolean

      is program allow token deposit

    • canWithdraw: boolean

      is program allow token withdrawal

    • canSpend: boolean

      is program allow token spending

    • canDistribute: boolean

      is program allow token distribution

    • isWithdrawServiceFeeEnable: boolean

      is program allow withdrawal service fee

    • withdrawServiceFeePercentage: number

      withdraw service fee percentage

    • isSpendServiceFeeEnable: boolean

      is program allow spending service fee

    • spendServiceFeePercentage: number

      spend service fee percentage

    • isDistributionServiceFeeEnable: boolean

      is program allow distribution service fee

    • distributionServiceFeePercentage: number

      distribution service fee percentage

    • isMinWithdrawEnable: boolean

      is program allow min withdraw token amount

    • isMaxWithdrawEnable: boolean

      is program allow max withdraw token amount

    • minWithdraw: number

      min withdraw token amount

    • maxWithdraw: number

      max withdraw token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createSpendTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • create spend transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createSpendWithoutUserTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • Create spend without user transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createUpdateTokenConfigTransaction(tokenDecimal: number, isPaused: boolean, canDeposit: boolean, canWithdraw: boolean, canSpend: boolean, canDistribute: boolean, isWithdrawServiceFeeEnable: boolean, withdrawServiceFeePercentage: number, isSpendServiceFeeEnable: boolean, spendServiceFeePercentage: number, isDistributionServiceFeeEnable: boolean, distributionServiceFeePercentage: number, isMinWithdrawEnable: boolean, isMaxWithdrawEnable: boolean, minWithdraw: number, maxWithdraw: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • create update token config transaction.

    Parameters

    • tokenDecimal: number

      decimal points of token mint account

    • isPaused: boolean

      is program is paused

    • canDeposit: boolean

      is program allow token deposit

    • canWithdraw: boolean

      is program allow token withdrawal

    • canSpend: boolean

      is program allow token spending

    • canDistribute: boolean

      is program allow token distribution

    • isWithdrawServiceFeeEnable: boolean

      is program allow withdrawal service fee

    • withdrawServiceFeePercentage: number

      withdraw service fee percentage

    • isSpendServiceFeeEnable: boolean

      is program allow spending service fee

    • spendServiceFeePercentage: number

      spend service fee percentage

    • isDistributionServiceFeeEnable: boolean

      is program allow distribution service fee

    • distributionServiceFeePercentage: number

      distribution service fee percentage

    • isMinWithdrawEnable: boolean

      is program allow min withdraw token amount

    • isMaxWithdrawEnable: boolean

      is program allow max withdraw token amount

    • minWithdraw: number

      min withdraw token amount

    • maxWithdraw: number

      max withdraw token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • incomeAccount: PublicKey

      income account public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createUpdateUserTokenConfigTransaction(isActive: boolean, canDeposit: boolean, canWithdraw: boolean, canSpend: boolean, canDistribute: boolean, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey): Promise<Transaction>
  • create update user token config transaction.

    Parameters

    • isActive: boolean

      is user account active

    • canDeposit: boolean

      is program allow token deposit

    • canWithdraw: boolean

      is program allow token withdrawal

    • canSpend: boolean

      is program allow token spending

    • canDistribute: boolean

      is program allow token distribution

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    Returns Promise<Transaction>

  • createWithdrawTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, receiver: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • create withdraw transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • incomeAccount: PublicKey

      income account public key

    • receiver: PublicKey

      receiver public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • createWithdrawWithoutUserTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, receiver: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
  • create withdraw without user transaction.

    Parameters

    • amount: number

      token amount

    • payer: PublicKey

      transaction fee payer public key

    • signingAuthority: PublicKey

      signing authority public key

    • tokenMintAccount: PublicKey

      token mint account public key

    • user: PublicKey

      user public key

    • incomeAccount: PublicKey

      income account public key

    • receiver: PublicKey

      receiver public key

    • tokenProgram: PublicKey = TOKEN_PROGRAM_ID

      token program id

    • associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID

      associated token program id

    • systemProgram: PublicKey = SystemProgram.programId

      system program id

    • rent: PublicKey = SYSVAR_RENT_PUBKEY

      rent program id

    Returns Promise<Transaction>

  • getAllDepositPoolAccountData(): Promise<any>
  • Get all deposit pool account data.

    Returns Promise<any>

  • getAllDistributionPoolAccountData(): Promise<any>
  • Get all distribution pool account data.

    Returns Promise<any>

  • getAllTokenConfigAccountData(): Promise<any>
  • Get all token config account data.

    Returns Promise<any>

  • getAllUserTokenConfigAccountData(): Promise<any>
  • Get all user token config account data.

    Returns Promise<any>

  • getDepositPoolAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool account pda and bump.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getDepositPoolAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • get deposit pool account pda and is initialized.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getDepositPoolAccountPdaData(depositPoolAccountPda: PublicKey): Promise<any>
  • Get deposit pool account pda data.

    Parameters

    • depositPoolAccountPda: PublicKey

      deposit pool account pda.

    Returns Promise<any>

  • getDepositPoolTokenAccountPdaAndBump(depositPoolPda: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool token account pda and bump.

    Parameters

    • depositPoolPda: PublicKey

      public key of deposit pool account.

    Returns Promise<[PublicKey, number]>

  • getDepositPoolTokenAccountPdaAndIsInitialized(depositPoolPda: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool token account pda and is initialized.

    Parameters

    • depositPoolPda: PublicKey

      public key of deposit pool account.

    Returns Promise<[PublicKey, number]>

  • getDistributionPoolAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool account pda and bump.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getDistributionPoolAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool account pda and is initialized.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getDistributionPoolAccountPdaData(distributionPoolAccountPda: PublicKey): Promise<any>
  • Get distribution pool account pda data.

    Parameters

    • distributionPoolAccountPda: PublicKey

      distribution pool account pda.

    Returns Promise<any>

  • getDistributionPoolTokenAccountPdaAndBump(distributionPoolPda: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool token account pda and bump.

    Parameters

    • distributionPoolPda: PublicKey

      public key of distribution pool account.

    Returns Promise<[PublicKey, number]>

  • getDistributionPoolTokenAccountPdaAndIsInitialized(distributionPoolPda: PublicKey): Promise<[PublicKey, number]>
  • Get deposit pool token account pda and is initialized.

    Parameters

    • distributionPoolPda: PublicKey

      public key of distribution pool account.

    Returns Promise<[PublicKey, number]>

  • getTokenConfigAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • Get token config account pda and bump.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getTokenConfigAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
  • get token config account pda and is initialized.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    Returns Promise<[PublicKey, number]>

  • getTokenConfigAccountPdaData(tokenConfigAccountPda: PublicKey): Promise<any>
  • Get token config account pda data.

    Parameters

    • tokenConfigAccountPda: PublicKey

      token config account pda.

    Returns Promise<any>

  • getUserTokenConfigAccountPdaAndBump(tokenMintAccount: PublicKey, user: PublicKey): Promise<[PublicKey, number]>
  • Get user token config account pda and bump.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    • user: PublicKey

      public key of user account

    Returns Promise<[PublicKey, number]>

  • getUserTokenConfigAccountPdaAndIsInitialized(tokenMintAccount: PublicKey, user: PublicKey): Promise<[PublicKey, number]>
  • Get user token config account pda and is initialized.

    Parameters

    • tokenMintAccount: PublicKey

      public key of the token mint account.

    • user: PublicKey

      public key of user account

    Returns Promise<[PublicKey, number]>

  • getUserTokenConfigAccountPdaData(userTokenConfigAccountPda: PublicKey): Promise<any>
  • Get user token config account pda data.

    Parameters

    • userTokenConfigAccountPda: PublicKey

      user token config account pda.

    Returns Promise<any>

  • isPdaAddressInitialize(pdaAddress: PublicKey): Promise<boolean>
  • Is pda address initialize.

    Parameters

    • pdaAddress: PublicKey

    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

Generated using TypeDoc