@pomade/core 0.0.12 → 0.1.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/dist/rpc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAA;AAGxC,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAA;AAG3E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAC,OAAO,EAAe,MAAM,cAAc,CAAA;AAElD,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,GAAG;IAAC,KAAK,EAAE,YAAY,CAAA;CAAC,CAAA;AAIpE,wBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,OAElC;AAED,qBAAa,GAAG;IAaL,MAAM,EAAE,OAAO;IAZxB,MAAM,CAAC,IAAI,SAAQ;IAEnB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,WAAW,EAAE,cAAc,EAAE,CAAK;IAClC,UAAU,kBAAwB;IAClC,QAAQ,0BAAgC;IAExC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,EAAO;gBAK9C,MAAM,EAAE,OAAO,EACtB,MAAM,GAAE,MAAM,EAAO;IAOjB,aAAa;IAwBb,eAAe;IAYf,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAS7D,MAAM,CAAC,KAAK,EAAE,YAAY;IAUhC,SAAS,CAAC,OAAO,EAAE,cAAc;IAcjC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAI/C,OAAO,CAA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A;AAC7C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAA;AAEzC,qBAAa,GAAG;IAGK,MAAM,EAAE,OAAO;IAFlC,MAAM,CAAC,KAAK,eAAoC;gBAE7B,MAAM,EAAE,OAAO;IAElC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM;IAI1B,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAWtD,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAwBjG"}
package/dist/rpc.js CHANGED
@@ -1,199 +1,43 @@
1
- import { tryCatch, uniq, without, spec } from "@welshman/lib";
2
- import { publish, request, PublishStatus } from "@welshman/net";
3
- import { prep, makePow } from "@welshman/util";
1
+ import { prep, makePow, makeHttpAuth, makeHttpAuthHeader } from "@welshman/util";
4
2
  import { Nip01Signer } from "@welshman/signer";
5
- import { debug, fetchRelays, normalizeRelay } from "./util.js";
6
- import { parseMessage } from "./message.js";
7
- // Base RPC class
8
- export function rpc(signer) {
9
- return new RPC(signer);
10
- }
11
3
  export class RPC {
12
4
  signer;
13
- static Kind = 28350;
14
- relays;
15
- subscribers = [];
16
- controller = new AbortController();
17
- channels = new Map();
18
- static fromSecret(secret, relays = []) {
19
- return new RPC(Nip01Signer.fromSecret(secret), relays);
20
- }
21
- constructor(signer, relays = []) {
5
+ static fetch = globalThis.fetch.bind(globalThis);
6
+ constructor(signer) {
22
7
  this.signer = signer;
23
- this.relays = relays.map(normalizeRelay);
24
- this.publishRelays();
25
- this.listenForEvents();
26
- }
27
- async publishRelays() {
28
- if (this.relays.length > 0) {
29
- debug("[rpc.publishRelays]", this.relays);
30
- const pubkey = await this.signer.getPubkey();
31
- const event = await this.signer.sign(prep({
32
- kind: 10002,
33
- content: "",
34
- tags: this.relays.map(url => ["r", url]),
35
- }, pubkey));
36
- publish({
37
- event,
38
- relays: this.relays,
39
- signal: this.controller.signal,
40
- });
41
- }
42
8
  }
43
- async listenForEvents() {
44
- if (this.relays) {
45
- const pubkey = await this.signer.getPubkey();
46
- request({
47
- relays: this.relays,
48
- signal: this.controller.signal,
49
- filters: [{ kinds: [RPC.Kind], "#p": [pubkey] }],
50
- onEvent: (event) => this.notify(event),
9
+ static fromSecret(secret) {
10
+ return new RPC(Nip01Signer.fromSecret(secret));
11
+ }
12
+ async makeAuthHeader(url, body, pow) {
13
+ const template = await makeHttpAuth(url, "POST", body);
14
+ const prepped = prep(template, await this.signer.getPubkey());
15
+ const signed = pow
16
+ ? await this.signer.sign(await makePow(prepped, pow).result)
17
+ : await this.signer.sign(prepped);
18
+ return makeHttpAuthHeader(signed);
19
+ }
20
+ async post(signerUrl, path, body, pow) {
21
+ const requestUrl = `${signerUrl}${path}`;
22
+ const bodyStr = JSON.stringify(body);
23
+ try {
24
+ const authHeader = await this.makeAuthHeader(requestUrl, bodyStr, pow);
25
+ const response = await RPC.fetch(requestUrl, {
26
+ method: "POST",
27
+ headers: {
28
+ "Content-Type": "application/json",
29
+ Authorization: authHeader,
30
+ },
31
+ body: bodyStr,
51
32
  });
52
- }
53
- }
54
- async read(event) {
55
- const decrypted = await this.decrypt(event.pubkey, event.content);
56
- const result = tryCatch(() => parseMessage(decrypted));
57
- if (result) {
58
- return { ...result, event };
59
- }
60
- }
61
- async notify(event) {
62
- const message = await this.read(event);
63
- if (message) {
64
- for (const subscriber of this.subscribers) {
65
- subscriber(message);
66
- }
67
- }
68
- }
69
- subscribe(handler) {
70
- if (this.controller.signal.aborted) {
71
- throw new Error("Attempted to subscribe to an rpc interface that has been closed");
72
- }
73
- this.subscribers.push(handler);
74
- return () => this.subscribers.splice(this.subscribers.findIndex(s => s === handler), 1);
75
- }
76
- sign(event) {
77
- return this.signer.sign(event);
78
- }
79
- encrypt(peer, payload) {
80
- return this.signer.nip44.encrypt(peer, payload);
81
- }
82
- decrypt(peer, payload) {
83
- return this.signer.nip44.decrypt(peer, payload);
84
- }
85
- channel(peer, usePeerRelays = true) {
86
- let channel = this.channels.get(peer);
87
- if (!channel) {
88
- channel = new RPCChannel(this, peer, usePeerRelays);
89
- this.channels.set(peer, channel);
90
- }
91
- return channel;
92
- }
93
- stop() {
94
- for (const channel of this.channels.values()) {
95
- channel.stop();
96
- }
97
- this.channels.clear();
98
- this.controller.abort();
99
- this.subscribers = [];
100
- }
101
- }
102
- export class RPCChannel {
103
- rpc;
104
- peer;
105
- usePeerRelays;
106
- relays;
107
- controller = new AbortController();
108
- constructor(rpc, peer, usePeerRelays = true) {
109
- this.rpc = rpc;
110
- this.peer = peer;
111
- this.usePeerRelays = usePeerRelays;
112
- const { signal } = this.controller;
113
- this.relays = usePeerRelays ? fetchRelays(peer, signal) : Promise.resolve([]);
114
- Promise.all([this.relays, this.rpc.signer.getPubkey()]).then(([relays, pubkey]) => {
115
- if (!signal.aborted) {
116
- const uniqueRelays = without(this.rpc.relays, relays);
117
- if (uniqueRelays.length > 0) {
118
- request({
119
- signal,
120
- relays: uniqueRelays,
121
- filters: [{ kinds: [RPC.Kind], authors: [this.peer], "#p": [pubkey] }],
122
- onEvent: (event) => this.rpc.notify(event),
123
- });
124
- }
33
+ if (!response.ok) {
34
+ return { url: signerUrl };
125
35
  }
126
- });
127
- }
128
- subscribe(handler) {
129
- if (this.controller.signal.aborted) {
130
- throw new Error("Attempted to subscribe to a channel that has been closed");
36
+ return { url: signerUrl, res: (await response.json()) };
131
37
  }
132
- return this.rpc.subscribe(message => {
133
- if (message.event.pubkey === this.peer) {
134
- handler(message);
135
- }
136
- });
137
- }
138
- receive(handler) {
139
- return new Promise((resolve, reject) => {
140
- const unsubscribe = this.subscribe(async (message) => {
141
- try {
142
- handler(message, done);
143
- }
144
- catch (e) {
145
- reject(e);
146
- }
147
- });
148
- const done = (result) => {
149
- clearTimeout(timeout);
150
- resolve(result);
151
- unsubscribe();
152
- };
153
- const timeout = setTimeout(done, 30_000);
154
- });
155
- }
156
- async prep(message, pow) {
157
- const pubkey = await this.rpc.signer.getPubkey();
158
- const template = {
159
- kind: RPC.Kind,
160
- tags: [["p", this.peer]],
161
- content: await this.encrypt(JSON.stringify(message)),
162
- };
163
- const prepped = prep(template, pubkey);
164
- if (pow) {
165
- return this.rpc.sign(await makePow(prepped, pow).result);
38
+ catch {
39
+ return { url: signerUrl };
166
40
  }
167
- return this.rpc.sign(prepped);
168
- }
169
- encrypt(payload) {
170
- return this.rpc.encrypt(this.peer, payload);
171
- }
172
- decrypt(payload) {
173
- return this.rpc.decrypt(this.peer, payload);
174
- }
175
- send(message, pow) {
176
- const controller = new AbortController();
177
- const abort = () => controller.abort();
178
- const eventPromise = this.prep(message, pow);
179
- const relaysPromise = this.relays;
180
- const res = Promise.all([eventPromise, relaysPromise]).then(([event, relays]) => publish({
181
- event,
182
- relays: uniq([...relays, ...this.rpc.relays]),
183
- signal: AbortSignal.any([this.controller.signal, controller.signal]),
184
- }));
185
- const ok = res.then(r => {
186
- return Object.values(r).some(spec({ status: PublishStatus.Success }));
187
- });
188
- const receive = (handler) => eventPromise.then(event => this.receive((message, resolve) => {
189
- if (message.payload.prev === event.id) {
190
- handler(message, resolve);
191
- }
192
- }));
193
- return { abort, res, ok, receive };
194
- }
195
- stop() {
196
- this.controller.abort();
197
41
  }
198
42
  }
199
43
  //# sourceMappingURL=rpc.js.map
package/dist/rpc.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAC,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,M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AE,CAAA;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACpC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;YAEtE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE;gBAC3C,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,UAAU;iBAC1B;gBACD,IAAI,EAAE,OAAO;aACd,CAAC,CAAA;YAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,EAAC,GAAG,EAAE,SAAS,EAAC,CAAA;YACzB,CAAC;YAED,OAAO,EAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,EAAC,CAAA;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAC,GAAG,EAAE,SAAS,EAAC,CAAA;QACzB,CAAC;IACH,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -1,27 +1,4 @@
1
1
  import * as z from "zod";
2
- export declare enum Method {
3
- ChallengeRequest = "challenge/request",
4
- EcdhRequest = "ecdh/request",
5
- EcdhResult = "ecdh/result",
6
- LoginStart = "login/start",
7
- LoginOptions = "login/options",
8
- LoginSelect = "login/select",
9
- LoginResult = "login/result",
10
- RecoveryStart = "recovery/start",
11
- RecoveryOptions = "recovery/options",
12
- RecoverySelect = "recovery/select",
13
- RecoveryResult = "recovery/result",
14
- RecoverySetup = "recovery/setup",
15
- RecoverySetupResult = "recovery/setup/result",
16
- RegisterRequest = "register/request",
17
- RegisterResult = "register/result",
18
- SessionDelete = "session/delete",
19
- SessionDeleteResult = "session/delete/result",
20
- SessionList = "session/list",
21
- SessionListResult = "session/list/result",
22
- SignRequest = "sign/request",
23
- SignResult = "sign/result"
24
- }
25
2
  declare const sessionItem: z.ZodObject<{
26
3
  pubkey: z.ZodString;
27
4
  client: z.ZodString;
@@ -54,27 +31,82 @@ export type Auth = z.infer<typeof auth>;
54
31
  export declare const isPasswordAuth: (auth: Auth) => auth is PasswordAuth;
55
32
  export declare const isOTPAuth: (auth: Auth) => auth is OTPAuth;
56
33
  export declare const Schema: {
34
+ registerRequest: z.ZodObject<{
35
+ share: z.ZodObject<{
36
+ idx: z.ZodNumber;
37
+ binder_sn: z.ZodString;
38
+ hidden_sn: z.ZodString;
39
+ seckey: z.ZodString;
40
+ }, z.core.$strip>;
41
+ group: z.ZodObject<{
42
+ commits: z.ZodArray<z.ZodObject<{
43
+ idx: z.ZodNumber;
44
+ pubkey: z.ZodString;
45
+ hidden_pn: z.ZodString;
46
+ binder_pn: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ group_pk: z.ZodString;
49
+ threshold: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ recovery: z.ZodBoolean;
52
+ }, z.core.$strip>;
53
+ registerResponse: z.ZodObject<{
54
+ ok: z.ZodBoolean;
55
+ message: z.ZodString;
56
+ }, z.core.$strip>;
57
+ signRequest: z.ZodObject<{
58
+ request: z.ZodObject<{
59
+ content: z.ZodNullable<z.ZodString>;
60
+ hashes: z.ZodArray<z.ZodTuple<[z.ZodString], z.ZodString>>;
61
+ members: z.ZodArray<z.ZodNumber>;
62
+ stamp: z.ZodNumber;
63
+ type: z.ZodString;
64
+ gid: z.ZodString;
65
+ sid: z.ZodString;
66
+ }, z.core.$strip>;
67
+ }, z.core.$strip>;
68
+ signResponse: z.ZodObject<{
69
+ ok: z.ZodBoolean;
70
+ message: z.ZodString;
71
+ result: z.ZodOptional<z.ZodObject<{
72
+ idx: z.ZodNumber;
73
+ psigs: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
74
+ pubkey: z.ZodString;
75
+ sid: z.ZodString;
76
+ }, z.core.$strip>>;
77
+ }, z.core.$strip>;
57
78
  ecdhRequest: z.ZodObject<{
58
79
  idx: z.ZodNumber;
59
80
  members: z.ZodArray<z.ZodNumber>;
60
81
  ecdh_pk: z.ZodString;
61
82
  }, z.core.$strip>;
62
- ecdhResult: z.ZodObject<{
83
+ ecdhResponse: z.ZodObject<{
84
+ ok: z.ZodBoolean;
85
+ message: z.ZodString;
63
86
  result: z.ZodOptional<z.ZodObject<{
64
87
  idx: z.ZodNumber;
65
88
  keyshare: z.ZodString;
66
89
  members: z.ZodArray<z.ZodNumber>;
67
90
  ecdh_pk: z.ZodString;
68
91
  }, z.core.$strip>>;
92
+ }, z.core.$strip>;
93
+ recoverySetupRequest: z.ZodObject<{
94
+ email: z.ZodString;
95
+ password_hash: z.ZodString;
96
+ }, z.core.$strip>;
97
+ recoverySetupResponse: z.ZodObject<{
69
98
  ok: z.ZodBoolean;
70
99
  message: z.ZodString;
71
- prev: z.ZodString;
72
100
  }, z.core.$strip>;
73
101
  challengeRequest: z.ZodObject<{
74
102
  prefix: z.ZodString;
75
103
  email_hash: z.ZodString;
76
104
  }, z.core.$strip>;
77
- loginStart: z.ZodObject<{
105
+ challengeResponse: z.ZodObject<{
106
+ ok: z.ZodLiteral<true>;
107
+ message: z.ZodString;
108
+ }, z.core.$strip>;
109
+ loginStartRequest: z.ZodObject<{
78
110
  auth: z.ZodUnion<readonly [z.ZodObject<{
79
111
  email_hash: z.ZodString;
80
112
  password_hash: z.ZodString;
@@ -83,7 +115,9 @@ export declare const Schema: {
83
115
  otp: z.ZodString;
84
116
  }, z.core.$strip>]>;
85
117
  }, z.core.$strip>;
86
- loginOptions: z.ZodObject<{
118
+ loginStartResponse: z.ZodObject<{
119
+ ok: z.ZodBoolean;
120
+ message: z.ZodString;
87
121
  items: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
122
  pubkey: z.ZodString;
89
123
  client: z.ZodString;
@@ -94,14 +128,13 @@ export declare const Schema: {
94
128
  idx: z.ZodNumber;
95
129
  email: z.ZodOptional<z.ZodString>;
96
130
  }, z.core.$strip>>>;
97
- ok: z.ZodBoolean;
98
- message: z.ZodString;
99
- prev: z.ZodString;
100
131
  }, z.core.$strip>;
101
- loginSelect: z.ZodObject<{
132
+ loginSelectRequest: z.ZodObject<{
102
133
  client: z.ZodString;
103
134
  }, z.core.$strip>;
104
- loginResult: z.ZodObject<{
135
+ loginSelectResponse: z.ZodObject<{
136
+ ok: z.ZodBoolean;
137
+ message: z.ZodString;
105
138
  group: z.ZodOptional<z.ZodObject<{
106
139
  commits: z.ZodArray<z.ZodObject<{
107
140
  idx: z.ZodNumber;
@@ -112,11 +145,8 @@ export declare const Schema: {
112
145
  group_pk: z.ZodString;
113
146
  threshold: z.ZodNumber;
114
147
  }, z.core.$strip>>;
115
- ok: z.ZodBoolean;
116
- message: z.ZodString;
117
- prev: z.ZodString;
118
148
  }, z.core.$strip>;
119
- recoveryStart: z.ZodObject<{
149
+ recoveryStartRequest: z.ZodObject<{
120
150
  auth: z.ZodUnion<readonly [z.ZodObject<{
121
151
  email_hash: z.ZodString;
122
152
  password_hash: z.ZodString;
@@ -125,7 +155,9 @@ export declare const Schema: {
125
155
  otp: z.ZodString;
126
156
  }, z.core.$strip>]>;
127
157
  }, z.core.$strip>;
128
- recoveryOptions: z.ZodObject<{
158
+ recoveryStartResponse: z.ZodObject<{
159
+ ok: z.ZodBoolean;
160
+ message: z.ZodString;
129
161
  items: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
162
  pubkey: z.ZodString;
131
163
  client: z.ZodString;
@@ -136,14 +168,13 @@ export declare const Schema: {
136
168
  idx: z.ZodNumber;
137
169
  email: z.ZodOptional<z.ZodString>;
138
170
  }, z.core.$strip>>>;
139
- ok: z.ZodBoolean;
140
- message: z.ZodString;
141
- prev: z.ZodString;
142
171
  }, z.core.$strip>;
143
- recoverySelect: z.ZodObject<{
172
+ recoverySelectRequest: z.ZodObject<{
144
173
  client: z.ZodString;
145
174
  }, z.core.$strip>;
146
- recoveryResult: z.ZodObject<{
175
+ recoverySelectResponse: z.ZodObject<{
176
+ ok: z.ZodBoolean;
177
+ message: z.ZodString;
147
178
  share: z.ZodOptional<z.ZodObject<{
148
179
  idx: z.ZodNumber;
149
180
  binder_sn: z.ZodString;
@@ -160,72 +191,11 @@ export declare const Schema: {
160
191
  group_pk: z.ZodString;
161
192
  threshold: z.ZodNumber;
162
193
  }, z.core.$strip>>;
163
- ok: z.ZodBoolean;
164
- message: z.ZodString;
165
- prev: z.ZodString;
166
194
  }, z.core.$strip>;
167
- recoverySetup: z.ZodObject<{
168
- email: z.ZodString;
169
- password_hash: z.ZodString;
170
- }, z.core.$strip>;
171
- recoverySetupResult: z.ZodObject<{
195
+ sessionListRequest: z.ZodObject<{}, z.core.$strip>;
196
+ sessionListResponse: z.ZodObject<{
172
197
  ok: z.ZodBoolean;
173
198
  message: z.ZodString;
174
- prev: z.ZodString;
175
- }, z.core.$strip>;
176
- registerRequest: z.ZodObject<{
177
- share: z.ZodObject<{
178
- idx: z.ZodNumber;
179
- binder_sn: z.ZodString;
180
- hidden_sn: z.ZodString;
181
- seckey: z.ZodString;
182
- }, z.core.$strip>;
183
- group: z.ZodObject<{
184
- commits: z.ZodArray<z.ZodObject<{
185
- idx: z.ZodNumber;
186
- pubkey: z.ZodString;
187
- hidden_pn: z.ZodString;
188
- binder_pn: z.ZodString;
189
- }, z.core.$strip>>;
190
- group_pk: z.ZodString;
191
- threshold: z.ZodNumber;
192
- }, z.core.$strip>;
193
- recovery: z.ZodBoolean;
194
- }, z.core.$strip>;
195
- registerResult: z.ZodObject<{
196
- ok: z.ZodBoolean;
197
- message: z.ZodString;
198
- prev: z.ZodString;
199
- }, z.core.$strip>;
200
- sessionDelete: z.ZodObject<{
201
- client: z.ZodString;
202
- auth: z.ZodObject<{
203
- sig: z.ZodString;
204
- id: z.ZodString;
205
- pubkey: z.ZodString;
206
- kind: z.ZodInt;
207
- tags: z.ZodArray<z.ZodArray<z.ZodString>>;
208
- content: z.ZodString;
209
- created_at: z.ZodInt;
210
- }, z.core.$strip>;
211
- }, z.core.$strip>;
212
- sessionDeleteResult: z.ZodObject<{
213
- ok: z.ZodBoolean;
214
- message: z.ZodString;
215
- prev: z.ZodString;
216
- }, z.core.$strip>;
217
- sessionList: z.ZodObject<{
218
- auth: z.ZodObject<{
219
- sig: z.ZodString;
220
- id: z.ZodString;
221
- pubkey: z.ZodString;
222
- kind: z.ZodInt;
223
- tags: z.ZodArray<z.ZodArray<z.ZodString>>;
224
- content: z.ZodString;
225
- created_at: z.ZodInt;
226
- }, z.core.$strip>;
227
- }, z.core.$strip>;
228
- sessionListResult: z.ZodObject<{
229
199
  items: z.ZodArray<z.ZodObject<{
230
200
  pubkey: z.ZodString;
231
201
  client: z.ZodString;
@@ -236,31 +206,13 @@ export declare const Schema: {
236
206
  idx: z.ZodNumber;
237
207
  email: z.ZodOptional<z.ZodString>;
238
208
  }, z.core.$strip>>;
239
- ok: z.ZodBoolean;
240
- message: z.ZodString;
241
- prev: z.ZodString;
242
209
  }, z.core.$strip>;
243
- signRequest: z.ZodObject<{
244
- request: z.ZodObject<{
245
- content: z.ZodNullable<z.ZodString>;
246
- hashes: z.ZodArray<z.ZodTuple<[z.ZodString], z.ZodString>>;
247
- members: z.ZodArray<z.ZodNumber>;
248
- stamp: z.ZodNumber;
249
- type: z.ZodString;
250
- gid: z.ZodString;
251
- sid: z.ZodString;
252
- }, z.core.$strip>;
210
+ sessionDeleteRequest: z.ZodObject<{
211
+ client: z.ZodString;
253
212
  }, z.core.$strip>;
254
- signResult: z.ZodObject<{
255
- result: z.ZodOptional<z.ZodObject<{
256
- idx: z.ZodNumber;
257
- psigs: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
258
- pubkey: z.ZodString;
259
- sid: z.ZodString;
260
- }, z.core.$strip>>;
213
+ sessionDeleteResponse: z.ZodObject<{
261
214
  ok: z.ZodBoolean;
262
215
  message: z.ZodString;
263
- prev: z.ZodString;
264
216
  }, z.core.$strip>;
265
217
  };
266
218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