@buildonspark/spark-sdk 0.1.43 → 0.1.45

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.
Files changed (153) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{RequestLightningSendInput-D7fZdT4A.d.ts → RequestLightningSendInput-DEPd_fPO.d.ts} +43 -4
  3. package/dist/{RequestLightningSendInput-Na1mHdWg.d.cts → RequestLightningSendInput-Du0z7Om7.d.cts} +43 -4
  4. package/dist/address/index.cjs +2 -2
  5. package/dist/address/index.d.cts +2 -2
  6. package/dist/address/index.d.ts +2 -2
  7. package/dist/address/index.js +2 -2
  8. package/dist/{chunk-IRW5TWMH.js → chunk-5FUB65LX.js} +7 -9
  9. package/dist/{chunk-BUTZWYBW.js → chunk-6264CGDM.js} +4 -4
  10. package/dist/{chunk-VFJQNBFX.js → chunk-7V6N75CC.js} +5 -2
  11. package/dist/{chunk-M6A4KFIG.js → chunk-BGGEVUJK.js} +1505 -445
  12. package/dist/{chunk-DQYKQJRZ.js → chunk-C2S227QR.js} +675 -52
  13. package/dist/{chunk-GYQR4B4P.js → chunk-GZ5IPPJ2.js} +2 -2
  14. package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
  15. package/dist/{chunk-TOSP3INR.js → chunk-I54FARY2.js} +4 -2
  16. package/dist/{chunk-WWOTVNPP.js → chunk-J2IE4Z7Y.js} +544 -431
  17. package/dist/{chunk-O4RYNJNB.js → chunk-KMUMFYFX.js} +3 -3
  18. package/dist/chunk-LHRD2WT6.js +2374 -0
  19. package/dist/{chunk-ABZA6R5S.js → chunk-NTFKFRQ2.js} +1 -1
  20. package/dist/{chunk-MIVX3GHD.js → chunk-OBFKIEMP.js} +1 -1
  21. package/dist/{chunk-HRQRRDSS.js → chunk-PQN3C2MF.js} +15 -15
  22. package/dist/{chunk-DOA6QXYQ.js → chunk-R5PXJZQS.js} +3 -1
  23. package/dist/{chunk-TIUBYNN5.js → chunk-YUPMXTCJ.js} +4 -4
  24. package/dist/graphql/objects/index.d.cts +6 -43
  25. package/dist/graphql/objects/index.d.ts +6 -43
  26. package/dist/graphql/objects/index.js +1 -1
  27. package/dist/index-B2AwKW5J.d.cts +214 -0
  28. package/dist/index-CJDi1HWc.d.ts +214 -0
  29. package/dist/index.cjs +4150 -1026
  30. package/dist/index.d.cts +764 -19
  31. package/dist/index.d.ts +764 -19
  32. package/dist/index.js +17 -21
  33. package/dist/index.node.cjs +4153 -1033
  34. package/dist/index.node.d.cts +10 -8
  35. package/dist/index.node.d.ts +10 -8
  36. package/dist/index.node.js +20 -28
  37. package/dist/native/index.cjs +4166 -1042
  38. package/dist/native/index.d.cts +369 -108
  39. package/dist/native/index.d.ts +369 -108
  40. package/dist/native/index.js +4138 -1015
  41. package/dist/{network-xkBSpaTn.d.ts → network-BTJl-Sul.d.ts} +1 -1
  42. package/dist/{network-D5lKssVl.d.cts → network-CqgsdUF2.d.cts} +1 -1
  43. package/dist/proto/lrc20.cjs +222 -19
  44. package/dist/proto/lrc20.d.cts +1 -1
  45. package/dist/proto/lrc20.d.ts +1 -1
  46. package/dist/proto/lrc20.js +2 -2
  47. package/dist/proto/spark.cjs +1502 -442
  48. package/dist/proto/spark.d.cts +1 -1
  49. package/dist/proto/spark.d.ts +1 -1
  50. package/dist/proto/spark.js +5 -5
  51. package/dist/proto/spark_token.cjs +1515 -56
  52. package/dist/proto/spark_token.d.cts +153 -15
  53. package/dist/proto/spark_token.d.ts +153 -15
  54. package/dist/proto/spark_token.js +40 -4
  55. package/dist/{sdk-types-B-q9py_P.d.cts → sdk-types-B0SwjolI.d.cts} +1 -1
  56. package/dist/{sdk-types-BPoPgzda.d.ts → sdk-types-Cc4l4kb1.d.ts} +1 -1
  57. package/dist/services/config.cjs +7 -3
  58. package/dist/services/config.d.cts +5 -4
  59. package/dist/services/config.d.ts +5 -4
  60. package/dist/services/config.js +6 -6
  61. package/dist/services/connection.cjs +2938 -646
  62. package/dist/services/connection.d.cts +5 -4
  63. package/dist/services/connection.d.ts +5 -4
  64. package/dist/services/connection.js +4 -4
  65. package/dist/services/index.cjs +6381 -3461
  66. package/dist/services/index.d.cts +7 -6
  67. package/dist/services/index.d.ts +7 -6
  68. package/dist/services/index.js +15 -13
  69. package/dist/services/lrc-connection.cjs +227 -21
  70. package/dist/services/lrc-connection.d.cts +5 -4
  71. package/dist/services/lrc-connection.d.ts +5 -4
  72. package/dist/services/lrc-connection.js +4 -4
  73. package/dist/services/token-transactions.cjs +868 -244
  74. package/dist/services/token-transactions.d.cts +25 -7
  75. package/dist/services/token-transactions.d.ts +25 -7
  76. package/dist/services/token-transactions.js +5 -4
  77. package/dist/services/wallet-config.cjs +4 -1
  78. package/dist/services/wallet-config.d.cts +7 -5
  79. package/dist/services/wallet-config.d.ts +7 -5
  80. package/dist/services/wallet-config.js +3 -1
  81. package/dist/signer/signer.cjs +5 -2
  82. package/dist/signer/signer.d.cts +3 -2
  83. package/dist/signer/signer.d.ts +3 -2
  84. package/dist/signer/signer.js +2 -2
  85. package/dist/{signer-wqesWifN.d.ts → signer-BocS_J6B.d.ts} +2 -6
  86. package/dist/{signer-IO3oMRNj.d.cts → signer-DKS0AJkw.d.cts} +2 -6
  87. package/dist/{spark-CDm4gqS6.d.cts → spark-dM7EYXYQ.d.cts} +138 -42
  88. package/dist/{spark-CDm4gqS6.d.ts → spark-dM7EYXYQ.d.ts} +138 -42
  89. package/dist/spark_bindings/native/index.cjs +183 -0
  90. package/dist/spark_bindings/native/index.d.cts +14 -0
  91. package/dist/spark_bindings/native/index.d.ts +14 -0
  92. package/dist/spark_bindings/native/index.js +141 -0
  93. package/dist/spark_bindings/wasm/index.cjs +1093 -0
  94. package/dist/spark_bindings/wasm/index.d.cts +47 -0
  95. package/dist/spark_bindings/wasm/index.d.ts +47 -0
  96. package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
  97. package/dist/types/index.cjs +1503 -443
  98. package/dist/types/index.d.cts +6 -5
  99. package/dist/types/index.d.ts +6 -5
  100. package/dist/types/index.js +3 -3
  101. package/dist/types-C-Rp0Oo7.d.cts +46 -0
  102. package/dist/types-C-Rp0Oo7.d.ts +46 -0
  103. package/dist/utils/index.cjs +358 -36
  104. package/dist/utils/index.d.cts +14 -134
  105. package/dist/utils/index.d.ts +14 -134
  106. package/dist/utils/index.js +8 -8
  107. package/package.json +21 -1
  108. package/src/constants.ts +5 -1
  109. package/src/graphql/client.ts +28 -0
  110. package/src/graphql/mutations/RequestCoopExit.ts +6 -0
  111. package/src/graphql/mutations/RequestSwapLeaves.ts +2 -0
  112. package/src/graphql/queries/GetCoopExitFeeQuote.ts +20 -0
  113. package/src/index.node.ts +0 -1
  114. package/src/index.ts +0 -1
  115. package/src/native/index.ts +1 -2
  116. package/src/proto/common.ts +5 -5
  117. package/src/proto/google/protobuf/descriptor.ts +34 -34
  118. package/src/proto/google/protobuf/duration.ts +2 -2
  119. package/src/proto/google/protobuf/empty.ts +2 -2
  120. package/src/proto/google/protobuf/timestamp.ts +2 -2
  121. package/src/proto/mock.ts +4 -4
  122. package/src/proto/spark.ts +1924 -525
  123. package/src/proto/spark_authn.ts +7 -7
  124. package/src/proto/spark_token.ts +1668 -105
  125. package/src/proto/validate/validate.ts +24 -24
  126. package/src/services/bolt11-spark.ts +62 -187
  127. package/src/services/coop-exit.ts +3 -0
  128. package/src/services/lrc20.ts +1 -1
  129. package/src/services/token-transactions.ts +209 -9
  130. package/src/services/transfer.ts +22 -3
  131. package/src/services/tree-creation.ts +13 -0
  132. package/src/services/wallet-config.ts +2 -1
  133. package/src/spark-wallet/spark-wallet.node.ts +3 -7
  134. package/src/spark-wallet/spark-wallet.ts +376 -232
  135. package/src/spark-wallet/types.ts +39 -3
  136. package/src/tests/bolt11-spark.test.ts +7 -15
  137. package/src/tests/integration/deposit.test.ts +16 -0
  138. package/src/tests/integration/ssp/coop-exit.test.ts +85 -21
  139. package/src/tests/integration/ssp/swap.test.ts +47 -0
  140. package/src/tests/integration/swap.test.ts +453 -433
  141. package/src/tests/integration/transfer.test.ts +261 -248
  142. package/src/tests/token-identifier.test.ts +54 -0
  143. package/src/tests/tokens.test.ts +218 -22
  144. package/src/utils/token-hashing.ts +346 -52
  145. package/src/utils/token-identifier.ts +88 -0
  146. package/src/utils/token-transaction-validation.ts +350 -5
  147. package/src/utils/token-transactions.ts +12 -8
  148. package/src/utils/transaction.ts +2 -8
  149. package/dist/chunk-VA7MV4MZ.js +0 -1073
  150. package/dist/index-7RYRH5wc.d.ts +0 -815
  151. package/dist/index-BJOc8Ur-.d.cts +0 -815
  152. package/dist/wasm-7OWFHDMS.js +0 -21
  153. package/src/logger.ts +0 -3
@@ -23,16 +23,34 @@ __export(spark_token_exports, {
23
23
  CommitTransactionRequest: () => CommitTransactionRequest,
24
24
  CommitTransactionResponse: () => CommitTransactionResponse,
25
25
  InputTtxoSignaturesPerOperator: () => InputTtxoSignaturesPerOperator,
26
+ OutputWithPreviousTransactionData: () => OutputWithPreviousTransactionData,
27
+ QueryTokenMetadataRequest: () => QueryTokenMetadataRequest,
28
+ QueryTokenMetadataResponse: () => QueryTokenMetadataResponse,
29
+ QueryTokenOutputsRequest: () => QueryTokenOutputsRequest,
30
+ QueryTokenOutputsResponse: () => QueryTokenOutputsResponse,
31
+ QueryTokenTransactionsRequest: () => QueryTokenTransactionsRequest,
32
+ QueryTokenTransactionsResponse: () => QueryTokenTransactionsResponse,
26
33
  SignatureWithIndex: () => SignatureWithIndex,
27
34
  SparkTokenServiceDefinition: () => SparkTokenServiceDefinition,
35
+ SpentTokenOutputMetadata: () => SpentTokenOutputMetadata,
28
36
  StartTransactionRequest: () => StartTransactionRequest,
29
37
  StartTransactionResponse: () => StartTransactionResponse,
38
+ TokenCreateInput: () => TokenCreateInput,
39
+ TokenMetadata: () => TokenMetadata,
30
40
  TokenMintInput: () => TokenMintInput,
31
41
  TokenOutput: () => TokenOutput,
32
42
  TokenOutputToSpend: () => TokenOutputToSpend,
33
43
  TokenTransaction: () => TokenTransaction,
44
+ TokenTransactionConfirmationMetadata: () => TokenTransactionConfirmationMetadata,
45
+ TokenTransactionStatus: () => TokenTransactionStatus,
46
+ TokenTransactionType: () => TokenTransactionType,
47
+ TokenTransactionWithStatus: () => TokenTransactionWithStatus,
34
48
  TokenTransferInput: () => TokenTransferInput,
35
- protobufPackage: () => protobufPackage
49
+ protobufPackage: () => protobufPackage,
50
+ tokenTransactionStatusFromJSON: () => tokenTransactionStatusFromJSON,
51
+ tokenTransactionStatusToJSON: () => tokenTransactionStatusToJSON,
52
+ tokenTransactionTypeFromJSON: () => tokenTransactionTypeFromJSON,
53
+ tokenTransactionTypeToJSON: () => tokenTransactionTypeToJSON
36
54
  });
37
55
  module.exports = __toCommonJS(spark_token_exports);
38
56
 
@@ -70,7 +88,7 @@ var Timestamp = {
70
88
  },
71
89
  decode(input, length) {
72
90
  const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
73
- let end = length === void 0 ? reader.len : reader.pos + length;
91
+ const end = length === void 0 ? reader.len : reader.pos + length;
74
92
  const message = createBaseTimestamp();
75
93
  while (reader.pos < end) {
76
94
  const tag = reader.uint32();
@@ -188,7 +206,7 @@ function networkToJSON(object) {
188
206
  }
189
207
  }
190
208
  function createBaseSigningKeyshare() {
191
- return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0) };
209
+ return { ownerIdentifiers: [], threshold: 0, publicKey: new Uint8Array(0), publicShares: {}, updatedTime: void 0 };
192
210
  }
193
211
  var SigningKeyshare = {
194
212
  encode(message, writer = new import_wire4.BinaryWriter()) {
@@ -201,11 +219,17 @@ var SigningKeyshare = {
201
219
  if (message.publicKey.length !== 0) {
202
220
  writer.uint32(26).bytes(message.publicKey);
203
221
  }
222
+ Object.entries(message.publicShares).forEach(([key, value]) => {
223
+ SigningKeyshare_PublicSharesEntry.encode({ key, value }, writer.uint32(34).fork()).join();
224
+ });
225
+ if (message.updatedTime !== void 0) {
226
+ Timestamp.encode(toTimestamp(message.updatedTime), writer.uint32(42).fork()).join();
227
+ }
204
228
  return writer;
205
229
  },
206
230
  decode(input, length) {
207
231
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
208
- let end = length === void 0 ? reader.len : reader.pos + length;
232
+ const end = length === void 0 ? reader.len : reader.pos + length;
209
233
  const message = createBaseSigningKeyshare();
210
234
  while (reader.pos < end) {
211
235
  const tag = reader.uint32();
@@ -231,6 +255,23 @@ var SigningKeyshare = {
231
255
  message.publicKey = reader.bytes();
232
256
  continue;
233
257
  }
258
+ case 4: {
259
+ if (tag !== 34) {
260
+ break;
261
+ }
262
+ const entry4 = SigningKeyshare_PublicSharesEntry.decode(reader, reader.uint32());
263
+ if (entry4.value !== void 0) {
264
+ message.publicShares[entry4.key] = entry4.value;
265
+ }
266
+ continue;
267
+ }
268
+ case 5: {
269
+ if (tag !== 42) {
270
+ break;
271
+ }
272
+ message.updatedTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
273
+ continue;
274
+ }
234
275
  }
235
276
  if ((tag & 7) === 4 || tag === 0) {
236
277
  break;
@@ -243,7 +284,12 @@ var SigningKeyshare = {
243
284
  return {
244
285
  ownerIdentifiers: globalThis.Array.isArray(object?.ownerIdentifiers) ? object.ownerIdentifiers.map((e) => globalThis.String(e)) : [],
245
286
  threshold: isSet2(object.threshold) ? globalThis.Number(object.threshold) : 0,
246
- publicKey: isSet2(object.publicKey) ? bytesFromBase64(object.publicKey) : new Uint8Array(0)
287
+ publicKey: isSet2(object.publicKey) ? bytesFromBase64(object.publicKey) : new Uint8Array(0),
288
+ publicShares: isObject(object.publicShares) ? Object.entries(object.publicShares).reduce((acc, [key, value]) => {
289
+ acc[key] = bytesFromBase64(value);
290
+ return acc;
291
+ }, {}) : {},
292
+ updatedTime: isSet2(object.updatedTime) ? fromJsonTimestamp(object.updatedTime) : void 0
247
293
  };
248
294
  },
249
295
  toJSON(message) {
@@ -257,6 +303,18 @@ var SigningKeyshare = {
257
303
  if (message.publicKey.length !== 0) {
258
304
  obj.publicKey = base64FromBytes(message.publicKey);
259
305
  }
306
+ if (message.publicShares) {
307
+ const entries = Object.entries(message.publicShares);
308
+ if (entries.length > 0) {
309
+ obj.publicShares = {};
310
+ entries.forEach(([k, v]) => {
311
+ obj.publicShares[k] = base64FromBytes(v);
312
+ });
313
+ }
314
+ }
315
+ if (message.updatedTime !== void 0) {
316
+ obj.updatedTime = message.updatedTime.toISOString();
317
+ }
260
318
  return obj;
261
319
  },
262
320
  create(base) {
@@ -267,6 +325,84 @@ var SigningKeyshare = {
267
325
  message.ownerIdentifiers = object.ownerIdentifiers?.map((e) => e) || [];
268
326
  message.threshold = object.threshold ?? 0;
269
327
  message.publicKey = object.publicKey ?? new Uint8Array(0);
328
+ message.publicShares = Object.entries(object.publicShares ?? {}).reduce(
329
+ (acc, [key, value]) => {
330
+ if (value !== void 0) {
331
+ acc[key] = value;
332
+ }
333
+ return acc;
334
+ },
335
+ {}
336
+ );
337
+ message.updatedTime = object.updatedTime ?? void 0;
338
+ return message;
339
+ }
340
+ };
341
+ function createBaseSigningKeyshare_PublicSharesEntry() {
342
+ return { key: "", value: new Uint8Array(0) };
343
+ }
344
+ var SigningKeyshare_PublicSharesEntry = {
345
+ encode(message, writer = new import_wire4.BinaryWriter()) {
346
+ if (message.key !== "") {
347
+ writer.uint32(10).string(message.key);
348
+ }
349
+ if (message.value.length !== 0) {
350
+ writer.uint32(18).bytes(message.value);
351
+ }
352
+ return writer;
353
+ },
354
+ decode(input, length) {
355
+ const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
356
+ const end = length === void 0 ? reader.len : reader.pos + length;
357
+ const message = createBaseSigningKeyshare_PublicSharesEntry();
358
+ while (reader.pos < end) {
359
+ const tag = reader.uint32();
360
+ switch (tag >>> 3) {
361
+ case 1: {
362
+ if (tag !== 10) {
363
+ break;
364
+ }
365
+ message.key = reader.string();
366
+ continue;
367
+ }
368
+ case 2: {
369
+ if (tag !== 18) {
370
+ break;
371
+ }
372
+ message.value = reader.bytes();
373
+ continue;
374
+ }
375
+ }
376
+ if ((tag & 7) === 4 || tag === 0) {
377
+ break;
378
+ }
379
+ reader.skip(tag & 7);
380
+ }
381
+ return message;
382
+ },
383
+ fromJSON(object) {
384
+ return {
385
+ key: isSet2(object.key) ? globalThis.String(object.key) : "",
386
+ value: isSet2(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0)
387
+ };
388
+ },
389
+ toJSON(message) {
390
+ const obj = {};
391
+ if (message.key !== "") {
392
+ obj.key = message.key;
393
+ }
394
+ if (message.value.length !== 0) {
395
+ obj.value = base64FromBytes(message.value);
396
+ }
397
+ return obj;
398
+ },
399
+ create(base) {
400
+ return SigningKeyshare_PublicSharesEntry.fromPartial(base ?? {});
401
+ },
402
+ fromPartial(object) {
403
+ const message = createBaseSigningKeyshare_PublicSharesEntry();
404
+ message.key = object.key ?? "";
405
+ message.value = object.value ?? new Uint8Array(0);
270
406
  return message;
271
407
  }
272
408
  };
@@ -293,12 +429,138 @@ function base64FromBytes(arr) {
293
429
  return globalThis.btoa(bin.join(""));
294
430
  }
295
431
  }
432
+ function toTimestamp(date) {
433
+ const seconds = Math.trunc(date.getTime() / 1e3);
434
+ const nanos = date.getTime() % 1e3 * 1e6;
435
+ return { seconds, nanos };
436
+ }
437
+ function fromTimestamp(t) {
438
+ let millis = (t.seconds || 0) * 1e3;
439
+ millis += (t.nanos || 0) / 1e6;
440
+ return new globalThis.Date(millis);
441
+ }
442
+ function fromJsonTimestamp(o) {
443
+ if (o instanceof globalThis.Date) {
444
+ return o;
445
+ } else if (typeof o === "string") {
446
+ return new globalThis.Date(o);
447
+ } else {
448
+ return fromTimestamp(Timestamp.fromJSON(o));
449
+ }
450
+ }
451
+ function isObject(value) {
452
+ return typeof value === "object" && value !== null;
453
+ }
296
454
  function isSet2(value) {
297
455
  return value !== null && value !== void 0;
298
456
  }
299
457
 
300
458
  // src/proto/spark_token.ts
301
459
  var protobufPackage = "spark_token";
460
+ var TokenTransactionType = /* @__PURE__ */ ((TokenTransactionType2) => {
461
+ TokenTransactionType2[TokenTransactionType2["TOKEN_TRANSACTION_TYPE_UNSPECIFIED"] = 0] = "TOKEN_TRANSACTION_TYPE_UNSPECIFIED";
462
+ TokenTransactionType2[TokenTransactionType2["TOKEN_TRANSACTION_TYPE_CREATE"] = 1] = "TOKEN_TRANSACTION_TYPE_CREATE";
463
+ TokenTransactionType2[TokenTransactionType2["TOKEN_TRANSACTION_TYPE_MINT"] = 2] = "TOKEN_TRANSACTION_TYPE_MINT";
464
+ TokenTransactionType2[TokenTransactionType2["TOKEN_TRANSACTION_TYPE_TRANSFER"] = 3] = "TOKEN_TRANSACTION_TYPE_TRANSFER";
465
+ TokenTransactionType2[TokenTransactionType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
466
+ return TokenTransactionType2;
467
+ })(TokenTransactionType || {});
468
+ function tokenTransactionTypeFromJSON(object) {
469
+ switch (object) {
470
+ case 0:
471
+ case "TOKEN_TRANSACTION_TYPE_UNSPECIFIED":
472
+ return 0 /* TOKEN_TRANSACTION_TYPE_UNSPECIFIED */;
473
+ case 1:
474
+ case "TOKEN_TRANSACTION_TYPE_CREATE":
475
+ return 1 /* TOKEN_TRANSACTION_TYPE_CREATE */;
476
+ case 2:
477
+ case "TOKEN_TRANSACTION_TYPE_MINT":
478
+ return 2 /* TOKEN_TRANSACTION_TYPE_MINT */;
479
+ case 3:
480
+ case "TOKEN_TRANSACTION_TYPE_TRANSFER":
481
+ return 3 /* TOKEN_TRANSACTION_TYPE_TRANSFER */;
482
+ case -1:
483
+ case "UNRECOGNIZED":
484
+ default:
485
+ return -1 /* UNRECOGNIZED */;
486
+ }
487
+ }
488
+ function tokenTransactionTypeToJSON(object) {
489
+ switch (object) {
490
+ case 0 /* TOKEN_TRANSACTION_TYPE_UNSPECIFIED */:
491
+ return "TOKEN_TRANSACTION_TYPE_UNSPECIFIED";
492
+ case 1 /* TOKEN_TRANSACTION_TYPE_CREATE */:
493
+ return "TOKEN_TRANSACTION_TYPE_CREATE";
494
+ case 2 /* TOKEN_TRANSACTION_TYPE_MINT */:
495
+ return "TOKEN_TRANSACTION_TYPE_MINT";
496
+ case 3 /* TOKEN_TRANSACTION_TYPE_TRANSFER */:
497
+ return "TOKEN_TRANSACTION_TYPE_TRANSFER";
498
+ case -1 /* UNRECOGNIZED */:
499
+ default:
500
+ return "UNRECOGNIZED";
501
+ }
502
+ }
503
+ var TokenTransactionStatus = /* @__PURE__ */ ((TokenTransactionStatus2) => {
504
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_STARTED"] = 0] = "TOKEN_TRANSACTION_STARTED";
505
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_SIGNED"] = 1] = "TOKEN_TRANSACTION_SIGNED";
506
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_REVEALED"] = 5] = "TOKEN_TRANSACTION_REVEALED";
507
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_FINALIZED"] = 2] = "TOKEN_TRANSACTION_FINALIZED";
508
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_STARTED_CANCELLED"] = 3] = "TOKEN_TRANSACTION_STARTED_CANCELLED";
509
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_SIGNED_CANCELLED"] = 4] = "TOKEN_TRANSACTION_SIGNED_CANCELLED";
510
+ TokenTransactionStatus2[TokenTransactionStatus2["TOKEN_TRANSACTION_UNKNOWN"] = 10] = "TOKEN_TRANSACTION_UNKNOWN";
511
+ TokenTransactionStatus2[TokenTransactionStatus2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
512
+ return TokenTransactionStatus2;
513
+ })(TokenTransactionStatus || {});
514
+ function tokenTransactionStatusFromJSON(object) {
515
+ switch (object) {
516
+ case 0:
517
+ case "TOKEN_TRANSACTION_STARTED":
518
+ return 0 /* TOKEN_TRANSACTION_STARTED */;
519
+ case 1:
520
+ case "TOKEN_TRANSACTION_SIGNED":
521
+ return 1 /* TOKEN_TRANSACTION_SIGNED */;
522
+ case 5:
523
+ case "TOKEN_TRANSACTION_REVEALED":
524
+ return 5 /* TOKEN_TRANSACTION_REVEALED */;
525
+ case 2:
526
+ case "TOKEN_TRANSACTION_FINALIZED":
527
+ return 2 /* TOKEN_TRANSACTION_FINALIZED */;
528
+ case 3:
529
+ case "TOKEN_TRANSACTION_STARTED_CANCELLED":
530
+ return 3 /* TOKEN_TRANSACTION_STARTED_CANCELLED */;
531
+ case 4:
532
+ case "TOKEN_TRANSACTION_SIGNED_CANCELLED":
533
+ return 4 /* TOKEN_TRANSACTION_SIGNED_CANCELLED */;
534
+ case 10:
535
+ case "TOKEN_TRANSACTION_UNKNOWN":
536
+ return 10 /* TOKEN_TRANSACTION_UNKNOWN */;
537
+ case -1:
538
+ case "UNRECOGNIZED":
539
+ default:
540
+ return -1 /* UNRECOGNIZED */;
541
+ }
542
+ }
543
+ function tokenTransactionStatusToJSON(object) {
544
+ switch (object) {
545
+ case 0 /* TOKEN_TRANSACTION_STARTED */:
546
+ return "TOKEN_TRANSACTION_STARTED";
547
+ case 1 /* TOKEN_TRANSACTION_SIGNED */:
548
+ return "TOKEN_TRANSACTION_SIGNED";
549
+ case 5 /* TOKEN_TRANSACTION_REVEALED */:
550
+ return "TOKEN_TRANSACTION_REVEALED";
551
+ case 2 /* TOKEN_TRANSACTION_FINALIZED */:
552
+ return "TOKEN_TRANSACTION_FINALIZED";
553
+ case 3 /* TOKEN_TRANSACTION_STARTED_CANCELLED */:
554
+ return "TOKEN_TRANSACTION_STARTED_CANCELLED";
555
+ case 4 /* TOKEN_TRANSACTION_SIGNED_CANCELLED */:
556
+ return "TOKEN_TRANSACTION_SIGNED_CANCELLED";
557
+ case 10 /* TOKEN_TRANSACTION_UNKNOWN */:
558
+ return "TOKEN_TRANSACTION_UNKNOWN";
559
+ case -1 /* UNRECOGNIZED */:
560
+ default:
561
+ return "UNRECOGNIZED";
562
+ }
563
+ }
302
564
  function createBaseTokenOutputToSpend() {
303
565
  return { prevTokenTransactionHash: new Uint8Array(0), prevTokenTransactionVout: 0 };
304
566
  }
@@ -314,7 +576,7 @@ var TokenOutputToSpend = {
314
576
  },
315
577
  decode(input, length) {
316
578
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
317
- let end = length === void 0 ? reader.len : reader.pos + length;
579
+ const end = length === void 0 ? reader.len : reader.pos + length;
318
580
  const message = createBaseTokenOutputToSpend();
319
581
  while (reader.pos < end) {
320
582
  const tag = reader.uint32();
@@ -379,7 +641,7 @@ var TokenTransferInput = {
379
641
  },
380
642
  decode(input, length) {
381
643
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
382
- let end = length === void 0 ? reader.len : reader.pos + length;
644
+ const end = length === void 0 ? reader.len : reader.pos + length;
383
645
  const message = createBaseTokenTransferInput();
384
646
  while (reader.pos < end) {
385
647
  const tag = reader.uint32();
@@ -421,21 +683,21 @@ var TokenTransferInput = {
421
683
  }
422
684
  };
423
685
  function createBaseTokenMintInput() {
424
- return { issuerPublicKey: new Uint8Array(0), issuerProvidedTimestamp: 0 };
686
+ return { issuerPublicKey: new Uint8Array(0), tokenIdentifier: void 0 };
425
687
  }
426
688
  var TokenMintInput = {
427
689
  encode(message, writer = new import_wire5.BinaryWriter()) {
428
690
  if (message.issuerPublicKey.length !== 0) {
429
691
  writer.uint32(10).bytes(message.issuerPublicKey);
430
692
  }
431
- if (message.issuerProvidedTimestamp !== 0) {
432
- writer.uint32(16).uint64(message.issuerProvidedTimestamp);
693
+ if (message.tokenIdentifier !== void 0) {
694
+ writer.uint32(18).bytes(message.tokenIdentifier);
433
695
  }
434
696
  return writer;
435
697
  },
436
698
  decode(input, length) {
437
699
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
438
- let end = length === void 0 ? reader.len : reader.pos + length;
700
+ const end = length === void 0 ? reader.len : reader.pos + length;
439
701
  const message = createBaseTokenMintInput();
440
702
  while (reader.pos < end) {
441
703
  const tag = reader.uint32();
@@ -448,10 +710,10 @@ var TokenMintInput = {
448
710
  continue;
449
711
  }
450
712
  case 2: {
451
- if (tag !== 16) {
713
+ if (tag !== 18) {
452
714
  break;
453
715
  }
454
- message.issuerProvidedTimestamp = longToNumber2(reader.uint64());
716
+ message.tokenIdentifier = reader.bytes();
455
717
  continue;
456
718
  }
457
719
  }
@@ -465,7 +727,7 @@ var TokenMintInput = {
465
727
  fromJSON(object) {
466
728
  return {
467
729
  issuerPublicKey: isSet3(object.issuerPublicKey) ? bytesFromBase642(object.issuerPublicKey) : new Uint8Array(0),
468
- issuerProvidedTimestamp: isSet3(object.issuerProvidedTimestamp) ? globalThis.Number(object.issuerProvidedTimestamp) : 0
730
+ tokenIdentifier: isSet3(object.tokenIdentifier) ? bytesFromBase642(object.tokenIdentifier) : void 0
469
731
  };
470
732
  },
471
733
  toJSON(message) {
@@ -473,8 +735,8 @@ var TokenMintInput = {
473
735
  if (message.issuerPublicKey.length !== 0) {
474
736
  obj.issuerPublicKey = base64FromBytes2(message.issuerPublicKey);
475
737
  }
476
- if (message.issuerProvidedTimestamp !== 0) {
477
- obj.issuerProvidedTimestamp = Math.round(message.issuerProvidedTimestamp);
738
+ if (message.tokenIdentifier !== void 0) {
739
+ obj.tokenIdentifier = base64FromBytes2(message.tokenIdentifier);
478
740
  }
479
741
  return obj;
480
742
  },
@@ -484,7 +746,158 @@ var TokenMintInput = {
484
746
  fromPartial(object) {
485
747
  const message = createBaseTokenMintInput();
486
748
  message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
487
- message.issuerProvidedTimestamp = object.issuerProvidedTimestamp ?? 0;
749
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
750
+ return message;
751
+ }
752
+ };
753
+ function createBaseTokenCreateInput() {
754
+ return {
755
+ issuerPublicKey: new Uint8Array(0),
756
+ tokenName: "",
757
+ tokenTicker: "",
758
+ decimals: 0,
759
+ maxSupply: new Uint8Array(0),
760
+ isFreezable: false,
761
+ creationEntityPublicKey: void 0
762
+ };
763
+ }
764
+ var TokenCreateInput = {
765
+ encode(message, writer = new import_wire5.BinaryWriter()) {
766
+ if (message.issuerPublicKey.length !== 0) {
767
+ writer.uint32(10).bytes(message.issuerPublicKey);
768
+ }
769
+ if (message.tokenName !== "") {
770
+ writer.uint32(18).string(message.tokenName);
771
+ }
772
+ if (message.tokenTicker !== "") {
773
+ writer.uint32(26).string(message.tokenTicker);
774
+ }
775
+ if (message.decimals !== 0) {
776
+ writer.uint32(32).uint32(message.decimals);
777
+ }
778
+ if (message.maxSupply.length !== 0) {
779
+ writer.uint32(42).bytes(message.maxSupply);
780
+ }
781
+ if (message.isFreezable !== false) {
782
+ writer.uint32(48).bool(message.isFreezable);
783
+ }
784
+ if (message.creationEntityPublicKey !== void 0) {
785
+ writer.uint32(58).bytes(message.creationEntityPublicKey);
786
+ }
787
+ return writer;
788
+ },
789
+ decode(input, length) {
790
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
791
+ const end = length === void 0 ? reader.len : reader.pos + length;
792
+ const message = createBaseTokenCreateInput();
793
+ while (reader.pos < end) {
794
+ const tag = reader.uint32();
795
+ switch (tag >>> 3) {
796
+ case 1: {
797
+ if (tag !== 10) {
798
+ break;
799
+ }
800
+ message.issuerPublicKey = reader.bytes();
801
+ continue;
802
+ }
803
+ case 2: {
804
+ if (tag !== 18) {
805
+ break;
806
+ }
807
+ message.tokenName = reader.string();
808
+ continue;
809
+ }
810
+ case 3: {
811
+ if (tag !== 26) {
812
+ break;
813
+ }
814
+ message.tokenTicker = reader.string();
815
+ continue;
816
+ }
817
+ case 4: {
818
+ if (tag !== 32) {
819
+ break;
820
+ }
821
+ message.decimals = reader.uint32();
822
+ continue;
823
+ }
824
+ case 5: {
825
+ if (tag !== 42) {
826
+ break;
827
+ }
828
+ message.maxSupply = reader.bytes();
829
+ continue;
830
+ }
831
+ case 6: {
832
+ if (tag !== 48) {
833
+ break;
834
+ }
835
+ message.isFreezable = reader.bool();
836
+ continue;
837
+ }
838
+ case 7: {
839
+ if (tag !== 58) {
840
+ break;
841
+ }
842
+ message.creationEntityPublicKey = reader.bytes();
843
+ continue;
844
+ }
845
+ }
846
+ if ((tag & 7) === 4 || tag === 0) {
847
+ break;
848
+ }
849
+ reader.skip(tag & 7);
850
+ }
851
+ return message;
852
+ },
853
+ fromJSON(object) {
854
+ return {
855
+ issuerPublicKey: isSet3(object.issuerPublicKey) ? bytesFromBase642(object.issuerPublicKey) : new Uint8Array(0),
856
+ tokenName: isSet3(object.tokenName) ? globalThis.String(object.tokenName) : "",
857
+ tokenTicker: isSet3(object.tokenTicker) ? globalThis.String(object.tokenTicker) : "",
858
+ decimals: isSet3(object.decimals) ? globalThis.Number(object.decimals) : 0,
859
+ maxSupply: isSet3(object.maxSupply) ? bytesFromBase642(object.maxSupply) : new Uint8Array(0),
860
+ isFreezable: isSet3(object.isFreezable) ? globalThis.Boolean(object.isFreezable) : false,
861
+ creationEntityPublicKey: isSet3(object.creationEntityPublicKey) ? bytesFromBase642(object.creationEntityPublicKey) : void 0
862
+ };
863
+ },
864
+ toJSON(message) {
865
+ const obj = {};
866
+ if (message.issuerPublicKey.length !== 0) {
867
+ obj.issuerPublicKey = base64FromBytes2(message.issuerPublicKey);
868
+ }
869
+ if (message.tokenName !== "") {
870
+ obj.tokenName = message.tokenName;
871
+ }
872
+ if (message.tokenTicker !== "") {
873
+ obj.tokenTicker = message.tokenTicker;
874
+ }
875
+ if (message.decimals !== 0) {
876
+ obj.decimals = Math.round(message.decimals);
877
+ }
878
+ if (message.maxSupply.length !== 0) {
879
+ obj.maxSupply = base64FromBytes2(message.maxSupply);
880
+ }
881
+ if (message.isFreezable !== false) {
882
+ obj.isFreezable = message.isFreezable;
883
+ }
884
+ if (message.creationEntityPublicKey !== void 0) {
885
+ obj.creationEntityPublicKey = base64FromBytes2(message.creationEntityPublicKey);
886
+ }
887
+ return obj;
888
+ },
889
+ create(base) {
890
+ return TokenCreateInput.fromPartial(base ?? {});
891
+ },
892
+ fromPartial(object) {
893
+ const message = createBaseTokenCreateInput();
894
+ message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
895
+ message.tokenName = object.tokenName ?? "";
896
+ message.tokenTicker = object.tokenTicker ?? "";
897
+ message.decimals = object.decimals ?? 0;
898
+ message.maxSupply = object.maxSupply ?? new Uint8Array(0);
899
+ message.isFreezable = object.isFreezable ?? false;
900
+ message.creationEntityPublicKey = object.creationEntityPublicKey ?? void 0;
488
901
  return message;
489
902
  }
490
903
  };
@@ -495,7 +908,8 @@ function createBaseTokenOutput() {
495
908
  revocationCommitment: void 0,
496
909
  withdrawBondSats: void 0,
497
910
  withdrawRelativeBlockLocktime: void 0,
498
- tokenPublicKey: new Uint8Array(0),
911
+ tokenPublicKey: void 0,
912
+ tokenIdentifier: void 0,
499
913
  tokenAmount: new Uint8Array(0)
500
914
  };
501
915
  }
@@ -516,9 +930,12 @@ var TokenOutput = {
516
930
  if (message.withdrawRelativeBlockLocktime !== void 0) {
517
931
  writer.uint32(40).uint64(message.withdrawRelativeBlockLocktime);
518
932
  }
519
- if (message.tokenPublicKey.length !== 0) {
933
+ if (message.tokenPublicKey !== void 0) {
520
934
  writer.uint32(50).bytes(message.tokenPublicKey);
521
935
  }
936
+ if (message.tokenIdentifier !== void 0) {
937
+ writer.uint32(66).bytes(message.tokenIdentifier);
938
+ }
522
939
  if (message.tokenAmount.length !== 0) {
523
940
  writer.uint32(58).bytes(message.tokenAmount);
524
941
  }
@@ -526,7 +943,7 @@ var TokenOutput = {
526
943
  },
527
944
  decode(input, length) {
528
945
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
529
- let end = length === void 0 ? reader.len : reader.pos + length;
946
+ const end = length === void 0 ? reader.len : reader.pos + length;
530
947
  const message = createBaseTokenOutput();
531
948
  while (reader.pos < end) {
532
949
  const tag = reader.uint32();
@@ -573,6 +990,13 @@ var TokenOutput = {
573
990
  message.tokenPublicKey = reader.bytes();
574
991
  continue;
575
992
  }
993
+ case 8: {
994
+ if (tag !== 66) {
995
+ break;
996
+ }
997
+ message.tokenIdentifier = reader.bytes();
998
+ continue;
999
+ }
576
1000
  case 7: {
577
1001
  if (tag !== 58) {
578
1002
  break;
@@ -595,7 +1019,8 @@ var TokenOutput = {
595
1019
  revocationCommitment: isSet3(object.revocationCommitment) ? bytesFromBase642(object.revocationCommitment) : void 0,
596
1020
  withdrawBondSats: isSet3(object.withdrawBondSats) ? globalThis.Number(object.withdrawBondSats) : void 0,
597
1021
  withdrawRelativeBlockLocktime: isSet3(object.withdrawRelativeBlockLocktime) ? globalThis.Number(object.withdrawRelativeBlockLocktime) : void 0,
598
- tokenPublicKey: isSet3(object.tokenPublicKey) ? bytesFromBase642(object.tokenPublicKey) : new Uint8Array(0),
1022
+ tokenPublicKey: isSet3(object.tokenPublicKey) ? bytesFromBase642(object.tokenPublicKey) : void 0,
1023
+ tokenIdentifier: isSet3(object.tokenIdentifier) ? bytesFromBase642(object.tokenIdentifier) : void 0,
599
1024
  tokenAmount: isSet3(object.tokenAmount) ? bytesFromBase642(object.tokenAmount) : new Uint8Array(0)
600
1025
  };
601
1026
  },
@@ -616,9 +1041,12 @@ var TokenOutput = {
616
1041
  if (message.withdrawRelativeBlockLocktime !== void 0) {
617
1042
  obj.withdrawRelativeBlockLocktime = Math.round(message.withdrawRelativeBlockLocktime);
618
1043
  }
619
- if (message.tokenPublicKey.length !== 0) {
1044
+ if (message.tokenPublicKey !== void 0) {
620
1045
  obj.tokenPublicKey = base64FromBytes2(message.tokenPublicKey);
621
1046
  }
1047
+ if (message.tokenIdentifier !== void 0) {
1048
+ obj.tokenIdentifier = base64FromBytes2(message.tokenIdentifier);
1049
+ }
622
1050
  if (message.tokenAmount.length !== 0) {
623
1051
  obj.tokenAmount = base64FromBytes2(message.tokenAmount);
624
1052
  }
@@ -634,7 +1062,8 @@ var TokenOutput = {
634
1062
  message.revocationCommitment = object.revocationCommitment ?? void 0;
635
1063
  message.withdrawBondSats = object.withdrawBondSats ?? void 0;
636
1064
  message.withdrawRelativeBlockLocktime = object.withdrawRelativeBlockLocktime ?? void 0;
637
- message.tokenPublicKey = object.tokenPublicKey ?? new Uint8Array(0);
1065
+ message.tokenPublicKey = object.tokenPublicKey ?? void 0;
1066
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
638
1067
  message.tokenAmount = object.tokenAmount ?? new Uint8Array(0);
639
1068
  return message;
640
1069
  }
@@ -646,7 +1075,8 @@ function createBaseTokenTransaction() {
646
1075
  tokenOutputs: [],
647
1076
  sparkOperatorIdentityPublicKeys: [],
648
1077
  expiryTime: void 0,
649
- network: 0
1078
+ network: 0,
1079
+ clientCreatedTimestamp: void 0
650
1080
  };
651
1081
  }
652
1082
  var TokenTransaction = {
@@ -661,6 +1091,9 @@ var TokenTransaction = {
661
1091
  case "transferInput":
662
1092
  TokenTransferInput.encode(message.tokenInputs.transferInput, writer.uint32(26).fork()).join();
663
1093
  break;
1094
+ case "createInput":
1095
+ TokenCreateInput.encode(message.tokenInputs.createInput, writer.uint32(66).fork()).join();
1096
+ break;
664
1097
  }
665
1098
  for (const v of message.tokenOutputs) {
666
1099
  TokenOutput.encode(v, writer.uint32(34).fork()).join();
@@ -669,16 +1102,19 @@ var TokenTransaction = {
669
1102
  writer.uint32(42).bytes(v);
670
1103
  }
671
1104
  if (message.expiryTime !== void 0) {
672
- Timestamp.encode(toTimestamp(message.expiryTime), writer.uint32(50).fork()).join();
1105
+ Timestamp.encode(toTimestamp2(message.expiryTime), writer.uint32(50).fork()).join();
673
1106
  }
674
1107
  if (message.network !== 0) {
675
1108
  writer.uint32(56).int32(message.network);
676
1109
  }
1110
+ if (message.clientCreatedTimestamp !== void 0) {
1111
+ Timestamp.encode(toTimestamp2(message.clientCreatedTimestamp), writer.uint32(74).fork()).join();
1112
+ }
677
1113
  return writer;
678
1114
  },
679
1115
  decode(input, length) {
680
1116
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
681
- let end = length === void 0 ? reader.len : reader.pos + length;
1117
+ const end = length === void 0 ? reader.len : reader.pos + length;
682
1118
  const message = createBaseTokenTransaction();
683
1119
  while (reader.pos < end) {
684
1120
  const tag = reader.uint32();
@@ -707,6 +1143,13 @@ var TokenTransaction = {
707
1143
  };
708
1144
  continue;
709
1145
  }
1146
+ case 8: {
1147
+ if (tag !== 66) {
1148
+ break;
1149
+ }
1150
+ message.tokenInputs = { $case: "createInput", createInput: TokenCreateInput.decode(reader, reader.uint32()) };
1151
+ continue;
1152
+ }
710
1153
  case 4: {
711
1154
  if (tag !== 34) {
712
1155
  break;
@@ -725,7 +1168,7 @@ var TokenTransaction = {
725
1168
  if (tag !== 50) {
726
1169
  break;
727
1170
  }
728
- message.expiryTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1171
+ message.expiryTime = fromTimestamp2(Timestamp.decode(reader, reader.uint32()));
729
1172
  continue;
730
1173
  }
731
1174
  case 7: {
@@ -735,6 +1178,13 @@ var TokenTransaction = {
735
1178
  message.network = reader.int32();
736
1179
  continue;
737
1180
  }
1181
+ case 9: {
1182
+ if (tag !== 74) {
1183
+ break;
1184
+ }
1185
+ message.clientCreatedTimestamp = fromTimestamp2(Timestamp.decode(reader, reader.uint32()));
1186
+ continue;
1187
+ }
738
1188
  }
739
1189
  if ((tag & 7) === 4 || tag === 0) {
740
1190
  break;
@@ -746,11 +1196,12 @@ var TokenTransaction = {
746
1196
  fromJSON(object) {
747
1197
  return {
748
1198
  version: isSet3(object.version) ? globalThis.Number(object.version) : 0,
749
- tokenInputs: isSet3(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet3(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : void 0,
1199
+ tokenInputs: isSet3(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet3(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : isSet3(object.createInput) ? { $case: "createInput", createInput: TokenCreateInput.fromJSON(object.createInput) } : void 0,
750
1200
  tokenOutputs: globalThis.Array.isArray(object?.tokenOutputs) ? object.tokenOutputs.map((e) => TokenOutput.fromJSON(e)) : [],
751
1201
  sparkOperatorIdentityPublicKeys: globalThis.Array.isArray(object?.sparkOperatorIdentityPublicKeys) ? object.sparkOperatorIdentityPublicKeys.map((e) => bytesFromBase642(e)) : [],
752
- expiryTime: isSet3(object.expiryTime) ? fromJsonTimestamp(object.expiryTime) : void 0,
753
- network: isSet3(object.network) ? networkFromJSON(object.network) : 0
1202
+ expiryTime: isSet3(object.expiryTime) ? fromJsonTimestamp2(object.expiryTime) : void 0,
1203
+ network: isSet3(object.network) ? networkFromJSON(object.network) : 0,
1204
+ clientCreatedTimestamp: isSet3(object.clientCreatedTimestamp) ? fromJsonTimestamp2(object.clientCreatedTimestamp) : void 0
754
1205
  };
755
1206
  },
756
1207
  toJSON(message) {
@@ -762,6 +1213,8 @@ var TokenTransaction = {
762
1213
  obj.mintInput = TokenMintInput.toJSON(message.tokenInputs.mintInput);
763
1214
  } else if (message.tokenInputs?.$case === "transferInput") {
764
1215
  obj.transferInput = TokenTransferInput.toJSON(message.tokenInputs.transferInput);
1216
+ } else if (message.tokenInputs?.$case === "createInput") {
1217
+ obj.createInput = TokenCreateInput.toJSON(message.tokenInputs.createInput);
765
1218
  }
766
1219
  if (message.tokenOutputs?.length) {
767
1220
  obj.tokenOutputs = message.tokenOutputs.map((e) => TokenOutput.toJSON(e));
@@ -775,6 +1228,9 @@ var TokenTransaction = {
775
1228
  if (message.network !== 0) {
776
1229
  obj.network = networkToJSON(message.network);
777
1230
  }
1231
+ if (message.clientCreatedTimestamp !== void 0) {
1232
+ obj.clientCreatedTimestamp = message.clientCreatedTimestamp.toISOString();
1233
+ }
778
1234
  return obj;
779
1235
  },
780
1236
  create(base) {
@@ -802,11 +1258,21 @@ var TokenTransaction = {
802
1258
  }
803
1259
  break;
804
1260
  }
1261
+ case "createInput": {
1262
+ if (object.tokenInputs?.createInput !== void 0 && object.tokenInputs?.createInput !== null) {
1263
+ message.tokenInputs = {
1264
+ $case: "createInput",
1265
+ createInput: TokenCreateInput.fromPartial(object.tokenInputs.createInput)
1266
+ };
1267
+ }
1268
+ break;
1269
+ }
805
1270
  }
806
1271
  message.tokenOutputs = object.tokenOutputs?.map((e) => TokenOutput.fromPartial(e)) || [];
807
1272
  message.sparkOperatorIdentityPublicKeys = object.sparkOperatorIdentityPublicKeys?.map((e) => e) || [];
808
1273
  message.expiryTime = object.expiryTime ?? void 0;
809
1274
  message.network = object.network ?? 0;
1275
+ message.clientCreatedTimestamp = object.clientCreatedTimestamp ?? void 0;
810
1276
  return message;
811
1277
  }
812
1278
  };
@@ -825,7 +1291,7 @@ var SignatureWithIndex = {
825
1291
  },
826
1292
  decode(input, length) {
827
1293
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
828
- let end = length === void 0 ? reader.len : reader.pos + length;
1294
+ const end = length === void 0 ? reader.len : reader.pos + length;
829
1295
  const message = createBaseSignatureWithIndex();
830
1296
  while (reader.pos < end) {
831
1297
  const tag = reader.uint32();
@@ -893,7 +1359,7 @@ var InputTtxoSignaturesPerOperator = {
893
1359
  },
894
1360
  decode(input, length) {
895
1361
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
896
- let end = length === void 0 ? reader.len : reader.pos + length;
1362
+ const end = length === void 0 ? reader.len : reader.pos + length;
897
1363
  const message = createBaseInputTtxoSignaturesPerOperator();
898
1364
  while (reader.pos < end) {
899
1365
  const tag = reader.uint32();
@@ -972,7 +1438,7 @@ var StartTransactionRequest = {
972
1438
  },
973
1439
  decode(input, length) {
974
1440
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
975
- let end = length === void 0 ? reader.len : reader.pos + length;
1441
+ const end = length === void 0 ? reader.len : reader.pos + length;
976
1442
  const message = createBaseStartTransactionRequest();
977
1443
  while (reader.pos < end) {
978
1444
  const tag = reader.uint32();
@@ -1066,7 +1532,7 @@ var StartTransactionResponse = {
1066
1532
  },
1067
1533
  decode(input, length) {
1068
1534
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1069
- let end = length === void 0 ? reader.len : reader.pos + length;
1535
+ const end = length === void 0 ? reader.len : reader.pos + length;
1070
1536
  const message = createBaseStartTransactionResponse();
1071
1537
  while (reader.pos < end) {
1072
1538
  const tag = reader.uint32();
@@ -1145,7 +1611,7 @@ var CommitTransactionRequest = {
1145
1611
  },
1146
1612
  decode(input, length) {
1147
1613
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1148
- let end = length === void 0 ? reader.len : reader.pos + length;
1614
+ const end = length === void 0 ? reader.len : reader.pos + length;
1149
1615
  const message = createBaseCommitTransactionRequest();
1150
1616
  while (reader.pos < end) {
1151
1617
  const tag = reader.uint32();
@@ -1233,7 +1699,7 @@ var CommitTransactionResponse = {
1233
1699
  },
1234
1700
  decode(input, length) {
1235
1701
  const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1236
- let end = length === void 0 ? reader.len : reader.pos + length;
1702
+ const end = length === void 0 ? reader.len : reader.pos + length;
1237
1703
  const message = createBaseCommitTransactionResponse();
1238
1704
  while (reader.pos < end) {
1239
1705
  const tag = reader.uint32();
@@ -1261,21 +1727,972 @@ var CommitTransactionResponse = {
1261
1727
  return message;
1262
1728
  }
1263
1729
  };
1264
- var SparkTokenServiceDefinition = {
1265
- name: "SparkTokenService",
1266
- fullName: "spark_token.SparkTokenService",
1267
- methods: {
1268
- /**
1269
- * Start process to create final token transaction with all inputs required
1270
- * from user and SOs (including revocation secret commitment)
1271
- */
1272
- start_transaction: {
1273
- name: "start_transaction",
1274
- requestType: StartTransactionRequest,
1275
- requestStream: false,
1276
- responseType: StartTransactionResponse,
1277
- responseStream: false,
1278
- options: {}
1730
+ function createBaseQueryTokenMetadataRequest() {
1731
+ return { tokenIdentifiers: [], issuerPublicKeys: [] };
1732
+ }
1733
+ var QueryTokenMetadataRequest = {
1734
+ encode(message, writer = new import_wire5.BinaryWriter()) {
1735
+ for (const v of message.tokenIdentifiers) {
1736
+ writer.uint32(10).bytes(v);
1737
+ }
1738
+ for (const v of message.issuerPublicKeys) {
1739
+ writer.uint32(18).bytes(v);
1740
+ }
1741
+ return writer;
1742
+ },
1743
+ decode(input, length) {
1744
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1745
+ const end = length === void 0 ? reader.len : reader.pos + length;
1746
+ const message = createBaseQueryTokenMetadataRequest();
1747
+ while (reader.pos < end) {
1748
+ const tag = reader.uint32();
1749
+ switch (tag >>> 3) {
1750
+ case 1: {
1751
+ if (tag !== 10) {
1752
+ break;
1753
+ }
1754
+ message.tokenIdentifiers.push(reader.bytes());
1755
+ continue;
1756
+ }
1757
+ case 2: {
1758
+ if (tag !== 18) {
1759
+ break;
1760
+ }
1761
+ message.issuerPublicKeys.push(reader.bytes());
1762
+ continue;
1763
+ }
1764
+ }
1765
+ if ((tag & 7) === 4 || tag === 0) {
1766
+ break;
1767
+ }
1768
+ reader.skip(tag & 7);
1769
+ }
1770
+ return message;
1771
+ },
1772
+ fromJSON(object) {
1773
+ return {
1774
+ tokenIdentifiers: globalThis.Array.isArray(object?.tokenIdentifiers) ? object.tokenIdentifiers.map((e) => bytesFromBase642(e)) : [],
1775
+ issuerPublicKeys: globalThis.Array.isArray(object?.issuerPublicKeys) ? object.issuerPublicKeys.map((e) => bytesFromBase642(e)) : []
1776
+ };
1777
+ },
1778
+ toJSON(message) {
1779
+ const obj = {};
1780
+ if (message.tokenIdentifiers?.length) {
1781
+ obj.tokenIdentifiers = message.tokenIdentifiers.map((e) => base64FromBytes2(e));
1782
+ }
1783
+ if (message.issuerPublicKeys?.length) {
1784
+ obj.issuerPublicKeys = message.issuerPublicKeys.map((e) => base64FromBytes2(e));
1785
+ }
1786
+ return obj;
1787
+ },
1788
+ create(base) {
1789
+ return QueryTokenMetadataRequest.fromPartial(base ?? {});
1790
+ },
1791
+ fromPartial(object) {
1792
+ const message = createBaseQueryTokenMetadataRequest();
1793
+ message.tokenIdentifiers = object.tokenIdentifiers?.map((e) => e) || [];
1794
+ message.issuerPublicKeys = object.issuerPublicKeys?.map((e) => e) || [];
1795
+ return message;
1796
+ }
1797
+ };
1798
+ function createBaseTokenMetadata() {
1799
+ return {
1800
+ issuerPublicKey: new Uint8Array(0),
1801
+ tokenName: "",
1802
+ tokenTicker: "",
1803
+ decimals: 0,
1804
+ maxSupply: new Uint8Array(0),
1805
+ isFreezable: false,
1806
+ creationEntityPublicKey: void 0,
1807
+ tokenIdentifier: new Uint8Array(0)
1808
+ };
1809
+ }
1810
+ var TokenMetadata = {
1811
+ encode(message, writer = new import_wire5.BinaryWriter()) {
1812
+ if (message.issuerPublicKey.length !== 0) {
1813
+ writer.uint32(10).bytes(message.issuerPublicKey);
1814
+ }
1815
+ if (message.tokenName !== "") {
1816
+ writer.uint32(18).string(message.tokenName);
1817
+ }
1818
+ if (message.tokenTicker !== "") {
1819
+ writer.uint32(26).string(message.tokenTicker);
1820
+ }
1821
+ if (message.decimals !== 0) {
1822
+ writer.uint32(32).uint32(message.decimals);
1823
+ }
1824
+ if (message.maxSupply.length !== 0) {
1825
+ writer.uint32(42).bytes(message.maxSupply);
1826
+ }
1827
+ if (message.isFreezable !== false) {
1828
+ writer.uint32(48).bool(message.isFreezable);
1829
+ }
1830
+ if (message.creationEntityPublicKey !== void 0) {
1831
+ writer.uint32(58).bytes(message.creationEntityPublicKey);
1832
+ }
1833
+ if (message.tokenIdentifier.length !== 0) {
1834
+ writer.uint32(66).bytes(message.tokenIdentifier);
1835
+ }
1836
+ return writer;
1837
+ },
1838
+ decode(input, length) {
1839
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1840
+ const end = length === void 0 ? reader.len : reader.pos + length;
1841
+ const message = createBaseTokenMetadata();
1842
+ while (reader.pos < end) {
1843
+ const tag = reader.uint32();
1844
+ switch (tag >>> 3) {
1845
+ case 1: {
1846
+ if (tag !== 10) {
1847
+ break;
1848
+ }
1849
+ message.issuerPublicKey = reader.bytes();
1850
+ continue;
1851
+ }
1852
+ case 2: {
1853
+ if (tag !== 18) {
1854
+ break;
1855
+ }
1856
+ message.tokenName = reader.string();
1857
+ continue;
1858
+ }
1859
+ case 3: {
1860
+ if (tag !== 26) {
1861
+ break;
1862
+ }
1863
+ message.tokenTicker = reader.string();
1864
+ continue;
1865
+ }
1866
+ case 4: {
1867
+ if (tag !== 32) {
1868
+ break;
1869
+ }
1870
+ message.decimals = reader.uint32();
1871
+ continue;
1872
+ }
1873
+ case 5: {
1874
+ if (tag !== 42) {
1875
+ break;
1876
+ }
1877
+ message.maxSupply = reader.bytes();
1878
+ continue;
1879
+ }
1880
+ case 6: {
1881
+ if (tag !== 48) {
1882
+ break;
1883
+ }
1884
+ message.isFreezable = reader.bool();
1885
+ continue;
1886
+ }
1887
+ case 7: {
1888
+ if (tag !== 58) {
1889
+ break;
1890
+ }
1891
+ message.creationEntityPublicKey = reader.bytes();
1892
+ continue;
1893
+ }
1894
+ case 8: {
1895
+ if (tag !== 66) {
1896
+ break;
1897
+ }
1898
+ message.tokenIdentifier = reader.bytes();
1899
+ continue;
1900
+ }
1901
+ }
1902
+ if ((tag & 7) === 4 || tag === 0) {
1903
+ break;
1904
+ }
1905
+ reader.skip(tag & 7);
1906
+ }
1907
+ return message;
1908
+ },
1909
+ fromJSON(object) {
1910
+ return {
1911
+ issuerPublicKey: isSet3(object.issuerPublicKey) ? bytesFromBase642(object.issuerPublicKey) : new Uint8Array(0),
1912
+ tokenName: isSet3(object.tokenName) ? globalThis.String(object.tokenName) : "",
1913
+ tokenTicker: isSet3(object.tokenTicker) ? globalThis.String(object.tokenTicker) : "",
1914
+ decimals: isSet3(object.decimals) ? globalThis.Number(object.decimals) : 0,
1915
+ maxSupply: isSet3(object.maxSupply) ? bytesFromBase642(object.maxSupply) : new Uint8Array(0),
1916
+ isFreezable: isSet3(object.isFreezable) ? globalThis.Boolean(object.isFreezable) : false,
1917
+ creationEntityPublicKey: isSet3(object.creationEntityPublicKey) ? bytesFromBase642(object.creationEntityPublicKey) : void 0,
1918
+ tokenIdentifier: isSet3(object.tokenIdentifier) ? bytesFromBase642(object.tokenIdentifier) : new Uint8Array(0)
1919
+ };
1920
+ },
1921
+ toJSON(message) {
1922
+ const obj = {};
1923
+ if (message.issuerPublicKey.length !== 0) {
1924
+ obj.issuerPublicKey = base64FromBytes2(message.issuerPublicKey);
1925
+ }
1926
+ if (message.tokenName !== "") {
1927
+ obj.tokenName = message.tokenName;
1928
+ }
1929
+ if (message.tokenTicker !== "") {
1930
+ obj.tokenTicker = message.tokenTicker;
1931
+ }
1932
+ if (message.decimals !== 0) {
1933
+ obj.decimals = Math.round(message.decimals);
1934
+ }
1935
+ if (message.maxSupply.length !== 0) {
1936
+ obj.maxSupply = base64FromBytes2(message.maxSupply);
1937
+ }
1938
+ if (message.isFreezable !== false) {
1939
+ obj.isFreezable = message.isFreezable;
1940
+ }
1941
+ if (message.creationEntityPublicKey !== void 0) {
1942
+ obj.creationEntityPublicKey = base64FromBytes2(message.creationEntityPublicKey);
1943
+ }
1944
+ if (message.tokenIdentifier.length !== 0) {
1945
+ obj.tokenIdentifier = base64FromBytes2(message.tokenIdentifier);
1946
+ }
1947
+ return obj;
1948
+ },
1949
+ create(base) {
1950
+ return TokenMetadata.fromPartial(base ?? {});
1951
+ },
1952
+ fromPartial(object) {
1953
+ const message = createBaseTokenMetadata();
1954
+ message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
1955
+ message.tokenName = object.tokenName ?? "";
1956
+ message.tokenTicker = object.tokenTicker ?? "";
1957
+ message.decimals = object.decimals ?? 0;
1958
+ message.maxSupply = object.maxSupply ?? new Uint8Array(0);
1959
+ message.isFreezable = object.isFreezable ?? false;
1960
+ message.creationEntityPublicKey = object.creationEntityPublicKey ?? void 0;
1961
+ message.tokenIdentifier = object.tokenIdentifier ?? new Uint8Array(0);
1962
+ return message;
1963
+ }
1964
+ };
1965
+ function createBaseQueryTokenMetadataResponse() {
1966
+ return { tokenMetadata: [] };
1967
+ }
1968
+ var QueryTokenMetadataResponse = {
1969
+ encode(message, writer = new import_wire5.BinaryWriter()) {
1970
+ for (const v of message.tokenMetadata) {
1971
+ TokenMetadata.encode(v, writer.uint32(10).fork()).join();
1972
+ }
1973
+ return writer;
1974
+ },
1975
+ decode(input, length) {
1976
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
1977
+ const end = length === void 0 ? reader.len : reader.pos + length;
1978
+ const message = createBaseQueryTokenMetadataResponse();
1979
+ while (reader.pos < end) {
1980
+ const tag = reader.uint32();
1981
+ switch (tag >>> 3) {
1982
+ case 1: {
1983
+ if (tag !== 10) {
1984
+ break;
1985
+ }
1986
+ message.tokenMetadata.push(TokenMetadata.decode(reader, reader.uint32()));
1987
+ continue;
1988
+ }
1989
+ }
1990
+ if ((tag & 7) === 4 || tag === 0) {
1991
+ break;
1992
+ }
1993
+ reader.skip(tag & 7);
1994
+ }
1995
+ return message;
1996
+ },
1997
+ fromJSON(object) {
1998
+ return {
1999
+ tokenMetadata: globalThis.Array.isArray(object?.tokenMetadata) ? object.tokenMetadata.map((e) => TokenMetadata.fromJSON(e)) : []
2000
+ };
2001
+ },
2002
+ toJSON(message) {
2003
+ const obj = {};
2004
+ if (message.tokenMetadata?.length) {
2005
+ obj.tokenMetadata = message.tokenMetadata.map((e) => TokenMetadata.toJSON(e));
2006
+ }
2007
+ return obj;
2008
+ },
2009
+ create(base) {
2010
+ return QueryTokenMetadataResponse.fromPartial(base ?? {});
2011
+ },
2012
+ fromPartial(object) {
2013
+ const message = createBaseQueryTokenMetadataResponse();
2014
+ message.tokenMetadata = object.tokenMetadata?.map((e) => TokenMetadata.fromPartial(e)) || [];
2015
+ return message;
2016
+ }
2017
+ };
2018
+ function createBaseQueryTokenOutputsRequest() {
2019
+ return { ownerPublicKeys: [], issuerPublicKeys: [], tokenIdentifiers: [], network: 0 };
2020
+ }
2021
+ var QueryTokenOutputsRequest = {
2022
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2023
+ for (const v of message.ownerPublicKeys) {
2024
+ writer.uint32(10).bytes(v);
2025
+ }
2026
+ for (const v of message.issuerPublicKeys) {
2027
+ writer.uint32(18).bytes(v);
2028
+ }
2029
+ for (const v of message.tokenIdentifiers) {
2030
+ writer.uint32(34).bytes(v);
2031
+ }
2032
+ if (message.network !== 0) {
2033
+ writer.uint32(24).int32(message.network);
2034
+ }
2035
+ return writer;
2036
+ },
2037
+ decode(input, length) {
2038
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2039
+ const end = length === void 0 ? reader.len : reader.pos + length;
2040
+ const message = createBaseQueryTokenOutputsRequest();
2041
+ while (reader.pos < end) {
2042
+ const tag = reader.uint32();
2043
+ switch (tag >>> 3) {
2044
+ case 1: {
2045
+ if (tag !== 10) {
2046
+ break;
2047
+ }
2048
+ message.ownerPublicKeys.push(reader.bytes());
2049
+ continue;
2050
+ }
2051
+ case 2: {
2052
+ if (tag !== 18) {
2053
+ break;
2054
+ }
2055
+ message.issuerPublicKeys.push(reader.bytes());
2056
+ continue;
2057
+ }
2058
+ case 4: {
2059
+ if (tag !== 34) {
2060
+ break;
2061
+ }
2062
+ message.tokenIdentifiers.push(reader.bytes());
2063
+ continue;
2064
+ }
2065
+ case 3: {
2066
+ if (tag !== 24) {
2067
+ break;
2068
+ }
2069
+ message.network = reader.int32();
2070
+ continue;
2071
+ }
2072
+ }
2073
+ if ((tag & 7) === 4 || tag === 0) {
2074
+ break;
2075
+ }
2076
+ reader.skip(tag & 7);
2077
+ }
2078
+ return message;
2079
+ },
2080
+ fromJSON(object) {
2081
+ return {
2082
+ ownerPublicKeys: globalThis.Array.isArray(object?.ownerPublicKeys) ? object.ownerPublicKeys.map((e) => bytesFromBase642(e)) : [],
2083
+ issuerPublicKeys: globalThis.Array.isArray(object?.issuerPublicKeys) ? object.issuerPublicKeys.map((e) => bytesFromBase642(e)) : [],
2084
+ tokenIdentifiers: globalThis.Array.isArray(object?.tokenIdentifiers) ? object.tokenIdentifiers.map((e) => bytesFromBase642(e)) : [],
2085
+ network: isSet3(object.network) ? networkFromJSON(object.network) : 0
2086
+ };
2087
+ },
2088
+ toJSON(message) {
2089
+ const obj = {};
2090
+ if (message.ownerPublicKeys?.length) {
2091
+ obj.ownerPublicKeys = message.ownerPublicKeys.map((e) => base64FromBytes2(e));
2092
+ }
2093
+ if (message.issuerPublicKeys?.length) {
2094
+ obj.issuerPublicKeys = message.issuerPublicKeys.map((e) => base64FromBytes2(e));
2095
+ }
2096
+ if (message.tokenIdentifiers?.length) {
2097
+ obj.tokenIdentifiers = message.tokenIdentifiers.map((e) => base64FromBytes2(e));
2098
+ }
2099
+ if (message.network !== 0) {
2100
+ obj.network = networkToJSON(message.network);
2101
+ }
2102
+ return obj;
2103
+ },
2104
+ create(base) {
2105
+ return QueryTokenOutputsRequest.fromPartial(base ?? {});
2106
+ },
2107
+ fromPartial(object) {
2108
+ const message = createBaseQueryTokenOutputsRequest();
2109
+ message.ownerPublicKeys = object.ownerPublicKeys?.map((e) => e) || [];
2110
+ message.issuerPublicKeys = object.issuerPublicKeys?.map((e) => e) || [];
2111
+ message.tokenIdentifiers = object.tokenIdentifiers?.map((e) => e) || [];
2112
+ message.network = object.network ?? 0;
2113
+ return message;
2114
+ }
2115
+ };
2116
+ function createBaseQueryTokenTransactionsRequest() {
2117
+ return {
2118
+ outputIds: [],
2119
+ ownerPublicKeys: [],
2120
+ issuerPublicKeys: [],
2121
+ tokenIdentifiers: [],
2122
+ tokenTransactionHashes: [],
2123
+ limit: 0,
2124
+ offset: 0
2125
+ };
2126
+ }
2127
+ var QueryTokenTransactionsRequest = {
2128
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2129
+ for (const v of message.outputIds) {
2130
+ writer.uint32(10).string(v);
2131
+ }
2132
+ for (const v of message.ownerPublicKeys) {
2133
+ writer.uint32(18).bytes(v);
2134
+ }
2135
+ for (const v of message.issuerPublicKeys) {
2136
+ writer.uint32(26).bytes(v);
2137
+ }
2138
+ for (const v of message.tokenIdentifiers) {
2139
+ writer.uint32(58).bytes(v);
2140
+ }
2141
+ for (const v of message.tokenTransactionHashes) {
2142
+ writer.uint32(34).bytes(v);
2143
+ }
2144
+ if (message.limit !== 0) {
2145
+ writer.uint32(40).int64(message.limit);
2146
+ }
2147
+ if (message.offset !== 0) {
2148
+ writer.uint32(48).int64(message.offset);
2149
+ }
2150
+ return writer;
2151
+ },
2152
+ decode(input, length) {
2153
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2154
+ const end = length === void 0 ? reader.len : reader.pos + length;
2155
+ const message = createBaseQueryTokenTransactionsRequest();
2156
+ while (reader.pos < end) {
2157
+ const tag = reader.uint32();
2158
+ switch (tag >>> 3) {
2159
+ case 1: {
2160
+ if (tag !== 10) {
2161
+ break;
2162
+ }
2163
+ message.outputIds.push(reader.string());
2164
+ continue;
2165
+ }
2166
+ case 2: {
2167
+ if (tag !== 18) {
2168
+ break;
2169
+ }
2170
+ message.ownerPublicKeys.push(reader.bytes());
2171
+ continue;
2172
+ }
2173
+ case 3: {
2174
+ if (tag !== 26) {
2175
+ break;
2176
+ }
2177
+ message.issuerPublicKeys.push(reader.bytes());
2178
+ continue;
2179
+ }
2180
+ case 7: {
2181
+ if (tag !== 58) {
2182
+ break;
2183
+ }
2184
+ message.tokenIdentifiers.push(reader.bytes());
2185
+ continue;
2186
+ }
2187
+ case 4: {
2188
+ if (tag !== 34) {
2189
+ break;
2190
+ }
2191
+ message.tokenTransactionHashes.push(reader.bytes());
2192
+ continue;
2193
+ }
2194
+ case 5: {
2195
+ if (tag !== 40) {
2196
+ break;
2197
+ }
2198
+ message.limit = longToNumber2(reader.int64());
2199
+ continue;
2200
+ }
2201
+ case 6: {
2202
+ if (tag !== 48) {
2203
+ break;
2204
+ }
2205
+ message.offset = longToNumber2(reader.int64());
2206
+ continue;
2207
+ }
2208
+ }
2209
+ if ((tag & 7) === 4 || tag === 0) {
2210
+ break;
2211
+ }
2212
+ reader.skip(tag & 7);
2213
+ }
2214
+ return message;
2215
+ },
2216
+ fromJSON(object) {
2217
+ return {
2218
+ outputIds: globalThis.Array.isArray(object?.outputIds) ? object.outputIds.map((e) => globalThis.String(e)) : [],
2219
+ ownerPublicKeys: globalThis.Array.isArray(object?.ownerPublicKeys) ? object.ownerPublicKeys.map((e) => bytesFromBase642(e)) : [],
2220
+ issuerPublicKeys: globalThis.Array.isArray(object?.issuerPublicKeys) ? object.issuerPublicKeys.map((e) => bytesFromBase642(e)) : [],
2221
+ tokenIdentifiers: globalThis.Array.isArray(object?.tokenIdentifiers) ? object.tokenIdentifiers.map((e) => bytesFromBase642(e)) : [],
2222
+ tokenTransactionHashes: globalThis.Array.isArray(object?.tokenTransactionHashes) ? object.tokenTransactionHashes.map((e) => bytesFromBase642(e)) : [],
2223
+ limit: isSet3(object.limit) ? globalThis.Number(object.limit) : 0,
2224
+ offset: isSet3(object.offset) ? globalThis.Number(object.offset) : 0
2225
+ };
2226
+ },
2227
+ toJSON(message) {
2228
+ const obj = {};
2229
+ if (message.outputIds?.length) {
2230
+ obj.outputIds = message.outputIds;
2231
+ }
2232
+ if (message.ownerPublicKeys?.length) {
2233
+ obj.ownerPublicKeys = message.ownerPublicKeys.map((e) => base64FromBytes2(e));
2234
+ }
2235
+ if (message.issuerPublicKeys?.length) {
2236
+ obj.issuerPublicKeys = message.issuerPublicKeys.map((e) => base64FromBytes2(e));
2237
+ }
2238
+ if (message.tokenIdentifiers?.length) {
2239
+ obj.tokenIdentifiers = message.tokenIdentifiers.map((e) => base64FromBytes2(e));
2240
+ }
2241
+ if (message.tokenTransactionHashes?.length) {
2242
+ obj.tokenTransactionHashes = message.tokenTransactionHashes.map((e) => base64FromBytes2(e));
2243
+ }
2244
+ if (message.limit !== 0) {
2245
+ obj.limit = Math.round(message.limit);
2246
+ }
2247
+ if (message.offset !== 0) {
2248
+ obj.offset = Math.round(message.offset);
2249
+ }
2250
+ return obj;
2251
+ },
2252
+ create(base) {
2253
+ return QueryTokenTransactionsRequest.fromPartial(base ?? {});
2254
+ },
2255
+ fromPartial(object) {
2256
+ const message = createBaseQueryTokenTransactionsRequest();
2257
+ message.outputIds = object.outputIds?.map((e) => e) || [];
2258
+ message.ownerPublicKeys = object.ownerPublicKeys?.map((e) => e) || [];
2259
+ message.issuerPublicKeys = object.issuerPublicKeys?.map((e) => e) || [];
2260
+ message.tokenIdentifiers = object.tokenIdentifiers?.map((e) => e) || [];
2261
+ message.tokenTransactionHashes = object.tokenTransactionHashes?.map((e) => e) || [];
2262
+ message.limit = object.limit ?? 0;
2263
+ message.offset = object.offset ?? 0;
2264
+ return message;
2265
+ }
2266
+ };
2267
+ function createBaseQueryTokenTransactionsResponse() {
2268
+ return { tokenTransactionsWithStatus: [], offset: 0 };
2269
+ }
2270
+ var QueryTokenTransactionsResponse = {
2271
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2272
+ for (const v of message.tokenTransactionsWithStatus) {
2273
+ TokenTransactionWithStatus.encode(v, writer.uint32(10).fork()).join();
2274
+ }
2275
+ if (message.offset !== 0) {
2276
+ writer.uint32(16).int64(message.offset);
2277
+ }
2278
+ return writer;
2279
+ },
2280
+ decode(input, length) {
2281
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2282
+ const end = length === void 0 ? reader.len : reader.pos + length;
2283
+ const message = createBaseQueryTokenTransactionsResponse();
2284
+ while (reader.pos < end) {
2285
+ const tag = reader.uint32();
2286
+ switch (tag >>> 3) {
2287
+ case 1: {
2288
+ if (tag !== 10) {
2289
+ break;
2290
+ }
2291
+ message.tokenTransactionsWithStatus.push(TokenTransactionWithStatus.decode(reader, reader.uint32()));
2292
+ continue;
2293
+ }
2294
+ case 2: {
2295
+ if (tag !== 16) {
2296
+ break;
2297
+ }
2298
+ message.offset = longToNumber2(reader.int64());
2299
+ continue;
2300
+ }
2301
+ }
2302
+ if ((tag & 7) === 4 || tag === 0) {
2303
+ break;
2304
+ }
2305
+ reader.skip(tag & 7);
2306
+ }
2307
+ return message;
2308
+ },
2309
+ fromJSON(object) {
2310
+ return {
2311
+ tokenTransactionsWithStatus: globalThis.Array.isArray(object?.tokenTransactionsWithStatus) ? object.tokenTransactionsWithStatus.map((e) => TokenTransactionWithStatus.fromJSON(e)) : [],
2312
+ offset: isSet3(object.offset) ? globalThis.Number(object.offset) : 0
2313
+ };
2314
+ },
2315
+ toJSON(message) {
2316
+ const obj = {};
2317
+ if (message.tokenTransactionsWithStatus?.length) {
2318
+ obj.tokenTransactionsWithStatus = message.tokenTransactionsWithStatus.map(
2319
+ (e) => TokenTransactionWithStatus.toJSON(e)
2320
+ );
2321
+ }
2322
+ if (message.offset !== 0) {
2323
+ obj.offset = Math.round(message.offset);
2324
+ }
2325
+ return obj;
2326
+ },
2327
+ create(base) {
2328
+ return QueryTokenTransactionsResponse.fromPartial(base ?? {});
2329
+ },
2330
+ fromPartial(object) {
2331
+ const message = createBaseQueryTokenTransactionsResponse();
2332
+ message.tokenTransactionsWithStatus = object.tokenTransactionsWithStatus?.map((e) => TokenTransactionWithStatus.fromPartial(e)) || [];
2333
+ message.offset = object.offset ?? 0;
2334
+ return message;
2335
+ }
2336
+ };
2337
+ function createBaseOutputWithPreviousTransactionData() {
2338
+ return { output: void 0, previousTransactionHash: new Uint8Array(0), previousTransactionVout: 0 };
2339
+ }
2340
+ var OutputWithPreviousTransactionData = {
2341
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2342
+ if (message.output !== void 0) {
2343
+ TokenOutput.encode(message.output, writer.uint32(10).fork()).join();
2344
+ }
2345
+ if (message.previousTransactionHash.length !== 0) {
2346
+ writer.uint32(18).bytes(message.previousTransactionHash);
2347
+ }
2348
+ if (message.previousTransactionVout !== 0) {
2349
+ writer.uint32(24).uint32(message.previousTransactionVout);
2350
+ }
2351
+ return writer;
2352
+ },
2353
+ decode(input, length) {
2354
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2355
+ const end = length === void 0 ? reader.len : reader.pos + length;
2356
+ const message = createBaseOutputWithPreviousTransactionData();
2357
+ while (reader.pos < end) {
2358
+ const tag = reader.uint32();
2359
+ switch (tag >>> 3) {
2360
+ case 1: {
2361
+ if (tag !== 10) {
2362
+ break;
2363
+ }
2364
+ message.output = TokenOutput.decode(reader, reader.uint32());
2365
+ continue;
2366
+ }
2367
+ case 2: {
2368
+ if (tag !== 18) {
2369
+ break;
2370
+ }
2371
+ message.previousTransactionHash = reader.bytes();
2372
+ continue;
2373
+ }
2374
+ case 3: {
2375
+ if (tag !== 24) {
2376
+ break;
2377
+ }
2378
+ message.previousTransactionVout = reader.uint32();
2379
+ continue;
2380
+ }
2381
+ }
2382
+ if ((tag & 7) === 4 || tag === 0) {
2383
+ break;
2384
+ }
2385
+ reader.skip(tag & 7);
2386
+ }
2387
+ return message;
2388
+ },
2389
+ fromJSON(object) {
2390
+ return {
2391
+ output: isSet3(object.output) ? TokenOutput.fromJSON(object.output) : void 0,
2392
+ previousTransactionHash: isSet3(object.previousTransactionHash) ? bytesFromBase642(object.previousTransactionHash) : new Uint8Array(0),
2393
+ previousTransactionVout: isSet3(object.previousTransactionVout) ? globalThis.Number(object.previousTransactionVout) : 0
2394
+ };
2395
+ },
2396
+ toJSON(message) {
2397
+ const obj = {};
2398
+ if (message.output !== void 0) {
2399
+ obj.output = TokenOutput.toJSON(message.output);
2400
+ }
2401
+ if (message.previousTransactionHash.length !== 0) {
2402
+ obj.previousTransactionHash = base64FromBytes2(message.previousTransactionHash);
2403
+ }
2404
+ if (message.previousTransactionVout !== 0) {
2405
+ obj.previousTransactionVout = Math.round(message.previousTransactionVout);
2406
+ }
2407
+ return obj;
2408
+ },
2409
+ create(base) {
2410
+ return OutputWithPreviousTransactionData.fromPartial(base ?? {});
2411
+ },
2412
+ fromPartial(object) {
2413
+ const message = createBaseOutputWithPreviousTransactionData();
2414
+ message.output = object.output !== void 0 && object.output !== null ? TokenOutput.fromPartial(object.output) : void 0;
2415
+ message.previousTransactionHash = object.previousTransactionHash ?? new Uint8Array(0);
2416
+ message.previousTransactionVout = object.previousTransactionVout ?? 0;
2417
+ return message;
2418
+ }
2419
+ };
2420
+ function createBaseQueryTokenOutputsResponse() {
2421
+ return { outputsWithPreviousTransactionData: [] };
2422
+ }
2423
+ var QueryTokenOutputsResponse = {
2424
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2425
+ for (const v of message.outputsWithPreviousTransactionData) {
2426
+ OutputWithPreviousTransactionData.encode(v, writer.uint32(10).fork()).join();
2427
+ }
2428
+ return writer;
2429
+ },
2430
+ decode(input, length) {
2431
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2432
+ const end = length === void 0 ? reader.len : reader.pos + length;
2433
+ const message = createBaseQueryTokenOutputsResponse();
2434
+ while (reader.pos < end) {
2435
+ const tag = reader.uint32();
2436
+ switch (tag >>> 3) {
2437
+ case 1: {
2438
+ if (tag !== 10) {
2439
+ break;
2440
+ }
2441
+ message.outputsWithPreviousTransactionData.push(
2442
+ OutputWithPreviousTransactionData.decode(reader, reader.uint32())
2443
+ );
2444
+ continue;
2445
+ }
2446
+ }
2447
+ if ((tag & 7) === 4 || tag === 0) {
2448
+ break;
2449
+ }
2450
+ reader.skip(tag & 7);
2451
+ }
2452
+ return message;
2453
+ },
2454
+ fromJSON(object) {
2455
+ return {
2456
+ outputsWithPreviousTransactionData: globalThis.Array.isArray(object?.outputsWithPreviousTransactionData) ? object.outputsWithPreviousTransactionData.map((e) => OutputWithPreviousTransactionData.fromJSON(e)) : []
2457
+ };
2458
+ },
2459
+ toJSON(message) {
2460
+ const obj = {};
2461
+ if (message.outputsWithPreviousTransactionData?.length) {
2462
+ obj.outputsWithPreviousTransactionData = message.outputsWithPreviousTransactionData.map(
2463
+ (e) => OutputWithPreviousTransactionData.toJSON(e)
2464
+ );
2465
+ }
2466
+ return obj;
2467
+ },
2468
+ create(base) {
2469
+ return QueryTokenOutputsResponse.fromPartial(base ?? {});
2470
+ },
2471
+ fromPartial(object) {
2472
+ const message = createBaseQueryTokenOutputsResponse();
2473
+ message.outputsWithPreviousTransactionData = object.outputsWithPreviousTransactionData?.map((e) => OutputWithPreviousTransactionData.fromPartial(e)) || [];
2474
+ return message;
2475
+ }
2476
+ };
2477
+ function createBaseSpentTokenOutputMetadata() {
2478
+ return { outputId: "", revocationSecret: new Uint8Array(0) };
2479
+ }
2480
+ var SpentTokenOutputMetadata = {
2481
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2482
+ if (message.outputId !== "") {
2483
+ writer.uint32(10).string(message.outputId);
2484
+ }
2485
+ if (message.revocationSecret.length !== 0) {
2486
+ writer.uint32(18).bytes(message.revocationSecret);
2487
+ }
2488
+ return writer;
2489
+ },
2490
+ decode(input, length) {
2491
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2492
+ const end = length === void 0 ? reader.len : reader.pos + length;
2493
+ const message = createBaseSpentTokenOutputMetadata();
2494
+ while (reader.pos < end) {
2495
+ const tag = reader.uint32();
2496
+ switch (tag >>> 3) {
2497
+ case 1: {
2498
+ if (tag !== 10) {
2499
+ break;
2500
+ }
2501
+ message.outputId = reader.string();
2502
+ continue;
2503
+ }
2504
+ case 2: {
2505
+ if (tag !== 18) {
2506
+ break;
2507
+ }
2508
+ message.revocationSecret = reader.bytes();
2509
+ continue;
2510
+ }
2511
+ }
2512
+ if ((tag & 7) === 4 || tag === 0) {
2513
+ break;
2514
+ }
2515
+ reader.skip(tag & 7);
2516
+ }
2517
+ return message;
2518
+ },
2519
+ fromJSON(object) {
2520
+ return {
2521
+ outputId: isSet3(object.outputId) ? globalThis.String(object.outputId) : "",
2522
+ revocationSecret: isSet3(object.revocationSecret) ? bytesFromBase642(object.revocationSecret) : new Uint8Array(0)
2523
+ };
2524
+ },
2525
+ toJSON(message) {
2526
+ const obj = {};
2527
+ if (message.outputId !== "") {
2528
+ obj.outputId = message.outputId;
2529
+ }
2530
+ if (message.revocationSecret.length !== 0) {
2531
+ obj.revocationSecret = base64FromBytes2(message.revocationSecret);
2532
+ }
2533
+ return obj;
2534
+ },
2535
+ create(base) {
2536
+ return SpentTokenOutputMetadata.fromPartial(base ?? {});
2537
+ },
2538
+ fromPartial(object) {
2539
+ const message = createBaseSpentTokenOutputMetadata();
2540
+ message.outputId = object.outputId ?? "";
2541
+ message.revocationSecret = object.revocationSecret ?? new Uint8Array(0);
2542
+ return message;
2543
+ }
2544
+ };
2545
+ function createBaseTokenTransactionConfirmationMetadata() {
2546
+ return { spentTokenOutputsMetadata: [] };
2547
+ }
2548
+ var TokenTransactionConfirmationMetadata = {
2549
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2550
+ for (const v of message.spentTokenOutputsMetadata) {
2551
+ SpentTokenOutputMetadata.encode(v, writer.uint32(10).fork()).join();
2552
+ }
2553
+ return writer;
2554
+ },
2555
+ decode(input, length) {
2556
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2557
+ const end = length === void 0 ? reader.len : reader.pos + length;
2558
+ const message = createBaseTokenTransactionConfirmationMetadata();
2559
+ while (reader.pos < end) {
2560
+ const tag = reader.uint32();
2561
+ switch (tag >>> 3) {
2562
+ case 1: {
2563
+ if (tag !== 10) {
2564
+ break;
2565
+ }
2566
+ message.spentTokenOutputsMetadata.push(SpentTokenOutputMetadata.decode(reader, reader.uint32()));
2567
+ continue;
2568
+ }
2569
+ }
2570
+ if ((tag & 7) === 4 || tag === 0) {
2571
+ break;
2572
+ }
2573
+ reader.skip(tag & 7);
2574
+ }
2575
+ return message;
2576
+ },
2577
+ fromJSON(object) {
2578
+ return {
2579
+ spentTokenOutputsMetadata: globalThis.Array.isArray(object?.spentTokenOutputsMetadata) ? object.spentTokenOutputsMetadata.map((e) => SpentTokenOutputMetadata.fromJSON(e)) : []
2580
+ };
2581
+ },
2582
+ toJSON(message) {
2583
+ const obj = {};
2584
+ if (message.spentTokenOutputsMetadata?.length) {
2585
+ obj.spentTokenOutputsMetadata = message.spentTokenOutputsMetadata.map((e) => SpentTokenOutputMetadata.toJSON(e));
2586
+ }
2587
+ return obj;
2588
+ },
2589
+ create(base) {
2590
+ return TokenTransactionConfirmationMetadata.fromPartial(base ?? {});
2591
+ },
2592
+ fromPartial(object) {
2593
+ const message = createBaseTokenTransactionConfirmationMetadata();
2594
+ message.spentTokenOutputsMetadata = object.spentTokenOutputsMetadata?.map((e) => SpentTokenOutputMetadata.fromPartial(e)) || [];
2595
+ return message;
2596
+ }
2597
+ };
2598
+ function createBaseTokenTransactionWithStatus() {
2599
+ return { tokenTransaction: void 0, status: 0, confirmationMetadata: void 0 };
2600
+ }
2601
+ var TokenTransactionWithStatus = {
2602
+ encode(message, writer = new import_wire5.BinaryWriter()) {
2603
+ if (message.tokenTransaction !== void 0) {
2604
+ TokenTransaction.encode(message.tokenTransaction, writer.uint32(10).fork()).join();
2605
+ }
2606
+ if (message.status !== 0) {
2607
+ writer.uint32(16).int32(message.status);
2608
+ }
2609
+ if (message.confirmationMetadata !== void 0) {
2610
+ TokenTransactionConfirmationMetadata.encode(message.confirmationMetadata, writer.uint32(26).fork()).join();
2611
+ }
2612
+ return writer;
2613
+ },
2614
+ decode(input, length) {
2615
+ const reader = input instanceof import_wire5.BinaryReader ? input : new import_wire5.BinaryReader(input);
2616
+ const end = length === void 0 ? reader.len : reader.pos + length;
2617
+ const message = createBaseTokenTransactionWithStatus();
2618
+ while (reader.pos < end) {
2619
+ const tag = reader.uint32();
2620
+ switch (tag >>> 3) {
2621
+ case 1: {
2622
+ if (tag !== 10) {
2623
+ break;
2624
+ }
2625
+ message.tokenTransaction = TokenTransaction.decode(reader, reader.uint32());
2626
+ continue;
2627
+ }
2628
+ case 2: {
2629
+ if (tag !== 16) {
2630
+ break;
2631
+ }
2632
+ message.status = reader.int32();
2633
+ continue;
2634
+ }
2635
+ case 3: {
2636
+ if (tag !== 26) {
2637
+ break;
2638
+ }
2639
+ message.confirmationMetadata = TokenTransactionConfirmationMetadata.decode(reader, reader.uint32());
2640
+ continue;
2641
+ }
2642
+ }
2643
+ if ((tag & 7) === 4 || tag === 0) {
2644
+ break;
2645
+ }
2646
+ reader.skip(tag & 7);
2647
+ }
2648
+ return message;
2649
+ },
2650
+ fromJSON(object) {
2651
+ return {
2652
+ tokenTransaction: isSet3(object.tokenTransaction) ? TokenTransaction.fromJSON(object.tokenTransaction) : void 0,
2653
+ status: isSet3(object.status) ? tokenTransactionStatusFromJSON(object.status) : 0,
2654
+ confirmationMetadata: isSet3(object.confirmationMetadata) ? TokenTransactionConfirmationMetadata.fromJSON(object.confirmationMetadata) : void 0
2655
+ };
2656
+ },
2657
+ toJSON(message) {
2658
+ const obj = {};
2659
+ if (message.tokenTransaction !== void 0) {
2660
+ obj.tokenTransaction = TokenTransaction.toJSON(message.tokenTransaction);
2661
+ }
2662
+ if (message.status !== 0) {
2663
+ obj.status = tokenTransactionStatusToJSON(message.status);
2664
+ }
2665
+ if (message.confirmationMetadata !== void 0) {
2666
+ obj.confirmationMetadata = TokenTransactionConfirmationMetadata.toJSON(message.confirmationMetadata);
2667
+ }
2668
+ return obj;
2669
+ },
2670
+ create(base) {
2671
+ return TokenTransactionWithStatus.fromPartial(base ?? {});
2672
+ },
2673
+ fromPartial(object) {
2674
+ const message = createBaseTokenTransactionWithStatus();
2675
+ message.tokenTransaction = object.tokenTransaction !== void 0 && object.tokenTransaction !== null ? TokenTransaction.fromPartial(object.tokenTransaction) : void 0;
2676
+ message.status = object.status ?? 0;
2677
+ message.confirmationMetadata = object.confirmationMetadata !== void 0 && object.confirmationMetadata !== null ? TokenTransactionConfirmationMetadata.fromPartial(object.confirmationMetadata) : void 0;
2678
+ return message;
2679
+ }
2680
+ };
2681
+ var SparkTokenServiceDefinition = {
2682
+ name: "SparkTokenService",
2683
+ fullName: "spark_token.SparkTokenService",
2684
+ methods: {
2685
+ /**
2686
+ * Start process to create final token transaction with all inputs required
2687
+ * from user and SOs (including revocation secret commitment)
2688
+ */
2689
+ start_transaction: {
2690
+ name: "start_transaction",
2691
+ requestType: StartTransactionRequest,
2692
+ requestStream: false,
2693
+ responseType: StartTransactionResponse,
2694
+ responseStream: false,
2695
+ options: {}
1279
2696
  },
1280
2697
  /**
1281
2698
  * Complete the transaction and commit it with all SOs. This will be
@@ -1288,6 +2705,30 @@ var SparkTokenServiceDefinition = {
1288
2705
  responseType: CommitTransactionResponse,
1289
2706
  responseStream: false,
1290
2707
  options: {}
2708
+ },
2709
+ query_token_metadata: {
2710
+ name: "query_token_metadata",
2711
+ requestType: QueryTokenMetadataRequest,
2712
+ requestStream: false,
2713
+ responseType: QueryTokenMetadataResponse,
2714
+ responseStream: false,
2715
+ options: {}
2716
+ },
2717
+ query_token_transactions: {
2718
+ name: "query_token_transactions",
2719
+ requestType: QueryTokenTransactionsRequest,
2720
+ requestStream: false,
2721
+ responseType: QueryTokenTransactionsResponse,
2722
+ responseStream: false,
2723
+ options: {}
2724
+ },
2725
+ query_token_outputs: {
2726
+ name: "query_token_outputs",
2727
+ requestType: QueryTokenOutputsRequest,
2728
+ requestStream: false,
2729
+ responseType: QueryTokenOutputsResponse,
2730
+ responseStream: false,
2731
+ options: {}
1291
2732
  }
1292
2733
  }
1293
2734
  };
@@ -1314,23 +2755,23 @@ function base64FromBytes2(arr) {
1314
2755
  return globalThis.btoa(bin.join(""));
1315
2756
  }
1316
2757
  }
1317
- function toTimestamp(date) {
2758
+ function toTimestamp2(date) {
1318
2759
  const seconds = Math.trunc(date.getTime() / 1e3);
1319
2760
  const nanos = date.getTime() % 1e3 * 1e6;
1320
2761
  return { seconds, nanos };
1321
2762
  }
1322
- function fromTimestamp(t) {
2763
+ function fromTimestamp2(t) {
1323
2764
  let millis = (t.seconds || 0) * 1e3;
1324
2765
  millis += (t.nanos || 0) / 1e6;
1325
2766
  return new globalThis.Date(millis);
1326
2767
  }
1327
- function fromJsonTimestamp(o) {
2768
+ function fromJsonTimestamp2(o) {
1328
2769
  if (o instanceof globalThis.Date) {
1329
2770
  return o;
1330
2771
  } else if (typeof o === "string") {
1331
2772
  return new globalThis.Date(o);
1332
2773
  } else {
1333
- return fromTimestamp(Timestamp.fromJSON(o));
2774
+ return fromTimestamp2(Timestamp.fromJSON(o));
1334
2775
  }
1335
2776
  }
1336
2777
  function longToNumber2(int64) {
@@ -1351,14 +2792,32 @@ function isSet3(value) {
1351
2792
  CommitTransactionRequest,
1352
2793
  CommitTransactionResponse,
1353
2794
  InputTtxoSignaturesPerOperator,
2795
+ OutputWithPreviousTransactionData,
2796
+ QueryTokenMetadataRequest,
2797
+ QueryTokenMetadataResponse,
2798
+ QueryTokenOutputsRequest,
2799
+ QueryTokenOutputsResponse,
2800
+ QueryTokenTransactionsRequest,
2801
+ QueryTokenTransactionsResponse,
1354
2802
  SignatureWithIndex,
1355
2803
  SparkTokenServiceDefinition,
2804
+ SpentTokenOutputMetadata,
1356
2805
  StartTransactionRequest,
1357
2806
  StartTransactionResponse,
2807
+ TokenCreateInput,
2808
+ TokenMetadata,
1358
2809
  TokenMintInput,
1359
2810
  TokenOutput,
1360
2811
  TokenOutputToSpend,
1361
2812
  TokenTransaction,
2813
+ TokenTransactionConfirmationMetadata,
2814
+ TokenTransactionStatus,
2815
+ TokenTransactionType,
2816
+ TokenTransactionWithStatus,
1362
2817
  TokenTransferInput,
1363
- protobufPackage
2818
+ protobufPackage,
2819
+ tokenTransactionStatusFromJSON,
2820
+ tokenTransactionStatusToJSON,
2821
+ tokenTransactionTypeFromJSON,
2822
+ tokenTransactionTypeToJSON
1364
2823
  });