@aifinpay/skill 2.6.0 → 2.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +41 -1
- package/README.md +30 -6
- package/agent/skills/aifinpay/SKILL.md +165 -43
- package/agent/skills/aifinpay-merchant/SKILL.md +94 -12
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aifinpay",
|
|
3
3
|
"description": "Payment rail for AI agents: pay for x402 APIs or charge agents for yours.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"author": { "name": "AiFinPay Support" },
|
|
6
6
|
"homepage": "https://aifinpay.io",
|
|
7
7
|
"repository": "https://github.com/AiFinPay/skill",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,44 @@
|
|
|
1
|
-
## 2.
|
|
1
|
+
## 2.9.0 — reporting cohort source candidate
|
|
2
|
+
|
|
3
|
+
- Align package, lock, plugin and both skill versions with the coordinated
|
|
4
|
+
MCP2.8.0 / Node SDK2.6.0 / Python SDK2.5.1 release target; preserve dated
|
|
5
|
+
published baselines without claiming this cohort is published or active.
|
|
6
|
+
- Describe the explicit merchant reporting v2 target for Node gate0.4.0 and
|
|
7
|
+
Python gate0.1.3: observed challenge/admission/completion, consent and
|
|
8
|
+
memory-only capabilities, bounded queue loss and acknowledged producer health.
|
|
9
|
+
Observations do not establish verified identity, payment or complete coverage.
|
|
10
|
+
- Keep the existing gated MCP tools, signing, receipt/budget/recovery and
|
|
11
|
+
network activation requirements. Canonical payer bytes must be copied into
|
|
12
|
+
the paired MCP build before its exact cohort and registry release gates.
|
|
13
|
+
- Validate matching payer/merchant/README targets, dated payer publication
|
|
14
|
+
baseline and changelog metadata; test drift refusals without dependencies.
|
|
15
|
+
|
|
16
|
+
## 2.8.0 — source candidate
|
|
17
|
+
|
|
18
|
+
- Describe the MCP2.7 / Node and Python2.5 Solana source target with explicit
|
|
19
|
+
owner environment/network, local Ed25519 identity and lamport fee/rent cap.
|
|
20
|
+
- Keep current disabled Solana deployment, governance and paid-acceptance
|
|
21
|
+
gates explicit; no publication or activation claim.
|
|
22
|
+
- Explain native/classic SPL exact units, persistent prepare/recovery and
|
|
23
|
+
case-sensitive payer/program/mint bindings without a replacement payment.
|
|
24
|
+
|
|
25
|
+
## 2.7.0 — release candidate
|
|
26
|
+
|
|
27
|
+
- Describe the coordinated MCP2.6.0 / Node and Python SDK2.4.0 target without
|
|
28
|
+
claiming publication or production activation; preserve dated baseline facts.
|
|
29
|
+
- List the nine owner-selectable EVM descriptors, exact pinned stablecoins,
|
|
30
|
+
6/18-decimal token units and selected native gas currency. Explain OP extra
|
|
31
|
+
costs and Nitro's already-inclusive estimate.
|
|
32
|
+
- Require explicit merchant accepted networks, verified payout and backend
|
|
33
|
+
readiness; a shared EVM address is not network consent. No non-EVM executor
|
|
34
|
+
or BOT-to-Robinhood alias is implied.
|
|
35
|
+
- Explain non-expiring unknown reservations, once-only recovery, original
|
|
36
|
+
signed-byte network binding, local-process shared budget storage and safe
|
|
37
|
+
reconciliation before downgrade.
|
|
38
|
+
- Correct the moved canonical `agent/skills/` paths and coordinate the MCP
|
|
39
|
+
bundle's exact release-target/content guard with the canonical package.
|
|
40
|
+
|
|
41
|
+
## 2.6.0
|
|
2
42
|
|
|
3
43
|
- Payer skill: Base. MCP 2.5 pays on the chain the owner sets in
|
|
4
44
|
`AIFINPAY_PAY_CHAIN` (`polygon` default, or `base`), with the gas cap in ETH
|
package/README.md
CHANGED
|
@@ -6,13 +6,33 @@ any client that loads `SKILL.md`).
|
|
|
6
6
|
|
|
7
7
|
| Skill | Side | File |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| `aifinpay` | Paying — agent buys x402-gated API access | `skills/aifinpay/SKILL.md` |
|
|
10
|
-
| `aifinpay-merchant` | Earning — merchant charges agents per request | `skills/aifinpay-merchant/SKILL.md` |
|
|
9
|
+
| `aifinpay` | Paying — agent buys x402-gated API access | `agent/skills/aifinpay/SKILL.md` |
|
|
10
|
+
| `aifinpay-merchant` | Earning — merchant charges agents per request | `agent/skills/aifinpay-merchant/SKILL.md` |
|
|
11
|
+
|
|
12
|
+
Version **2.9.0** describes a coordinated reporting release target.
|
|
13
|
+
Release target: MCP **2.8.0**, Node SDK **2.6.0**, Python **2.5.1**.
|
|
14
|
+
Reporting release target: Node gate **0.4.0**, Python gate **0.1.3**.
|
|
15
|
+
The merchant guide describes explicit opt-in observations, consent, queue loss
|
|
16
|
+
and producer health using the SDK's reporting v2 contract. It adds no MCP tools
|
|
17
|
+
or signing authority and does not establish publication or partner rollout.
|
|
18
|
+
The payer guide retains the Solana source adapter. Canonical disabled Solana
|
|
19
|
+
records remain unavailable until accepted and served. Its nine EVM descriptors
|
|
20
|
+
require explicit owner and merchant
|
|
21
|
+
network consent plus backend readiness; installing instructions does not
|
|
22
|
+
activate networks. Historical published baselines are dated in the payer
|
|
23
|
+
guide and do not claim the target packages have already been published.
|
|
11
24
|
|
|
12
25
|
Rule of thumb: if the user wants to **pay** for a paid API, load `aifinpay`.
|
|
13
26
|
If they **own** a site/API agents visit, load `aifinpay-merchant` — and mention
|
|
14
27
|
the other side exists.
|
|
15
28
|
|
|
29
|
+
For merchant reporting, follow the merchant guide's optional reporting section
|
|
30
|
+
and the SDK's [Node](https://github.com/AiFinPay/sdk/blob/main/gate/REPORTING-V2.md)
|
|
31
|
+
or [Python](https://github.com/AiFinPay/sdk/blob/main/python-gate/REPORTING-V2.md)
|
|
32
|
+
instructions. Observation events, admission and resource completion are
|
|
33
|
+
distinct; payments require confirmed settlement evidence. Producer health
|
|
34
|
+
and pending/drop coverage describe telemetry completeness, not payment success.
|
|
35
|
+
|
|
16
36
|
## Install
|
|
17
37
|
|
|
18
38
|
Install the skills with the `skills` CLI:
|
|
@@ -154,12 +174,16 @@ Installed skills are available in new Aider sessions. Aider follows the same Age
|
|
|
154
174
|
|
|
155
175
|
Skill markdown is authored once and mirrored:
|
|
156
176
|
|
|
157
|
-
- Canonical source
|
|
158
|
-
-
|
|
159
|
-
|
|
177
|
+
- Canonical source and npm package: this repository's `agent/skills/`.
|
|
178
|
+
- MCP bundle: SDK repository `mcp/skills/SKILL.md`, copied from the installed
|
|
179
|
+
canonical package at build time (payer side only).
|
|
180
|
+
- The SDK repository's old `skill/README.md` only points here; it is not a
|
|
181
|
+
second skill package or authored mirror.
|
|
160
182
|
|
|
161
183
|
If a CLI command, tool name, or settlement behavior changes, update all three
|
|
162
|
-
in
|
|
184
|
+
in coordinated PRs and bump this package's version + CHANGELOG together.
|
|
185
|
+
MCP verifies installed/bundled/served bytes and the exact release target;
|
|
186
|
+
publish this package before refreshing MCP's real registry dependency lock.
|
|
163
187
|
|
|
164
188
|
## Version gate
|
|
165
189
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aifinpay
|
|
3
|
-
description: Pay for x402-gated APIs and sites as an agent (AIFP-1 on
|
|
3
|
+
description: Pay for x402-gated APIs and sites as an agent (AIFP-1 on an owner-selected EVM or accepted Solana network,
|
|
4
4
|
within owner-set limits) — including when the owner just says "buy access for
|
|
5
5
|
this site" — link the agent to its owner's AiFinPay dashboard, and read
|
|
6
6
|
wallet, payment history, prepaid quotas and Agent Passport records through
|
|
7
7
|
the AiFinPay MCP server or SDK.
|
|
8
8
|
license: MIT
|
|
9
|
-
version: 2.
|
|
9
|
+
version: 2.9.0
|
|
10
10
|
author: AiFinPay Support
|
|
11
11
|
metadata:
|
|
12
12
|
hermes:
|
|
@@ -61,20 +61,112 @@ your language. There is no "install together" scenario.
|
|
|
61
61
|
|
|
62
62
|
## Version and release status
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
Release target: MCP **2.8.0**, Node SDK **2.6.0**, Python **2.5.1**.
|
|
65
|
+
This skill describes that coordinated package cohort. Check the installed
|
|
66
|
+
versions before using its additional-network instructions; a release target
|
|
67
|
+
does not establish npm/PyPI publication or production network activation.
|
|
68
|
+
Published baseline checked 2026-10-04: MCP **2.5.0**, Node SDK **2.3.2**.
|
|
69
|
+
`payable_fetch` has shipped since MCP 2.2.0, and Base since MCP 2.5.0.
|
|
70
|
+
Published packages remain usable within their documented capabilities.
|
|
68
71
|
|
|
69
72
|
| Surface | Can it pay? |
|
|
70
73
|
|---|---|
|
|
71
|
-
| MCP `@aifinpay/mcp` 2.
|
|
72
|
-
| Node `@aifinpay/agent` 2.
|
|
73
|
-
| Python `aifinpay-agent` 2.
|
|
74
|
+
| MCP `@aifinpay/mcp` 2.8.x | `payable_fetch`, only with a persistent wallet and every owner limit set. Polygon is the default; other networks require explicit `AIFINPAY_PAY_CHAIN`. The merchant and backend must authorize and serve that network. `scope: "merchant"` buys a site-wide batch. |
|
|
75
|
+
| Node `@aifinpay/agent` 2.6.x | `fetchPaid` with a v14 journal, gas cap and owner budgets. Select another network with `v14.chain`; select a pinned stablecoin with `v14.asset`. Native payments require an independent native/USD rate. |
|
|
76
|
+
| Python `aifinpay-agent` 2.5.x | `agent.fetch_paid(url, allowed_origins=…, max_amount_usd=…, daily_amount_usd=…)`; use explicit `chain` and the chain's native gas cap for another network, or a pinned stablecoin `asset`. `agent.recover_paid(journal_path)` recovers the original transaction. |
|
|
77
|
+
|
|
78
|
+
The client descriptors below are shared by the target cohort. They do not
|
|
79
|
+
activate a deployment, enroll a merchant or prove a completed payment.
|
|
80
|
+
|
|
81
|
+
| Owner chain name | Chain ID | Native payment and gas | Pinned stablecoin symbols |
|
|
82
|
+
|---|---|---|---|
|
|
83
|
+
| `polygon` | 137 | POL | `USDC`, `USDC.e` |
|
|
84
|
+
| `base` | 8453 | ETH | `USDC` |
|
|
85
|
+
| `optimism` | 10 | ETH | `USDC` |
|
|
86
|
+
| `arbitrum` | 42161 | ETH | `USDC` |
|
|
87
|
+
| `avalanche` | 43114 | AVAX | `USDC`, `USDT` |
|
|
88
|
+
| `bnb` | 56 | BNB | `USDC`, `USDT` |
|
|
89
|
+
| `unichain` | 130 | ETH | `USDC` |
|
|
90
|
+
| `xrplevm` | 1440000 | XRP | None |
|
|
91
|
+
| `robinhood` | 4663 | ETH | `USDe`, `USDG` |
|
|
92
|
+
|
|
93
|
+
Use the exact symbols and chain names. Token addresses and decimals are pinned
|
|
94
|
+
independently per network; a token with the same symbol at another address is
|
|
95
|
+
not accepted. BNB USDC/USDT and Robinhood USDe use 18 decimals; the other pinned
|
|
96
|
+
stablecoins use 6. USD micro-units remain 6 decimals. The SDK validates exact
|
|
97
|
+
integer `token_settlement` amounts, approval, signed gross and every split leg;
|
|
98
|
+
never scale, round or edit quote fields yourself.
|
|
99
|
+
|
|
100
|
+
Read the selected issuer's `/api/payment-capabilities` and the merchant's
|
|
101
|
+
discovery/quote. A new network also requires the merchant's explicit accepted
|
|
102
|
+
network set, verified payout, a served deployment and a working verifier/rate.
|
|
103
|
+
If the backend refuses a network, retain the refusal and ask the owner to
|
|
104
|
+
resolve readiness; do not switch networks or construct a manual payment.
|
|
105
|
+
The Solana source adapter in this target cohort remains unavailable while its
|
|
106
|
+
canonical deployment is disabled. NEAR, Aptos and current Casper payment
|
|
107
|
+
executors are outside this cohort.
|
|
108
|
+
Historical BOT is not an alias for Robinhood. Wallet derivation on a network
|
|
109
|
+
does not establish payment support.
|
|
110
|
+
|
|
111
|
+
## Solana source integration and activation status
|
|
112
|
+
|
|
113
|
+
The target cohort adds native SOL and accepted classic SPL transaction, receipt
|
|
114
|
+
and recovery adapters using the existing v1.4 program/IDL. The checked
|
|
115
|
+
`@aifinpay/deployments@1.1.3` mainnet and devnet records are disabled. Installing
|
|
116
|
+
this cohort does not override that gate. Do not send a direct transaction to
|
|
117
|
+
work around a refused quote or unavailable payment capability. Mainnet also
|
|
118
|
+
requires governance acceptance; actual funded end-to-end acceptance remains
|
|
119
|
+
separate from source tests.
|
|
120
|
+
|
|
121
|
+
After a deployment is accepted and served, the owner explicitly selects Solana
|
|
122
|
+
and its network. The environment independently binds mainnet to live/prod and
|
|
123
|
+
devnet to dev; a quote cannot select the network. Example owner configuration
|
|
124
|
+
for that future accepted mainnet route (limits are examples, not permission):
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"AIFINPAY_PAY_CHAIN": "solana",
|
|
129
|
+
"AIFINPAY_SOLANA_NETWORK": "mainnet",
|
|
130
|
+
"AIFINPAY_MODE": "live",
|
|
131
|
+
"AIFINPAY_PAY_ASSET": "SOL",
|
|
132
|
+
"AIFINPAY_MAX_FEE_LAMPORTS": "10000000"
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Keep the existing enabled-payments, origin, per-payment and daily USD limits.
|
|
137
|
+
Use the existing local Solana identity, not an EVM address. Configure an
|
|
138
|
+
owner-trusted Solana RPC with `AIFINPAY_RPC_URL`. The fee limit is an integer
|
|
139
|
+
number of lamports (1 SOL = 1,000,000,000 lamports) and covers transaction fees
|
|
140
|
+
and required nonce/token account rent; it is not a POL/ETH gas cap. Keep enough
|
|
141
|
+
SOL for these costs even when paying in an accepted SPL asset. The SDK refuses
|
|
142
|
+
missing fee/rent estimates and unsupported mints or decimals. Token2022 is not
|
|
143
|
+
supported by this program. Devnet assets require separate accepted mint pins.
|
|
144
|
+
|
|
145
|
+
Node selects the family with `solanaV14: { environment, network, asset,
|
|
146
|
+
maxFeeLamports, onPrepared }`, preserving the existing EVM `v14` options. Do not
|
|
147
|
+
provide both family options. Python uses `chain="solana"`, `environment`,
|
|
148
|
+
`solana_network` and `max_fee_lamports` alongside its existing allowed origins,
|
|
149
|
+
journal and USD caps. Maintain a private persistent journal and the SDK's
|
|
150
|
+
required prepared-transaction callback; do not remove persistence to make a
|
|
151
|
+
payment proceed.
|
|
152
|
+
|
|
153
|
+
Before requesting a Solana quote, the SDK durably retains the exact owner-signed
|
|
154
|
+
authorization and request identity. After a timeout or restart, resume that same
|
|
155
|
+
admission; do not generate a fresh nonce while its outcome is unknown. An expired
|
|
156
|
+
authorization can reconcile an existing admission but cannot authorize a new
|
|
157
|
+
one. Keep issued-quote evidence separate from a prepared transaction: quote
|
|
158
|
+
expiry alone does not prove a refund of a backend reservation.
|
|
159
|
+
|
|
160
|
+
The signed Solana transaction and its base58 signature are saved before
|
|
161
|
+
broadcast. A timeout, expired blockhash or missing RPC result does not permit
|
|
162
|
+
a second payment: retain the unresolved reservation and recover the same
|
|
163
|
+
transaction/receipt. Case-sensitive payer/mint/program/network identity must
|
|
164
|
+
match throughout quote, journal, receipt and history. An on-chain nonce marker
|
|
165
|
+
or event log alone does not prove a valid paid request.
|
|
74
166
|
|
|
75
167
|
# AiFinPay agent workflow
|
|
76
168
|
|
|
77
|
-
Use the tools actually returned by MCP tools/list. MCP 2.
|
|
169
|
+
Use the tools actually returned by MCP tools/list. MCP 2.8.0 exposes
|
|
78
170
|
agent_address, agent_reload, agent_claim_self, agent_history, agent_quota,
|
|
79
171
|
agent_passport_resolve, settlement_routes, settlement_invoice and
|
|
80
172
|
deployment_info; `payable_fetch` appears when the owner has enabled payments.
|
|
@@ -99,7 +191,8 @@ into ratersapp.com", "купи доступ до цього сайту". Handle
|
|
|
99
191
|
$0.10 for 200 standard requests), that it covers every path on the origin,
|
|
100
192
|
and how it drains — each request costs its own listed `unit_price_usd`, so
|
|
101
193
|
the same $0.10 is 200 standard or 20 premium requests in any mix. Gas is
|
|
102
|
-
separate, in
|
|
194
|
+
separate, in the selected network's native currency. Use the display rules
|
|
195
|
+
in "Transaction display" below.
|
|
103
196
|
4. **Check readiness.** `payable_fetch` must be in your tools and the origin
|
|
104
197
|
must be in `AIFINPAY_GATEWAY_ORIGINS`; the tool names a refused origin. If
|
|
105
198
|
either is missing, show the owner the exact change — the environment block
|
|
@@ -154,34 +247,51 @@ fund its EVM address on Polygon with POL, or with USDC plus some POL. Funding a
|
|
|
154
247
|
unlimited spend authority. Use the owner's actual approved limits and origins,
|
|
155
248
|
then call `payable_fetch({"url":"https://merchant.example/api/data"})`.
|
|
156
249
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`AIFINPAY_MAX_GAS_POL` is refused
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
250
|
+
For another network, the owner sets `AIFINPAY_PAY_CHAIN` to an exact name in
|
|
251
|
+
the table and `AIFINPAY_MAX_GAS` in its native currency. For Base, for example,
|
|
252
|
+
the currency is ETH; the owner must choose a cap that covers the current
|
|
253
|
+
worst-case estimate. `AIFINPAY_MAX_GAS_POL` is refused outside Polygon rather
|
|
254
|
+
than interpreted as another currency. Fund the same EVM address **on the
|
|
255
|
+
selected network** with its native currency for gas and the selected asset
|
|
256
|
+
for the batch. A quote for another network is refused; only the owner changes
|
|
257
|
+
the network or limits.
|
|
258
|
+
|
|
259
|
+
Stablecoin payments budget approval and settlement together. Base, Optimism
|
|
260
|
+
and Unichain include L1 data and operator fees in the worst-case gas estimate;
|
|
261
|
+
an unavailable required fee read stops payment before signing. Arbitrum and
|
|
262
|
+
Robinhood use the Nitro estimate that already includes parent-chain data and
|
|
263
|
+
do not add that fee twice. A refusal never authorizes raising a gas cap.
|
|
264
|
+
|
|
265
|
+
It supports GET resources and authorized AIFP-1 v1.4 payments on the selected
|
|
266
|
+
supported EVM network. It verifies
|
|
168
267
|
the quote, price, deployment, signer and receipt, saves the transaction before
|
|
169
268
|
broadcasting, and reuses the purchased batch. No custom merchant script is
|
|
170
269
|
needed. Other protocol/version/asset paths fail closed.
|
|
171
270
|
|
|
172
|
-
A pending result retains the original transaction
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
271
|
+
A pending result retains the original signed transaction and network.
|
|
272
|
+
Retrying recovers its receipt without sending a replacement transaction.
|
|
273
|
+
Unknown broadcasts keep their budget reservation indefinitely; confirmed
|
|
274
|
+
spend is never refunded by a later receipt or HTTP failure. Daily confirmed
|
|
275
|
+
spend uses a rolling 24-hour window. Unresolved access stays guarded even if
|
|
276
|
+
the owner later changes networks. Use one shared local filesystem for the
|
|
277
|
+
wallet's ledger/journal across local processes; this is not a multi-host lock.
|
|
278
|
+
Do not delete journals, remove an unknown lock, replace a wallet, bypass a
|
|
279
|
+
reservation or downgrade with unresolved state. Reconcile with the original
|
|
280
|
+
transaction and verified receipt/revert evidence first. A legacy journal
|
|
281
|
+
without its network can be adopted only when actual signed bytes match the
|
|
282
|
+
owner-selected chain, payer, pinned target and exact call. Insufficient
|
|
283
|
+
evidence requires manual receipt reconciliation. Quote signing expiry does
|
|
284
|
+
not itself require a second settlement. Raw transactions and receipt JWTs
|
|
285
|
+
remain private.
|
|
176
286
|
|
|
177
287
|
### Network access
|
|
178
288
|
|
|
179
289
|
In a sandbox that allowlists outbound hosts, allow `api.aifinpay.io` and an RPC
|
|
180
|
-
for the pay chain (
|
|
181
|
-
|
|
182
|
-
native/USD check MCP
|
|
183
|
-
|
|
184
|
-
|
|
290
|
+
for the owner-selected pay chain (`AIFINPAY_RPC_URL` overrides its default).
|
|
291
|
+
Stablecoin payments need the issuer, merchant and that RPC. For the independent
|
|
292
|
+
native/USD check MCP uses the pinned Chainlink feed on Polygon or Base, then
|
|
293
|
+
`api.coinbase.com`, then `api.coingecko.com`. Other networks use those independent
|
|
294
|
+
HTTP price sources. An implausible, stale or future-dated rate is refused. If no rate is available,
|
|
185
295
|
`payable_fetch` stops before paying and nothing is spent; tell the owner which
|
|
186
296
|
hosts to allow rather than inventing a workaround. With the Node SDK, pass your
|
|
187
297
|
own `nativeUsdPrice`: Chainlink POL/USD on Polygon, Coinbase `POL-USD`, or
|
|
@@ -196,14 +306,19 @@ agent's balance, payments and receipts, and can set a daily-spend email alert,
|
|
|
196
306
|
at https://dash.aifinpay.io → My Agents:
|
|
197
307
|
|
|
198
308
|
- **MCP:** the owner clicks **Claim via MCP**, gets a one-time URL and gives it
|
|
199
|
-
to you; call `agent_claim_self({"magic_link_url": "…"})`.
|
|
309
|
+
to you; call `agent_claim_self({"magic_link_url": "…"})`. The owner-selected
|
|
310
|
+
payment family must be bound successfully; the other wallet is best-effort.
|
|
311
|
+
Binding a wallet does not activate a disabled payment network. Use the
|
|
312
|
+
selected wallet's **Fund** panel for available networks and assets.
|
|
200
313
|
- **Node / Python:** the owner uses **Add agent by address** and gives you the
|
|
201
314
|
challenge; return `agent.signDashboardClaim(challenge)` (Node) or
|
|
202
315
|
`agent.sign_dashboard_claim(challenge)` (Python). These sign only
|
|
203
316
|
`AiFinPay-claim:polygon:<own address>:<nonce>`.
|
|
204
317
|
|
|
205
|
-
|
|
206
|
-
`AIFINPAY_DAILY_USD`)
|
|
318
|
+
Keep local owner spending limits in the agent's configuration (`AIFINPAY_MAX_USD`,
|
|
319
|
+
`AIFINPAY_DAILY_USD`). Claimed-wallet controls in the dashboard are additional
|
|
320
|
+
backend restrictions on quotes and gateway access; they do not replace local
|
|
321
|
+
limits or control transactions sent directly outside AiFinPay.
|
|
207
322
|
|
|
208
323
|
Discover routes on the exact requested origin: `/.well-known/x402.json` and any
|
|
209
324
|
API catalog linked by that site. A dev hostname does not imply testnet. If a
|
|
@@ -265,17 +380,23 @@ Use agent_history. Do not guess /v1/history, /v1/payments or /v1/wallet/tx.
|
|
|
265
380
|
|
|
266
381
|
Canonical AIFP-1 economics are gross-inclusive: the agent pays the quoted
|
|
267
382
|
price, AiFinPay takes **1 %** (100 bps) from it, and the merchant receives
|
|
268
|
-
**99 %**. No fixed fee is implied.
|
|
269
|
-
|
|
270
|
-
|
|
383
|
+
**99 %**. No fixed fee is implied. Production served Polygon and Base
|
|
384
|
+
(splitter v1.4) at the 2026-10-04 baseline check. Additional client descriptors
|
|
385
|
+
do not prove production activation; check issuer capabilities and merchant
|
|
386
|
+
authorization. This source cohort adds a Solana v1.4 adapter with explicit
|
|
387
|
+
network, asset and fee/rent limits; current published Solana deployment records
|
|
388
|
+
remain disabled. The smallest paid batch is $0.10, plus network fees and any
|
|
389
|
+
required account rent.
|
|
271
390
|
|
|
272
391
|
(The older "98.99 / 1 / 0.01" figure was the v1.2 fee-on-top model.)
|
|
273
392
|
|
|
274
393
|
Routes:
|
|
275
394
|
|
|
276
395
|
- GET /v1/agents/:address/transactions?chain=polygon&limit=25&offset=0:
|
|
277
|
-
public facts from indexed AiFinPay
|
|
278
|
-
|
|
396
|
+
public facts from indexed AiFinPay settlements in the durable ledger on
|
|
397
|
+
backends with that network's indexer. Select the configured network with
|
|
398
|
+
`chain`; a source descriptor does not prove indexing coverage. Excludes
|
|
399
|
+
arbitrary wallet transfers and may lag the chain.
|
|
279
400
|
- GET /v1/agents/:address/receipts?limit=25&offset=0: retained prepaid-batch
|
|
280
401
|
metadata, including test payments. Never includes the spendable receipt JWT.
|
|
281
402
|
- GET /v1/agents/:address/statement?days=7: retained billing statement.
|
|
@@ -370,8 +491,9 @@ retype from memory:
|
|
|
370
491
|
`setBudget({ per_call_usd, daily_usd })`, discovery + `fetchPaid`
|
|
371
492
|
- `wallet-budget-paid.mjs` (JavaScript, ESM): same flow, no types
|
|
372
493
|
- `wallet-budget-call.py` (Python): `from_seed(os.environ["SEED_HASH"])`,
|
|
373
|
-
`call(provider, body, cost=…)` cap; fails closed on paid
|
|
374
|
-
`
|
|
494
|
+
`call(provider, body, cost=…)` cap; this legacy snippet fails closed on paid
|
|
495
|
+
402s. For a paid purchase use the current SDK `fetch_paid` guide or Node
|
|
496
|
+
`fetchPaid`, with explicit origin, amount and gas limits.
|
|
375
497
|
|
|
376
498
|
Browse: `https://github.com/AiFinPay/sdk/tree/main/examples/agent-snippets`
|
|
377
499
|
|
|
@@ -425,8 +547,8 @@ terminal for that request: do not lower units below the server minimum, edit
|
|
|
425
547
|
quotes, or construct a manual nonce, receipt or transaction workaround.
|
|
426
548
|
|
|
427
549
|
This dev quote tool never broadcasts. The new low-level SDK executor supports
|
|
428
|
-
native Amoy v1.4
|
|
429
|
-
A full paid testnet receipt flow is not
|
|
550
|
+
native Amoy v1.4; this MCP exposes no Amoy paid receipt executor.
|
|
551
|
+
A full paid testnet receipt flow is not claimed. A prepaid batch means one settlement funding
|
|
430
552
|
multiple API calls, not an arbitrary batch of on-chain transfers.
|
|
431
553
|
|
|
432
554
|
After any actual settlement, retain its quote and transaction reference.
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aifinpay-merchant
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
keep 99%.
|
|
3
|
+
description: Configure an HTTP 402 gate for agent access to a website or API,
|
|
4
|
+
with owner-selected routes, verified payouts and explicitly accepted EVM
|
|
5
|
+
networks. Agents settle from their own wallets; the merchant receives 99%.
|
|
7
6
|
license: MIT
|
|
8
|
-
version: 2.
|
|
7
|
+
version: 2.9.0
|
|
9
8
|
author: AiFinPay Support
|
|
10
9
|
metadata:
|
|
11
10
|
hermes:
|
|
@@ -156,10 +155,86 @@ Gate 0.3.3 source adds `instructions_url` (payer skill),
|
|
|
156
155
|
links to maintained public instructions, not stored wallet or receipt data.
|
|
157
156
|
Existing sites must upgrade/redeploy gate to emit those new fields.
|
|
158
157
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
Release target: MCP **2.8.0**, Node SDK **2.6.0**, Python **2.5.1**.
|
|
159
|
+
This coordinated target does not establish publication or reporting rollout.
|
|
160
|
+
Those clients
|
|
161
|
+
reuse the signed v1.4 payment kernel for nine EVM network descriptors; network
|
|
162
|
+
metadata does not activate a deployment or verifier. Production served Polygon
|
|
163
|
+
and Base at the 2026-10-04 baseline check. Additional networks require a ready
|
|
164
|
+
backend, pinned deployment/token metadata, a verifier and merchant consent.
|
|
165
|
+
|
|
166
|
+
The Solana adapter is a source capability in this target. Current
|
|
167
|
+
`deployments1.1.3` Solana records remain disabled. A Solana merchant needs an
|
|
168
|
+
explicit accepted network and verified Solana payout, an accepted program/IDL
|
|
169
|
+
and mint inventory, configured signer/RPC, finalized value verification and
|
|
170
|
+
funded end-to-end acceptance before payments are advertised. Native SOL and
|
|
171
|
+
classic SPL use exact lamport/token units; a balance or program address does
|
|
172
|
+
not establish payment readiness. Do not substitute historical Seat/receipt
|
|
173
|
+
flows for the v1.4 paid-access route.
|
|
174
|
+
|
|
175
|
+
Agents using MCP `payable_fetch`, Node `fetchPaid` or Python `fetch_paid` pay
|
|
176
|
+
merchants registered for `settlement_version: "1.4"` on an explicitly accepted
|
|
177
|
+
and served network. Existing merchants keep their prior version and default
|
|
178
|
+
network until their owner updates them. Read the selected issuer's
|
|
179
|
+
`/api/payment-capabilities`; discovery returning 200 alone does not establish
|
|
180
|
+
payment readiness. Do not change a payout wallet, accepted network set or
|
|
181
|
+
settlement version without the merchant owner's authorization.
|
|
182
|
+
|
|
183
|
+
## Optional observation and reporting
|
|
184
|
+
|
|
185
|
+
Reporting release target: Node gate **0.4.0**, Python gate **0.1.3**.
|
|
186
|
+
Use these instructions only after checking the installed packages and the
|
|
187
|
+
backend's reporting v2 readiness. Installing the skill does not enable reporting
|
|
188
|
+
or verify a partner integration. Opt in when the merchant owner requests it:
|
|
189
|
+
Node uses `createGateReporterV2` with `reporting: { version: 2, reporter,
|
|
190
|
+
context }`; Python uses `GateReporterV2` with `Gate(..., reporting=reporter,
|
|
191
|
+
reporting_context=...)`. Keep the existing receipt verification and shared
|
|
192
|
+
quota store. Use one producer per merchant per worker, created after fork in
|
|
193
|
+
Python; do not also attach the legacy `onEvent`/`on_event` reporter or report
|
|
194
|
+
the same request through both hosted and self-hosted instrumentation.
|
|
195
|
+
|
|
196
|
+
Declare only stages the adapter actually observes: `access_challenged` for an
|
|
197
|
+
emitted 402, `access_admitted` before the paid handler, and
|
|
198
|
+
`resource_response_completed` for its terminal success, redirect, error or
|
|
199
|
+
abort. A challenge is not a browser view; admission is not completion.
|
|
200
|
+
Neither stage counts a verified unique agent or proves payment. Payments and
|
|
201
|
+
revenue require confirmed settlement evidence, never purchased quota or
|
|
202
|
+
invented historical usage. Browser observations need their separate API;
|
|
203
|
+
the gate producer does not infer them from User-Agent or `AIFP-Agent-Id`.
|
|
204
|
+
|
|
205
|
+
Context carries an explicit channel and consent state. Only granted consent
|
|
206
|
+
allows an optional random, site-scoped `client_id`; it remains unverified.
|
|
207
|
+
Do not derive identity from a wallet, IP, fingerprint, headers or request body.
|
|
208
|
+
An optional flow minted by `mintFlow`/`mint_flow` carries a short-lived
|
|
209
|
+
`reporting_token` for observation only. It grants no access, payment authority,
|
|
210
|
+
ownership or integration verification. Keep it in memory, outside URLs,
|
|
211
|
+
logs, browser storage, cookies and payment/recovery files. The payer SDK's
|
|
212
|
+
optional `reportingToken`/`reporting_token` reaches only its fixed first-party
|
|
213
|
+
quote endpoints; never manually forward it to merchant, pay, RPC or JWKS
|
|
214
|
+
requests. Reporting failures preserve the original access/payment result.
|
|
215
|
+
|
|
216
|
+
Keep the merchant secret server-side. Report only registered route patterns,
|
|
217
|
+
never full URLs, queries, bodies, raw headers, IPs, receipt JWTs or wallet IDs.
|
|
218
|
+
Queues are in memory, bounded to 1000 events, with batches of at most 50,
|
|
219
|
+
3-second request deadlines and at most 5 attempts within 15 minutes.
|
|
220
|
+
Retries retain the same event IDs, timestamps and facts; outages, overflow
|
|
221
|
+
and crashes lose observations. Permanent errors and redirects are not retried;
|
|
222
|
+
fix credentials/configuration before replacing a stopped producer.
|
|
223
|
+
|
|
224
|
+
Node health auto-samples every 60 seconds; Python normally samples every 5
|
|
225
|
+
seconds. All health attempts are at least 5 seconds apart, and retries may
|
|
226
|
+
delay samples. A health acknowledgement is exactly `{version: 2, duplicate: boolean}`,
|
|
227
|
+
separate from the event-batch acknowledgement. Until a sample is acknowledged,
|
|
228
|
+
remote pending/drop coverage is unknown; a health gap over 5 minutes remains
|
|
229
|
+
a coverage gap. Local counters and successful HTTP responses do not prove a
|
|
230
|
+
complete report, and superseding lifetime health counters must not be summed.
|
|
231
|
+
Drain HTTP requests before closing the producer in the existing shutdown hook;
|
|
232
|
+
flush/close do not promise delivery.
|
|
233
|
+
|
|
234
|
+
Read the exact wiring and consent/loss rules before implementation:
|
|
235
|
+
[Node reporting v2](https://github.com/AiFinPay/sdk/blob/main/gate/REPORTING-V2.md)
|
|
236
|
+
and [Python reporting v2](https://github.com/AiFinPay/sdk/blob/main/python-gate/REPORTING-V2.md).
|
|
237
|
+
This reporting target adds no MCP tools or signing authority.
|
|
163
238
|
|
|
164
239
|
## Register the site (get your merchant_id)
|
|
165
240
|
|
|
@@ -183,9 +258,15 @@ The gate needs a `merchant_id`. Two ways to get one:
|
|
|
183
258
|
`{"name", "pay_to": {"evm": "0x…"}, "settlement_version": "1.4"}` returns the
|
|
184
259
|
id and a `merchant_secret` shown once. Claim the merchant in the dashboard
|
|
185
260
|
with that secret, or it belongs to no account. Send ONE `pay_to.evm` — it
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
261
|
+
is the EVM-family payout; per-chain keys such as `base` are refused. An EVM
|
|
262
|
+
address does not opt the merchant into every network. `settlement_chain`
|
|
263
|
+
remains the merchant's default (`polygon` unless configured otherwise).
|
|
264
|
+
Updated backends accept an explicit `settlement_chains` list, for example
|
|
265
|
+
`["polygon", "base"]`, with the default included. An agent's optional
|
|
266
|
+
quote `settlement_chain` is accepted only when it is in that merchant list,
|
|
267
|
+
has a verified payout and is served for the request's mode. Omitting it
|
|
268
|
+
preserves the merchant default. Never broaden consent just because two
|
|
269
|
+
networks share the same EVM address. To
|
|
189
270
|
move the payout later, `PATCH /v1/merchants/{id}` with header
|
|
190
271
|
`AIFP-Merchant-Secret` and `{"pay_to": {"evm": "0x…"}}`.
|
|
191
272
|
|
|
@@ -194,6 +275,7 @@ The gate needs a `merchant_id`. Two ways to get one:
|
|
|
194
275
|
| decision | why it matters |
|
|
195
276
|
|---|---|
|
|
196
277
|
| **payout wallet** | where the 99% lands. EVM address (same on every EVM chain) and/or a Solana address. Set in the dashboard. |
|
|
278
|
+
| **accepted payment networks** | an explicit set plus a default; the backend intersects it with verified payouts and served deployments. A wallet address alone does not grant network consent. |
|
|
197
279
|
| **which routes cost money** | gate the agent/data endpoints; leave human pages open. The gate only challenges agent-shaped requests, so humans are never blocked. |
|
|
198
280
|
| **price per route** | a `tier` (standard / complex / premium) sets the per-request price. Change it in the dashboard without redeploying. |
|
|
199
281
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aifinpay/skill",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "AiFinPay agent skills: pay for x402-gated APIs as an agent (aifinpay) and charge agents for your API as a merchant (aifinpay-merchant).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"CHANGELOG.md"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"test": "node scripts/validate.mjs",
|
|
14
|
+
"test": "node scripts/validate.mjs && node --test scripts/validate.test.mjs",
|
|
15
15
|
"prepublishOnly": "npm test"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|