@buildonspark/issuer-sdk 0.0.59 → 0.0.60

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/src/proto/mock.ts DELETED
@@ -1,431 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.6.1
4
- // protoc v5.29.3
5
- // source: mock.proto
6
-
7
- /* eslint-disable */
8
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
- import { type CallContext, type CallOptions } from "nice-grpc-common";
10
- import { Empty } from "./google/protobuf/empty.js";
11
-
12
- export const protobufPackage = "mock";
13
-
14
- export interface CleanUpPreimageShareRequest {
15
- paymentHash: Uint8Array;
16
- }
17
-
18
- export interface InterruptTransferRequest {
19
- action: InterruptTransferRequest_InterruptTransferAction;
20
- }
21
-
22
- export enum InterruptTransferRequest_InterruptTransferAction {
23
- NONE = 0,
24
- INTERRUPT = 1,
25
- RESUME = 2,
26
- UNRECOGNIZED = -1,
27
- }
28
-
29
- export function interruptTransferRequest_InterruptTransferActionFromJSON(
30
- object: any,
31
- ): InterruptTransferRequest_InterruptTransferAction {
32
- switch (object) {
33
- case 0:
34
- case "NONE":
35
- return InterruptTransferRequest_InterruptTransferAction.NONE;
36
- case 1:
37
- case "INTERRUPT":
38
- return InterruptTransferRequest_InterruptTransferAction.INTERRUPT;
39
- case 2:
40
- case "RESUME":
41
- return InterruptTransferRequest_InterruptTransferAction.RESUME;
42
- case -1:
43
- case "UNRECOGNIZED":
44
- default:
45
- return InterruptTransferRequest_InterruptTransferAction.UNRECOGNIZED;
46
- }
47
- }
48
-
49
- export function interruptTransferRequest_InterruptTransferActionToJSON(
50
- object: InterruptTransferRequest_InterruptTransferAction,
51
- ): string {
52
- switch (object) {
53
- case InterruptTransferRequest_InterruptTransferAction.NONE:
54
- return "NONE";
55
- case InterruptTransferRequest_InterruptTransferAction.INTERRUPT:
56
- return "INTERRUPT";
57
- case InterruptTransferRequest_InterruptTransferAction.RESUME:
58
- return "RESUME";
59
- case InterruptTransferRequest_InterruptTransferAction.UNRECOGNIZED:
60
- default:
61
- return "UNRECOGNIZED";
62
- }
63
- }
64
-
65
- export interface UpdateNodesStatusRequest {
66
- nodeIds: string[];
67
- status: string;
68
- }
69
-
70
- function createBaseCleanUpPreimageShareRequest(): CleanUpPreimageShareRequest {
71
- return { paymentHash: new Uint8Array(0) };
72
- }
73
-
74
- export const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest> =
75
- {
76
- encode(
77
- message: CleanUpPreimageShareRequest,
78
- writer: BinaryWriter = new BinaryWriter(),
79
- ): BinaryWriter {
80
- if (message.paymentHash.length !== 0) {
81
- writer.uint32(10).bytes(message.paymentHash);
82
- }
83
- return writer;
84
- },
85
-
86
- decode(
87
- input: BinaryReader | Uint8Array,
88
- length?: number,
89
- ): CleanUpPreimageShareRequest {
90
- const reader =
91
- input instanceof BinaryReader ? input : new BinaryReader(input);
92
- let end = length === undefined ? reader.len : reader.pos + length;
93
- const message = createBaseCleanUpPreimageShareRequest();
94
- while (reader.pos < end) {
95
- const tag = reader.uint32();
96
- switch (tag >>> 3) {
97
- case 1: {
98
- if (tag !== 10) {
99
- break;
100
- }
101
-
102
- message.paymentHash = reader.bytes();
103
- continue;
104
- }
105
- }
106
- if ((tag & 7) === 4 || tag === 0) {
107
- break;
108
- }
109
- reader.skip(tag & 7);
110
- }
111
- return message;
112
- },
113
-
114
- fromJSON(object: any): CleanUpPreimageShareRequest {
115
- return {
116
- paymentHash: isSet(object.paymentHash)
117
- ? bytesFromBase64(object.paymentHash)
118
- : new Uint8Array(0),
119
- };
120
- },
121
-
122
- toJSON(message: CleanUpPreimageShareRequest): unknown {
123
- const obj: any = {};
124
- if (message.paymentHash.length !== 0) {
125
- obj.paymentHash = base64FromBytes(message.paymentHash);
126
- }
127
- return obj;
128
- },
129
-
130
- create(
131
- base?: DeepPartial<CleanUpPreimageShareRequest>,
132
- ): CleanUpPreimageShareRequest {
133
- return CleanUpPreimageShareRequest.fromPartial(base ?? {});
134
- },
135
- fromPartial(
136
- object: DeepPartial<CleanUpPreimageShareRequest>,
137
- ): CleanUpPreimageShareRequest {
138
- const message = createBaseCleanUpPreimageShareRequest();
139
- message.paymentHash = object.paymentHash ?? new Uint8Array(0);
140
- return message;
141
- },
142
- };
143
-
144
- function createBaseInterruptTransferRequest(): InterruptTransferRequest {
145
- return { action: 0 };
146
- }
147
-
148
- export const InterruptTransferRequest: MessageFns<InterruptTransferRequest> = {
149
- encode(
150
- message: InterruptTransferRequest,
151
- writer: BinaryWriter = new BinaryWriter(),
152
- ): BinaryWriter {
153
- if (message.action !== 0) {
154
- writer.uint32(8).int32(message.action);
155
- }
156
- return writer;
157
- },
158
-
159
- decode(
160
- input: BinaryReader | Uint8Array,
161
- length?: number,
162
- ): InterruptTransferRequest {
163
- const reader =
164
- input instanceof BinaryReader ? input : new BinaryReader(input);
165
- let end = length === undefined ? reader.len : reader.pos + length;
166
- const message = createBaseInterruptTransferRequest();
167
- while (reader.pos < end) {
168
- const tag = reader.uint32();
169
- switch (tag >>> 3) {
170
- case 1: {
171
- if (tag !== 8) {
172
- break;
173
- }
174
-
175
- message.action = reader.int32() as any;
176
- continue;
177
- }
178
- }
179
- if ((tag & 7) === 4 || tag === 0) {
180
- break;
181
- }
182
- reader.skip(tag & 7);
183
- }
184
- return message;
185
- },
186
-
187
- fromJSON(object: any): InterruptTransferRequest {
188
- return {
189
- action: isSet(object.action)
190
- ? interruptTransferRequest_InterruptTransferActionFromJSON(
191
- object.action,
192
- )
193
- : 0,
194
- };
195
- },
196
-
197
- toJSON(message: InterruptTransferRequest): unknown {
198
- const obj: any = {};
199
- if (message.action !== 0) {
200
- obj.action = interruptTransferRequest_InterruptTransferActionToJSON(
201
- message.action,
202
- );
203
- }
204
- return obj;
205
- },
206
-
207
- create(
208
- base?: DeepPartial<InterruptTransferRequest>,
209
- ): InterruptTransferRequest {
210
- return InterruptTransferRequest.fromPartial(base ?? {});
211
- },
212
- fromPartial(
213
- object: DeepPartial<InterruptTransferRequest>,
214
- ): InterruptTransferRequest {
215
- const message = createBaseInterruptTransferRequest();
216
- message.action = object.action ?? 0;
217
- return message;
218
- },
219
- };
220
-
221
- function createBaseUpdateNodesStatusRequest(): UpdateNodesStatusRequest {
222
- return { nodeIds: [], status: "" };
223
- }
224
-
225
- export const UpdateNodesStatusRequest: MessageFns<UpdateNodesStatusRequest> = {
226
- encode(
227
- message: UpdateNodesStatusRequest,
228
- writer: BinaryWriter = new BinaryWriter(),
229
- ): BinaryWriter {
230
- for (const v of message.nodeIds) {
231
- writer.uint32(10).string(v!);
232
- }
233
- if (message.status !== "") {
234
- writer.uint32(18).string(message.status);
235
- }
236
- return writer;
237
- },
238
-
239
- decode(
240
- input: BinaryReader | Uint8Array,
241
- length?: number,
242
- ): UpdateNodesStatusRequest {
243
- const reader =
244
- input instanceof BinaryReader ? input : new BinaryReader(input);
245
- let end = length === undefined ? reader.len : reader.pos + length;
246
- const message = createBaseUpdateNodesStatusRequest();
247
- while (reader.pos < end) {
248
- const tag = reader.uint32();
249
- switch (tag >>> 3) {
250
- case 1: {
251
- if (tag !== 10) {
252
- break;
253
- }
254
-
255
- message.nodeIds.push(reader.string());
256
- continue;
257
- }
258
- case 2: {
259
- if (tag !== 18) {
260
- break;
261
- }
262
-
263
- message.status = reader.string();
264
- continue;
265
- }
266
- }
267
- if ((tag & 7) === 4 || tag === 0) {
268
- break;
269
- }
270
- reader.skip(tag & 7);
271
- }
272
- return message;
273
- },
274
-
275
- fromJSON(object: any): UpdateNodesStatusRequest {
276
- return {
277
- nodeIds: globalThis.Array.isArray(object?.nodeIds)
278
- ? object.nodeIds.map((e: any) => globalThis.String(e))
279
- : [],
280
- status: isSet(object.status) ? globalThis.String(object.status) : "",
281
- };
282
- },
283
-
284
- toJSON(message: UpdateNodesStatusRequest): unknown {
285
- const obj: any = {};
286
- if (message.nodeIds?.length) {
287
- obj.nodeIds = message.nodeIds;
288
- }
289
- if (message.status !== "") {
290
- obj.status = message.status;
291
- }
292
- return obj;
293
- },
294
-
295
- create(
296
- base?: DeepPartial<UpdateNodesStatusRequest>,
297
- ): UpdateNodesStatusRequest {
298
- return UpdateNodesStatusRequest.fromPartial(base ?? {});
299
- },
300
- fromPartial(
301
- object: DeepPartial<UpdateNodesStatusRequest>,
302
- ): UpdateNodesStatusRequest {
303
- const message = createBaseUpdateNodesStatusRequest();
304
- message.nodeIds = object.nodeIds?.map((e) => e) || [];
305
- message.status = object.status ?? "";
306
- return message;
307
- },
308
- };
309
-
310
- export type MockServiceDefinition = typeof MockServiceDefinition;
311
- export const MockServiceDefinition = {
312
- name: "MockService",
313
- fullName: "mock.MockService",
314
- methods: {
315
- clean_up_preimage_share: {
316
- name: "clean_up_preimage_share",
317
- requestType: CleanUpPreimageShareRequest,
318
- requestStream: false,
319
- responseType: Empty,
320
- responseStream: false,
321
- options: {},
322
- },
323
- interrupt_transfer: {
324
- name: "interrupt_transfer",
325
- requestType: InterruptTransferRequest,
326
- requestStream: false,
327
- responseType: Empty,
328
- responseStream: false,
329
- options: {},
330
- },
331
- update_nodes_status: {
332
- name: "update_nodes_status",
333
- requestType: UpdateNodesStatusRequest,
334
- requestStream: false,
335
- responseType: Empty,
336
- responseStream: false,
337
- options: {},
338
- },
339
- },
340
- } as const;
341
-
342
- export interface MockServiceImplementation<CallContextExt = {}> {
343
- clean_up_preimage_share(
344
- request: CleanUpPreimageShareRequest,
345
- context: CallContext & CallContextExt,
346
- ): Promise<DeepPartial<Empty>>;
347
- interrupt_transfer(
348
- request: InterruptTransferRequest,
349
- context: CallContext & CallContextExt,
350
- ): Promise<DeepPartial<Empty>>;
351
- update_nodes_status(
352
- request: UpdateNodesStatusRequest,
353
- context: CallContext & CallContextExt,
354
- ): Promise<DeepPartial<Empty>>;
355
- }
356
-
357
- export interface MockServiceClient<CallOptionsExt = {}> {
358
- clean_up_preimage_share(
359
- request: DeepPartial<CleanUpPreimageShareRequest>,
360
- options?: CallOptions & CallOptionsExt,
361
- ): Promise<Empty>;
362
- interrupt_transfer(
363
- request: DeepPartial<InterruptTransferRequest>,
364
- options?: CallOptions & CallOptionsExt,
365
- ): Promise<Empty>;
366
- update_nodes_status(
367
- request: DeepPartial<UpdateNodesStatusRequest>,
368
- options?: CallOptions & CallOptionsExt,
369
- ): Promise<Empty>;
370
- }
371
-
372
- function bytesFromBase64(b64: string): Uint8Array {
373
- if ((globalThis as any).Buffer) {
374
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
375
- } else {
376
- const bin = globalThis.atob(b64);
377
- const arr = new Uint8Array(bin.length);
378
- for (let i = 0; i < bin.length; ++i) {
379
- arr[i] = bin.charCodeAt(i);
380
- }
381
- return arr;
382
- }
383
- }
384
-
385
- function base64FromBytes(arr: Uint8Array): string {
386
- if ((globalThis as any).Buffer) {
387
- return globalThis.Buffer.from(arr).toString("base64");
388
- } else {
389
- const bin: string[] = [];
390
- arr.forEach((byte) => {
391
- bin.push(globalThis.String.fromCharCode(byte));
392
- });
393
- return globalThis.btoa(bin.join(""));
394
- }
395
- }
396
-
397
- type Builtin =
398
- | Date
399
- | Function
400
- | Uint8Array
401
- | string
402
- | number
403
- | boolean
404
- | undefined;
405
-
406
- export type DeepPartial<T> = T extends Builtin
407
- ? T
408
- : T extends globalThis.Array<infer U>
409
- ? globalThis.Array<DeepPartial<U>>
410
- : T extends ReadonlyArray<infer U>
411
- ? ReadonlyArray<DeepPartial<U>>
412
- : T extends { $case: string }
413
- ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
414
- $case: T["$case"];
415
- }
416
- : T extends {}
417
- ? { [K in keyof T]?: DeepPartial<T[K]> }
418
- : Partial<T>;
419
-
420
- function isSet(value: any): boolean {
421
- return value !== null && value !== undefined;
422
- }
423
-
424
- export interface MessageFns<T> {
425
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
426
- decode(input: BinaryReader | Uint8Array, length?: number): T;
427
- fromJSON(object: any): T;
428
- toJSON(message: T): unknown;
429
- create(base?: DeepPartial<T>): T;
430
- fromPartial(object: DeepPartial<T>): T;
431
- }