x402z-client 0.0.10 → 0.0.19
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 +31 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,8 +48,39 @@ console.log(response.status);
|
|
|
48
48
|
- `fetch` (optional): custom fetch implementation
|
|
49
49
|
- `client.pay(url, options?)`: performs the 402 handshake and retries with payment headers
|
|
50
50
|
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
See `examples/README.md` for the full-process scripts (`client-pay.ts`, `client-wrap.ts`, `client-unwrap.ts`).
|
|
54
|
+
|
|
51
55
|
## Notes
|
|
52
56
|
|
|
53
57
|
- Scheme name: `erc7984-mind-v1`
|
|
54
58
|
- The client does not expose balance helpers; use `x402z-shared` for that.
|
|
55
59
|
- For browser usage, use `x402z-client-web` with `x402z-shared-web`.
|
|
60
|
+
|
|
61
|
+
## API surface
|
|
62
|
+
|
|
63
|
+
Exports:
|
|
64
|
+
- `X402zEvmClientScheme`: client scheme implementation for erc7984-mind-v1.
|
|
65
|
+
- `registerX402zEvmClientScheme`: registers the scheme with x402 client.
|
|
66
|
+
- `buildPaymentInput`: builds encrypted payment input for a requirement.
|
|
67
|
+
- `createX402zClient`: convenience client wrapper for pay flows.
|
|
68
|
+
- `x402Client`: core x402 client constructor.
|
|
69
|
+
- `x402HTTPClient`: core HTTP client wrapper.
|
|
70
|
+
|
|
71
|
+
Types:
|
|
72
|
+
- `X402zClientSchemeOptions`: scheme config for client registration.
|
|
73
|
+
- `X402zClientRegistrationOptions`: registration options for the scheme.
|
|
74
|
+
- `X402zClientOptions`: options for `createX402zClient`.
|
|
75
|
+
- `PayOptions`: per-request payment options.
|
|
76
|
+
- `AfterPaymentCreationHook`: hook after a payment is built.
|
|
77
|
+
- `BeforePaymentCreationHook`: hook before a payment is built.
|
|
78
|
+
- `OnPaymentCreationFailureHook`: hook on payment build failures.
|
|
79
|
+
- `PaymentCreatedContext`: context for successful payment creation.
|
|
80
|
+
- `PaymentCreationContext`: context for payment creation.
|
|
81
|
+
- `PaymentCreationFailureContext`: context for payment errors.
|
|
82
|
+
- `PaymentPolicy`: policy for selecting payment requirements.
|
|
83
|
+
- `SchemeRegistration`: generic scheme registration type.
|
|
84
|
+
- `SelectPaymentRequirements`: selection callback for requirements.
|
|
85
|
+
- `x402ClientConfig`: x402 client configuration type.
|
|
86
|
+
- re-exported types from `@x402/core/types`: shared x402 types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x402z-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@x402/core": "^2.0.0",
|
|
19
19
|
"@x402/evm": "^2.0.0",
|
|
20
20
|
"viem": "^2.39.3",
|
|
21
|
-
"x402z-shared": "0.0.
|
|
21
|
+
"x402z-shared": "0.0.19"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"jest": "^29.7.0",
|