Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 134
Misc artist coins QA#13129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Misc artist coins QA #13129
Changes from all commits
b1685d967b09fb0c3433d5d5d76ee50ed20File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| import { DynamicBondingCurveClient } from '@meteora-ag/dynamic-bonding-curve-sdk' | ||
| import { | ||
| createTransferInstruction, | ||
| getAssociatedTokenAddressSync | ||
| } from '@solana/spl-token' | ||
| import { PublicKey } from '@solana/web3.js' | ||
| import { Request, Response } from 'express' | ||
| @@ -11,6 +15,8 @@ interface ClaimFeesRequestBody { | ||
| receiverWalletAddress: string | ||
| } | ||
| const AUDIO_MINT = '9LzCMqDgTKYz9Drzqnpgee3SGa89up3a247ypMj2xrqM' | ||
| export const claimFees = async ( | ||
| req: Request<unknown, unknown, ClaimFeesRequestBody>, | ||
| res: Response | ||
| @@ -39,16 +45,31 @@ export const claimFees = async ( | ||
| const poolData = tokenPool.account | ||
| const ownerWallet = new PublicKey(ownerWalletAddress) | ||
| const receiverWallet = new PublicKey(receiverWalletAddress) | ||
| const maxQuoteAmount = poolData.creatorQuoteFee | ||
| const claimFeesTx = await dbcClient.creator.claimCreatorTradingFee({ | ||
| pool: poolAddress, | ||
| payer: ownerWallet, | ||
| creator: ownerWallet, | ||
| maxBaseAmount: poolData.creatorBaseFee, // Match max amount to the claimable amount (effectively no limit) | ||
| maxQuoteAmount: poolData.creatorQuoteFee, // Match max amount to the claimable amount (effectively no limit) | ||
| receiver: receiverWallet | ||
| maxQuoteAmount, // Match max amount to the claimable amount (effectively no limit) | ||
| receiver: ownerWallet | ||
| }) | ||
| const ownerWalletATA = getAssociatedTokenAddressSync( | ||
| new PublicKey(AUDIO_MINT), | ||
| ownerWallet, | ||
| false | ||
| ) | ||
| const sendFromOwnerWallet = createTransferInstruction( | ||
| ownerWalletATA, | ||
| receiverWallet, | ||
| ownerWallet, | ||
| BigInt(maxQuoteAmount.toString()) | ||
| ) | ||
| claimFeesTx.instructions.push(sendFromOwnerWallet) | ||
| claimFeesTx.recentBlockhash = ( | ||
| await connection.getLatestBlockhash() | ||
| ).blockhash | ||
| @@ -58,6 +79,7 @@ export const claimFees = async ( | ||
| claimFeesTx: claimFeesTx.serialize({ requireAllSignatures: false }) | ||
| }) | ||
| } catch (e) { | ||
| logger.error(e) | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra logger? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intentional? | ||
| logger.error( | ||
| 'Error in claim_fees - unable to create creator claim fee transaction' | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be missing context, this intentional?