{"_id":"@ace_won/conduit-sdk","_rev":"2-2fb0c797657a5fb82a7d06b8d4ae9a0a","name":"@ace_won/conduit-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ace_won/conduit-sdk","version":"1.0.0","keywords":["conduit","payment","sdk","usdc","arc","arc-network","circle","escrow","split-payments","webhooks","web3","stablecoin"],"author":{"name":"ace_won"},"license":"MIT","_id":"@ace_won/conduit-sdk@1.0.0","maintainers":[{"name":"ace_won","email":"ace7coderr@gmail.com"}],"homepage":"https://conduit-pay.vercel.app/developers","bugs":{"url":"https://github.com/ace-coderr/conduit/issues"},"dist":{"shasum":"40a0e573317bf45d17d77da8c4f028be0ab2816b","tarball":"https://registry.npmjs.org/@ace_won/conduit-sdk/-/conduit-sdk-1.0.0.tgz","fileCount":6,"integrity":"sha512-QpDIlkq5tshOaOwd5Qla5X7T4JKkvJ7mdGflr7edDLmqJ9B/NB29SKm9SaekcdtLT+t4YJS0KyMh1WG77975MQ==","signatures":[{"sig":"MEUCIQCyYFqo6yKAMYvUTCBHVXYXn7HqCH9U8zmsz8MMOvFW3wIgQP+C40Y1y4RMdqOO5YYlc9lakBgGKKzj7WUpJolG48s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38062},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"8b3255bc0bcbfa7bd8adbaebdb441e191dd06be8","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"_npmUser":{"name":"ace_won","email":"ace7coderr@gmail.com"},"repository":{"url":"git+https://github.com/ace-coderr/conduit.git","type":"git"},"_npmVersion":"10.9.2","description":"Official TypeScript SDK for Conduit — USDC payment infrastructure on Arc Network. Create payment links, escrow, splits, and webhooks programmatically.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5","@types/node":"^20"},"_npmOperationalInternal":{"tmp":"tmp/conduit-sdk_1.0.0_1781879492094_0.09445758493902057","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ace_won/conduit-sdk","version":"1.0.1","description":"Official TypeScript SDK for Conduit — USDC payment infrastructure on Arc Network. Create payment links, escrow, splits, and webhooks programmatically.","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","dev":"tsup src/index.ts --format cjs,esm --dts --watch","prepublishOnly":"npm run build"},"keywords":["conduit","payment","sdk","usdc","arc","arc-network","circle","escrow","split-payments","webhooks","web3","stablecoin"],"author":{"name":"ace_won"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ace-coderr/conduit.git"},"homepage":"https://conduit-pay.vercel.app/developers","bugs":{"url":"https://github.com/ace-coderr/conduit/issues"},"devDependencies":{"@types/node":"^20","tsup":"^8.0.0","typescript":"^5"},"_id":"@ace_won/conduit-sdk@1.0.1","gitHead":"e583d11b348f3bfb846b2eda34e5707703cf9d4c","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-JVUY4xNyBsd2KCeTPs7nE4cMKmd22GZ9jmctvDsGjy3skg4PfMV+YmXoCzu8gsECm0E+t8dg30KOm6c9OV8Zlw==","shasum":"c1d6ec5d58f7a028faa02f544e5513f4013ae7cc","tarball":"https://registry.npmjs.org/@ace_won/conduit-sdk/-/conduit-sdk-1.0.1.tgz","fileCount":6,"unpackedSize":38076,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICbRKKx6yn+m6XZzA2ZIprMx5i0FiaPEjPlsMzU7zDYRAiBpjsxRStfdyyIxMNE9c0szuwPIILt/pP+iPOoLm9YUNQ=="}]},"_npmUser":{"name":"ace_won","email":"ace7coderr@gmail.com"},"directories":{},"maintainers":[{"name":"ace_won","email":"ace7coderr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/conduit-sdk_1.0.1_1781958072345_0.6545567942127455"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-19T14:31:31.965Z","modified":"2026-06-20T12:21:12.585Z","1.0.0":"2026-06-19T14:31:32.233Z","1.0.1":"2026-06-20T12:21:12.496Z"},"bugs":{"url":"https://github.com/ace-coderr/conduit/issues"},"author":{"name":"ace_won"},"license":"MIT","homepage":"https://conduit-pay.vercel.app/developers","keywords":["conduit","payment","sdk","usdc","arc","arc-network","circle","escrow","split-payments","webhooks","web3","stablecoin"],"repository":{"type":"git","url":"git+https://github.com/ace-coderr/conduit.git"},"description":"Official TypeScript SDK for Conduit — USDC payment infrastructure on Arc Network. Create payment links, escrow, splits, and webhooks programmatically.","maintainers":[{"name":"ace_won","email":"ace7coderr@gmail.com"}],"readme":"# @ace_won/conduit-sdk\r\n\r\nOfficial TypeScript SDK for **Conduit** — USDC payment infrastructure on Arc Network. Create payment links, escrow, split payments, and webhooks programmatically with full type safety.\r\n\r\n```bash\r\nnpm install @ace_won/conduit-sdk\r\n```\r\n\r\n## Quick start\r\n\r\n```ts\r\nimport { ConduitClient } from \"@ace_won/conduit-sdk\";\r\n\r\nconst conduit = new ConduitClient({\r\n  address: \"0xYourWalletAddress\", // default owner for create/list calls\r\n});\r\n\r\n// Create a payment link\r\nconst link = await conduit.links.create({\r\n  title: \"Logo design\",\r\n  amount: 50,\r\n});\r\n\r\nconsole.log(conduit.links.payUrl(link.id));\r\n// → https://www.conduitpay.xyz/pay/<id>\r\n```\r\n\r\n## Configuration\r\n\r\n```ts\r\nconst conduit = new ConduitClient({\r\n  baseUrl: \"https://www.conduitpay.xyz\", // optional, this is the default\r\n  address: \"0xYourWallet\",           // optional default owner address\r\n  fetch: customFetch,                // optional, for Node <18\r\n});\r\n```\r\n\r\n## Payment Links\r\n\r\n```ts\r\nconst link = await conduit.links.create({\r\n  title: \"Invoice #102\",\r\n  amount: \"25.00\",\r\n  description: \"Consulting — June\",\r\n});\r\n\r\nconst all = await conduit.links.list();          // your links\r\nconst one = await conduit.links.get(link.id);    // single link\r\nconst url = conduit.links.payUrl(link.id);        // hosted pay page\r\n```\r\n\r\n## Escrow\r\n\r\n```ts\r\nconst escrow = await conduit.escrow.create({\r\n  title: \"iPhone 15 Pro\",\r\n  amount: 800,\r\n  sellerContact: \"@seller on Telegram\",\r\n  deliveryDays: 7,\r\n});\r\n\r\nconst escrows = await conduit.escrow.list();\r\nconst url = conduit.escrow.payUrl(escrow.id);\r\n```\r\n\r\n## Split Payments\r\n\r\n```ts\r\n// Percentages must sum to 100\r\nconst split = await conduit.splits.create({\r\n  title: \"Team revenue split\",\r\n  amount: 1000,\r\n  recipients: [\r\n    { address: \"0xAlice...\", percentage: 50, label: \"Alice\" },\r\n    { address: \"0xBob...\",   percentage: 30, label: \"Bob\" },\r\n    { address: \"0xCarol...\", percentage: 20, label: \"Carol\" },\r\n  ],\r\n});\r\n\r\nconst url = conduit.splits.payUrl(split.id);\r\n// One payment auto-distributes to all recipients, gaslessly.\r\n```\r\n\r\n## Webhooks\r\n\r\n### Register an endpoint\r\n\r\n```ts\r\nconst webhook = await conduit.webhooks.create({\r\n  url: \"https://your-app.com/webhooks/conduit\",\r\n  events: [\"payment.completed\", \"escrow.released\", \"split.distributed\"],\r\n});\r\n\r\nconsole.log(webhook.secret); // whsec_... — save this, shown only once\r\n```\r\n\r\nOther operations:\r\n\r\n```ts\r\nawait conduit.webhooks.list();\r\nawait conduit.webhooks.update(webhook.id, { active: false });\r\nawait conduit.webhooks.test(webhook.id);\r\nawait conduit.webhooks.delete(webhook.id);\r\n```\r\n\r\n### Verify incoming webhooks\r\n\r\nConduit signs every delivery with HMAC-SHA256 in the `X-Conduit-Signature` header. Always verify it.\r\n\r\n```ts\r\nimport { constructWebhookEvent } from \"@ace_won/conduit-sdk\";\r\n\r\n// Next.js App Router\r\nexport async function POST(req: Request) {\r\n  const raw = await req.text();\r\n  const sig = req.headers.get(\"x-conduit-signature\") ?? \"\";\r\n\r\n  try {\r\n    const event = constructWebhookEvent(raw, sig, process.env.CONDUIT_WEBHOOK_SECRET!);\r\n\r\n    switch (event.event) {\r\n      case \"payment.completed\":\r\n        console.log(\"Paid:\", event.data.amount, \"USDC\");\r\n        break;\r\n      case \"split.distributed\":\r\n        console.log(\"Split done:\", event.data.payouts);\r\n        break;\r\n    }\r\n\r\n    return new Response(\"ok\");\r\n  } catch {\r\n    return new Response(\"Invalid signature\", { status: 401 });\r\n  }\r\n}\r\n```\r\n\r\nOr verify manually:\r\n\r\n```ts\r\nimport { verifyWebhookSignature } from \"@ace_won/conduit-sdk\";\r\n\r\nconst valid = verifyWebhookSignature(rawBody, signature, secret);\r\n```\r\n\r\n## Webhook events\r\n\r\n| Event | Fires when |\r\n|---|---|\r\n| `payment.completed` | A payment link is paid |\r\n| `escrow.funded` | A buyer funds an escrow |\r\n| `escrow.released` | Escrow funds are released to the seller |\r\n| `escrow.disputed` | A buyer disputes an escrow |\r\n| `escrow.refunded` | An escrow is refunded to the buyer |\r\n| `split.funded` | A split link is paid into |\r\n| `split.distributed` | A split finishes distributing to all recipients |\r\n\r\n## Error handling\r\n\r\n```ts\r\nimport { ConduitApiError } from \"@ace_won/conduit-sdk\";\r\n\r\ntry {\r\n  await conduit.links.create({ title: \"Test\", amount: 10 });\r\n} catch (err) {\r\n  if (err instanceof ConduitApiError) {\r\n    console.error(err.status, err.message);\r\n  }\r\n}\r\n```\r\n\r\n## License\r\n\r\nMIT","readmeFilename":"README.md"}