@profullstack/x402-gateway 0.3.0 → 0.3.1
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/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.js +1 -1
package/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ export interface GatewayOptions {
|
|
|
72
72
|
secret?: string;
|
|
73
73
|
page?: (ctx: PageContext) => string;
|
|
74
74
|
contact?: string;
|
|
75
|
+
/** Awaited before the buyer's receipt is sent, and its errors are swallowed: a sale is recorded, and a recording failure never costs the buyer the pass. */
|
|
75
76
|
onSale?: (sale: Sale) => void | Promise<void>;
|
|
76
77
|
fetch?: typeof fetch;
|
|
77
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/x402-gateway",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Sell crawl access to AI training crawlers by the day over x402, settled by CoinPay. One middleware: 402 with an offer, a sales page with CLI instructions, signed passes, and a robots.txt that keeps search crawlers welcome.",
|
|
6
6
|
"keywords": [
|
package/src/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export { buildOffer, decodePayment, expectedFor, METHODS, verifyAndSettle } from
|
|
|
56
56
|
* @param {string} [options.secret] pass signing secret; defaults to the CoinPay key
|
|
57
57
|
* @param {(ctx: object) => string} [options.page] custom sales page renderer
|
|
58
58
|
* @param {string} [options.contact] mailto: or URL for bulk deals
|
|
59
|
-
* @param {(sale: object) => void|Promise<void>} [options.onSale] accounting hook
|
|
59
|
+
* @param {(sale: object) => void|Promise<void>} [options.onSale] accounting hook; awaited before the receipt goes out, and its errors are swallowed
|
|
60
60
|
* @param {typeof fetch} [options.fetch] for tests
|
|
61
61
|
*/
|
|
62
62
|
export function createGateway(options = {}) {
|