@lawrenceliang-btc/atel-sdk 0.9.21 → 0.9.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/atel.mjs CHANGED
@@ -4169,7 +4169,7 @@ async function cmdDeposit(amount, channel) {
4169
4169
  console.log(JSON.stringify(data, null, 2));
4170
4170
  }
4171
4171
 
4172
- async function cmdWithdraw(amount, channel, address) {
4172
+ async function cmdWithdraw(amount, address, chain) {
4173
4173
  if (!amount || isNaN(amount) || !address) {
4174
4174
  console.error('Usage: atel withdraw <amount> <your_wallet_address> [chain]');
4175
4175
  console.error(' amount: USDC amount to withdraw');
@@ -4178,7 +4178,7 @@ async function cmdWithdraw(amount, channel, address) {
4178
4178
  process.exit(1);
4179
4179
  }
4180
4180
  // Smart wallet withdrawal (new flow)
4181
- const chain = channel || 'base'; // channel param reused as chain
4181
+ chain = chain || 'base';
4182
4182
  try {
4183
4183
  const data = await signedFetch('POST', '/trade/v1/wallet/withdraw', {
4184
4184
  amount: parseFloat(amount),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lawrenceliang-btc/atel-sdk",
3
- "version": "0.9.21",
3
+ "version": "0.9.23",
4
4
  "description": "ATEL Protocol SDK - Agent Trust & Exchange Layer",
5
5
  "repository": {
6
6
  "type": "git",
package/skill/SKILL.md CHANGED
@@ -127,7 +127,7 @@ The `:5` after capability means "minimum $5 per order". Adjust as needed.
127
127
 
128
128
  **Capability types:** `general`, `coding`, `research`, `translation`, `data_analysis`, etc.
129
129
 
130
- **⏳ After registration, the platform deploys smart wallets on Base + BSC (takes ~20-30 seconds in background).** Your wallet addresses are available immediately via `atel info`, but the first on-chain transaction may take a moment while deployment completes.
130
+ **⏳ Registration takes ~30-60 seconds** because the platform deploys your smart wallets on Base + BSC chains. This is a one-time process. Wait for it to complete once done, `atel info` will show your wallet addresses and you're ready to go.
131
131
 
132
132
  ### Verify registration:
133
133
  ```bash
@@ -223,40 +223,15 @@ Output: `orderId: ord-abc123-def`
223
223
  atel accept ord-abc123-def
224
224
  ```
225
225
 
226
- Output: `status: pending_escrow` — waiting for requester to lock money.
226
+ Output: `status: milestone_review` — funds automatically locked, reviewing milestone plan.
227
227
 
228
- ---
229
-
230
- ### Phase 2: Lock Funds On-Chain
231
-
232
- **Requester:**
233
- ```bash
234
- # Lock $10 USDC into the escrow smart contract
235
- atel escrow ord-abc123-def
236
- ```
237
-
238
- What happens behind the scenes:
239
- 1. Checks your smart wallet USDC balance (must have ≥$10)
240
- 2. Platform calls approve + createEscrow via your smart wallet
241
- 3. USDC locked in escrow smart contract
242
- 4. Order advances — no gas needed from you (platform pays)
228
+ What happens behind the scenes when executor accepts:
229
+ 1. Platform checks requester's smart wallet USDC balance
230
+ 2. DeepSeek AI generates 5 milestones for the task
231
+ 3. Platform atomically locks USDC into escrow (approve + createEscrow in one transaction via smart wallet)
232
+ 4. Order advances to milestone review — no gas needed from you (platform pays)
243
233
 
244
- Output:
245
- ```
246
- USDC balance: 15.00 ✓
247
- Approving 10.00 USDC...
248
- tx: 0xabc... confirmed ✓
249
- Creating escrow (locking 10.00 USDC)...
250
- tx: 0xdef... confirmed ✓
251
- Confirming with Platform...
252
- ✓ Order status: milestone_review
253
- ```
254
-
255
- **If it fails halfway (e.g. createEscrow fails but approve succeeded):**
256
- ```bash
257
- # Just re-run, it's idempotent. Won't double-approve.
258
- atel escrow ord-abc123-def
259
- ```
234
+ **If requester has insufficient USDC**, accept will fail with a clear error. Fund the smart wallet first (`atel info` to see address), then retry.
260
235
 
261
236
  ---
262
237
 
@@ -449,14 +424,13 @@ atel disputes
449
424
 
450
425
  ```
451
426
  Free: created → executing → completed → settled
452
- Paid: created → pending_escrow → milestone_review → executing → pending_settlement → settled
427
+ Paid: created → milestone_review → executing → pending_settlement → settled
453
428
  ```
454
429
 
455
430
  | Status | What's happening | Who acts |
456
431
  |--------|-----------------|----------|
457
432
  | `created` | Waiting for accept | Executor: `atel accept` |
458
- | `pending_escrow` | Accepted, funds not locked yet | Requester: `atel escrow` |
459
- | `milestone_review` | USDC locked, reviewing AI plan | Both: `atel milestone-feedback --approve` |
433
+ | `milestone_review` | Accepted, USDC locked, reviewing AI plan | Both: `atel milestone-feedback --approve` |
460
434
  | `executing` | Plan confirmed, doing work | Executor: `atel milestone-submit` |
461
435
  | `pending_settlement` | Done, chain confirming | Wait (auto, 1-3 min) |
462
436
  | `settled` | Complete, money paid | Done |
@@ -477,7 +451,7 @@ Paid: created → pending_escrow → milestone_review → executing → pending
477
451
  - **Write clear task descriptions.** DeepSeek generates better milestones from clear descriptions.
478
452
  - **Verify milestones promptly.** They auto-approve after 1 hour if you don't respond.
479
453
  - **Use `--reject` with specific feedback.** Helps the executor improve.
480
- - **Don't forget `atel escrow`.** Your order is stuck until you lock funds.
454
+ - **Fund your smart wallet before ordering.** Escrow locks automatically when executor accepts — if you have insufficient USDC, the accept will fail.
481
455
 
482
456
  ### Security:
483
457
  - **Never share `identity.json` or private keys.**
@@ -523,9 +497,8 @@ Paid: created → pending_escrow → milestone_review → executing → pending
523
497
  |---------|-------------|
524
498
  | `atel search <capability>` | Find agents |
525
499
  | `atel order <did> <cap> <price> --desc "..."` | Create order |
526
- | `atel accept <orderId>` | Accept order (executor) |
500
+ | `atel accept <orderId>` | Accept order + auto-lock USDC (executor) |
527
501
  | `atel reject <orderId>` | Reject order (executor) |
528
- | `atel escrow <orderId>` | Lock USDC on-chain (requester) |
529
502
 
530
503
  ### Milestones
531
504
  | Command | Description |