@didcid/keymaster 0.4.1 → 0.4.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.
@@ -1,5 +1,6 @@
1
- import { Cipher, EcdsaJwkPublic } from '@didcid/cipher/types';
2
- import { GatekeeperInterface, DidCidDocument, ResolveDIDOptions, Proof } from '@didcid/gatekeeper/types';
1
+ import { Cipher, EcdsaJwkPublic, NostrKeys, NostrEvent } from '@didcid/cipher/types';
2
+ import { GatekeeperInterface, DidCidDocument, ResolveDIDOptions, Proof, LightningConfig, LightningBalance, LightningInvoice, LightningPayment, LightningPaymentRecord, LightningPaymentStatus } from '@didcid/gatekeeper/types';
3
+ export type { NostrKeys, NostrEvent } from '@didcid/cipher/types';
3
4
  export interface Seed {
4
5
  /** Passphrase-encrypted mnemonic */
5
6
  mnemonicEnc?: {
@@ -60,6 +61,10 @@ export interface Group {
60
61
  name: string;
61
62
  members: string[];
62
63
  }
64
+ export interface GroupData {
65
+ version: 2;
66
+ members: string[];
67
+ }
63
68
  export interface CredentialSchema {
64
69
  id: string;
65
70
  type: "JsonSchema";
@@ -193,6 +198,16 @@ export interface WalletBase {
193
198
  loadWallet(): Promise<StoredWallet | null>;
194
199
  updateWallet(mutator: (wallet: StoredWallet) => void | Promise<void>): Promise<void>;
195
200
  }
201
+ export type { LightningConfig, LightningBalance, LightningInvoice, LightningPayment, LightningPaymentRecord, LightningPaymentStatus, } from '@didcid/gatekeeper/types';
202
+ export interface DecodedLightningInvoice {
203
+ amount?: string;
204
+ description?: string;
205
+ created?: string;
206
+ expiry?: string;
207
+ expires?: string;
208
+ payment_hash?: string;
209
+ network?: string;
210
+ }
196
211
  export interface KeymasterOptions {
197
212
  passphrase: string;
198
213
  gatekeeper: GatekeeperInterface;
@@ -213,6 +228,7 @@ export interface PossiblyProofed {
213
228
  }
214
229
  export interface RestClientOptions {
215
230
  url?: string;
231
+ apiKey?: string;
216
232
  console?: any;
217
233
  waitUntilReady?: boolean;
218
234
  intervalSeconds?: number;
@@ -274,6 +290,21 @@ export interface KeymasterInterface {
274
290
  addAlias(alias: string, did: string): Promise<boolean>;
275
291
  getAlias(alias: string): Promise<string | null>;
276
292
  removeAlias(alias: string): Promise<boolean>;
293
+ addNostr(id?: string): Promise<NostrKeys>;
294
+ removeNostr(id?: string): Promise<boolean>;
295
+ exportNsec(id?: string): Promise<string>;
296
+ signNostrEvent(event: NostrEvent): Promise<NostrEvent>;
297
+ addLightning(id?: string): Promise<LightningConfig>;
298
+ removeLightning(id?: string): Promise<boolean>;
299
+ getLightningBalance(id?: string): Promise<LightningBalance>;
300
+ createLightningInvoice(amount: number, memo: string, id?: string): Promise<LightningInvoice>;
301
+ payLightningInvoice(bolt11: string, id?: string): Promise<LightningPayment>;
302
+ checkLightningPayment(paymentHash: string, id?: string): Promise<LightningPaymentStatus>;
303
+ decodeLightningInvoice(bolt11: string): Promise<DecodedLightningInvoice>;
304
+ publishLightning(name?: string): Promise<boolean>;
305
+ unpublishLightning(name?: string): Promise<boolean>;
306
+ zapLightning(id: string, amount: number, memo?: string, name?: string): Promise<LightningPayment>;
307
+ getLightningPayments(name?: string): Promise<LightningPaymentRecord[]>;
277
308
  resolveDID(did: string, options?: ResolveDIDOptions): Promise<DidCidDocument>;
278
309
  updateDID(id: string, doc: DidCidDocument): Promise<boolean>;
279
310
  createAsset(data: unknown, options?: CreateAssetOptions): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didcid/keymaster",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Archon Keymaster",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -141,15 +141,16 @@
141
141
  "author": "David McFadzean <davidmc@gmail.com>",
142
142
  "license": "MIT",
143
143
  "dependencies": {
144
- "@didcid/cipher": "^0.2.1",
145
- "@didcid/common": "^0.1.3",
146
- "@didcid/gatekeeper": "^0.4.1",
144
+ "@didcid/cipher": "^0.2.3",
145
+ "@didcid/common": "^0.1.5",
146
+ "@didcid/gatekeeper": "^0.4.3",
147
147
  "axios": "^1.7.7",
148
148
  "commander": "^11.1.0",
149
149
  "dotenv": "^16.4.5",
150
150
  "file-type": "^21.0.0",
151
151
  "image-size": "^2.0.1",
152
152
  "ioredis": "^5.4.1",
153
+ "light-bolt11-decoder": "^3.2.0",
153
154
  "mongodb": "^6.5.0",
154
155
  "sqlite": "^5.1.1",
155
156
  "sqlite3": "^5.1.7"
@@ -158,5 +159,5 @@
158
159
  "type": "git",
159
160
  "url": "git+https://github.com/archetech/archon.git"
160
161
  },
161
- "gitHead": "40bac9cb578004fc32d9c937c68da9179210ec23"
162
+ "gitHead": "31451ebef086804bbf65c99e08cb77b4b87a2923"
162
163
  }