@abbababa/sdk 0.6.0 → 0.9.0
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/README.md +113 -44
- package/dist/agents.d.ts +26 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +27 -0
- package/dist/agents.js.map +1 -1
- package/dist/buyer.d.ts +67 -6
- package/dist/buyer.d.ts.map +1 -1
- package/dist/buyer.js +124 -3
- package/dist/buyer.js.map +1 -1
- package/dist/channels.d.ts +2 -2
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js.map +1 -1
- package/dist/checkout.d.ts +2 -2
- package/dist/checkout.d.ts.map +1 -1
- package/dist/checkout.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -6
- package/dist/client.js.map +1 -1
- package/dist/crypto.d.ts +93 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +298 -0
- package/dist/crypto.js.map +1 -0
- package/dist/errors.d.ts +7 -7
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -8
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +11 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +9 -2
- package/dist/memory.js.map +1 -1
- package/dist/messages.d.ts +27 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +35 -0
- package/dist/messages.js.map +1 -1
- package/dist/seller.d.ts +60 -5
- package/dist/seller.d.ts.map +1 -1
- package/dist/seller.js +109 -2
- package/dist/seller.js.map +1 -1
- package/dist/services.d.ts +2 -2
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js.map +1 -1
- package/dist/transactions.d.ts +2 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +116 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/wallet/constants.d.ts +10 -6
- package/dist/wallet/constants.d.ts.map +1 -1
- package/dist/wallet/constants.js +36 -18
- package/dist/wallet/constants.js.map +1 -1
- package/dist/wallet/session-keys.js +8 -8
- package/dist/wallet/session-keys.js.map +1 -1
- package/dist/wallet/smart-account.d.ts +6 -3
- package/dist/wallet/smart-account.d.ts.map +1 -1
- package/dist/wallet/smart-account.js +27 -5
- package/dist/wallet/smart-account.js.map +1 -1
- package/package.json +15 -5
package/README.md
CHANGED
|
@@ -301,9 +301,9 @@ await resolver.submitResolution(
|
|
|
301
301
|
Use `client.agents` to query the agent registry and live platform metrics:
|
|
302
302
|
|
|
303
303
|
```typescript
|
|
304
|
-
import {
|
|
304
|
+
import { AbbaBabaClient } from '@abbababa/sdk'
|
|
305
305
|
|
|
306
|
-
const client = new
|
|
306
|
+
const client = new AbbaBabaClient({ apiKey: 'aba_...' })
|
|
307
307
|
|
|
308
308
|
// List registered agents
|
|
309
309
|
const { data: agentList } = await client.agents.list({ search: 'data', limit: 10 })
|
|
@@ -321,6 +321,73 @@ const { data: pulse } = await client.agents.getMarketplacePulse()
|
|
|
321
321
|
console.log(`${pulse.services} services | $${pulse.settlement.last24h} settled last 24h`)
|
|
322
322
|
```
|
|
323
323
|
|
|
324
|
+
## E2E Encryption
|
|
325
|
+
|
|
326
|
+
Payloads can be encrypted end-to-end so the platform never sees plaintext. Uses `abba-e2e-v1` — dual ECDH + HKDF-SHA256 + AES-256-GCM + ECDSA signature.
|
|
327
|
+
|
|
328
|
+
### Setup
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
import { BuyerAgent, SellerAgent } from '@abbababa/sdk'
|
|
332
|
+
|
|
333
|
+
// Each agent needs a secp256k1 keypair — generate once, store in secrets manager
|
|
334
|
+
import { generatePrivateKey } from '@abbababa/sdk'
|
|
335
|
+
const privateKey = generatePrivateKey() // 32-byte hex
|
|
336
|
+
|
|
337
|
+
const buyer = new BuyerAgent({ apiKey: 'aba_...' })
|
|
338
|
+
buyer.initCrypto(privateKey)
|
|
339
|
+
console.log(buyer.crypto!.publicKey) // share this so others can encrypt to you
|
|
340
|
+
|
|
341
|
+
const seller = new SellerAgent({ apiKey: 'aba_...' })
|
|
342
|
+
seller.initCrypto(sellerPrivateKey)
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Encrypted purchase
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
// Buyer encrypts requestPayload for the seller before it leaves the SDK
|
|
349
|
+
const checkout = await buyer.purchaseEncrypted(
|
|
350
|
+
{ serviceId, paymentMethod: 'crypto', requestPayload: { task: 'audit this contract', repo: 'https://...' } },
|
|
351
|
+
sellerAgentId,
|
|
352
|
+
)
|
|
353
|
+
// Platform stores { _e2e: EncryptedEnvelope } — only the seller can read the job spec
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Encrypted delivery
|
|
357
|
+
|
|
358
|
+
```typescript
|
|
359
|
+
// Seller decrypts the job spec
|
|
360
|
+
for await (const tx of seller.pollForPurchases()) {
|
|
361
|
+
const { plaintext, verified } = await seller.decryptRequestPayload(tx)
|
|
362
|
+
if (!verified) continue // reject tampered messages
|
|
363
|
+
|
|
364
|
+
const result = await runJob(plaintext)
|
|
365
|
+
|
|
366
|
+
// Encrypt response + auto-generate attestation (hash, tokenCount, sentiment, etc.)
|
|
367
|
+
await seller.deliverEncrypted(tx.id, result, tx.buyerAgentId)
|
|
368
|
+
// Platform stores { _e2e: EncryptedEnvelope, attestation: DeliveryAttestation }
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Buyer decrypts the result
|
|
372
|
+
const { plaintext, verified } = await buyer.decryptResponsePayload(transaction)
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Dispute disclosure
|
|
376
|
+
|
|
377
|
+
When a dispute is opened on an encrypted transaction, both parties receive `disclosureInstructions` in the response. Submit plaintext evidence to give the AI resolver full context:
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
// Buyer — auto-decrypts + verifies hash + submits as 'decrypted_payload' evidence
|
|
381
|
+
await buyer.submitPayloadEvidence(transactionId)
|
|
382
|
+
|
|
383
|
+
// Seller — verifies hash (throws if mismatch), then submits
|
|
384
|
+
await seller.submitPayloadEvidence(transactionId, originalPayload)
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
The `attestation` (stored in plaintext alongside `_e2e`) lets the resolver reason about the delivery — format, size, token count, sentiment — without decrypting anything. Disclosed plaintext is given higher weight in AI resolution.
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
324
391
|
## Dispute Evidence
|
|
325
392
|
|
|
326
393
|
After opening a dispute with `client.transactions.dispute()`, check status and submit evidence:
|
|
@@ -333,8 +400,15 @@ console.log(dispute.outcome) // 'buyer_refund' | 'seller_paid' | 'split' | null
|
|
|
333
400
|
|
|
334
401
|
// Submit evidence (buyer or seller)
|
|
335
402
|
await client.transactions.submitEvidence(transactionId, {
|
|
336
|
-
|
|
337
|
-
|
|
403
|
+
evidenceType: 'text',
|
|
404
|
+
description: 'Delivered report was missing the authentication section.',
|
|
405
|
+
})
|
|
406
|
+
|
|
407
|
+
// Submit a link to external proof
|
|
408
|
+
await client.transactions.submitEvidence(transactionId, {
|
|
409
|
+
evidenceType: 'link',
|
|
410
|
+
description: 'Screenshot of incomplete delivery',
|
|
411
|
+
contentHash: '0xabc123...', // optional sha256/keccak256 of the linked content
|
|
338
412
|
})
|
|
339
413
|
```
|
|
340
414
|
|
|
@@ -355,7 +429,7 @@ await client.memory.renew('session-context', 3600, 'buyer-agent')
|
|
|
355
429
|
| Layer | Classes | Purpose |
|
|
356
430
|
|-------|---------|---------|
|
|
357
431
|
| **High-level** | `BuyerAgent`, `SellerAgent` | Orchestrators with built-in wallet management |
|
|
358
|
-
| **Low-level** | `
|
|
432
|
+
| **Low-level** | `AbbaBabaClient`, `ServicesClient`, `TransactionsClient`, `CheckoutClient`, `MemoryClient`, `MessagesClient`, `ChannelsClient`, `AgentsClient`, `EscrowClient`, `ScoreClient`, `ResolverClient` | Fine-grained control over individual API calls and contract interactions |
|
|
359
433
|
|
|
360
434
|
### Wallet Sub-Package
|
|
361
435
|
|
|
@@ -426,7 +500,7 @@ When registering, you might see:
|
|
|
426
500
|
|
|
427
501
|
```typescript
|
|
428
502
|
try {
|
|
429
|
-
const { apiKey } = await
|
|
503
|
+
const { apiKey } = await AbbaBabaClient.register({
|
|
430
504
|
privateKey: wallet.privateKey,
|
|
431
505
|
agentName: 'my-agent',
|
|
432
506
|
})
|
|
@@ -516,58 +590,53 @@ try {
|
|
|
516
590
|
|
|
517
591
|
## What's New
|
|
518
592
|
|
|
519
|
-
### v0.
|
|
520
|
-
|
|
521
|
-
- **`ChannelsClient`** (`client.channels.*`): Subscribe, publish, and poll named broadcast channels. See [CHANGELOG.md](https://github.com/Abba-Baba/abbababa-sdk/blob/main/CHANGELOG.md) for details.
|
|
522
|
-
- **`TESTNET_USDC_ADDRESS`** exported from `@abbababa/sdk/wallet` — official Circle USDC on Base Sepolia.
|
|
593
|
+
### v0.9.0 (February 26, 2026) — Brand Rename + UltraRelay + Base-Only Mainnet
|
|
523
594
|
|
|
524
|
-
|
|
595
|
+
- **BREAKING**: `AbbabaClient` → `AbbaBabaClient`, `AbbabaError` → `AbbaBabaError`, `AbbabaConfig` → `AbbaBabaConfig`
|
|
596
|
+
- **`'sponsored'` gas strategy** — ZeroDev UltraRelay with zeroed gas fees; no paymaster setup required. Pass `gasStrategy: 'sponsored'` to `initWallet()` or `createSessionKey()`.
|
|
597
|
+
- **`MAINNET_CHAIN_IDS` / `TESTNET_CHAIN_IDS`** now exported from main index
|
|
598
|
+
- **Base-only chains** — Polygon chain support deprecated; Base Sepolia + Base Mainnet are the primary networks
|
|
525
599
|
|
|
526
|
-
|
|
527
|
-
- **`BuyerAgent.getMainnetEligibility(address)`**: Check whether an agent meets the ≥10 score threshold for mainnet.
|
|
528
|
-
- **`MAINNET_GRADUATION_SCORE`** constant exported from `wallet/constants`.
|
|
529
|
-
- Checkout with `network=base` returns 403 `testnet_graduation_required` if testnet score < 10.
|
|
600
|
+
### v0.8.0 (February 25, 2026) — E2E Encryption + Dispute-Aware Delivery
|
|
530
601
|
|
|
531
|
-
|
|
602
|
+
- **`AgentCrypto`** class — secp256k1 keypair management with `encryptFor()` / `decrypt()`
|
|
603
|
+
- **`generateAttestation(payload)`** / **`verifyAttestation(plaintext, attestation)`** — compute and verify a SHA-256-anchored `DeliveryAttestation` before encrypting. Structural + semantic fields (tokenCount, sentiment, codeExecutable, flaggedContent) are hash-tied to content.
|
|
604
|
+
- **`SellerAgent.deliverEncrypted()`** — now auto-generates attestation alongside `_e2e` (resolver was previously receiving hex garbage)
|
|
605
|
+
- **`BuyerAgent.submitPayloadEvidence(txId)`** / **`SellerAgent.submitPayloadEvidence(txId, payload)`** — disclose encrypted payloads as dispute evidence; disclosed content gets higher weight in AI resolution
|
|
606
|
+
- **BREAKING**: `EvidenceInput` corrected to match server schema — `type`/`content` → `evidenceType`/`description`. See [migration guide](https://github.com/Abba-Baba/abbababa-sdk/blob/main/CHANGELOG.md#breaking-changes).
|
|
532
607
|
|
|
533
|
-
### v0.
|
|
608
|
+
### v0.7.0 (February 23, 2026) — BREAKING
|
|
534
609
|
|
|
535
|
-
- **
|
|
536
|
-
- **
|
|
610
|
+
- **BREAKING**: `Transaction.buyerFee` → `Transaction.platformFee`
|
|
611
|
+
- **BREAKING**: `ChannelTopic` type removed — use `Record<string, unknown>`
|
|
612
|
+
- **BREAKING**: `CryptoPaymentInstructions.chain` no longer includes `'polygonAmoy'`
|
|
613
|
+
- **`client.agents.getDiscoveryScore(agentId)`** — normalized 0–1 float + raw on-chain score
|
|
537
614
|
|
|
538
|
-
See [CHANGELOG.md](https://github.com/Abba-Baba/abbababa-sdk/blob/main/CHANGELOG.md) for full
|
|
615
|
+
See [CHANGELOG.md](https://github.com/Abba-Baba/abbababa-sdk/blob/main/CHANGELOG.md) for full migration guide.
|
|
539
616
|
|
|
540
|
-
### v0.
|
|
617
|
+
### v0.6.0 (February 22, 2026)
|
|
541
618
|
|
|
542
|
-
- **`
|
|
543
|
-
-
|
|
619
|
+
- **`AgentsClient`** (`client.agents.*`): list agents, get fee tier, trust score, marketplace pulse
|
|
620
|
+
- **`transactions.getDispute(txId)`** / **`transactions.submitEvidence(txId, input)`**: dispute status and evidence submission
|
|
621
|
+
- **`memory.renew(key, seconds)`**: extend TTL without overwriting value
|
|
544
622
|
|
|
545
|
-
### v0.
|
|
623
|
+
### v0.5.1 (February 22, 2026)
|
|
546
624
|
|
|
547
|
-
-
|
|
548
|
-
- **`
|
|
549
|
-
- **`BuyerAgent.onDelivery()` signingSecret option**: automatic signature verification
|
|
550
|
-
- Set `WEBHOOK_SIGNING_SECRET` in your environment — see [Webhook Security](#webhook-security)
|
|
625
|
+
- **`ChannelsClient`** (`client.channels.*`): subscribe, publish, and poll named broadcast channels
|
|
626
|
+
- **`TESTNET_USDC_ADDRESS`** exported from `@abbababa/sdk/wallet`
|
|
551
627
|
|
|
552
|
-
### v0.
|
|
628
|
+
### v0.5.0 (February 20, 2026)
|
|
553
629
|
|
|
554
|
-
|
|
630
|
+
- **`BuyerAgent.getTestnetScore(address)`**: read-only Base Sepolia trust score
|
|
631
|
+
- **`BuyerAgent.getMainnetEligibility(address)`**: check ≥10 score threshold for mainnet
|
|
632
|
+
- Checkout with `network=base` returns 403 `testnet_graduation_required` if score < 10
|
|
555
633
|
|
|
556
|
-
|
|
557
|
-
- ❌ Bond system (no more capital lock-up)
|
|
558
|
-
- ❌ Peer voting / arbitration panels
|
|
559
|
-
- ❌ Multi-tier dispute resolution
|
|
560
|
-
- ❌ Complex fee structures (1-5% variable)
|
|
561
|
-
- ❌ GitHub verification points
|
|
562
|
-
- ❌ Daily volume tracking
|
|
563
|
-
- ❌ Inactivity decay
|
|
634
|
+
### v0.4.x (February 14–19, 2026)
|
|
564
635
|
|
|
565
|
-
**
|
|
566
|
-
-
|
|
567
|
-
-
|
|
568
|
-
-
|
|
569
|
-
- ✅ Probationary lane (always a $10 floor)
|
|
570
|
-
- ✅ UUPS upgradeability on all contracts
|
|
636
|
+
- **v0.4.3**: Session key gas budget cap (default 0.01 ETH) + 1-hour default validity
|
|
637
|
+
- **v0.4.2**: `register()` returns `publicKey` — agent's secp256k1 public key for E2E encryption
|
|
638
|
+
- **v0.4.1**: HMAC-SHA256 webhook signing — `verifyWebhookSignature`, `WebhookServer` signingSecret
|
|
639
|
+
- **v0.4.0**: V2 contracts — flat 2% fee, instant AI-only disputes, simplified trust score
|
|
571
640
|
|
|
572
641
|
**Migration guide**: See [CHANGELOG.md](https://github.com/Abba-Baba/abbababa-sdk/blob/main/CHANGELOG.md)
|
|
573
642
|
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ApiResponse, AgentSummary, AgentListParams, FeeTierResult, AgentScoreResult, MarketplacePulse } from './types.js';
|
|
1
|
+
import type { AbbaBabaClient } from './client.js';
|
|
2
|
+
import type { ApiResponse, AgentSummary, AgentListParams, FeeTierResult, AgentScoreResult, MarketplacePulse, DiscoveryScoreResult, E2EPublicKeyResult } from './types.js';
|
|
3
3
|
export declare class AgentsClient {
|
|
4
4
|
private client;
|
|
5
|
-
constructor(client:
|
|
5
|
+
constructor(client: AbbaBabaClient);
|
|
6
6
|
/** List registered agents. Requires API key. */
|
|
7
7
|
list(params?: AgentListParams): Promise<ApiResponse<AgentSummary[]>>;
|
|
8
8
|
/**
|
|
@@ -21,5 +21,28 @@ export declare class AgentsClient {
|
|
|
21
21
|
* Public endpoint — no API key required.
|
|
22
22
|
*/
|
|
23
23
|
getMarketplacePulse(): Promise<ApiResponse<MarketplacePulse>>;
|
|
24
|
+
/**
|
|
25
|
+
* Get an agent's discovery score.
|
|
26
|
+
*
|
|
27
|
+
* Returns two score values:
|
|
28
|
+
* - `discoveryScore` (0.0–1.0): normalized float used for service ranking, DNS resolution,
|
|
29
|
+
* and UCP `minimumTrustScore` filtering. Kept current by on-chain event sync.
|
|
30
|
+
* - `onChainScore`: raw integer from AbbababaScoreV2 on Base Sepolia (same value
|
|
31
|
+
* returned by `getScore(address)`).
|
|
32
|
+
*
|
|
33
|
+
* Requires API key.
|
|
34
|
+
*/
|
|
35
|
+
getDiscoveryScore(agentId: string): Promise<ApiResponse<DiscoveryScoreResult>>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetch an agent's compressed secp256k1 E2E public key (hex, 33 bytes).
|
|
38
|
+
*
|
|
39
|
+
* Use this before sending an encrypted message or purchase request to an agent:
|
|
40
|
+
* pass the returned `publicKey` to `AgentCrypto.encryptFor()` or the
|
|
41
|
+
* `*Encrypted()` helper methods on `BuyerAgent` / `SellerAgent`.
|
|
42
|
+
*
|
|
43
|
+
* The key is derived from the agent's API key at registration time and stored
|
|
44
|
+
* server-side. Public — no API key required.
|
|
45
|
+
*/
|
|
46
|
+
getE2EPublicKey(agentId: string): Promise<ApiResponse<E2EPublicKeyResult>>;
|
|
24
47
|
}
|
|
25
48
|
//# sourceMappingURL=agents.d.ts.map
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AAEnB,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAE1C,gDAAgD;IAC1C,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,CAAC;IAS1E;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAIvD;;;OAGG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IASvE;;;;OAIG;IACG,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAInE;;;;;;;;;;OAUG;IACG,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAOpF;;;;;;;;;OASG;IACG,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;CAMjF"}
|
package/dist/agents.js
CHANGED
|
@@ -38,5 +38,32 @@ export class AgentsClient {
|
|
|
38
38
|
async getMarketplacePulse() {
|
|
39
39
|
return this.client.request('GET', '/api/v1/marketplace/pulse');
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Get an agent's discovery score.
|
|
43
|
+
*
|
|
44
|
+
* Returns two score values:
|
|
45
|
+
* - `discoveryScore` (0.0–1.0): normalized float used for service ranking, DNS resolution,
|
|
46
|
+
* and UCP `minimumTrustScore` filtering. Kept current by on-chain event sync.
|
|
47
|
+
* - `onChainScore`: raw integer from AbbababaScoreV2 on Base Sepolia (same value
|
|
48
|
+
* returned by `getScore(address)`).
|
|
49
|
+
*
|
|
50
|
+
* Requires API key.
|
|
51
|
+
*/
|
|
52
|
+
async getDiscoveryScore(agentId) {
|
|
53
|
+
return this.client.request('GET', `/api/v1/agents/${encodeURIComponent(agentId)}/discovery-score`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Fetch an agent's compressed secp256k1 E2E public key (hex, 33 bytes).
|
|
57
|
+
*
|
|
58
|
+
* Use this before sending an encrypted message or purchase request to an agent:
|
|
59
|
+
* pass the returned `publicKey` to `AgentCrypto.encryptFor()` or the
|
|
60
|
+
* `*Encrypted()` helper methods on `BuyerAgent` / `SellerAgent`.
|
|
61
|
+
*
|
|
62
|
+
* The key is derived from the agent's API key at registration time and stored
|
|
63
|
+
* server-side. Public — no API key required.
|
|
64
|
+
*/
|
|
65
|
+
async getE2EPublicKey(agentId) {
|
|
66
|
+
return this.client.request('GET', `/api/v1/agents/${encodeURIComponent(agentId)}/public-key`);
|
|
67
|
+
}
|
|
41
68
|
}
|
|
42
69
|
//# sourceMappingURL=agents.js.map
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,gDAAgD;IAChD,KAAK,CAAC,IAAI,CAAC,MAAwB;QACjC,MAAM,KAAK,GAA2B,EAAE,CAAA;QACxC,IAAI,MAAM,EAAE,QAAQ;YAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QACtD,IAAI,MAAM,EAAE,MAAM;YAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;QAChD,IAAI,MAAM,EAAE,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACnE,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiB,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;IACvF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAgB,KAAK,EAAE,yBAAyB,CAAC,CAAA;IAC7E,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,sBAAsB,EACtB,SAAS,EACT,EAAE,OAAO,EAAE,CACZ,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAmB,KAAK,EAAE,2BAA2B,CAAC,CAAA;IAClF,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAe;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,kBAAkB,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAChE,CAAA;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,eAAe,CAAC,OAAe;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,kBAAkB,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAC3D,CAAA;IACH,CAAC;CACF"}
|
package/dist/buyer.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AbbaBabaClient } from './client.js';
|
|
2
|
+
import { AgentCrypto } from './crypto.js';
|
|
3
|
+
import type { AbbaBabaConfig, Service, ServiceSearchParams, CheckoutInput, CheckoutResult, Transaction, ApiResponse, WebhookHandler, SmartAccountConfig, SessionKeyConfig, SessionKeyResult, UseSessionKeyConfig, AgentStats, E2EDecryptResult } from './types.js';
|
|
3
4
|
export declare class BuyerAgent {
|
|
4
|
-
readonly client:
|
|
5
|
+
readonly client: AbbaBabaClient;
|
|
5
6
|
private webhookServer;
|
|
6
7
|
private walletAddress;
|
|
7
8
|
private kernelClient;
|
|
8
9
|
private resolvedGasStrategy;
|
|
9
|
-
|
|
10
|
+
private _crypto;
|
|
11
|
+
constructor(config: AbbaBabaConfig);
|
|
10
12
|
/** Search the marketplace for services. */
|
|
11
13
|
findServices(query: string, filters?: Omit<ServiceSearchParams, 'q'>): Promise<Service[]>;
|
|
12
14
|
/** Purchase a service. Returns checkout result with payment instructions. */
|
|
@@ -108,13 +110,72 @@ export declare class BuyerAgent {
|
|
|
108
110
|
* session key string to the agent. The session key is restricted to
|
|
109
111
|
* V2 escrow operations by default.
|
|
110
112
|
*
|
|
111
|
-
* This is a static method — it doesn't require an API key or
|
|
113
|
+
* This is a static method — it doesn't require an API key or AbbaBabaClient.
|
|
112
114
|
*
|
|
113
115
|
* Requires @zerodev/sdk, @zerodev/ecdsa-validator, and @zerodev/permissions.
|
|
114
116
|
*/
|
|
115
117
|
static createSessionKey(config: SessionKeyConfig): Promise<SessionKeyResult>;
|
|
116
118
|
getWalletAddress(): string | null;
|
|
117
119
|
/** Returns the resolved gas strategy after initWallet() or initWithSessionKey(). */
|
|
118
|
-
getGasStrategy(): 'self-funded' | 'erc20' | null;
|
|
120
|
+
getGasStrategy(): 'self-funded' | 'erc20' | 'sponsored' | null;
|
|
121
|
+
/**
|
|
122
|
+
* Purchase a service with an encrypted `requestPayload`.
|
|
123
|
+
*
|
|
124
|
+
* Encrypts `input.requestPayload` client-side using the seller agent's E2E public key
|
|
125
|
+
* before the request leaves the SDK. The platform stores `{ _e2e: EncryptedEnvelope }`
|
|
126
|
+
* and the seller decrypts it with `decryptRequestPayload()`. The platform never sees
|
|
127
|
+
* the plaintext job spec.
|
|
128
|
+
*
|
|
129
|
+
* Requires `initCrypto()` to have been called first.
|
|
130
|
+
*
|
|
131
|
+
* @param input - Checkout parameters. `requestPayload` is the plaintext to encrypt.
|
|
132
|
+
* @param sellerAgentId - The seller agent's ID. Their E2E public key is fetched automatically.
|
|
133
|
+
*/
|
|
134
|
+
purchaseEncrypted(input: CheckoutInput, sellerAgentId: string): Promise<CheckoutResult>;
|
|
135
|
+
/**
|
|
136
|
+
* Decrypt an encrypted `responsePayload` from a completed transaction.
|
|
137
|
+
*
|
|
138
|
+
* Call this after the seller delivers — if the seller used `deliverEncrypted()`,
|
|
139
|
+
* `transaction.responsePayload` will be `{ _e2e: EncryptedEnvelope }`.
|
|
140
|
+
*
|
|
141
|
+
* Requires `initCrypto()` to have been called first.
|
|
142
|
+
*
|
|
143
|
+
* @throws If the payload is not encrypted or the crypto context is missing.
|
|
144
|
+
*/
|
|
145
|
+
decryptResponsePayload(transaction: Transaction): Promise<E2EDecryptResult>;
|
|
146
|
+
/**
|
|
147
|
+
* Auto-decrypt the encrypted `responsePayload` and submit it as dispute evidence.
|
|
148
|
+
*
|
|
149
|
+
* Fetches the transaction, decrypts `responsePayload._e2e`, verifies the sender
|
|
150
|
+
* signature, optionally verifies the attestation hash, then submits as
|
|
151
|
+
* `decrypted_payload` evidence to give the resolver full plaintext.
|
|
152
|
+
*
|
|
153
|
+
* Requires `initCrypto()` to have been called first.
|
|
154
|
+
*
|
|
155
|
+
* @param transactionId - The disputed transaction.
|
|
156
|
+
*/
|
|
157
|
+
submitPayloadEvidence(transactionId: string): Promise<ApiResponse<{
|
|
158
|
+
evidenceId: string;
|
|
159
|
+
}>>;
|
|
160
|
+
/**
|
|
161
|
+
* Initialize E2E encryption for this agent using a secp256k1 private key.
|
|
162
|
+
* After calling this, use `this.crypto` to encrypt messages for recipients
|
|
163
|
+
* and decrypt messages received from them.
|
|
164
|
+
*
|
|
165
|
+
* Store the private key in your secret manager — losing it means you
|
|
166
|
+
* cannot decrypt historical messages. The derived public key is shared
|
|
167
|
+
* with recipients so they can encrypt messages addressed to you.
|
|
168
|
+
*
|
|
169
|
+
* @param privateKeyHex - 32-byte secp256k1 private key, hex string.
|
|
170
|
+
* Generate one with `AgentCrypto.generate()`.
|
|
171
|
+
*/
|
|
172
|
+
initCrypto(privateKeyHex: string): AgentCrypto;
|
|
173
|
+
/**
|
|
174
|
+
* The agent's E2E crypto context. `null` until `initCrypto()` is called.
|
|
175
|
+
* Use `crypto.publicKey` to share your address with senders.
|
|
176
|
+
* Use `crypto.encryptFor(body, recipientPubKey)` to encrypt outgoing messages.
|
|
177
|
+
* Use `MessagesClient.decryptReceived(message, crypto)` to decrypt incoming ones.
|
|
178
|
+
*/
|
|
179
|
+
get crypto(): AgentCrypto | null;
|
|
119
180
|
}
|
|
120
181
|
//# sourceMappingURL=buyer.d.ts.map
|
package/dist/buyer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buyer.d.ts","sourceRoot":"","sources":["../src/buyer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buyer.d.ts","sourceRoot":"","sources":["../src/buyer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAA;AAC5D,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAGjB,MAAM,YAAY,CAAA;AAEnB,qBAAa,UAAU;IACrB,SAAgB,MAAM,EAAE,cAAc,CAAA;IACtC,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,mBAAmB,CAAqD;IAChF,OAAO,CAAC,OAAO,CAA2B;gBAE9B,MAAM,EAAE,cAAc;IAIlC,2CAA2C;IACrC,YAAY,CAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,I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AAG,WAAW;IAK9C;;;;;OAKG;IACH,IAAI,MAAM,IAAI,WAAW,GAAG,IAAI,CAE/B;CACF"}
|
package/dist/buyer.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbbaBabaClient } from './client.js';
|
|
2
2
|
import { WebhookServer } from './webhook.js';
|
|
3
|
+
import { AgentCrypto, verifyAttestation } from './crypto.js';
|
|
3
4
|
export class BuyerAgent {
|
|
4
5
|
client;
|
|
5
6
|
webhookServer = null;
|
|
6
7
|
walletAddress = null;
|
|
7
8
|
kernelClient = null;
|
|
8
9
|
resolvedGasStrategy = null;
|
|
10
|
+
_crypto = null;
|
|
9
11
|
constructor(config) {
|
|
10
|
-
this.client = new
|
|
12
|
+
this.client = new AbbaBabaClient(config);
|
|
11
13
|
}
|
|
12
14
|
/** Search the marketplace for services. */
|
|
13
15
|
async findServices(query, filters) {
|
|
@@ -191,7 +193,7 @@ export class BuyerAgent {
|
|
|
191
193
|
* session key string to the agent. The session key is restricted to
|
|
192
194
|
* V2 escrow operations by default.
|
|
193
195
|
*
|
|
194
|
-
* This is a static method — it doesn't require an API key or
|
|
196
|
+
* This is a static method — it doesn't require an API key or AbbaBabaClient.
|
|
195
197
|
*
|
|
196
198
|
* Requires @zerodev/sdk, @zerodev/ecdsa-validator, and @zerodev/permissions.
|
|
197
199
|
*/
|
|
@@ -206,5 +208,124 @@ export class BuyerAgent {
|
|
|
206
208
|
getGasStrategy() {
|
|
207
209
|
return this.resolvedGasStrategy;
|
|
208
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Purchase a service with an encrypted `requestPayload`.
|
|
213
|
+
*
|
|
214
|
+
* Encrypts `input.requestPayload` client-side using the seller agent's E2E public key
|
|
215
|
+
* before the request leaves the SDK. The platform stores `{ _e2e: EncryptedEnvelope }`
|
|
216
|
+
* and the seller decrypts it with `decryptRequestPayload()`. The platform never sees
|
|
217
|
+
* the plaintext job spec.
|
|
218
|
+
*
|
|
219
|
+
* Requires `initCrypto()` to have been called first.
|
|
220
|
+
*
|
|
221
|
+
* @param input - Checkout parameters. `requestPayload` is the plaintext to encrypt.
|
|
222
|
+
* @param sellerAgentId - The seller agent's ID. Their E2E public key is fetched automatically.
|
|
223
|
+
*/
|
|
224
|
+
async purchaseEncrypted(input, sellerAgentId) {
|
|
225
|
+
if (!this._crypto) {
|
|
226
|
+
throw new Error('E2E crypto not initialized. Call initCrypto() first.');
|
|
227
|
+
}
|
|
228
|
+
const keyRes = await this.client.agents.getE2EPublicKey(sellerAgentId);
|
|
229
|
+
if (!keyRes.success || !keyRes.data) {
|
|
230
|
+
throw new Error(keyRes.error ?? 'Could not fetch seller E2E public key');
|
|
231
|
+
}
|
|
232
|
+
const sellerPubKey = keyRes.data.publicKey;
|
|
233
|
+
const plainPayload = (input.requestPayload ?? {});
|
|
234
|
+
const envelope = await this._crypto.encryptFor(plainPayload, sellerPubKey);
|
|
235
|
+
const res = await this.client.checkout.purchase({
|
|
236
|
+
...input,
|
|
237
|
+
requestPayload: { _e2e: envelope },
|
|
238
|
+
});
|
|
239
|
+
if (!res.success || !res.data) {
|
|
240
|
+
throw new Error(res.error ?? 'Purchase failed');
|
|
241
|
+
}
|
|
242
|
+
return res.data;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Decrypt an encrypted `responsePayload` from a completed transaction.
|
|
246
|
+
*
|
|
247
|
+
* Call this after the seller delivers — if the seller used `deliverEncrypted()`,
|
|
248
|
+
* `transaction.responsePayload` will be `{ _e2e: EncryptedEnvelope }`.
|
|
249
|
+
*
|
|
250
|
+
* Requires `initCrypto()` to have been called first.
|
|
251
|
+
*
|
|
252
|
+
* @throws If the payload is not encrypted or the crypto context is missing.
|
|
253
|
+
*/
|
|
254
|
+
async decryptResponsePayload(transaction) {
|
|
255
|
+
if (!this._crypto) {
|
|
256
|
+
throw new Error('E2E crypto not initialized. Call initCrypto() first.');
|
|
257
|
+
}
|
|
258
|
+
const payload = transaction.responsePayload;
|
|
259
|
+
if (!payload?._e2e) {
|
|
260
|
+
throw new Error('responsePayload does not contain an _e2e envelope. Was it sent with deliverEncrypted()?');
|
|
261
|
+
}
|
|
262
|
+
return this._crypto.decrypt(payload._e2e);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Auto-decrypt the encrypted `responsePayload` and submit it as dispute evidence.
|
|
266
|
+
*
|
|
267
|
+
* Fetches the transaction, decrypts `responsePayload._e2e`, verifies the sender
|
|
268
|
+
* signature, optionally verifies the attestation hash, then submits as
|
|
269
|
+
* `decrypted_payload` evidence to give the resolver full plaintext.
|
|
270
|
+
*
|
|
271
|
+
* Requires `initCrypto()` to have been called first.
|
|
272
|
+
*
|
|
273
|
+
* @param transactionId - The disputed transaction.
|
|
274
|
+
*/
|
|
275
|
+
async submitPayloadEvidence(transactionId) {
|
|
276
|
+
if (!this._crypto) {
|
|
277
|
+
throw new Error('E2E crypto not initialized. Call initCrypto() first.');
|
|
278
|
+
}
|
|
279
|
+
const txRes = await this.client.transactions.get(transactionId);
|
|
280
|
+
if (!txRes.success || !txRes.data) {
|
|
281
|
+
throw new Error(txRes.error ?? 'Could not fetch transaction');
|
|
282
|
+
}
|
|
283
|
+
const rp = txRes.data.responsePayload;
|
|
284
|
+
if (!rp?._e2e) {
|
|
285
|
+
throw new Error('responsePayload does not contain an _e2e envelope. Was it sent with deliverEncrypted()?');
|
|
286
|
+
}
|
|
287
|
+
const result = await this._crypto.decrypt(rp._e2e);
|
|
288
|
+
const attestation = rp.attestation;
|
|
289
|
+
let hashVerified = false;
|
|
290
|
+
if (attestation) {
|
|
291
|
+
hashVerified = verifyAttestation(result.plaintext, attestation);
|
|
292
|
+
}
|
|
293
|
+
return this.client.transactions.submitEvidence(transactionId, {
|
|
294
|
+
evidenceType: 'decrypted_payload',
|
|
295
|
+
description: `Buyer discloses encrypted responsePayload. Sender sig verified: ${result.verified}. Hash verified: ${hashVerified}`,
|
|
296
|
+
contentHash: attestation?.hash,
|
|
297
|
+
metadata: {
|
|
298
|
+
role: 'buyer',
|
|
299
|
+
payload: result.plaintext,
|
|
300
|
+
senderVerified: result.verified,
|
|
301
|
+
hashVerified,
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Initialize E2E encryption for this agent using a secp256k1 private key.
|
|
307
|
+
* After calling this, use `this.crypto` to encrypt messages for recipients
|
|
308
|
+
* and decrypt messages received from them.
|
|
309
|
+
*
|
|
310
|
+
* Store the private key in your secret manager — losing it means you
|
|
311
|
+
* cannot decrypt historical messages. The derived public key is shared
|
|
312
|
+
* with recipients so they can encrypt messages addressed to you.
|
|
313
|
+
*
|
|
314
|
+
* @param privateKeyHex - 32-byte secp256k1 private key, hex string.
|
|
315
|
+
* Generate one with `AgentCrypto.generate()`.
|
|
316
|
+
*/
|
|
317
|
+
initCrypto(privateKeyHex) {
|
|
318
|
+
this._crypto = AgentCrypto.fromPrivateKey(privateKeyHex);
|
|
319
|
+
return this._crypto;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The agent's E2E crypto context. `null` until `initCrypto()` is called.
|
|
323
|
+
* Use `crypto.publicKey` to share your address with senders.
|
|
324
|
+
* Use `crypto.encryptFor(body, recipientPubKey)` to encrypt outgoing messages.
|
|
325
|
+
* Use `MessagesClient.decryptReceived(message, crypto)` to decrypt incoming ones.
|
|
326
|
+
*/
|
|
327
|
+
get crypto() {
|
|
328
|
+
return this._crypto;
|
|
329
|
+
}
|
|
209
330
|
}
|
|
210
331
|
//# sourceMappingURL=buyer.js.map
|
package/dist/buyer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buyer.js","sourceRoot":"","sources":["../src/buyer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buyer.js","sourceRoot":"","sources":["../src/buyer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;A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,CAAC,EAAE,CAAC,IAAyB,CAAC,CAAA;QACvE,MAAM,WAAW,GAAG,EAAE,CAAC,WAA8C,CAAA;QAErE,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,IAAI,WAAW,EAAE,CAAC;YAChB,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QACjE,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,aAAa,EAAE;YAC5D,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,mEAAmE,MAAM,CAAC,QAAQ,oBAAoB,YAAY,EAAE;YACjI,WAAW,EAAE,WAAW,EAAE,IAAI;YAC9B,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,MAAM,CAAC,SAAS;gBACzB,cAAc,EAAE,MAAM,CAAC,QAAQ;gBAC/B,YAAY;aACb;SACF,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,aAAqB;QAC9B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;QACxD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED;;;;;OAKG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
|
package/dist/channels.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AbbaBabaClient } from './client.js';
|
|
2
2
|
import type { ApiResponse } from './types.js';
|
|
3
3
|
export interface Channel {
|
|
4
4
|
id: string;
|
|
@@ -36,7 +36,7 @@ export interface PublishResult {
|
|
|
36
36
|
}
|
|
37
37
|
export declare class ChannelsClient {
|
|
38
38
|
private client;
|
|
39
|
-
constructor(client:
|
|
39
|
+
constructor(client: AbbaBabaClient);
|
|
40
40
|
/** List all channels visible to this agent (public channels + any private channels the agent belongs to). */
|
|
41
41
|
list(): Promise<ApiResponse<Channel[]>>;
|
|
42
42
|
/** Subscribe to a channel. Required before you can receive messages from it. */
|
package/dist/channels.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,OAAO,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAE1C,6GAA6G;IACvG,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAI7C,gFAAgF;IAC1E,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAIzE,4EAA4E;IACtE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAIvG,6FAA6F;IACvF,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAY9C,kCAAkC;IAC5B,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAMlF"}
|
package/dist/channels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AA0CA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AA0CA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,6GAA6G;IAC7G,KAAK,CAAC,IAAI;QACR,O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