@seedhape/x402-merchant-sdk 0.3.2 → 0.3.3
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 +20 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,26 @@ const config = merchantConfig(base, {
|
|
|
93
93
|
|
|
94
94
|
Set `CDP_API_KEY_ID` and `CDP_API_KEY_SECRET` on the server only. The SDK uses the injected client for official EIP-3009 verification and settlement; the existing URL/API-key configuration remains available for other facilitators and custom ERC-7710 endpoints. After deployment, validate the endpoint and complete one successful payment through CDP for Bazaar indexing.
|
|
95
95
|
|
|
96
|
+
Do not treat `FACILITATOR_URL=https://api.cdp.coinbase.com/platform/v2/x402` by itself as CDP authentication, and do not send `CDP_API_KEY_SECRET` as a raw bearer token. Use `createCdpFacilitatorClient()` so the CDP SDK creates the required authenticated facilitator requests.
|
|
97
|
+
|
|
98
|
+
#### Bazaar publication checklist
|
|
99
|
+
|
|
100
|
+
1. Deploy the route at a public HTTPS URL.
|
|
101
|
+
2. Include route metadata and accurate input/output schemas so the SDK emits `extensions.bazaar`.
|
|
102
|
+
3. Validate the endpoint before paying:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
curl -X POST https://api.cdp.coinbase.com/platform/v2/x402/validate \
|
|
106
|
+
-H "Content-Type: application/json" \
|
|
107
|
+
-d '{"resource":"https://api.example.com/report","method":"GET"}'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Continue only when the response reports `valid: true` and an accepted simulation outcome.
|
|
111
|
+
|
|
112
|
+
4. Complete one successful payment through the CDP Facilitator. There is no separate Bazaar registration form or publish API. CDP indexes the endpoint after settlement; indexing may initially report `processing` and become searchable asynchronously.
|
|
113
|
+
|
|
114
|
+
5. Confirm the facilitator extension response reports Bazaar `success` or `processing`, then search the CDP Bazaar catalog for the resource.
|
|
115
|
+
|
|
96
116
|
The `route` metadata automatically becomes the Bazaar `extensions.bazaar.info` object in the x402 v2 challenge. Sonar can read the same resource URL, description, schemas, payment requirements, network, asset, and payment methods from that challenge.
|
|
97
117
|
|
|
98
118
|
## Hono and node:http
|
package/package.json
CHANGED