@ngtchain/agentkit
v0.1.1
Published
Coinbase AgentKit action provider: let an AgentKit agent pay x402 NGT paywalls on Base, with a per-call cap and a session budget. The AgentKit wallet signs; the seller pays gas.
Maintainers
Readme
@ngtchain/agentkit
A Coinbase AgentKit action provider that lets an agent pay x402 paywalls on Base.
The AgentKit wallet signs an EIP-3009 TransferWithAuthorization. The seller's facilitator settles it on Base and pays the gas, so the agent never needs ETH. The private key stays inside the AgentKit wallet.
Install
npm i @ngtchain/agentkit @coinbase/agentkit zod@3Use
import { AgentKit } from "@coinbase/agentkit";
import { ngtActionProvider } from "@ngtchain/agentkit";
const agentkit = await AgentKit.from({
walletProvider, // any EvmWalletProvider on Base
actionProviders: [ngtActionProvider({ maxPrice: "0.01", sessionBudget: "0.1" })],
});This adds one action, ngt_pay_and_fetch:
| Argument | |
|---|---|
| url | The paywalled https URL (http://localhost allowed for testing). |
| method, body | Optional request method and body. |
| max_price_ngt | Optional. Lowers the cap for this call; can never raise it. |
Limits
maxPrice: most one call may spend, in NGT. Default0.01.sessionBudget: most the provider may spend in total. Default0.1.- Only NGT on Base is paid. A challenge for any other asset, network or a price above the cap is refused before signing.
Tested with ViemWalletProvider. Sell with @ngtchain/paywall.
Source: Har50/vpcshield. Homepage: vpcshield.com.
