Constructors
constructor
- new GameWalletLib(programId: PublicKey, connection: Connection, wallet: Wallet): GameWalletLib
Parameters
programId: PublicKey
connection: Connection
wallet: Wallet
Properties
connection
connection: Connection
program
Methods
addFeePayerAndRecentBlockHashInTransaction
- addFeePayerAndRecentBlockHashInTransaction(tx: Transaction, feePayer: PublicKey): Promise<Transaction>
Parameters
tx: Transaction
feePayer: PublicKey
Returns Promise<Transaction>
addSignatureInTransaction
- addSignatureInTransaction(tx: Transaction, signerAddress: PublicKey, signature: Buffer): Transaction
Parameters
tx: Transaction
signerAddress: PublicKey
signature: Buffer
Returns Transaction
createAddDepositSupplyTransaction
- createAddDepositSupplyTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createAddDistributeSupplyTransaction
- createAddDistributeSupplyTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createDepositTransaction
- createDepositTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, depositFor: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
depositFor: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createDistributeTransaction
- createDistributeTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createDistributeWithoutUserTransaction
- createDistributeWithoutUserTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createInitializeTokenConfigTransaction
- 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>
Parameters
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 = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createSpendTransaction
- createSpendTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createSpendWithoutUserTransaction
- createSpendWithoutUserTransaction(amount: number, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey, incomeAccount: PublicKey, tokenProgram?: PublicKey, associatedTokenProgram?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createUpdateTokenConfigTransaction
- 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>
Parameters
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 = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createUpdateUserTokenConfigTransaction
- createUpdateUserTokenConfigTransaction(isActive: boolean, canDeposit: boolean, canWithdraw: boolean, canSpend: boolean, canDistribute: boolean, payer: PublicKey, signingAuthority: PublicKey, tokenMintAccount: PublicKey, user: PublicKey): Promise<Transaction>
Parameters
isActive: boolean
canDeposit: boolean
canWithdraw: boolean
canSpend: boolean
canDistribute: boolean
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
Returns Promise<Transaction>
createWithdrawTransaction
- 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>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
receiver: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createWithdrawWithoutUserTransaction
- 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>
Parameters
amount: number
payer: PublicKey
signingAuthority: PublicKey
tokenMintAccount: PublicKey
user: PublicKey
incomeAccount: PublicKey
receiver: PublicKey
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
getAllDepositPoolAccountData
- getAllDepositPoolAccountData(): Promise<any>
Returns Promise<any>
getAllDistributionPoolAccountData
- getAllDistributionPoolAccountData(): Promise<any>
Returns Promise<any>
getAllTokenConfigAccountData
- getAllTokenConfigAccountData(): Promise<any>
Returns Promise<any>
getAllUserTokenConfigAccountData
- getAllUserTokenConfigAccountData(): Promise<any>
Returns Promise<any>
getDepositPoolAccountPdaAndBump
- getDepositPoolAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getDepositPoolAccountPdaAndIsInitialized
- getDepositPoolAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getDepositPoolAccountPdaData
- getDepositPoolAccountPdaData(depositPoolAccountPda: PublicKey): Promise<any>
Parameters
depositPoolAccountPda: PublicKey
Returns Promise<any>
getDepositPoolTokenAccountPdaAndBump
- getDepositPoolTokenAccountPdaAndBump(depositPoolPda: PublicKey): Promise<[PublicKey, number]>
Parameters
depositPoolPda: PublicKey
Returns Promise<[PublicKey, number]>
getDepositPoolTokenAccountPdaAndIsInitialized
- getDepositPoolTokenAccountPdaAndIsInitialized(depositPoolPda: PublicKey): Promise<[PublicKey, number]>
Parameters
depositPoolPda: PublicKey
Returns Promise<[PublicKey, number]>
getDistributionPoolAccountPdaAndBump
- getDistributionPoolAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getDistributionPoolAccountPdaAndIsInitialized
- getDistributionPoolAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getDistributionPoolAccountPdaData
- getDistributionPoolAccountPdaData(distributionPoolAccountPda: PublicKey): Promise<any>
Parameters
distributionPoolAccountPda: PublicKey
Returns Promise<any>
getDistributionPoolTokenAccountPdaAndBump
- getDistributionPoolTokenAccountPdaAndBump(distributionPoolPda: PublicKey): Promise<[PublicKey, number]>
Parameters
distributionPoolPda: PublicKey
Returns Promise<[PublicKey, number]>
getDistributionPoolTokenAccountPdaAndIsInitialized
- getDistributionPoolTokenAccountPdaAndIsInitialized(distributionPoolPda: PublicKey): Promise<[PublicKey, number]>
Parameters
distributionPoolPda: PublicKey
Returns Promise<[PublicKey, number]>
getTokenConfigAccountPdaAndBump
- getTokenConfigAccountPdaAndBump(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getTokenConfigAccountPdaAndIsInitialized
- getTokenConfigAccountPdaAndIsInitialized(tokenMintAccount: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
Returns Promise<[PublicKey, number]>
getTokenConfigAccountPdaData
- getTokenConfigAccountPdaData(tokenConfigAccountPda: PublicKey): Promise<any>
Parameters
tokenConfigAccountPda: PublicKey
Returns Promise<any>
getUserTokenConfigAccountPdaAndBump
- getUserTokenConfigAccountPdaAndBump(tokenMintAccount: PublicKey, user: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
user: PublicKey
Returns Promise<[PublicKey, number]>
getUserTokenConfigAccountPdaAndIsInitialized
- getUserTokenConfigAccountPdaAndIsInitialized(tokenMintAccount: PublicKey, user: PublicKey): Promise<[PublicKey, number]>
Parameters
tokenMintAccount: PublicKey
user: PublicKey
Returns Promise<[PublicKey, number]>
getUserTokenConfigAccountPdaData
- getUserTokenConfigAccountPdaData(userTokenConfigAccountPda: PublicKey): Promise<any>
Parameters
userTokenConfigAccountPda: PublicKey
Returns Promise<any>
isPdaAddressInitialize
- isPdaAddressInitialize(pdaAddress: PublicKey): Promise<boolean>
Parameters
Returns Promise<boolean>
signTransaction
- signTransaction(tx: Transaction, secretKey: string): Transaction
Parameters
tx: Transaction
secretKey: string
Returns Transaction
Add signature in the transaction.