@weftlabs/sdk 0.26.2 → 0.26.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 CHANGED
@@ -83,6 +83,34 @@ console.log({ idempotencyKey, artifact });
83
83
  Do not create a new key for a retry of the same logical purchase. The CLI
84
84
  generates a key automatically and returns it in its success envelope.
85
85
 
86
+ ## Retrieve a wallet-protected result
87
+
88
+ For an x402 Sign-In-With-X (SIWX) result endpoint, use the same buyer credential
89
+ as the paid submission and set an explicit zero ceiling:
90
+
91
+ ```js
92
+ const result = await weft.fetch(
93
+ {
94
+ url: "https://merchant.example/runs/your-run-id",
95
+ method: "GET",
96
+ maxCostUsd: "0",
97
+ },
98
+ { idempotencyKey: "poll-your-run-id" },
99
+ );
100
+ console.log(result.paymentStatus, result.artifactId, result.bodyBase64);
101
+ ```
102
+
103
+ Weft signs a fresh, resource-bound challenge with the buyer wallet. No local
104
+ wallet key is needed. The provider must support smart-wallet signatures and
105
+ issue a valid HTTPS challenge for the requested resource. Retrieval never
106
+ falls back to payment. Success returns `paymentStatus: "not_required"`,
107
+ `paidUsd: "0.00"`, and null `heldUsd` and `txHash`.
108
+
109
+ Repeat this GET until the provider reports a terminal job state. Polls read
110
+ fresh provider state even when the idempotency key is repeated. Do not repeat
111
+ the paid submission to poll. `SIWX_RETRIEVAL_FAILED` means the challenge was
112
+ unsafe or authentication failed; keep the zero ceiling when investigating.
113
+
86
114
  ## CLI
87
115
 
88
116
  The `weft` executable is published separately as `@weftlabs/cli`.
@@ -136,7 +136,7 @@ function createFacilitatorClient(config, weftAuthHeaders) {
136
136
  }
137
137
 
138
138
  // package.json
139
- var version = "0.26.2";
139
+ var version = "0.26.3";
140
140
 
141
141
  // src/facilitator/middleware/product.ts
142
142
  var PRODUCT_TYPES = ["api", "agent", "mcp"];