@buildonspark/issuer-sdk 0.0.30 → 0.0.31

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.
@@ -92,7 +92,10 @@ function createBaseDuration(): Duration {
92
92
  }
93
93
 
94
94
  export const Duration: MessageFns<Duration> = {
95
- encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
95
+ encode(
96
+ message: Duration,
97
+ writer: BinaryWriter = new BinaryWriter(),
98
+ ): BinaryWriter {
96
99
  if (message.seconds !== 0) {
97
100
  writer.uint32(8).int64(message.seconds);
98
101
  }
@@ -103,7 +106,8 @@ export const Duration: MessageFns<Duration> = {
103
106
  },
104
107
 
105
108
  decode(input: BinaryReader | Uint8Array, length?: number): Duration {
106
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
109
+ const reader =
110
+ input instanceof BinaryReader ? input : new BinaryReader(input);
107
111
  let end = length === undefined ? reader.len : reader.pos + length;
108
112
  const message = createBaseDuration();
109
113
  while (reader.pos < end) {
@@ -163,14 +167,28 @@ export const Duration: MessageFns<Duration> = {
163
167
  },
164
168
  };
165
169
 
166
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
167
-
168
- export type DeepPartial<T> = T extends Builtin ? T
169
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
170
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
171
- : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
172
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
173
- : Partial<T>;
170
+ type Builtin =
171
+ | Date
172
+ | Function
173
+ | Uint8Array
174
+ | string
175
+ | number
176
+ | boolean
177
+ | undefined;
178
+
179
+ export type DeepPartial<T> = T extends Builtin
180
+ ? T
181
+ : T extends globalThis.Array<infer U>
182
+ ? globalThis.Array<DeepPartial<U>>
183
+ : T extends ReadonlyArray<infer U>
184
+ ? ReadonlyArray<DeepPartial<U>>
185
+ : T extends { $case: string }
186
+ ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
187
+ $case: T["$case"];
188
+ }
189
+ : T extends {}
190
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
191
+ : Partial<T>;
174
192
 
175
193
  function longToNumber(int64: { toString(): string }): number {
176
194
  const num = globalThis.Number(int64.toString());
@@ -18,8 +18,7 @@ export const protobufPackage = "google.protobuf";
18
18
  * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
19
19
  * }
20
20
  */
21
- export interface Empty {
22
- }
21
+ export interface Empty {}
23
22
 
24
23
  function createBaseEmpty(): Empty {
25
24
  return {};
@@ -31,7 +30,8 @@ export const Empty: MessageFns<Empty> = {
31
30
  },
32
31
 
33
32
  decode(input: BinaryReader | Uint8Array, length?: number): Empty {
34
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33
+ const reader =
34
+ input instanceof BinaryReader ? input : new BinaryReader(input);
35
35
  let end = length === undefined ? reader.len : reader.pos + length;
36
36
  const message = createBaseEmpty();
37
37
  while (reader.pos < end) {
@@ -64,14 +64,28 @@ export const Empty: MessageFns<Empty> = {
64
64
  },
65
65
  };
66
66
 
67
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
67
+ type Builtin =
68
+ | Date
69
+ | Function
70
+ | Uint8Array
71
+ | string
72
+ | number
73
+ | boolean
74
+ | undefined;
68
75
 
69
- export type DeepPartial<T> = T extends Builtin ? T
70
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
71
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
72
- : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
73
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
74
- : Partial<T>;
76
+ export type DeepPartial<T> = T extends Builtin
77
+ ? T
78
+ : T extends globalThis.Array<infer U>
79
+ ? globalThis.Array<DeepPartial<U>>
80
+ : T extends ReadonlyArray<infer U>
81
+ ? ReadonlyArray<DeepPartial<U>>
82
+ : T extends { $case: string }
83
+ ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
84
+ $case: T["$case"];
85
+ }
86
+ : T extends {}
87
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
88
+ : Partial<T>;
75
89
 
76
90
  export interface MessageFns<T> {
77
91
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -121,7 +121,10 @@ function createBaseTimestamp(): Timestamp {
121
121
  }
122
122
 
123
123
  export const Timestamp: MessageFns<Timestamp> = {
124
- encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
124
+ encode(
125
+ message: Timestamp,
126
+ writer: BinaryWriter = new BinaryWriter(),
127
+ ): BinaryWriter {
125
128
  if (message.seconds !== 0) {
126
129
  writer.uint32(8).int64(message.seconds);
127
130
  }
@@ -132,7 +135,8 @@ export const Timestamp: MessageFns<Timestamp> = {
132
135
  },
133
136
 
134
137
  decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
135
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
138
+ const reader =
139
+ input instanceof BinaryReader ? input : new BinaryReader(input);
136
140
  let end = length === undefined ? reader.len : reader.pos + length;
137
141
  const message = createBaseTimestamp();
138
142
  while (reader.pos < end) {
@@ -192,14 +196,28 @@ export const Timestamp: MessageFns<Timestamp> = {
192
196
  },
193
197
  };
194
198
 
195
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
196
-
197
- export type DeepPartial<T> = T extends Builtin ? T
198
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
199
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
200
- : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
201
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
202
- : Partial<T>;
199
+ type Builtin =
200
+ | Date
201
+ | Function
202
+ | Uint8Array
203
+ | string
204
+ | number
205
+ | boolean
206
+ | undefined;
207
+
208
+ export type DeepPartial<T> = T extends Builtin
209
+ ? T
210
+ : T extends globalThis.Array<infer U>
211
+ ? globalThis.Array<DeepPartial<U>>
212
+ : T extends ReadonlyArray<infer U>
213
+ ? ReadonlyArray<DeepPartial<U>>
214
+ : T extends { $case: string }
215
+ ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
216
+ $case: T["$case"];
217
+ }
218
+ : T extends {}
219
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
220
+ : Partial<T>;
203
221
 
204
222
  function longToNumber(int64: { toString(): string }): number {
205
223
  const num = globalThis.Number(int64.toString());
package/src/proto/mock.ts CHANGED
@@ -19,59 +19,75 @@ function createBaseCleanUpPreimageShareRequest(): CleanUpPreimageShareRequest {
19
19
  return { paymentHash: new Uint8Array(0) };
20
20
  }
21
21
 
22
- export const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest> = {
23
- encode(message: CleanUpPreimageShareRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
24
- if (message.paymentHash.length !== 0) {
25
- writer.uint32(10).bytes(message.paymentHash);
26
- }
27
- return writer;
28
- },
22
+ export const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest> =
23
+ {
24
+ encode(
25
+ message: CleanUpPreimageShareRequest,
26
+ writer: BinaryWriter = new BinaryWriter(),
27
+ ): BinaryWriter {
28
+ if (message.paymentHash.length !== 0) {
29
+ writer.uint32(10).bytes(message.paymentHash);
30
+ }
31
+ return writer;
32
+ },
29
33
 
30
- decode(input: BinaryReader | Uint8Array, length?: number): CleanUpPreimageShareRequest {
31
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32
- let end = length === undefined ? reader.len : reader.pos + length;
33
- const message = createBaseCleanUpPreimageShareRequest();
34
- while (reader.pos < end) {
35
- const tag = reader.uint32();
36
- switch (tag >>> 3) {
37
- case 1: {
38
- if (tag !== 10) {
39
- break;
34
+ decode(
35
+ input: BinaryReader | Uint8Array,
36
+ length?: number,
37
+ ): CleanUpPreimageShareRequest {
38
+ const reader =
39
+ input instanceof BinaryReader ? input : new BinaryReader(input);
40
+ let end = length === undefined ? reader.len : reader.pos + length;
41
+ const message = createBaseCleanUpPreimageShareRequest();
42
+ while (reader.pos < end) {
43
+ const tag = reader.uint32();
44
+ switch (tag >>> 3) {
45
+ case 1: {
46
+ if (tag !== 10) {
47
+ break;
48
+ }
49
+
50
+ message.paymentHash = reader.bytes();
51
+ continue;
40
52
  }
41
-
42
- message.paymentHash = reader.bytes();
43
- continue;
44
53
  }
54
+ if ((tag & 7) === 4 || tag === 0) {
55
+ break;
56
+ }
57
+ reader.skip(tag & 7);
45
58
  }
46
- if ((tag & 7) === 4 || tag === 0) {
47
- break;
48
- }
49
- reader.skip(tag & 7);
50
- }
51
- return message;
52
- },
59
+ return message;
60
+ },
53
61
 
54
- fromJSON(object: any): CleanUpPreimageShareRequest {
55
- return { paymentHash: isSet(object.paymentHash) ? bytesFromBase64(object.paymentHash) : new Uint8Array(0) };
56
- },
62
+ fromJSON(object: any): CleanUpPreimageShareRequest {
63
+ return {
64
+ paymentHash: isSet(object.paymentHash)
65
+ ? bytesFromBase64(object.paymentHash)
66
+ : new Uint8Array(0),
67
+ };
68
+ },
57
69
 
58
- toJSON(message: CleanUpPreimageShareRequest): unknown {
59
- const obj: any = {};
60
- if (message.paymentHash.length !== 0) {
61
- obj.paymentHash = base64FromBytes(message.paymentHash);
62
- }
63
- return obj;
64
- },
70
+ toJSON(message: CleanUpPreimageShareRequest): unknown {
71
+ const obj: any = {};
72
+ if (message.paymentHash.length !== 0) {
73
+ obj.paymentHash = base64FromBytes(message.paymentHash);
74
+ }
75
+ return obj;
76
+ },
65
77
 
66
- create(base?: DeepPartial<CleanUpPreimageShareRequest>): CleanUpPreimageShareRequest {
67
- return CleanUpPreimageShareRequest.fromPartial(base ?? {});
68
- },
69
- fromPartial(object: DeepPartial<CleanUpPreimageShareRequest>): CleanUpPreimageShareRequest {
70
- const message = createBaseCleanUpPreimageShareRequest();
71
- message.paymentHash = object.paymentHash ?? new Uint8Array(0);
72
- return message;
73
- },
74
- };
78
+ create(
79
+ base?: DeepPartial<CleanUpPreimageShareRequest>,
80
+ ): CleanUpPreimageShareRequest {
81
+ return CleanUpPreimageShareRequest.fromPartial(base ?? {});
82
+ },
83
+ fromPartial(
84
+ object: DeepPartial<CleanUpPreimageShareRequest>,
85
+ ): CleanUpPreimageShareRequest {
86
+ const message = createBaseCleanUpPreimageShareRequest();
87
+ message.paymentHash = object.paymentHash ?? new Uint8Array(0);
88
+ return message;
89
+ },
90
+ };
75
91
 
76
92
  export type MockServiceDefinition = typeof MockServiceDefinition;
77
93
  export const MockServiceDefinition = {
@@ -128,14 +144,28 @@ function base64FromBytes(arr: Uint8Array): string {
128
144
  }
129
145
  }
130
146
 
131
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
132
-
133
- export type DeepPartial<T> = T extends Builtin ? T
134
- : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
135
- : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
136
- : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
137
- : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
138
- : Partial<T>;
147
+ type Builtin =
148
+ | Date
149
+ | Function
150
+ | Uint8Array
151
+ | string
152
+ | number
153
+ | boolean
154
+ | undefined;
155
+
156
+ export type DeepPartial<T> = T extends Builtin
157
+ ? T
158
+ : T extends globalThis.Array<infer U>
159
+ ? globalThis.Array<DeepPartial<U>>
160
+ : T extends ReadonlyArray<infer U>
161
+ ? ReadonlyArray<DeepPartial<U>>
162
+ : T extends { $case: string }
163
+ ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & {
164
+ $case: T["$case"];
165
+ }
166
+ : T extends {}
167
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
168
+ : Partial<T>;
139
169
 
140
170
  function isSet(value: any): boolean {
141
171
  return value !== null && value !== undefined;