@4mica/sdk 0.5.3 → 0.5.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 +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,9 +38,9 @@ The SDK requires a signing key and can use sensible defaults for the rest:
|
|
|
38
38
|
- `authUrl` and `authRefreshMarginSecs` (optional): SIWE auth config. Only used when auth is
|
|
39
39
|
enabled via `enableAuth()` or by setting either value (defaults to `rpcUrl` and 60 seconds).
|
|
40
40
|
|
|
41
|
-
> Note: `ethereumHttpRpcUrl` and `contractAddress` are fetched from the core service
|
|
42
|
-
>
|
|
43
|
-
> different values than the server defaults.
|
|
41
|
+
> Note: `ethereumHttpRpcUrl` and `contractAddress` are fetched from the core service by default.
|
|
42
|
+
> The SDK validates the connected chain ID but does not verify the contract address or code. Only
|
|
43
|
+
> override these if you need to use different values than the server defaults.
|
|
44
44
|
|
|
45
45
|
### 1) Using ConfigBuilder
|
|
46
46
|
|
|
@@ -153,6 +153,7 @@ X-PAYMENT header (and optional `/settle` call) that the facilitator will accept.
|
|
|
153
153
|
|
|
154
154
|
At minimum you need:
|
|
155
155
|
- `scheme` and `network` (scheme must include `4mica`, e.g. `4mica-credit`)
|
|
156
|
+
- `payTo` (recipient address), `asset`, and `maxAmountRequired` (v1) or `amount` (v2)
|
|
156
157
|
- `extra.tabEndpoint` for tab resolution
|
|
157
158
|
|
|
158
159
|
`X402Flow` will refresh the tab by calling `extra.tabEndpoint` before signing.
|
|
@@ -258,6 +259,7 @@ Notes:
|
|
|
258
259
|
- `signPayment` and `signPaymentV2` always use EIP-712 signing and will error if the scheme is not 4mica.
|
|
259
260
|
- `UserClient.signPayment` supports `SigningScheme.EIP712` (default) and `SigningScheme.EIP191`.
|
|
260
261
|
- `settlePayment` only hits `/settle`; resource servers should still call `/verify` first when enforcing access.
|
|
262
|
+
- `RecipientClient.remunerate` requires the optional `@noble/curves` dependency for BLS decoding.
|
|
261
263
|
|
|
262
264
|
### API Methods Summary
|
|
263
265
|
|
|
@@ -303,8 +305,7 @@ Available under `client.rpc` (requires an admin API key):
|
|
|
303
305
|
## Error Handling
|
|
304
306
|
|
|
305
307
|
All SDK errors extend `FourMicaError`. Common error types include `ConfigError`, `RpcError`,
|
|
306
|
-
`
|
|
307
|
-
`AuthError`.
|
|
308
|
+
`SigningError`, `VerificationError`, `X402Error`, and `AuthError`.
|
|
308
309
|
|
|
309
310
|
## License
|
|
310
311
|
|