@agent-fuel/sdk 0.1.1 → 0.3.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/CHANGELOG.md +26 -0
- package/README.md +36 -1
- package/dist/cli.cjs +4530 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +4528 -0
- package/dist/cli.js.map +1 -0
- package/dist/idl/credit-vault.cjs +475 -1
- package/dist/idl/credit-vault.cjs.map +1 -1
- package/dist/idl/credit-vault.d.cts +477 -1
- package/dist/idl/credit-vault.d.ts +477 -1
- package/dist/idl/credit-vault.js +475 -1
- package/dist/idl/credit-vault.js.map +1 -1
- package/dist/index.cjs +723 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js +722 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@agent-fuel/sdk` are documented here. Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [0.3.0] — 2026-05-31
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `agent-fuel` CLI binary. Same install (`npm i -g @agent-fuel/sdk` or `npx @agent-fuel/sdk …`), three command surfaces:
|
|
10
|
+
- **Read** (no key) — `score <agent>`, `vault <owner> <agent>`, `policy <owner> <agent>`, `service <authority>`. Hit the live backend / on-chain account directly, no setup needed: `npx @agent-fuel/sdk vault <owner> <agent>` works out of the box.
|
|
11
|
+
- **Action** (`--keypair`) — `pay`, `request-spend`, `register-service`. Same primitives as the JS surface, with keypairs loaded from `solana-keygen`-style JSON files.
|
|
12
|
+
- **Dev** — `keygen [--out path]` (writes a fresh keypair; pubkey to stdout, secret to stderr so you can redirect), `--version`, `--help`.
|
|
13
|
+
- Global flags: `--cluster <name>` (default `devnet`), `--rpc <url>` override, `--api-base <url>` (default `https://api.agentfuel.online`), `--json` for machine-readable output piping into `jq`.
|
|
14
|
+
|
|
15
|
+
## [0.2.0] — 2026-05-31
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `pay({ agent, service, owner, amountUsdc, receiptHash, connection })` — atomic `spend` + `record_payment` in one tx, mirroring `Spender::pay()` in the Rust runtime. Vault burn and reputation accrual now land together or not at all; no half-states where USDC moved but the agent ↔ service link never updated.
|
|
20
|
+
- `requestSpend({ agent, owner, service, amountUsdc, connection })` — agent-initiated half of the over-limit approval flow. Returns the `pendingSpend` PDA so callers can poll for resolution.
|
|
21
|
+
- `registerService({ sponsor, service, name, category, serviceUri?, connection })` — register a new service on chain. Two-signer (sponsor pays rent, service is the long-lived identity).
|
|
22
|
+
- `pendingSpendPda(vault, nonce)` PDA helper.
|
|
23
|
+
- `PendingSpendAccount` type + decoder.
|
|
24
|
+
- Convenience wrappers on `AgentFuel`: `fuel.pay()`, `fuel.requestSpend()`, `fuel.registerService()` — same surface as the standalone functions, with the connection and agent supplied by the instance.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- Re-vendored IDLs against the latest on-chain deploys so the SDK sees `request_spend`, `approve_spend`, `cancel_spend`, `register_service`, and the new `pending_count` field on `CreditVault`.
|
|
29
|
+
- `CreditVaultAccount` now includes `pending_count: number` — the nonce burned by the next `request_spend`.
|
|
30
|
+
|
|
5
31
|
## [0.1.1] — 2026-05-29
|
|
6
32
|
|
|
7
33
|
### Changed
|
package/README.md
CHANGED
|
@@ -2,7 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for [Agent Fuel](https://github.com/TODO/agent_fuel) — credit vault + reputation primitives for AI agents on Solana.
|
|
4
4
|
|
|
5
|
-
> **Status:** `0.
|
|
5
|
+
> **Status:** `0.3.0`. Full read/write/stream surface live, plus the `agent-fuel` CLI. Published to npm with provenance.
|
|
6
|
+
|
|
7
|
+
## CLI
|
|
8
|
+
|
|
9
|
+
Installing the package also installs an `agent-fuel` binary. Read commands work with zero setup over `npx`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @agent-fuel/sdk vault <OWNER_PUBKEY> <AGENT_PUBKEY>
|
|
13
|
+
npx @agent-fuel/sdk score <AGENT_PUBKEY>
|
|
14
|
+
npx @agent-fuel/sdk policy <OWNER_PUBKEY> <AGENT_PUBKEY>
|
|
15
|
+
npx @agent-fuel/sdk service <AUTHORITY_PUBKEY>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Action commands take a `solana-keygen`-style keypair JSON:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
agent-fuel pay \
|
|
22
|
+
--keypair ~/.config/solana/agent.json \
|
|
23
|
+
--service-keypair ~/.config/solana/svc-pyth.json \
|
|
24
|
+
--owner <OWNER_PUBKEY> \
|
|
25
|
+
--amount 0.5
|
|
26
|
+
|
|
27
|
+
agent-fuel request-spend \
|
|
28
|
+
--keypair ~/.config/solana/agent.json \
|
|
29
|
+
--owner <OWNER_PUBKEY> \
|
|
30
|
+
--service <SERVICE_PUBKEY> \
|
|
31
|
+
--amount 30
|
|
32
|
+
|
|
33
|
+
agent-fuel register-service \
|
|
34
|
+
--sponsor ~/.config/solana/id.json \
|
|
35
|
+
--service-keypair ~/.config/solana/svc-pyth.json \
|
|
36
|
+
--name "Pyth BTC Feed" \
|
|
37
|
+
--category DataFeed
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Plus `agent-fuel keygen [--out path]` to generate a fresh keypair (pubkey to stdout, secret to stderr — redirect with `2>` to save). Global flags: `--cluster devnet|mainnet-beta|testnet|localnet`, `--rpc <url>`, `--api-base <url>`, `--json` for machine-readable output.
|
|
6
41
|
|
|
7
42
|
## The six functions
|
|
8
43
|
|