@stridge/pay-sdk 0.0.0-stage → 0.1.0-alpha.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stridge Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @stridge/pay-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Staging-only. Pin an exact version. Use the newest kit.
4
+
5
+ The protocol and encoding package of the Stridge pay kit, with no framework and zero runtime dependencies. It holds the messaging contract between an app page and the Stridge hub. React apps use `@stridge/pay-kit`, which owns the frames, sender authentication and ceremonies.
6
+
7
+ Install the SDK with `pnpm add --save-exact @stridge/pay-sdk`. Packages with near names and no `@stridge/` scope are not ours.
8
+
9
+ ## Use the public protocol
10
+
11
+ ```ts
12
+ import { createPayEnvelope, isSignText } from "@stridge/pay-sdk";
13
+ import type { PayJob, PayCurrency, FundStartScreen } from "@stridge/pay-sdk";
14
+
15
+ const job: PayJob = "pay";
16
+ const currency: PayCurrency = "USD";
17
+ const start: FundStartScreen = "fund";
18
+ const message = "Confirm my order";
19
+ if (!isSignText(message)) throw new TypeError("Invalid sign text");
20
+ const request = createPayEnvelope("request-1", "sign", { message });
21
+ ```
22
+
23
+ These are wire names, and they keep their text. `PayJob` is the wire's `"pay"` or `"deposit"`; the kit's `PayElement` names it `mode` (`"payment"` or `"deposit"`).
24
+
25
+ The root supports ESM and CommonJS with declarations. Import only from the package root. The Coordinator HTTP client, API DTOs, keypair helpers, storage ports and relay code are internal to the hub and are absent from the published exports. There is no public direct HTTP-client entry.
26
+
27
+ ## Host requirements and errors
28
+
29
+ The envelope builder constructs messages; it does not authenticate peers or validate its arguments at runtime. Use the matching decoders on incoming data and authenticate both the sender window and origin. Unknown message types are ignored for compatibility; malformed known messages are rejected. A decoded settlement or connected notice is not signing permission or proof that a payment arrived.
30
+
31
+ With the kit, the provider's `environment` picks the hub, and the page origin must be registered for the app id. Keep popup opener links intact and start ceremonies in the user's click. For React setup, payment events, request errors, CSP and overlay focus, use the `@stridge/pay-kit` README. The SDK has no UI, stylesheet or focus manager.
32
+
33
+ The public message types describe protocol error codes. React request promises reject with the kit's `PayError`; internal Coordinator errors are not a consumer HTTP API. Check each payment on your server before you ship an order.