{"_id":"@anchor-cctp/core-sdk","name":"@anchor-cctp/core-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anchor-cctp/core-sdk","version":"1.0.0","description":"AnchorCCTP SDK Core Engine — accept USDC from any CCTP-connected chain on Stellar with a single function call.","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Dyjuen/anchorcctp-sdk.git","directory":"packages/core"},"bugs":{"url":"https://github.com/Dyjuen/anchorcctp-sdk/issues"},"homepage":"https://github.com/Dyjuen/anchorcctp-sdk#readme","scripts":{"build":"tsc","test":"jest --coverage"},"keywords":["stellar","cctp","usdc","anchor","circle","cross-chain"],"author":{"name":"Mother's Grace","url":"Juen"},"license":"MIT","dependencies":{"@stellar/stellar-sdk":"^13.1.0"},"devDependencies":{"@types/jest":"^29.5.14","@types/node":"^22.13.4","jest":"^29.7.0","ts-jest":"^29.2.5","typescript":"^5.7.3"},"gitHead":"0dc5605b9154cb60ed4fda854b16467e321b863a","_id":"@anchor-cctp/core-sdk@1.0.0","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-/PeHfDNuzI0bEx+xNCKapS3UOhnydDrYvsaKGFrhPDFsBEZfY+WKlhcDqU+H5wYgQKfLrD7ZUnC71eLvh2kaiA==","shasum":"c9c8e947fb67f40882d36b5daed7c5e856138ff4","tarball":"https://registry.npmjs.org/@anchor-cctp/core-sdk/-/core-sdk-1.0.0.tgz","fileCount":50,"unpackedSize":82301,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBHZf2m4nsGHdfO49zo/OI3Nmb3K41/dU7Ew8uT+HVi9AiEAu0pKK6GhWSxIGRw8Mkl1AwVrbAYVsrKK8AZL58eUkDA="}]},"_npmUser":{"name":"mothersgrace","email":"anchorcctpsdk@gmail.com"},"directories":{},"maintainers":[{"name":"mothersgrace","email":"anchorcctpsdk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core-sdk_1.0.0_1789026104097_0.3458911665800797"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-10T07:41:43.824Z","1.0.0":"2026-09-10T07:41:44.227Z","modified":"2026-09-10T07:41:44.526Z"},"maintainers":[{"name":"mothersgrace","email":"anchorcctpsdk@gmail.com"}],"description":"AnchorCCTP SDK Core Engine — accept USDC from any CCTP-connected chain on Stellar with a single function call.","homepage":"https://github.com/Dyjuen/anchorcctp-sdk#readme","keywords":["stellar","cctp","usdc","anchor","circle","cross-chain"],"repository":{"type":"git","url":"git+https://github.com/Dyjuen/anchorcctp-sdk.git","directory":"packages/core"},"author":{"name":"Mother's Grace","url":"Juen"},"bugs":{"url":"https://github.com/Dyjuen/anchorcctp-sdk/issues"},"license":"MIT","readme":"# @anchor-cctp/core-sdk\r\n\r\n> Production-ready TypeScript core engine for Stellar Anchors to accept USDC from 23+ CCTP-connected chains via a single function call.\r\n\r\n[![npm version](https://img.shields.io/npm/v/@anchor-cctp/core-sdk.svg)](https://www.npmjs.com/package/@anchor-cctp/core-sdk)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\r\n\r\n---\r\n\r\n## ⚠️ Security & Non-Audit Disclaimer\r\n\r\n> [!CAUTION]\r\n> **Non-Audit Disclaimer (PRD §7.10):**\r\n> This SDK is provided as-is for integration acceleration and has **not** undergone a third-party security audit. While built following strict security invariants (zero private key persistence, mandatory cryptographic attestation verification, replay guards, BigInt-only math, and allow-listed domains), integrators and custody-grade operators must review all signing paths and test thoroughly before handling substantial production value.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- ⚡ **One Function Integration**: `AnchorCCTP.receive()` handles polling, conversion, forwarder translation, and settlement.\r\n- 🔐 **Zero Private Key Storage**: All transaction signing is delegated to caller-supplied callbacks or sponsor env vars.\r\n- 🛡️ **Replay Attack Protection**: Pluggable idempotency store guards against double-crediting.\r\n- 🔢 **Exact Decimal Math**: 6-to-7 decimal scaling using BigInt integer arithmetic with explicit dust routing.\r\n- 🌐 **26 CCTP Domains**: Full registry mapping (Stellar = 27, Base = 6, Ethereum = 0, Arbitrum = 3, etc.).\r\n- 📡 **Typed Lifecycle Events**: `onReceiving`, `onSettled`, `onDustCollected`, `onError`.\r\n\r\n---\r\n\r\n## Quickstart\r\n\r\n### 1. Installation\r\n\r\n```bash\r\nnpm install @anchor-cctp/core-sdk @stellar/stellar-sdk\r\n```\r\n\r\n### 2. Usage\r\n\r\n```typescript\r\nimport { createAnchorCCTP } from '@anchor-cctp/core-sdk';\r\n\r\n// Initialize SDK instance\r\nconst sdk = createAnchorCCTP({\r\n  signer: async (xdr: string) => {\r\n    // Sign the transaction with your anchor's service account or Freighter wallet\r\n    return mySigningCallback(xdr);\r\n  },\r\n  trustline: {\r\n    allowCreation: true,\r\n    spendCapXlm: 2.0,\r\n  },\r\n});\r\n\r\n// Listen to lifecycle events\r\nsdk.on('onReceiving', ({ burnTxHash, status, attempt }) => {\r\n  console.log(`[CCTP] Polling ${burnTxHash} (attempt ${attempt}): ${status}`);\r\n});\r\n\r\nsdk.on('onSettled', ({ amount, dust, txHash }) => {\r\n  console.log(`[CCTP] Transfer settled! Amount: ${amount} stroops, Tx: ${txHash}`);\r\n});\r\n\r\n// Process an inbound cross-chain transfer\r\nasync function handleDeposit() {\r\n  const result = await sdk.receive({\r\n    sourceDomain: 6, // Base\r\n    burnTxHash: '0x87a1c38e7f9b8...',\r\n    destinationAddress: 'GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5',\r\n    amount: 10000000n, // 10 USDC (6 decimals)\r\n  });\r\n\r\n  console.log('Result:', result);\r\n}\r\n```\r\n\r\n---\r\n\r\n## Lifecycle Events\r\n\r\n| Event | Payload | Description |\r\n|---|---|---|\r\n| `onReceiving` | `{ burnTxHash, status, attempt, elapsedTimeMs, sourceDomain }` | Emitted on each Circle Attestation API poll interval. |\r\n| `onSettled` | `{ amount, dust, txHash, sourceDomain, destinationAddress, timestamp }` | Emitted when USDC has been minted and credited on Stellar. |\r\n| `onDustCollected` | `{ amount, collector, burnTxHash }` | Emitted when non-zero sub-stroop dust is routed to the collector. |\r\n| `onError` | `{ error, burnTxHash }` | Emitted when an unrecoverable deposit failure occurs. |\r\n\r\n---\r\n\r\n## Supported CCTP Domains (Excerpt)\r\n\r\n| Domain ID | Chain Name | Network Type |\r\n|---|---|---|\r\n| **0** | Ethereum | EVM |\r\n| **1** | Avalanche | EVM |\r\n| **2** | OP Mainnet | EVM |\r\n| **3** | Arbitrum | EVM |\r\n| **4** | Noble | Cosmos |\r\n| **5** | Solana | SVM |\r\n| **6** | Base | EVM |\r\n| **7** | Polygon PoS | EVM |\r\n| **27** | **Stellar** | **Stellar (Classic / Soroban)** |\r\n| **37** | X Layer | EVM |\r\n\r\n*(All 26 mainnet & testnet domains included)*\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT © [Mother's Grace / Stellar Indonesia](LICENSE)\r\n","readmeFilename":"README.md","_rev":"1-86128268e57150426473ae55d23107c2"}