{"_id":"@cyreneai/fee-claimer","_rev":"4-249397bf76872d65e6c2b767b615aec2","name":"@cyreneai/fee-claimer","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.2":{"name":"@cyreneai/fee-claimer","version":"0.2.2","license":"MIT","_id":"@cyreneai/fee-claimer@0.2.2","maintainers":[{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"}],"dist":{"shasum":"8a566d44a8df8204f44ba6e9815c69d889fddbd3","tarball":"https://registry.npmjs.org/@cyreneai/fee-claimer/-/fee-claimer-0.2.2.tgz","fileCount":14,"integrity":"sha512-KL3RcIifKmNSpHrxsk8maZ5dGwt7HHViIF62nsmmJo8Ry23+6/rFZbFS8IokFEolQ3uPUNiV77pchMGVdk+cVw==","signatures":[{"sig":"MEUCIQCsilbd2LyzXaeNaYOIfJakh+dVGvUgSj1AG89I7N0vaAIgVeRxMtJ8RZ461pBBuV5LWZ+Oehy5J7kbfl8A+6nZWVw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47905},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"5605f07a4aff08910caaf1b64985b12dcf4b62e4","scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","validate":"npm run type-check && npm run build","type-check":"tsc --noEmit","release:major":"npm version major && npm run validate && npm publish --access public","release:minor":"npm version minor && npm run validate && npm publish --access public","release:patch":"npm version patch && npm run validate && npm publish --access public","prepublishOnly":"npm run validate"},"_npmUser":{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"},"_npmVersion":"11.11.1","description":"Server-side SDK for Cyrene partner fee flows (DBC/DAMM v2).","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/fee-claimer_0.2.2_1776331192547_0.6406369381102108","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@cyreneai/fee-claimer","version":"0.2.3","license":"MIT","_id":"@cyreneai/fee-claimer@0.2.3","maintainers":[{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"}],"dist":{"shasum":"1f177ca1eca5039051e69d5f5106cc811cbbd7bc","tarball":"https://registry.npmjs.org/@cyreneai/fee-claimer/-/fee-claimer-0.2.3.tgz","fileCount":14,"integrity":"sha512-4n3iId0Xuzac27q13COX0ZH9JXpQGrcR9Zh9u1aAk+oraWgFNXbu3Gl6NcUcaqb2oF8MYMBiG987h9TJlPK+Ew==","signatures":[{"sig":"MEQCIALM1d44ZdvbbtzkyI8Dm+CBdq2r79GvFDonxdlJ+4dVAiBkCqiPrYvTpXbo7UxH+3qm3EfH1gbVZxSW03+2y9yjlQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52729},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"70bb34e004c9e30b7b2bd2049cc8fddac3d7a09f","scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","validate":"npm run type-check && npm run build","type-check":"tsc --noEmit","release:major":"npm version major && npm run validate && npm publish --access public","release:minor":"npm version minor && npm run validate && npm publish --access public","release:patch":"npm version patch && npm run validate && npm publish --access public","prepublishOnly":"npm run validate"},"_npmUser":{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"},"_npmVersion":"10.9.0","description":"Server-side SDK for Cyrene partner fee flows (DBC/DAMM v2).","directories":{},"_nodeVersion":"23.3.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/fee-claimer_0.2.3_1776345619266_0.91985082225877","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@cyreneai/fee-claimer","version":"0.3.0","license":"MIT","_id":"@cyreneai/fee-claimer@0.3.0","maintainers":[{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"}],"dist":{"shasum":"8d7bac33e5cbbaf4b02efa3112e8b0d6ab20fde8","tarball":"https://registry.npmjs.org/@cyreneai/fee-claimer/-/fee-claimer-0.3.0.tgz","fileCount":14,"integrity":"sha512-8we6Vxqwgk+HJcGNlTxsCL3+xNq1ukLq28oi5w6pJIiusldep2+Iz3QpU76/EOh5O0seSeGfl0LWNgmKLz/jWA==","signatures":[{"sig":"MEYCIQCLgo0gx7IqSQmKJJvJSRYrh4pK/4Y4gfDxQP8RgnkzNwIhAOHOBqZnpY0XYuSFiIX6uf1rjmyierXC0zAzy5396xKl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79588},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e4be693f9845e04f5fc5485d8f253929df6957e6","scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","validate":"npm run type-check && npm run build","type-check":"tsc --noEmit","release:major":"npm version major && npm run validate && npm publish --access public","release:minor":"npm version minor && npm run validate && npm publish --access public","release:patch":"npm version patch && npm run validate && npm publish --access public","prepublishOnly":"npm run validate"},"_npmUser":{"name":"ajxhash","email":"jadhavabhishek24k2@gmail.com"},"_npmVersion":"10.9.0","description":"Server-side SDK for Cyrene partner fee flows (DBC/DAMM v2).","directories":{},"_nodeVersion":"23.3.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/fee-claimer_0.3.0_1776432610815_0.9474150065609674","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-16T09:19:52.444Z","modified":"2026-04-17T17:36:40.062Z","0.2.2":"2026-04-16T09:19:52.721Z","0.2.3":"2026-04-16T13:20:19.417Z","0.3.0":"2026-04-17T13:30:10.966Z"},"license":"MIT","description":"Server-side SDK for Cyrene partner fee flows (DBC/DAMM v2).","maintainers":[{"email":"jadhavabhishek24k2@gmail.com","name":"ajxhash"},{"email":"anish@cyreneai.com","name":"ansm"}],"readme":"# @cyreneai/fee-claimer\n\nTypeScript SDK for claiming partner fees from Cyrene AI-powered DBC (Dynamic Bonding Curve) and DAMM (Decentralized Automated Market Maker) pools on Solana.\n\n## Installation\n\n```bash\nnpm install @cyreneai/fee-claimer\n```\n\n## Quick Start\n\n```typescript\nimport { CyrenePartnerFeesClient } from '@cyreneai/fee-claimer';\n\nconst client = new CyrenePartnerFeesClient({\n  baseUrl: 'https://cyreneai.com',\n  apiKey: process.env.CYRENE_API_KEY!,\n  cluster: 'MAINNET', // or 'DEVNET'\n});\n\n// Prepare partner launch transactions\nconst launch = await client.launchWithPartners({\n  tokenName: 'My Token',\n  tokenSymbol: 'MTK',\n  tokenImage: 'https://ipfs.erebrus.io/ipfs/...',\n  totalTokenSupply: 1_000_000_000,\n  migrationQuoteThreshold: 10,\n  platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n  creator: { address: 'CREATOR_WALLET', bps: 2000 },\n  partner1: { address: 'PARTNER_1_WALLET', bps: 1000 },\n  partner2: { address: 'PARTNER_2_WALLET', bps: 1000 },\n});\n\n// Sign and submit launch.serializedConfigTransaction / serializedPoolTransaction\n// with the partner wallet, then initialize the DBC pool:\n\n// Initialize fee claimers for a DBC pool\nawait client.initializeDbcPool({\n  dbcPoolAddress: launch.dbcPoolAddress,\n  platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n  creator: { address: 'CREATOR_WALLET', bps: 2000 },\n  partner1: { address: 'PARTNER_1_WALLET', bps: 1000 },\n  partner2: { address: 'PARTNER_2_WALLET', bps: 1000 },\n});\n\n// Or use the higher-level helper:\nawait client.launchAndInitializeDbc(\n  {\n    tokenName: 'My Token',\n    tokenSymbol: 'MTK',\n    tokenImage: 'https://ipfs.erebrus.io/ipfs/...',\n    totalTokenSupply: 1_000_000_000,\n    migrationQuoteThreshold: 10,\n    platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n    creator: { address: 'CREATOR_WALLET', bps: 2000 },\n    partner1: { address: 'PARTNER_1_WALLET', bps: 1000 },\n    partner2: { address: 'PARTNER_2_WALLET', bps: 1000 },\n  },\n  async (launch) => {\n    // Your app/server signs and submits launch.serializedConfigTransaction,\n    // launch.serializedPoolTransaction, and optional launch.swapSerializedTransaction.\n    return {\n      configSignature: 'CONFIG_TX_SIGNATURE',\n      poolSignature: 'POOL_TX_SIGNATURE',\n      firstBuySignature: 'OPTIONAL_FIRST_BUY_SIGNATURE',\n    };\n  },\n);\n\n// Check individual claimable amounts\nconst amounts = await client.claimableAmounts({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS',\n  partnerWalletAddress: 'PARTNER_1_WALLET',\n});\n\nconsole.log(`Claimable: ${amounts.dbc.walletBaseFee} base tokens`);\n\n// Claim and distribute fees\nawait client.claimPartnerFees({ dbcPoolAddress: 'DBC_POOL_ADDRESS' });\n```\n\n## Configuration\n\n```typescript\ninterface ClientConfig {\n  baseUrl: string;        // API base URL\n  apiKey: string;         // Your Cyrene API key\n  cluster?: 'MAINNET' | 'DEVNET';\n  timeoutMs?: number;     // Request timeout (default: 30000)\n  retries?: number;       // Retry attempts (default: 2)\n  retryDelayMs?: number;  // Retry delay (default: 500)\n}\n```\n\n## API Reference\n\n### launchWithPartners\n\nPrepare config, pool, and optional first-buy transactions for a partner launch flow.\n\n```typescript\nconst result = await client.launchWithPartners({\n  tokenName: 'My Token', // required\n  tokenSymbol: 'MTK', // required\n  tokenImage: 'https://ipfs.erebrus.io/ipfs/...', // required\n  tokenDescription: 'Optional token description', // optional\n  totalTokenSupply: 1_000_000_000, // required\n  migrationQuoteThreshold: 10, // required\n  quoteMint: 'SOL', // optional\n  cluster: 'MAINNET', // optional\n  isEarlySalesEnabled: false, // optional\n  enableFirstBuy: true, // optional\n  firstBuyAmountSol: 0.1, // optional, required when enableFirstBuy is true\n  minimumTokensOut: 0, // optional, required when enableFirstBuy is true\n  customVestingParams: { // optional\n    totalLockedVestingAmount: 100000000,\n    numberOfVestingPeriod: 6,\n    cliffUnlockAmount: 50000000,\n    totalVestingDuration: 15552000,\n    cliffDurationFromMigrationTime: 15552000,\n  },\n  lockedVestingParam: { // optional\n    totalLockedVestingAmount: 100000000,\n    numberOfVestingPeriod: 6,\n    cliffUnlockAmount: 50000000,\n    totalVestingDuration: 15552000,\n    cliffDurationFromMigrationTime: 15552000,\n  },\n  platform: { address: 'PLATFORM_WALLET', bps: 5000 }, // optional\n  creator: { address: 'CREATOR_WALLET', bps: 2000 }, // optional\n  partner1: { address: 'PARTNER_1', bps: 1000 }, // optional\n  partner2: { address: 'PARTNER_2', bps: 1000 }, // optional\n  baseMintPrivateKey: 'BASE58_OR_JSON_ARRAY', // optional\n});\n\n// Response\n{\n  configAddress: string;\n  baseMint: string;\n  baseMintSource: 'provided' | 'vanity';\n  dbcPoolAddress: string;\n  initializePoolPayload: {\n    dbcPoolAddress: string;\n    cluster: 'MAINNET' | 'DEVNET';\n    platform: { address: string; bps: number } | null;\n    creator: { address: string; bps: number } | null;\n    partner1: { address: string; bps: number } | null;\n    partner2: { address: string; bps: number } | null;\n  };\n  serializedConfigTransaction: string;\n  serializedPoolTransaction: string;\n  swapSerializedTransaction: string | null;\n}\n```\n\nNotes:\n- Required payload fields: `tokenName`, `tokenSymbol`, `tokenImage`, `totalTokenSupply`, `migrationQuoteThreshold`.\n- The role split is validated as a 10000-scale input across `platform`, `creator`, `partner1`, and `partner2`.\n- `firstBuyAmountSol` and `minimumTokensOut` are required only when `enableFirstBuy` is `true`.\n- `customVestingParams` and `lockedVestingParam` are alternative optional vesting inputs. If both are omitted, server defaults are used.\n- `baseMintPrivateKey` is optional. If omitted, the API uses the server-side fallback flow configured for base mint selection.\n\n### launchAndInitializeDbc\n\nRun the full DBC launch flow:\n1. call `launchWithPartners`\n2. execute the returned transactions through your wallet/signer callback\n3. call `initializeDbcPool` automatically\n\n```typescript\nconst result = await client.launchAndInitializeDbc(\n  {\n    tokenName: 'My Token',\n    tokenSymbol: 'MTK',\n    tokenImage: 'https://ipfs.erebrus.io/ipfs/...',\n    totalTokenSupply: 1_000_000_000,\n    migrationQuoteThreshold: 10,\n    platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n    creator: { address: 'CREATOR_WALLET', bps: 2000 },\n  },\n  async (launch) => {\n    // Sign and submit the returned transactions in your own environment.\n    return {\n      configSignature: 'CONFIG_TX_SIGNATURE',\n      poolSignature: 'POOL_TX_SIGNATURE',\n      firstBuySignature: null,\n    };\n  },\n);\n\n// Response\n{\n  launch: LaunchWithPartnersResponse;\n  execution: {\n    configSignature: string;\n    poolSignature: string;\n    firstBuySignature?: string | null;\n  };\n  initializePool: InitializePoolResponse;\n}\n```\n\nNotes:\n- The SDK still does not sign transactions by itself.\n- Your callback must actually submit and confirm the launch transactions before returning.\n- Once the callback returns, the SDK calls `initializeDbcPool` automatically using `launch.initializePoolPayload`.\n\n### initializeDbcPool\n\nInitialize DBC pool claimers and create Address Lookup Table.\n\n```typescript\nconst result = await client.initializeDbcPool({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS',\n  platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n  creator: { address: 'CREATOR_WALLET', bps: 2000 },\n  partner1: { address: 'WALLET_1', bps: 1000 },\n  partner2: { address: 'WALLET_2', bps: 1000 },\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  transaction: string;\n  transactionLink: string;\n  altAddress?: string;\n  dbcPoolAddress: string;\n  claimersCount: number;\n  totalBps: number;\n  normalizedInputTotalBps: number;\n  denormalizedVariableTotalBps: number;\n  normalizedRoles: Array<{ role: string; address: string; inputBps: number }>;\n}\n```\n\n### initializeDammV2Pool\n\nInitialize DAMM v2 pool claimers and create Address Lookup Table.\n\n```typescript\nconst result = await client.initializeDammV2Pool({\n  dammPoolAddress: 'DAMM_POOL_ADDRESS',\n  partners: [\n    { address: 'WALLET_1', bps: 500 },\n    { address: 'WALLET_2', bps: 250 },\n  ],\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  transaction: string;\n  transactionLink: string;\n  dammPoolAddress: string;\n  claimersCount: number;\n}\n```\n\n### claimableAmounts\n\nGet individual claimable amounts for a wallet. Automatically handles graduation check.\n\n```typescript\nconst amounts = await client.claimableAmounts({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS',\n  partnerWalletAddress: 'PARTNER_WALLET',\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  dbcPoolAddress: string;\n  partnerWalletAddress: string;\n  isGraduated: boolean;\n  dammPoolAddress?: string;\n  dbc: {\n    totalPartnerBaseFee: string;\n    totalPartnerQuoteFee: string;\n    walletBps: number;\n    walletBaseFee: string;\n    walletQuoteFee: string;\n  };\n  dammV2: {\n    totalPartnerFeeA: string;\n    totalPartnerFeeB: string;\n    walletBps: number;\n    walletFeeA: string;\n    walletFeeB: string;\n  };\n}\n```\n\n### claimPartnerFees\n\nClaim and distribute fees. Automatically uses correct ALT for DBC and DAMM.\n\n```typescript\nconst result = await client.claimPartnerFees({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS',\n  partnerWalletAddress: 'SPECIFIC_WALLET', // optional\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  dbc: {\n    claimed: boolean;\n    baseAmount: string;\n    quoteAmount: string;\n    claimTx: string | null;\n    distributeTx: string | null;\n  };\n  dammV2?: {\n    initialized: boolean;\n    claimed: boolean;\n    baseAmount: string;\n    quoteAmount: string;\n    claimTx: string | null;\n    distributeTx: string | null;\n  };\n  isGraduated: boolean;\n  dammPoolAddress?: string;\n}\n```\n\n### checkGraduation\n\nCheck if DBC pool has graduated to DAMM.\n\n```typescript\nconst result = await client.checkGraduation({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS',\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  dbcPoolAddress: string;\n  graduated: boolean;\n  progress: number; // 0.0 to 1.0\n  dammPoolAddress?: string;\n  message: string;\n}\n```\n\n### custodyPartners\n\nFetch on-chain claimer state for DBC or DAMM pools.\n\n```typescript\nconst result = await client.custodyPartners({\n  dbcPoolAddress: 'DBC_POOL_ADDRESS', // provide exactly one\n  // or dammPoolAddress: 'DAMM_POOL_ADDRESS',\n  cluster: 'MAINNET', // optional\n});\n\n// Response\n{\n  pool: string;\n  claimerAddresses: string[];\n  claimerBps: number[];\n  poolState: 'Dbc' | 'DammV2' | 'NotInitialized';\n  claimers: Array<{ address: string; bps: number }>;\n}\n```\n\n## Complete Workflow Example\n\n```typescript\nimport { CyrenePartnerFeesClient } from '@cyreneai/fee-claimer';\n\nconst client = new CyrenePartnerFeesClient({\n  baseUrl: 'https://cyreneai.com',\n  apiKey: process.env.CYRENE_API_KEY!,\n  cluster: 'MAINNET',\n});\n\nasync function runWorkflow() {\n  const wallet = 'PARTNER_WALLET_ADDRESS';\n\n  // 1. Prepare launch transactions\n  const launch = await client.launchWithPartners({\n    tokenName: 'My Token',\n    tokenSymbol: 'MTK',\n    tokenImage: 'https://ipfs.erebrus.io/ipfs/...',\n    totalTokenSupply: 1_000_000_000,\n    migrationQuoteThreshold: 10,\n    platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n    creator: { address: wallet, bps: 5000 },\n  });\n\n  // 2. Sign and submit the returned transactions with the partner wallet.\n  //    After confirmation, initialize the DBC claimers.\n  await client.initializeDbcPool({\n    dbcPoolAddress: launch.dbcPoolAddress,\n    platform: { address: 'PLATFORM_WALLET', bps: 5000 },\n    creator: { address: wallet, bps: 5000 },\n  });\n\n  // 3. Check claimable amounts\n  const amounts = await client.claimableAmounts({\n    dbcPoolAddress: launch.dbcPoolAddress,\n    partnerWalletAddress: wallet,\n  });\n\n  // 4. Check graduation status\n  const grad = await client.checkGraduation({ dbcPoolAddress: launch.dbcPoolAddress });\n\n  // 5. Initialize DAMM if graduated\n  if (grad.graduated && grad.dammPoolAddress) {\n    await client.initializeDammV2Pool({\n      dammPoolAddress: grad.dammPoolAddress,\n      partners: [{ address: wallet, bps: 500 }],\n    });\n  }\n\n  // 6. Claim fees\n  await client.claimPartnerFees({ dbcPoolAddress: launch.dbcPoolAddress });\n\n  // 7. Verify custody state\n  const custody = await client.custodyPartners({ dbcPoolAddress: launch.dbcPoolAddress });\n  console.log('Pool state:', custody.poolState);\n}\n\nrunWorkflow().catch(console.error);\n```\n\n## Error Handling\n\n```typescript\nimport { CyreneApiError } from '@cyreneai/fee-claimer';\n\ntry {\n  await client.claimPartnerFees({ dbcPoolAddress: 'INVALID' });\n} catch (error) {\n  if (error instanceof CyreneApiError) {\n    console.error('Status:', error.status);\n    console.error('Message:', error.message);\n    \n    if (error.status === 401) console.error('Invalid API key');\n    if (error.status === 404) console.error('Pool not found');\n    if (error.status === 400) console.error('Bad request');\n  }\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}