@sigil-oss/connect 0.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # @sigil-oss/connect
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2ee6687: Initial release scaffold for the Sigil Connect SDK, including typed deep-link request builders, envelope signing helpers, tests, and Changesets-based publish automation.
8
+
9
+ All notable changes to this package will be documented in this file.
10
+
11
+ The format is based on Changesets and follows semver.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sigil
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 ADDED
@@ -0,0 +1,255 @@
1
+ # `@sigil-oss/connect`
2
+
3
+ Framework-agnostic TypeScript SDK for launching Sigil deep-link requests.
4
+
5
+ `@sigil-oss/connect` gives web apps, desktop apps, and hybrid frontends a small typed layer for interacting with the Sigil wallet without depending on React, Vue, Svelte, or any framework runtime.
6
+
7
+ Use it to:
8
+
9
+ - build valid `sigil://` request URLs
10
+ - create typed `transfer`, `connect`, `sign_message`, `verify_message`, and `sc_call` requests
11
+ - attach callback URLs safely
12
+ - generate signed request proofs for trusted Sigil flows
13
+
14
+ ---
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ bun add @sigil-oss/connect
20
+ ```
21
+
22
+ or
23
+
24
+ ```bash
25
+ npm install @sigil-oss/connect
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Why This Package Exists
31
+
32
+ Sigil itself is a desktop wallet.
33
+
34
+ This package is the companion SDK for dApps and tools that want to hand requests off to Sigil in a predictable, typed, cross-framework way. It keeps request construction in sync with the wallet’s current deep-link model, including:
35
+
36
+ - request envelopes
37
+ - callback handling
38
+ - nonce / expiry defaults
39
+ - optional signed proof metadata
40
+
41
+ ---
42
+
43
+ ## Quick Start
44
+
45
+ ```ts
46
+ import {
47
+ createTransferRequest,
48
+ createEnvelope,
49
+ buildSigilUrl,
50
+ } from "@sigil-oss/connect";
51
+
52
+ const request = createTransferRequest({
53
+ type: "transfer",
54
+ dapp: {
55
+ name: "Demo App",
56
+ origin: "https://demo.app",
57
+ },
58
+ to: "UVYAOYTNYCRBVFBHNFIJUEOUEPEDIDUWWEAXKFSJEBJVASCQEROJOVOEEATL",
59
+ amount: "1000",
60
+ });
61
+
62
+ const envelope = createEnvelope(request, {
63
+ callback: "https://demo.app/api/sigil/callback",
64
+ });
65
+
66
+ const url = buildSigilUrl(envelope);
67
+ ```
68
+
69
+ You can then:
70
+
71
+ - assign `url` to a button or anchor
72
+ - call `window.location.assign(url)`
73
+ - use `launchSigilRequest(envelope)` in browser environments
74
+
75
+ ---
76
+
77
+ ## Request Builders
78
+
79
+ The package exposes typed helpers for the current Sigil request model:
80
+
81
+ - `createTransferRequest()`
82
+ - `createScCallRequest()`
83
+ - `createSignMessageRequest()`
84
+ - `createVerifyMessageRequest()`
85
+ - `createConnectRequest()`
86
+
87
+ All builders:
88
+
89
+ - require an HTTPS `dapp.origin`
90
+ - generate a nonce by default
91
+ - generate a short-lived expiry by default
92
+
93
+ You can override nonce or expiry when needed.
94
+
95
+ ---
96
+
97
+ ## Envelope Model
98
+
99
+ Sigil now accepts request envelopes, not only flat request payloads.
100
+
101
+ ```ts
102
+ interface SigilEnvelope {
103
+ request: SigilRequest;
104
+ callback?: string | null;
105
+ proof?: SigilProof;
106
+ }
107
+ ```
108
+
109
+ Build one with:
110
+
111
+ ```ts
112
+ const envelope = createEnvelope(request, {
113
+ callback: "https://demo.app/api/callback",
114
+ });
115
+ ```
116
+
117
+ Then encode it into a deep link:
118
+
119
+ ```ts
120
+ const url = buildSigilUrl(envelope);
121
+ ```
122
+
123
+ If you need compatibility with older callback query handling, you can include the legacy `cb` parameter too:
124
+
125
+ ```ts
126
+ const url = buildSigilUrl(envelope, {
127
+ includeLegacyCallbackParam: true,
128
+ });
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Signed Requests
134
+
135
+ If your integration uses Sigil’s signed trust flow, you can attach an ES256 proof:
136
+
137
+ ```ts
138
+ import {
139
+ createConnectRequest,
140
+ createEnvelope,
141
+ signEnvelope,
142
+ } from "@sigil-oss/connect";
143
+
144
+ const request = createConnectRequest({
145
+ type: "connect",
146
+ dapp: {
147
+ name: "Trusted Demo",
148
+ origin: "https://demo.app",
149
+ },
150
+ permissions: ["transfer", "sign_message"],
151
+ });
152
+
153
+ const envelope = createEnvelope(request, {
154
+ callback: "https://demo.app/api/callback",
155
+ });
156
+
157
+ const signed = await signEnvelope(envelope, {
158
+ issuer: "demo.app",
159
+ privateJwk,
160
+ publicJwk,
161
+ includePublicJwk: true,
162
+ });
163
+ ```
164
+
165
+ Related helpers:
166
+
167
+ - `serializeSignedRequestPayload()`
168
+ - `hashSignedRequestPayload()`
169
+ - `signEnvelope()`
170
+
171
+ ---
172
+
173
+ ## Browser Helper
174
+
175
+ To launch Sigil directly from a browser context:
176
+
177
+ ```ts
178
+ import { launchSigilRequest } from "@sigil-oss/connect";
179
+
180
+ launchSigilRequest(envelope);
181
+ ```
182
+
183
+ This helper throws when used outside a browser environment.
184
+
185
+ ---
186
+
187
+ ## API Surface
188
+
189
+ ### URL and request helpers
190
+
191
+ - `createNonce()`
192
+ - `createExpiry()`
193
+ - `withRequestDefaults()`
194
+ - `createEnvelope()`
195
+ - `encodeEnvelope()`
196
+ - `buildSigilUrl()`
197
+ - `openSigilUrl()`
198
+ - `launchSigilRequest()`
199
+
200
+ ### Validation helpers
201
+
202
+ - `isAllowedCallbackUrl()`
203
+
204
+ ### Signing helpers
205
+
206
+ - `serializeSignedRequestPayload()`
207
+ - `hashSignedRequestPayload()`
208
+ - `signEnvelope()`
209
+
210
+ ### Types
211
+
212
+ - `SigilRequest`
213
+ - `SigilEnvelope`
214
+ - `SigilProof`
215
+ - `SigilPermission`
216
+ - `SigilTransferRequest`
217
+ - `SigilScCallRequest`
218
+ - `SigilSignMessageRequest`
219
+ - `SigilVerifyMessageRequest`
220
+ - `SigilConnectRequest`
221
+
222
+ ---
223
+
224
+ ## Compatibility Notes
225
+
226
+ - `dapp.origin` must use `https://`
227
+ - callback URLs must use `https://`, except `http://localhost` and `http://127.0.0.1`
228
+ - the generated deep links target Sigil’s current `sigil://v1/request?d=...` format
229
+ - this package is framework-agnostic, but browser-launch helpers require `window`
230
+
231
+ ---
232
+
233
+ ## Local Development
234
+
235
+ ```bash
236
+ bun install
237
+ bun run check
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Release Flow
243
+
244
+ This package uses Changesets.
245
+
246
+ - add a changeset for each user-facing package change
247
+ - merge to `main`
248
+ - let the GitHub release workflow open or update the release PR
249
+ - publish through the Changesets action with `NPM_TOKEN`
250
+
251
+ ---
252
+
253
+ ## License
254
+
255
+ MIT
package/TESTING.md ADDED
@@ -0,0 +1,110 @@
1
+ # `@sigil-oss/connect` Testing Guide
2
+
3
+ Release checklist for the Sigil Connect SDK.
4
+
5
+ This package is small, but it sits directly on the wallet handoff boundary. Treat request-format drift and callback-policy regressions as release blockers.
6
+
7
+ ---
8
+
9
+ ## Required Checks
10
+
11
+ Run before every release:
12
+
13
+ ```bash
14
+ bun install
15
+ bun run check
16
+ ```
17
+
18
+ This covers:
19
+
20
+ - TypeScript typecheck
21
+ - unit tests
22
+ - production build output
23
+
24
+ ---
25
+
26
+ ## Core Scenarios
27
+
28
+ ### Request builders
29
+
30
+ Verify all request helpers produce the expected shape:
31
+
32
+ - `createTransferRequest`
33
+ - `createScCallRequest`
34
+ - `createSignMessageRequest`
35
+ - `createVerifyMessageRequest`
36
+ - `createConnectRequest`
37
+
38
+ Checks:
39
+
40
+ - `nonce` is generated when omitted
41
+ - `exp` is generated when omitted
42
+ - custom `nonce` and `exp` are preserved when provided
43
+ - `dapp.origin` rejects non-HTTPS values
44
+
45
+ ### Envelope helpers
46
+
47
+ Verify:
48
+
49
+ - `createEnvelope()` accepts valid callback URLs
50
+ - invalid callback URLs throw
51
+ - `encodeEnvelope()` returns a base64url payload
52
+ - `buildSigilUrl()` produces `sigil://v1/request?d=...`
53
+ - legacy callback query param is only included when requested
54
+
55
+ ### Browser launch helper
56
+
57
+ Verify:
58
+
59
+ - `launchSigilRequest()` returns the final URL
60
+ - browser-only helper throws cleanly in a non-browser environment
61
+
62
+ ### Signed request helpers
63
+
64
+ Verify:
65
+
66
+ - `serializeSignedRequestPayload()` is stable
67
+ - `hashSignedRequestPayload()` is deterministic
68
+ - `signEnvelope()` emits `proof.algorithm = "ES256"`
69
+ - signed proof includes `payload_hash`
70
+ - optional `public_jwk` inclusion works
71
+
72
+ ---
73
+
74
+ ## Cross-Compatibility Pass
75
+
76
+ Before publishing, validate one generated URL against a current installed Sigil build.
77
+
78
+ At minimum:
79
+
80
+ 1. Generate a `transfer` request URL with this package.
81
+ 2. Open it against Sigil.
82
+ 3. Confirm Sigil shows the request review screen.
83
+ 4. Repeat for `connect` and `sign_message`.
84
+
85
+ If Sigil rejects the payload, do not ship until the package and wallet are back in sync.
86
+
87
+ ---
88
+
89
+ ## Regression Risks To Watch
90
+
91
+ Treat these as high risk:
92
+
93
+ - wallet request-envelope shape changes
94
+ - callback policy changes
95
+ - signed proof serialization drift
96
+ - request type field renames
97
+ - accidental Node-only or browser-only runtime assumptions in shared helpers
98
+
99
+ ---
100
+
101
+ ## Release Exit Criteria
102
+
103
+ Do not publish if any of these fail:
104
+
105
+ - package fails `bun run check`
106
+ - built `dist/` output is missing JS or `.d.ts`
107
+ - generated deep links no longer open current Sigil builds
108
+ - non-HTTPS origin validation regresses
109
+ - callback URL policy regresses
110
+ - signing helper output becomes incompatible with Sigil trust verification
@@ -0,0 +1,97 @@
1
+ export type SigilPermission = "transfer" | "sc_call" | "sign_message";
2
+ export type SigilRequestType = "transfer" | "sc_call" | "sign_message" | "verify_message" | "connect";
3
+ export interface SigilDappMeta {
4
+ name?: string;
5
+ origin: string;
6
+ icon?: string;
7
+ }
8
+ export interface SigilBaseRequest {
9
+ type: SigilRequestType;
10
+ dapp: SigilDappMeta;
11
+ nonce: string;
12
+ exp?: number;
13
+ }
14
+ export interface SigilTransferRequest extends SigilBaseRequest {
15
+ type: "transfer";
16
+ to: string;
17
+ amount: string | number;
18
+ from?: string;
19
+ tick_offset?: number;
20
+ }
21
+ export interface SigilScCallRequest extends SigilBaseRequest {
22
+ type: "sc_call";
23
+ contract_index: number;
24
+ input_type: number;
25
+ from?: string;
26
+ amount?: string | number;
27
+ payload?: string;
28
+ tick_offset?: number;
29
+ }
30
+ export interface SigilSignMessageRequest extends SigilBaseRequest {
31
+ type: "sign_message";
32
+ message: string;
33
+ from?: string;
34
+ data?: string;
35
+ }
36
+ export interface SigilVerifyMessageRequest extends SigilBaseRequest {
37
+ type: "verify_message";
38
+ message: string;
39
+ data?: string;
40
+ signature: string;
41
+ public_key: string;
42
+ }
43
+ export interface SigilConnectRequest extends SigilBaseRequest {
44
+ type: "connect";
45
+ permissions?: SigilPermission[];
46
+ }
47
+ export type SigilRequest = SigilTransferRequest | SigilScCallRequest | SigilSignMessageRequest | SigilVerifyMessageRequest | SigilConnectRequest;
48
+ export interface SigilProof {
49
+ version: 1;
50
+ algorithm: "ES256";
51
+ issuer: string;
52
+ key_id?: string;
53
+ payload_hash: string;
54
+ signature: string;
55
+ public_jwk?: JsonWebKey;
56
+ }
57
+ export interface SigilEnvelope {
58
+ request: SigilRequest;
59
+ callback?: string | null;
60
+ proof?: SigilProof;
61
+ }
62
+ export interface SigilUrlOptions {
63
+ includeLegacyCallbackParam?: boolean;
64
+ }
65
+ export interface SigilRequestDefaults {
66
+ nonce?: string;
67
+ exp?: number;
68
+ ttlSeconds?: number;
69
+ }
70
+ export interface SigilProofOptions {
71
+ issuer: string;
72
+ keyId?: string;
73
+ privateJwk: JsonWebKey;
74
+ includePublicJwk?: boolean;
75
+ publicJwk?: JsonWebKey;
76
+ }
77
+ export declare function isAllowedCallbackUrl(value: string): boolean;
78
+ export declare function createNonce(): string;
79
+ export declare function createExpiry(ttlSeconds?: number): number;
80
+ export declare function withRequestDefaults<T extends Omit<SigilRequest, "nonce" | "exp">>(request: T, defaults?: SigilRequestDefaults): T & Pick<SigilBaseRequest, "nonce" | "exp">;
81
+ export declare function createTransferRequest(request: Omit<SigilTransferRequest, "nonce" | "exp">, defaults?: SigilRequestDefaults): SigilTransferRequest;
82
+ export declare function createScCallRequest(request: Omit<SigilScCallRequest, "nonce" | "exp">, defaults?: SigilRequestDefaults): SigilScCallRequest;
83
+ export declare function createSignMessageRequest(request: Omit<SigilSignMessageRequest, "nonce" | "exp">, defaults?: SigilRequestDefaults): SigilSignMessageRequest;
84
+ export declare function createVerifyMessageRequest(request: Omit<SigilVerifyMessageRequest, "nonce" | "exp">, defaults?: SigilRequestDefaults): SigilVerifyMessageRequest;
85
+ export declare function createConnectRequest(request: Omit<SigilConnectRequest, "nonce" | "exp">, defaults?: SigilRequestDefaults): SigilConnectRequest;
86
+ export declare function createEnvelope(request: SigilRequest, options?: {
87
+ callback?: string | null;
88
+ proof?: SigilProof;
89
+ }): SigilEnvelope;
90
+ export declare function encodeEnvelope(envelope: SigilEnvelope): string;
91
+ export declare function buildSigilUrl(envelope: SigilEnvelope, options?: SigilUrlOptions): string;
92
+ export declare function openSigilUrl(url: string): void;
93
+ export declare function launchSigilRequest(envelope: SigilEnvelope, options?: SigilUrlOptions): string;
94
+ export declare function serializeSignedRequestPayload(envelope: Pick<SigilEnvelope, "request" | "callback">): string;
95
+ export declare function hashSignedRequestPayload(envelope: Pick<SigilEnvelope, "request" | "callback">): Promise<string>;
96
+ export declare function signEnvelope(envelope: SigilEnvelope, options: SigilProofOptions): Promise<SigilEnvelope>;
97
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;AACtE,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,SAAS,CAAC;AAEd,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;I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{
3
+ if (typeof Buffer !== "undefined") {
4
+ return Buffer.from(bytes)
5
+ .toString("base64")
6
+ .replace(/\+/g, "-")
7
+ .replace(/\//g, "_")
8
+ .replace(/=+$/g, "");
9
+ }
10
+ let binary = "";
11
+ for (const byte of bytes)
12
+ binary += String.fromCharCode(byte);
13
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
14
+ }
15
+ function stringToBase64Url(value) {
16
+ return bytesToBase64Url(new TextEncoder().encode(value));
17
+ }
18
+ function assertValidDappOrigin(origin) {
19
+ let url;
20
+ try {
21
+ url = new URL(origin);
22
+ }
23
+ catch {
24
+ throw new Error("dApp origin must be a valid URL");
25
+ }
26
+ if (url.protocol !== "https:") {
27
+ throw new Error("dApp origin must use HTTPS");
28
+ }
29
+ }
30
+ export function isAllowedCallbackUrl(value) {
31
+ try {
32
+ const url = new URL(value);
33
+ const host = url.hostname.toLowerCase();
34
+ const isLocal = host === "localhost" || host === "127.0.0.1";
35
+ return url.protocol === "https:" || (url.protocol === "http:" && isLocal);
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
41
+ function canonicalize(value) {
42
+ if (Array.isArray(value)) {
43
+ return `[${value.map((item) => canonicalize(item)).join(",")}]`;
44
+ }
45
+ if (value && typeof value === "object") {
46
+ const entries = Object.entries(value)
47
+ .sort(([a], [b]) => a.localeCompare(b))
48
+ .map(([key, entry]) => `${JSON.stringify(key)}:${canonicalize(entry)}`);
49
+ return `{${entries.join(",")}}`;
50
+ }
51
+ return JSON.stringify(value);
52
+ }
53
+ function unixNow() {
54
+ return Math.floor(Date.now() / 1000);
55
+ }
56
+ export function createNonce() {
57
+ return globalThis.crypto.randomUUID().replace(/-/g, "");
58
+ }
59
+ export function createExpiry(ttlSeconds = DEFAULT_EXPIRY_SECONDS) {
60
+ if (!Number.isFinite(ttlSeconds) || ttlSeconds <= 0) {
61
+ throw new Error("ttlSeconds must be a positive number");
62
+ }
63
+ return unixNow() + Math.floor(ttlSeconds);
64
+ }
65
+ export function withRequestDefaults(request, defaults = {}) {
66
+ assertValidDappOrigin(request.dapp.origin);
67
+ return {
68
+ ...request,
69
+ nonce: defaults.nonce ?? createNonce(),
70
+ exp: defaults.exp ?? createExpiry(defaults.ttlSeconds),
71
+ };
72
+ }
73
+ export function createTransferRequest(request, defaults) {
74
+ return withRequestDefaults(request, defaults);
75
+ }
76
+ export function createScCallRequest(request, defaults) {
77
+ return withRequestDefaults(request, defaults);
78
+ }
79
+ export function createSignMessageRequest(request, defaults) {
80
+ return withRequestDefaults(request, defaults);
81
+ }
82
+ export function createVerifyMessageRequest(request, defaults) {
83
+ return withRequestDefaults(request, defaults);
84
+ }
85
+ export function createConnectRequest(request, defaults) {
86
+ return withRequestDefaults(request, defaults);
87
+ }
88
+ export function createEnvelope(request, options = {}) {
89
+ if (options.callback && !isAllowedCallbackUrl(options.callback)) {
90
+ throw new Error("Callback URL must use HTTPS or localhost HTTP");
91
+ }
92
+ return {
93
+ request,
94
+ callback: options.callback ?? null,
95
+ proof: options.proof,
96
+ };
97
+ }
98
+ export function encodeEnvelope(envelope) {
99
+ if (envelope.callback && !isAllowedCallbackUrl(envelope.callback)) {
100
+ throw new Error("Callback URL must use HTTPS or localhost HTTP");
101
+ }
102
+ return stringToBase64Url(JSON.stringify(envelope));
103
+ }
104
+ export function buildSigilUrl(envelope, options = {}) {
105
+ const payload = encodeEnvelope(envelope);
106
+ const params = new URLSearchParams({ d: payload });
107
+ if (options.includeLegacyCallbackParam && envelope.callback) {
108
+ params.set("cb", envelope.callback);
109
+ }
110
+ return `sigil://v1/request?${params.toString()}`;
111
+ }
112
+ export function openSigilUrl(url) {
113
+ if (typeof window === "undefined") {
114
+ throw new Error("openSigilUrl can only be used in a browser environment");
115
+ }
116
+ window.location.assign(url);
117
+ }
118
+ export function launchSigilRequest(envelope, options) {
119
+ const url = buildSigilUrl(envelope, options);
120
+ openSigilUrl(url);
121
+ return url;
122
+ }
123
+ export function serializeSignedRequestPayload(envelope) {
124
+ return canonicalize({
125
+ request: envelope.request,
126
+ callback: envelope.callback ?? null,
127
+ });
128
+ }
129
+ export async function hashSignedRequestPayload(envelope) {
130
+ const payload = serializeSignedRequestPayload(envelope);
131
+ const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(payload));
132
+ return bytesToBase64Url(new Uint8Array(digest));
133
+ }
134
+ export async function signEnvelope(envelope, options) {
135
+ const payload = serializeSignedRequestPayload(envelope);
136
+ const payloadHash = await hashSignedRequestPayload(envelope);
137
+ const key = await globalThis.crypto.subtle.importKey("jwk", options.privateJwk, { name: "ECDSA", namedCurve: "P-256" }, false, ["sign"]);
138
+ const signature = await globalThis.crypto.subtle.sign({ name: "ECDSA", hash: "SHA-256" }, key, new TextEncoder().encode(payload));
139
+ return {
140
+ ...envelope,
141
+ proof: {
142
+ version: 1,
143
+ algorithm: "ES256",
144
+ issuer: options.issuer,
145
+ key_id: options.keyId,
146
+ payload_hash: payloadHash,
147
+ signature: bytesToBase64Url(new Uint8Array(signature)),
148
+ public_jwk: options.includePublicJwk ? options.publicJwk ?? derivePublicJwk(options.privateJwk) : undefined,
149
+ },
150
+ };
151
+ }
152
+ function derivePublicJwk(privateJwk) {
153
+ const { d: _discarded, key_ops: _ops, ...rest } = privateJwk;
154
+ return rest;
155
+ }
156
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoGA,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,SAAS,gBAAgB,CAAC,KAAiB;IACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aACtB,QAAQ,CAAC,QAAQ,CAAC;aAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,MAAM,EAAE,E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E;YACL,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,KAAK;YACrB,YAAY,EAAE,WAAW;YACzB,SAAS,EAAE,gBAAgB,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;YACtD,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;SAC5G;KACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,UAAsB;IAC7C,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@sigil-oss/connect",
3
+ "version": "0.2.0",
4
+ "description": "Framework-agnostic TypeScript SDK for launching and signing Sigil deep-link requests.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/sigil-oss/sigil.connect.git"
10
+ },
11
+ "homepage": "https://github.com/sigil-oss/sigil.connect#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/sigil-oss/sigil.connect/issues"
14
+ },
15
+ "keywords": [
16
+ "sigil",
17
+ "qubic",
18
+ "wallet",
19
+ "deeplink",
20
+ "sdk",
21
+ "typescript"
22
+ ],
23
+ "sideEffects": false,
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "CHANGELOG.md",
28
+ "LICENSE",
29
+ "TESTING.md"
30
+ ],
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js",
38
+ "default": "./dist/index.js"
39
+ }
40
+ },
41
+ "engines": {
42
+ "bun": ">=1.1.0",
43
+ "node": ">=18"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "provenance": true
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "lint": "tsc --noEmit -p tsconfig.json",
52
+ "test": "bun test",
53
+ "check": "bun run lint && bun run test && bun run build",
54
+ "changeset": "changeset",
55
+ "version": "changeset version",
56
+ "prepublishOnly": "bun run check"
57
+ },
58
+ "devDependencies": {
59
+ "@changesets/cli": "^2.29.6",
60
+ "@types/bun": "latest",
61
+ "typescript": "^5.8.3"
62
+ }
63
+ }