divine-signer 0.1.0 → 0.3.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/README.md CHANGED
@@ -10,7 +10,7 @@ A headless Nostr signer library that gives web apps five authentication paths th
10
10
  | **NIP-07 extension** | `ExtensionSigner` | Delegates to browser extensions (Alby, nos2x, Soapbox Signer). Keys never leave the extension. |
11
11
  | **NIP-46 bunker** | `BunkerNIP44Signer` | Connects to a remote signer via `bunker://` URL over WebSocket relays. |
12
12
  | **NIP-46 nostrconnect** | `BunkerNIP44Signer` | QR code flow — user scans with a mobile signer app (Amber, Primal, nsec.app). |
13
- | **diVine OAuth** | `KeycastHttpSigner` | Email/password login via [diVine](https://divine.video). Signs over HTTP with PKCE, token refresh, and rate-limit retry. |
13
+ | **OAuth** | `OAuthSigner` | OAuth login (e.g. [diVine](https://divine.video)). Signs over HTTP with PKCE, token refresh, and rate-limit retry. |
14
14
 
15
15
  All five implement `NostrSigner`:
16
16
 
@@ -111,7 +111,7 @@ const { signer, accessToken, refreshToken } = await exchangeCode(
111
111
  params.get('state')!,
112
112
  oauthConfig,
113
113
  );
114
- // signer is a KeycastHttpSigner — use it like any other NostrSigner
114
+ // signer is a OAuthSigner — use it like any other NostrSigner
115
115
  ```
116
116
 
117
117
  ### Session persistence
@@ -125,7 +125,7 @@ import { createSessionStore, restoreSession } from 'divine-signer';
125
125
  const sessions = createSessionStore(localStorage, 'my_app');
126
126
 
127
127
  // After login, save the session
128
- sessions.save({ type: 'keycast', accessToken, refreshToken });
128
+ sessions.save({ type: 'oauth', accessToken, refreshToken });
129
129
  // or: sessions.save({ type: 'extension' });
130
130
  // or: sessions.save({ type: 'bunker', bunkerUrl: '...' });
131
131
  // or: sessions.save({ type: 'nsec', nsec: '...' });
@@ -138,16 +138,16 @@ if (stored) {
138
138
  }
139
139
  ```
140
140
 
141
- ### Token refresh (Keycast)
141
+ ### Token refresh (OAuth)
142
142
 
143
- The `KeycastHttpSigner` handles token refresh automatically. Hook into it to persist new tokens:
143
+ The `OAuthSigner` handles token refresh automatically. Hook into it to persist new tokens:
144
144
 
145
145
  ```typescript
146
- import { KeycastHttpSigner } from 'divine-signer';
146
+ import { OAuthSigner } from 'divine-signer';
147
147
 
148
- if (signer instanceof KeycastHttpSigner) {
148
+ if (signer instanceof OAuthSigner) {
149
149
  signer.onTokenRefresh = ({ accessToken, refreshToken }) => {
150
- sessions.save({ type: 'keycast', accessToken, refreshToken });
150
+ sessions.save({ type: 'oauth', accessToken, refreshToken });
151
151
  };
152
152
  }
153
153
  ```
@@ -161,8 +161,8 @@ if (signer instanceof KeycastHttpSigner) {
161
161
  - `BunkerNIP44Signer.fromBunkerUrl(input, params?, overrideType?, timeout?)` — connect via bunker URL
162
162
  - `BunkerNIP44Signer.reconnect(clientSecretKey, bunkerUrl, params?, timeout?)` — restore a bunker session
163
163
  - `BunkerNIP44Signer.fromNostrConnect(uri, clientSecretKey, params?, timeoutOrAbort?)` — QR code connect flow
164
- - `KeycastHttpSigner(token, options?)` — HTTP signing via Keycast API
165
- - `KeycastAuthError` — thrown on 401/403 (check `error.status`)
164
+ - `OAuthSigner(token, options?)` — HTTP signing via OAuth API
165
+ - `OAuthError` — thrown on 401/403 (check `error.status`)
166
166
 
167
167
  ### OAuth
168
168
 
@@ -177,7 +177,7 @@ if (signer instanceof KeycastHttpSigner) {
177
177
  ### Types
178
178
 
179
179
  - `NostrSigner` — the signer interface all methods implement
180
- - `SignerType` — `'nsec' | 'extension' | 'bunker' | 'nostrconnect' | 'keycast'`
180
+ - `SignerType` — `'nsec' | 'extension' | 'bunker' | 'nostrconnect' | 'oauth'`
181
181
  - `StoredSession` — discriminated union of all persistable session shapes
182
182
  - `OAuthStorage` — interface for PKCE state persistence
183
183
  - `OAuthConfig` — `{ clientId, redirectUri, apiUrl?, scope?, storage, fetchImpl? }`
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export type { NostrSigner, SignerType } from './types';
2
2
  export type { StoredSession, SessionStore, SessionStorage } from './session';
3
3
  export type { OAuthStorage, OAuthConfig, OAuthResult } from './oauth';
4
- export type { TokenRefreshResult } from './keycast-http-signer';
4
+ export type { TokenRefreshResult } from './oauth-signer';
5
5
  export { NsecSigner } from './nsec-signer';
6
6
  export { ExtensionSigner } from './extension-signer';
7
7
  export { BunkerNIP44Signer } from './bunker-signer';
8
- export { KeycastHttpSigner, KeycastAuthError } from './keycast-http-signer';
8
+ export { OAuthSigner, OAuthError } from './oauth-signer';
9
9
  export { createSessionStore, restoreSession } from './session';
10
10
  export { buildOAuthUrl, exchangeCode } from './oauth';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG/D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG/D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -227,26 +227,26 @@ var BunkerNIP44Signer = class _BunkerNIP44Signer {
227
227
  }
228
228
  };
229
229
 
230
- // src/keycast-http-signer.ts
230
+ // src/oauth-signer.ts
231
231
  import { verifyEvent } from "nostr-tools/pure";
232
- var DEFAULT_KEYCAST_API = "https://login.divine.video";
233
- var KeycastAuthError = class extends Error {
232
+ var DEFAULT_OAUTH_API = "https://login.divine.video";
233
+ var OAuthError = class extends Error {
234
234
  constructor(status) {
235
- super(`Keycast auth failed: HTTP ${status}`);
236
- this.name = "KeycastAuthError";
235
+ super(`OAuth signer auth failed: HTTP ${status}`);
236
+ this.name = "OAuthError";
237
237
  this.status = status;
238
238
  }
239
239
  };
240
- var KeycastHttpSigner = class {
240
+ var OAuthSigner = class {
241
241
  constructor(token, options) {
242
- this.type = "keycast";
242
+ this.type = "oauth";
243
243
  this.cachedPubkey = null;
244
244
  this.refreshPromise = null;
245
245
  this.onTokenRefresh = null;
246
246
  this.token = token;
247
247
  this.refreshToken = options?.refreshToken ?? null;
248
248
  this.clientId = options?.clientId ?? "privdm";
249
- this.apiUrl = options?.apiUrl ?? DEFAULT_KEYCAST_API;
249
+ this.apiUrl = options?.apiUrl ?? DEFAULT_OAUTH_API;
250
250
  this.fetchImpl = options?.fetchImpl ?? ((...args) => fetch(...args));
251
251
  }
252
252
  async tryRefreshToken() {
@@ -260,7 +260,7 @@ var KeycastHttpSigner = class {
260
260
  await this.refreshPromise;
261
261
  return true;
262
262
  } catch (e) {
263
- console.warn("[keycast] Token refresh failed:", e);
263
+ console.warn("[oauth-signer] Token refresh failed:", e);
264
264
  return false;
265
265
  } finally {
266
266
  this.refreshPromise = null;
@@ -279,7 +279,7 @@ var KeycastHttpSigner = class {
279
279
  });
280
280
  if (!res.ok) {
281
281
  this.refreshToken = null;
282
- throw new KeycastAuthError(res.status);
282
+ throw new OAuthError(res.status);
283
283
  }
284
284
  const data = await res.json();
285
285
  if (!data.access_token) throw new Error("No access_token in refresh response");
@@ -307,7 +307,7 @@ var KeycastHttpSigner = class {
307
307
  const retryAfter = res.headers.get("Retry-After");
308
308
  const delay = retryAfter ? parseInt(retryAfter, 10) * 1e3 : 1e3 * 2 ** attempt;
309
309
  console.warn(
310
- `[keycast] Rate limited on ${method}, retrying in ${delay}ms (attempt ${attempt + 1}/${maxRetries})` + (retryAfter ? `, Retry-After: ${retryAfter}s` : "")
310
+ `[oauth-signer] Rate limited on ${method}, retrying in ${delay}ms (attempt ${attempt + 1}/${maxRetries})` + (retryAfter ? `, Retry-After: ${retryAfter}s` : "")
311
311
  );
312
312
  await new Promise((r) => setTimeout(r, delay));
313
313
  continue;
@@ -315,17 +315,17 @@ var KeycastHttpSigner = class {
315
315
  if ((res.status === 401 || res.status === 403) && attempt === 0) {
316
316
  const refreshed = await this.tryRefreshToken();
317
317
  if (refreshed) continue;
318
- throw new KeycastAuthError(res.status);
318
+ throw new OAuthError(res.status);
319
319
  }
320
320
  if (!res.ok) {
321
321
  if (res.status === 401 || res.status === 403) {
322
- throw new KeycastAuthError(res.status);
322
+ throw new OAuthError(res.status);
323
323
  }
324
- throw new Error(`Keycast RPC failed: HTTP ${res.status}`);
324
+ throw new Error(`OAuth signer RPC failed: HTTP ${res.status}`);
325
325
  }
326
326
  const data = await res.json();
327
327
  if (data.error) {
328
- throw new Error(`Keycast RPC error: ${data.error}`);
328
+ throw new Error(`OAuth signer RPC error: ${data.error}`);
329
329
  }
330
330
  return data.result;
331
331
  }
@@ -342,7 +342,7 @@ var KeycastHttpSigner = class {
342
342
  const result = await this.rpc("sign_event", [JSON.stringify(unsigned)]);
343
343
  const signed = typeof result === "string" ? JSON.parse(result) : result;
344
344
  if (!verifyEvent(signed)) {
345
- throw new Error("Keycast returned an invalid signed event");
345
+ throw new Error("OAuth signer returned an invalid signed event");
346
346
  }
347
347
  return signed;
348
348
  }
@@ -376,10 +376,10 @@ function createSessionStore(storage, prefix) {
376
376
  if (!parsed || typeof parsed !== "object") return null;
377
377
  const obj = parsed;
378
378
  switch (obj.type) {
379
- case "keycast":
379
+ case "oauth":
380
380
  if (typeof obj.accessToken === "string") {
381
381
  return {
382
- type: "keycast",
382
+ type: "oauth",
383
383
  accessToken: obj.accessToken,
384
384
  ...typeof obj.refreshToken === "string" ? { refreshToken: obj.refreshToken } : {}
385
385
  };
@@ -416,8 +416,8 @@ function createSessionStore(storage, prefix) {
416
416
  }
417
417
  async function restoreSession(session) {
418
418
  switch (session.type) {
419
- case "keycast":
420
- return new KeycastHttpSigner(session.accessToken, {
419
+ case "oauth":
420
+ return new OAuthSigner(session.accessToken, {
421
421
  refreshToken: session.refreshToken
422
422
  });
423
423
  case "extension":
@@ -511,7 +511,7 @@ async function exchangeCode(code, state, config) {
511
511
  config.storage.saveAuthorizationHandle(data.authorization_handle);
512
512
  }
513
513
  return {
514
- signer: new KeycastHttpSigner(data.access_token, {
514
+ signer: new OAuthSigner(data.access_token, {
515
515
  refreshToken: data.refresh_token,
516
516
  clientId: config.clientId,
517
517
  apiUrl
@@ -523,9 +523,9 @@ async function exchangeCode(code, state, config) {
523
523
  export {
524
524
  BunkerNIP44Signer,
525
525
  ExtensionSigner,
526
- KeycastAuthError,
527
- KeycastHttpSigner,
528
526
  NsecSigner,
527
+ OAuthError,
528
+ OAuthSigner,
529
529
  buildOAuthUrl,
530
530
  createSessionStore,
531
531
  exchangeCode,
@@ -1,7 +1,7 @@
1
1
  import type { EventTemplate, VerifiedEvent } from 'nostr-tools/pure';
2
2
  import type { NostrSigner, SignerType } from './types';
3
- export declare const DEFAULT_KEYCAST_API = "https://login.divine.video";
4
- export declare class KeycastAuthError extends Error {
3
+ export declare const DEFAULT_OAUTH_API = "https://login.divine.video";
4
+ export declare class OAuthError extends Error {
5
5
  readonly status: number;
6
6
  constructor(status: number);
7
7
  }
@@ -9,7 +9,7 @@ export interface TokenRefreshResult {
9
9
  accessToken: string;
10
10
  refreshToken: string;
11
11
  }
12
- export declare class KeycastHttpSigner implements NostrSigner {
12
+ export declare class OAuthSigner implements NostrSigner {
13
13
  readonly type: SignerType;
14
14
  private token;
15
15
  private refreshToken;
@@ -35,4 +35,4 @@ export declare class KeycastHttpSigner implements NostrSigner {
35
35
  nip44Encrypt(pubkey: string, plaintext: string): Promise<string>;
36
36
  nip44Decrypt(pubkey: string, ciphertext: string): Promise<string>;
37
37
  }
38
- //# sourceMappingURL=keycast-http-signer.d.ts.map
38
+ //# sourceMappingURL=oauth-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-signer.d.ts","sourceRoot":"","sources":["../src/oauth-signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBACZ,MAAM,EAAE,MAAM;CAK3B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAA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 @@
1
1
  import type { NostrSigner } from './types';
2
2
  export type StoredSession = {
3
- type: 'keycast';
3
+ type: 'oauth';
4
4
  accessToken: string;
5
5
  refreshToken?: string;
6
6
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,IAAI,IAAI,aAAa,GAAG,IAAI,CAAC;IAC7B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAuDxF;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAkBjF"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,IAAI,IAAI,aAAa,GAAG,IAAI,CAAC;IAC7B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAuDxF;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAkBjF"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { EventTemplate, VerifiedEvent } from 'nostr-tools/pure';
2
- export type SignerType = 'nsec' | 'extension' | 'bunker' | 'nostrconnect' | 'keycast';
2
+ export type SignerType = 'nsec' | 'extension' | 'bunker' | 'nostrconnect' | 'oauth';
3
3
  export interface NostrSigner {
4
4
  type: SignerType;
5
5
  getPublicKey(): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAC;AAEtF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAErE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,OAAO,CAAC;AAEpF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "divine-signer",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"file":"keycast-http-signer.d.ts","sourceRoot":"","sources":["../src/keycast-http-signer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBACZ,MAAM,EAAE,MAAM;CAK3B;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,EAAE,UAAU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