@x402api/agent-wallet-cli 0.2.2 → 0.2.4

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 CHANGED
@@ -4,15 +4,16 @@ Installs the `x402api` executable and bundled `x402api-pay` skill for persistent
4
4
  agent wallets and exact x402 payments.
5
5
 
6
6
  The launch payer authorizes only sponsored Base USDC and sponsored Solana
7
- USDC/USDT. x402api supplies the network fee asset, so buyers do not need ETH or
8
- SOL. TRON payment authorization returns `unsupported_profile` until that rail
9
- is launched.
7
+ USDC/USDT. x402api supplies the network fee asset from its platform treasury,
8
+ so buyers do not need ETH or SOL and actual gas is not debited from the
9
+ merchant tenant. TRON payment authorization returns `unsupported_profile`
10
+ until that rail is launched.
10
11
 
11
12
  The CLI runs on the buyer or agent host; merchant integrations do not host it
12
13
  or receive its keys. A wallet's funded token balance is spend authority, and
13
14
  `wallet create --maximum-payment-atomic N` can add a per-payment ceiling. The
14
15
  ceiling is not a daily, cumulative, or merchant-specific permission and cannot
15
- be updated in place in version 0.2.2.
16
+ be updated in place in version 0.2.4.
16
17
 
17
18
  Run `x402api help --json` for the machine-readable command summary. Unlock
18
19
  material is accepted only from standard input or an owner-only file named by
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x402api/agent-wallet-cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Command-line wallet for autonomous x402 purchases.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,6 +38,6 @@
38
38
  "lint": "tsc --noEmit -p tsconfig.json"
39
39
  },
40
40
  "dependencies": {
41
- "@x402api/agent-wallet-core": "0.2.2"
41
+ "@x402api/agent-wallet-core": "0.2.4"
42
42
  }
43
43
  }
package/skill/SKILL.md CHANGED
@@ -80,7 +80,9 @@ instructions to the human instead of sending email.
80
80
  request and receive its `402 Payment Required` challenge.
81
81
  2. Have that integration write the exact credential-free request envelope.
82
82
  Never place authorization tokens, cookies, SSH keys, or owner credentials in
83
- the envelope.
83
+ the envelope. Keep any merchant-side `X-X402API-Challenge-Handle` out as
84
+ well; it is reconciliation metadata, not the buyer payment identifier or a
85
+ signing input.
84
86
  3. Verify the URL, method, exact body bytes, resource, network, asset, amount,
85
87
  recipient, profile, and challenge digest.
86
88
  4. Require a launch-sponsored Base USDC or Solana USDC/USDT profile and the
@@ -104,7 +106,8 @@ submission rules.
104
106
  Distinguish these states:
105
107
 
106
108
  - funding: the wallet has usable USDC/USDT balance; x402api sponsors launch-rail
107
- ETH/SOL from the merchant tenant's prepaid gas billing;
109
+ ETH/SOL from its platform treasury, subject to the merchant tenant's active
110
+ sponsorship allowance;
108
111
  - authorization: one durable payment artifact exists;
109
112
  - settlement: the payment is authoritative on the chosen rail;
110
113
  - fulfillment: the merchant returned the purchased result.
@@ -34,7 +34,7 @@ x402api wallet sweep --wallet NAME --to ADDRESS --json
34
34
  `--maximum-payment-atomic` is an optional canonical decimal in atomic units for
35
35
  the wallet's supported payment asset. It is enforced on each authorization and
36
36
  returns `payment_limit_exceeded` when the exact amount is larger. It is not a
37
- daily or cumulative budget. Version 0.2.2 sets it only at wallet creation and
37
+ daily or cumulative budget. Version 0.2.4 sets it only at wallet creation and
38
38
  does not provide a policy-update command.
39
39
 
40
40
  Unlocking commands additionally require `X402API_WALLET_PASSWORD_FILE` or an
@@ -95,13 +95,21 @@ when a merchant-specific integration owns the request lifecycle.
95
95
  registered refill notification.
96
96
  - `insufficient_network_fee_resources`: is not expected for a valid launch
97
97
  profile; stop because the merchant challenge was not safely sponsored.
98
- - `gas_treasury_below_floor`, `tenant_gas_credit_insufficient`,
99
- `sponsorship_reservation_expired`: the sponsored rail is temporarily not
100
- admissible; do not switch to buyer-funded gas.
98
+ - `gas_sponsorship_unavailable`, `gas_treasury_below_floor`,
99
+ `sponsor_signature_unavailable`: retain the exact attempt and retry only with
100
+ bounded backoff; never switch to buyer-funded gas.
101
+ - `sponsorship_allowance_unavailable`, `sponsorship_payment_cap_exceeded`,
102
+ `sponsorship_payment_allowance_exhausted`,
103
+ `sponsorship_volume_allowance_exhausted`,
104
+ `sponsorship_gas_budget_exhausted`: the current authorization is terminal.
105
+ The merchant tenant must top up or change its allowance configuration and
106
+ issue a fresh challenge; the buyer must not fund native gas.
107
+ - `tenant_gas_credit_insufficient`: legacy-server response; retain the exact
108
+ attempt and retry only after the merchant tenant restores service credit.
109
+ - `sponsorship_reservation_expired`: obtain a fresh challenge without reusing
110
+ the expired authorization.
101
111
  - `sponsored_payload_invalid`: stop; the challenge or signed payload is not
102
112
  safely sponsored.
103
- - `sponsor_signature_unavailable`: retain the exact attempt and retry with
104
- bounded backoff.
105
113
  - `settlement_outcome_unknown`: keep the exact attempt and request envelope;
106
114
  retry or reconcile them without creating a new authorization.
107
115
  - `unsupported_network`, `unsupported_asset`, `unsupported_profile`,
@@ -25,7 +25,34 @@ The merchant tool writes an owner-only JSON file:
25
25
  The body is exact canonical base64 and is never parsed and reserialized before
26
26
  paid submission. The decoded `resource.url` must equal the normalized envelope
27
27
  URL. The envelope excludes authorization headers, cookies, API keys, SSH keys,
28
- and owner tokens.
28
+ owner tokens, and merchant-side challenge handles. A response header such as
29
+ `X-X402API-Challenge-Handle` is opaque reconciliation metadata for the merchant
30
+ integration. It is not the buyer payment identifier, does not affect the token
31
+ authorization, and must not be added to this exact V1 envelope. The wallet
32
+ creates its own `buyerPaymentIdentifier` when it authorizes a selected payment
33
+ requirement.
34
+
35
+ ## Programmatic charge handoff
36
+
37
+ A merchant may create a variable-price challenge with the tenant-authenticated
38
+ x402api `POST /v1/charges` endpoint before writing the wallet request envelope.
39
+ That operation belongs to trusted merchant server code—not this wallet.
40
+
41
+ - The merchant uses the current template `active_version.id` as
42
+ `resource_version_id`; a resource UUID or `pay_...` public payment ID is not a
43
+ substitute.
44
+ - One active template may allow multiple rails. The merchant charge supplies
45
+ exact runtime amounts for a non-empty subset; the wallet independently
46
+ validates and selects one returned `PAYMENT-REQUIRED.accepts` alternative.
47
+ - The request envelope receives only the exact credential-free protected
48
+ request and canonical `PAYMENT-REQUIRED` challenge. It never contains the
49
+ tenant API credential, `resource_version_id`, or a tenant-side API request.
50
+ - Retiring or replacing a template is a merchant concern. The wallet validates
51
+ the exact issued challenge and must not discover, guess, or rewrite a
52
+ template UUID.
53
+
54
+ See the tenant integration guide at
55
+ https://x402api.com/docs/payments/x402/programmatic-charges.
29
56
 
30
57
  ## Payment submission or artifact handoff
31
58
 
@@ -9,7 +9,7 @@ Base, Solana, and TRON.
9
9
 
10
10
  An optional `maximumPaymentAtomic` value adds a local ceiling to each payment.
11
11
  It does not limit aggregate or daily spend, restrict merchants, revoke existing
12
- artifacts, or protect a wallet on a compromised same-user host. Version 0.2.2
12
+ artifacts, or protect a wallet on a compromised same-user host. Version 0.2.4
13
13
  sets this value only when creating a wallet and has no policy-update command.
14
14
 
15
15
  Show the exact network, token contract or mint, public address, and requested