|
1 | 1 | --- |
2 | 2 | name: coinpayportal |
3 | | -version: 2.1.0 |
4 | | -description: Non-custodial multi-chain wallet for AI agents. Send and receive BTC, ETH, SOL, POL, BCH, and USDC. |
| 3 | +version: 3.0.0 |
| 4 | +description: Non-custodial payments, escrow, and wallets for AI agents. Send, receive, and hold funds in escrow across BTC, ETH, SOL, POL, BCH, and USDC. |
5 | 5 | homepage: https://coinpayportal.com |
6 | 6 | --- |
7 | 7 |
|
8 | 8 | ```bash |
9 | 9 | curl -s https://coinpayportal.com/skill.md |
10 | 10 | ``` |
11 | 11 |
|
12 | | -# CoinPayPortal Wallet SDK |
| 12 | +# CoinPayPortal — Payments, Escrow & Wallets |
13 | 13 |
|
14 | | -Non-custodial multi-chain wallet for AI agents. Create wallets, check balances, send transactions, and receive payments across BTC, ETH, SOL, POL, BCH, and USDC — no KYC required. |
| 14 | +Non-custodial crypto infrastructure for AI agents and humans. Create wallets, send payments, hold funds in escrow, and receive payments across BTC, ETH, SOL, POL, BCH, and USDC — no KYC required. |
15 | 15 |
|
16 | 16 | **Base URL:** `https://coinpayportal.com/api/web-wallet` |
17 | 17 | **npm:** `@profullstack/coinpay` |
@@ -270,6 +270,137 @@ pnpm coinpay-wallet sync <wallet-id> --chain SOL |
270 | 270 | - `COINPAY_AUTH_TOKEN` — JWT token for read-only operations |
271 | 271 | - `COINPAY_MNEMONIC` — Mnemonic phrase (required for `send`) |
272 | 272 |
|
| 273 | +## Escrow Service |
| 274 | +
|
| 275 | +Create trustless escrows to hold funds until both parties are satisfied. No accounts required — authentication uses unique tokens. |
| 276 | +
|
| 277 | +### Create Escrow |
| 278 | +
|
| 279 | +```bash |
| 280 | +curl -X POST https://coinpayportal.com/api/escrow \ |
| 281 | + -H "Content-Type: application/json" \ |
| 282 | + -d '{ |
| 283 | + "chain": "ETH", |
| 284 | + "amount": 0.5, |
| 285 | + "depositor_address": "0xAlice...", |
| 286 | + "beneficiary_address": "0xBob...", |
| 287 | + "expires_in_hours": 48 |
| 288 | + }' |
| 289 | +``` |
| 290 | +
|
| 291 | +Response: |
| 292 | +```json |
| 293 | +{ |
| 294 | + "id": "uuid", |
| 295 | + "escrow_address": "0xDeposit...", |
| 296 | + "status": "created", |
| 297 | + "release_token": "esc_abc123...", |
| 298 | + "beneficiary_token": "esc_def456...", |
| 299 | + "amount": 0.5, |
| 300 | + "fee_amount": 0.005, |
| 301 | + "expires_at": "2024-01-03T12:00:00Z" |
| 302 | +} |
| 303 | +``` |
| 304 | +
|
| 305 | +Save both tokens — they are only returned once. Depositor gets `release_token`, beneficiary gets `beneficiary_token`. |
| 306 | +
|
| 307 | +### Escrow Flow |
| 308 | +
|
| 309 | +1. **Create** → get deposit address + tokens |
| 310 | +2. **Fund** → depositor sends crypto to `escrow_address` (auto-detected) |
| 311 | +3. **Release** → depositor calls release, funds forwarded to beneficiary minus fee |
| 312 | +4. **OR Refund** → depositor calls refund, full amount returned (no fee) |
| 313 | +5. **OR Dispute** → either party opens dispute |
| 314 | +
|
| 315 | +### Escrow Endpoints |
| 316 | +
|
| 317 | +| Endpoint | Method | Auth | Purpose | |
| 318 | +|----------|--------|------|---------| |
| 319 | +| `/api/escrow` | POST | Optional | Create escrow | |
| 320 | +| `/api/escrow` | GET | Optional | List escrows (requires filter) | |
| 321 | +| `/api/escrow/:id` | GET | No | Get escrow details | |
| 322 | +| `/api/escrow/:id/release` | POST | Token | Release funds to beneficiary | |
| 323 | +| `/api/escrow/:id/refund` | POST | Token | Refund to depositor (no fee) | |
| 324 | +| `/api/escrow/:id/dispute` | POST | Token | Open dispute | |
| 325 | +| `/api/escrow/:id/events` | GET | No | Audit log | |
| 326 | +
|
| 327 | +### Release Funds |
| 328 | +
|
| 329 | +```bash |
| 330 | +curl -X POST https://coinpayportal.com/api/escrow/<id>/release \ |
| 331 | + -H "Content-Type: application/json" \ |
| 332 | + -d '{ "release_token": "esc_abc123..." }' |
| 333 | +``` |
| 334 | +
|
| 335 | +### Refund |
| 336 | +
|
| 337 | +```bash |
| 338 | +curl -X POST https://coinpayportal.com/api/escrow/<id>/refund \ |
| 339 | + -H "Content-Type: application/json" \ |
| 340 | + -d '{ "release_token": "esc_abc123..." }' |
| 341 | +``` |
| 342 | +
|
| 343 | +### Dispute |
| 344 | +
|
| 345 | +```bash |
| 346 | +curl -X POST https://coinpayportal.com/api/escrow/<id>/dispute \ |
| 347 | + -H "Content-Type: application/json" \ |
| 348 | + -d '{ |
| 349 | + "token": "esc_def456...", |
| 350 | + "reason": "Work not delivered as agreed" |
| 351 | + }' |
| 352 | +``` |
| 353 | +
|
| 354 | +### Escrow Statuses |
| 355 | +
|
| 356 | +| Status | Meaning | |
| 357 | +|--------|---------| |
| 358 | +| `created` | Awaiting deposit | |
| 359 | +| `funded` | Deposit received on-chain | |
| 360 | +| `released` | Depositor approved release | |
| 361 | +| `settled` | Funds forwarded to beneficiary | |
| 362 | +| `disputed` | Dispute opened | |
| 363 | +| `refunded` | Funds returned to depositor | |
| 364 | +| `expired` | Deposit window expired | |
| 365 | +
|
| 366 | +### Escrow SDK |
| 367 | +
|
| 368 | +```typescript |
| 369 | +const escrow = await client.createEscrow({ |
| 370 | + chain: 'SOL', amount: 10, |
| 371 | + depositor_address: 'Alice...', |
| 372 | + beneficiary_address: 'Bob...', |
| 373 | +}); |
| 374 | +
|
| 375 | +// Release |
| 376 | +await client.releaseEscrow(escrow.id, escrow.release_token); |
| 377 | +
|
| 378 | +// Refund |
| 379 | +await client.refundEscrow(escrow.id, escrow.release_token); |
| 380 | +
|
| 381 | +// Wait for settlement |
| 382 | +const settled = await client.waitForEscrow(escrow.id, 'settled'); |
| 383 | +``` |
| 384 | +
|
| 385 | +### Escrow CLI |
| 386 | +
|
| 387 | +```bash |
| 388 | +coinpay escrow create --chain SOL --amount 10 \ |
| 389 | + --depositor Alice... --beneficiary Bob... |
| 390 | +coinpay escrow get <id> |
| 391 | +coinpay escrow list --status funded |
| 392 | +coinpay escrow release <id> --token esc_abc... |
| 393 | +coinpay escrow refund <id> --token esc_abc... |
| 394 | +coinpay escrow dispute <id> --token esc_def... --reason "..." |
| 395 | +coinpay escrow events <id> |
| 396 | +``` |
| 397 | +
|
| 398 | +### Fees |
| 399 | +
|
| 400 | +- **Free tier:** 1% on release |
| 401 | +- **Professional:** 0.5% on release |
| 402 | +- **Refunds:** No fee |
| 403 | +
|
273 | 404 | ## Rate Limits |
274 | 405 |
|
275 | 406 | | Endpoint | Limit | |
|
0 commit comments