coincircuit
v0.2.1
Published
Official CoinCircuit Node.js SDK
Maintainers
Readme
coincircuit
Official CoinCircuit Node.js / TypeScript SDK.
Install
npm install coincircuitUsage
import { CoinCircuit } from 'coincircuit';
const cc = new CoinCircuit({ apiKey: 'api_live_...' });
// Create a payment session
const session = await cc.payments.create({
amount: '10.00',
currency: 'USD',
asset: 'USDC',
chain: 'base',
customer: { email: '[email protected]' },
});
// List transactions
const { data, meta } = await cc.transactions.list({ page: 1, size: 20 });
// Auto-paginate
for await (const tx of cc.transactions.listAutoPaginate()) {
console.log(tx);
}
// Settle x402 gasless payment
const result = await cc.x402.settle({
scheme: 'eip3009',
chain: 'base',
asset: 'USDC',
payload: {
from: '0xSender...',
to: '0xDeposit...',
value: '1000000',
validAfter: '0',
validBefore: '1774055094',
nonce: '0xrandom32bytes...',
signature: '0xsigned...',
},
});Configuration
const cc = new CoinCircuit({
apiKey: 'api_live_...',
baseUrl: 'https://api.coincircuit.io', // default
timeout: 30000, // default 30s
maxRetries: 2, // default 2
});Resources
| Resource | Methods |
|----------|---------|
| cc.payments | create, list, get, generateAddress, estimate |
| cc.x402 | settle, verify |
| cc.invoices | create, list, get |
| cc.transactions | list, get |
| cc.payouts | create, list, get, estimateFees |
| cc.balance | get |
| cc.blockchain | assets, confirmations, gasFees |
| cc.customers | create, list, get |
| cc.refunds | createForSession, createForInvoice, list, get, estimate |
| cc.settlements | list, get |
| cc.rates | convert, list |
| cc.paymentPages | create, list, update, delete, sessions |
| cc.bankAccounts | create, list, get, update, delete, banks |
| cc.cryptoAddresses | create, list, get, update, delete, validate |
Links
License
MIT
