@buildonspark/spark-sdk 0.1.44 → 0.1.46

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 (143) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{RequestLightningSendInput-BxbCtwpV.d.cts → RequestLightningSendInput-2cSh_In4.d.cts} +1 -1
  3. package/dist/{RequestLightningSendInput-RGel43ks.d.ts → RequestLightningSendInput-CN6BNg_g.d.ts} +1 -1
  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-EKFD62HN.js → chunk-4EMV7HHW.js} +2 -1
  9. package/dist/{chunk-4Q2ZDYYU.js → chunk-BGGEVUJK.js} +1157 -208
  10. package/dist/{chunk-CIZNCBKE.js → chunk-C2S227QR.js} +648 -45
  11. package/dist/{chunk-WPTRVD2V.js → chunk-DXR2PXJU.js} +15 -15
  12. package/dist/{chunk-NBCNYDWJ.js → chunk-HHNQ3ZHC.js} +2 -2
  13. package/dist/{chunk-DAXGVPVM.js → chunk-HSCLBJEL.js} +2 -2
  14. package/dist/{chunk-6AFUC5M2.js → chunk-HWJWKEIU.js} +8 -2
  15. package/dist/{chunk-A2ZLMH6I.js → chunk-JB64OQES.js} +259 -327
  16. package/dist/{chunk-KEKGSH7B.js → chunk-KMUMFYFX.js} +3 -3
  17. package/dist/chunk-LHRD2WT6.js +2374 -0
  18. package/dist/{chunk-HTMXTJRK.js → chunk-N5VZVCGJ.js} +4 -4
  19. package/dist/{chunk-SQKXGAIR.js → chunk-NTFKFRQ2.js} +1 -1
  20. package/dist/{chunk-K4BJARWM.js → chunk-OBFKIEMP.js} +1 -1
  21. package/dist/{chunk-UBT6EDVJ.js → chunk-OFCJFZ4I.js} +1 -1
  22. package/dist/{chunk-XX4RRWOX.js → chunk-UXDODSDT.js} +8 -10
  23. package/dist/graphql/objects/index.d.cts +5 -4
  24. package/dist/graphql/objects/index.d.ts +5 -4
  25. package/dist/index-CKL5DodV.d.cts +214 -0
  26. package/dist/index-COm59SPw.d.ts +214 -0
  27. package/dist/index.cjs +4026 -1315
  28. package/dist/index.d.cts +764 -19
  29. package/dist/index.d.ts +764 -19
  30. package/dist/index.js +23 -27
  31. package/dist/index.node.cjs +4026 -1319
  32. package/dist/index.node.d.cts +10 -8
  33. package/dist/index.node.d.ts +10 -8
  34. package/dist/index.node.js +23 -31
  35. package/dist/native/index.cjs +4027 -1316
  36. package/dist/native/index.d.cts +281 -85
  37. package/dist/native/index.d.ts +281 -85
  38. package/dist/native/index.js +4018 -1307
  39. package/dist/{network-CfxLnaot.d.cts → network-Css46DAz.d.cts} +1 -1
  40. package/dist/{network-CroCOQ0B.d.ts → network-hynb7iTZ.d.ts} +1 -1
  41. package/dist/proto/lrc20.cjs +222 -19
  42. package/dist/proto/lrc20.d.cts +1 -1
  43. package/dist/proto/lrc20.d.ts +1 -1
  44. package/dist/proto/lrc20.js +2 -2
  45. package/dist/proto/spark.cjs +1154 -205
  46. package/dist/proto/spark.d.cts +1 -1
  47. package/dist/proto/spark.d.ts +1 -1
  48. package/dist/proto/spark.js +3 -1
  49. package/dist/proto/spark_token.cjs +1377 -58
  50. package/dist/proto/spark_token.d.cts +153 -15
  51. package/dist/proto/spark_token.d.ts +153 -15
  52. package/dist/proto/spark_token.js +40 -4
  53. package/dist/{sdk-types-CTbTdDbE.d.ts → sdk-types-CKBsylfW.d.ts} +1 -1
  54. package/dist/{sdk-types-BeCBoozO.d.cts → sdk-types-Ct8xmN7l.d.cts} +1 -1
  55. package/dist/services/config.cjs +2 -2
  56. package/dist/services/config.d.cts +5 -4
  57. package/dist/services/config.d.ts +5 -4
  58. package/dist/services/config.js +6 -6
  59. package/dist/services/connection.cjs +2438 -262
  60. package/dist/services/connection.d.cts +5 -4
  61. package/dist/services/connection.d.ts +5 -4
  62. package/dist/services/connection.js +4 -4
  63. package/dist/services/index.cjs +5937 -3154
  64. package/dist/services/index.d.cts +7 -6
  65. package/dist/services/index.d.ts +7 -6
  66. package/dist/services/index.js +17 -15
  67. package/dist/services/lrc-connection.cjs +223 -20
  68. package/dist/services/lrc-connection.d.cts +5 -4
  69. package/dist/services/lrc-connection.d.ts +5 -4
  70. package/dist/services/lrc-connection.js +4 -4
  71. package/dist/services/token-transactions.cjs +840 -236
  72. package/dist/services/token-transactions.d.cts +25 -7
  73. package/dist/services/token-transactions.d.ts +25 -7
  74. package/dist/services/token-transactions.js +5 -4
  75. package/dist/services/wallet-config.cjs +3 -1
  76. package/dist/services/wallet-config.d.cts +7 -5
  77. package/dist/services/wallet-config.d.ts +7 -5
  78. package/dist/services/wallet-config.js +3 -1
  79. package/dist/signer/signer.cjs +1 -1
  80. package/dist/signer/signer.d.cts +3 -2
  81. package/dist/signer/signer.d.ts +3 -2
  82. package/dist/signer/signer.js +2 -2
  83. package/dist/{signer-D7vfYik9.d.ts → signer-BP6F__oR.d.cts} +2 -6
  84. package/dist/{signer-DaY8c60s.d.cts → signer-BVZJXcq7.d.ts} +2 -6
  85. package/dist/{spark-C4ZrsgjC.d.cts → spark-DbzGfse6.d.cts} +93 -15
  86. package/dist/{spark-C4ZrsgjC.d.ts → spark-DbzGfse6.d.ts} +93 -15
  87. package/dist/spark_bindings/native/index.cjs +183 -0
  88. package/dist/spark_bindings/native/index.d.cts +14 -0
  89. package/dist/spark_bindings/native/index.d.ts +14 -0
  90. package/dist/spark_bindings/native/index.js +141 -0
  91. package/dist/spark_bindings/wasm/index.cjs +1093 -0
  92. package/dist/spark_bindings/wasm/index.d.cts +47 -0
  93. package/dist/spark_bindings/wasm/index.d.ts +47 -0
  94. package/dist/{chunk-K4C4W5FC.js → spark_bindings/wasm/index.js} +7 -6
  95. package/dist/types/index.cjs +1156 -208
  96. package/dist/types/index.d.cts +5 -4
  97. package/dist/types/index.d.ts +5 -4
  98. package/dist/types/index.js +2 -2
  99. package/dist/types-C-Rp0Oo7.d.cts +46 -0
  100. package/dist/types-C-Rp0Oo7.d.ts +46 -0
  101. package/dist/utils/index.cjs +65 -13
  102. package/dist/utils/index.d.cts +14 -134
  103. package/dist/utils/index.d.ts +14 -134
  104. package/dist/utils/index.js +13 -13
  105. package/package.json +22 -2
  106. package/src/index.node.ts +0 -1
  107. package/src/index.ts +0 -1
  108. package/src/native/index.ts +1 -2
  109. package/src/proto/common.ts +5 -5
  110. package/src/proto/google/protobuf/descriptor.ts +34 -34
  111. package/src/proto/google/protobuf/duration.ts +2 -2
  112. package/src/proto/google/protobuf/empty.ts +2 -2
  113. package/src/proto/google/protobuf/timestamp.ts +2 -2
  114. package/src/proto/mock.ts +4 -4
  115. package/src/proto/spark.ts +1452 -185
  116. package/src/proto/spark_authn.ts +7 -7
  117. package/src/proto/spark_token.ts +1668 -105
  118. package/src/proto/validate/validate.ts +24 -24
  119. package/src/services/bolt11-spark.ts +62 -187
  120. package/src/services/coop-exit.ts +3 -0
  121. package/src/services/lrc20.ts +1 -1
  122. package/src/services/token-transactions.ts +197 -9
  123. package/src/services/transfer.ts +22 -0
  124. package/src/services/tree-creation.ts +13 -0
  125. package/src/services/wallet-config.ts +2 -2
  126. package/src/spark-wallet/spark-wallet.node.ts +0 -4
  127. package/src/spark-wallet/spark-wallet.ts +76 -108
  128. package/src/spark-wallet/types.ts +39 -3
  129. package/src/tests/bolt11-spark.test.ts +7 -15
  130. package/src/tests/integration/ssp/coop-exit.test.ts +7 -7
  131. package/src/tests/integration/swap.test.ts +453 -433
  132. package/src/tests/integration/transfer.test.ts +261 -248
  133. package/src/tests/token-identifier.test.ts +54 -0
  134. package/src/tests/tokens.test.ts +218 -23
  135. package/src/utils/token-hashing.ts +320 -44
  136. package/src/utils/token-identifier.ts +88 -0
  137. package/src/utils/token-transaction-validation.ts +350 -5
  138. package/src/utils/token-transactions.ts +12 -8
  139. package/src/utils/transaction.ts +0 -6
  140. package/dist/chunk-B3AMIGJG.js +0 -1073
  141. package/dist/index-CZmDdSts.d.cts +0 -829
  142. package/dist/index-ClIRO_3y.d.ts +0 -829
  143. package/dist/wasm-7OWFHDMS.js +0 -21
@@ -1,7 +1,7 @@
1
1
  import { NetworkType as NetworkType$1 } from '@buildonspark/lrc20-sdk';
2
2
  import * as btc from '@scure/btc-signer';
3
3
  import * as bitcoin from 'bitcoinjs-lib';
4
- import { N as Network$1 } from './spark-C4ZrsgjC.cjs';
4
+ import { N as Network$1 } from './spark-DbzGfse6.cjs';
5
5
  import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.cjs';
6
6
 
7
7
  declare enum Network {
@@ -1,7 +1,7 @@
1
1
  import { NetworkType as NetworkType$1 } from '@buildonspark/lrc20-sdk';
2
2
  import * as btc from '@scure/btc-signer';
3
3
  import * as bitcoin from 'bitcoinjs-lib';
4
- import { N as Network$1 } from './spark-C4ZrsgjC.js';
4
+ import { N as Network$1 } from './spark-DbzGfse6.js';
5
5
  import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.js';
6
6
 
7
7
  declare enum Network {
@@ -95,7 +95,7 @@ var Empty = {
95
95
  },
96
96
  decode(input, length) {
97
97
  const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
98
- let end = length === void 0 ? reader.len : reader.pos + length;
98
+ const end = length === void 0 ? reader.len : reader.pos + length;
99
99
  const message = createBaseEmpty();
100
100
  while (reader.pos < end) {
101
101
  const tag = reader.uint32();
@@ -141,7 +141,7 @@ var Timestamp = {
141
141
  },
142
142
  decode(input, length) {
143
143
  const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
144
- let end = length === void 0 ? reader.len : reader.pos + length;
144
+ const end = length === void 0 ? reader.len : reader.pos + length;
145
145
  const message = createBaseTimestamp();
146
146
  while (reader.pos < end) {
147
147
  const tag = reader.uint32();
@@ -270,7 +270,7 @@ var TokenOutputToSpend = {
270
270
  },
271
271
  decode(input, length) {
272
272
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
273
- let end = length === void 0 ? reader.len : reader.pos + length;
273
+ const end = length === void 0 ? reader.len : reader.pos + length;
274
274
  const message = createBaseTokenOutputToSpend();
275
275
  while (reader.pos < end) {
276
276
  const tag = reader.uint32();
@@ -335,7 +335,7 @@ var TokenTransferInput = {
335
335
  },
336
336
  decode(input, length) {
337
337
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
338
- let end = length === void 0 ? reader.len : reader.pos + length;
338
+ const end = length === void 0 ? reader.len : reader.pos + length;
339
339
  const message = createBaseTokenTransferInput();
340
340
  while (reader.pos < end) {
341
341
  const tag = reader.uint32();
@@ -377,7 +377,7 @@ var TokenTransferInput = {
377
377
  }
378
378
  };
379
379
  function createBaseTokenMintInput() {
380
- return { issuerPublicKey: new Uint8Array(0), issuerProvidedTimestamp: 0 };
380
+ return { issuerPublicKey: new Uint8Array(0), issuerProvidedTimestamp: 0, tokenIdentifier: void 0 };
381
381
  }
382
382
  var TokenMintInput = {
383
383
  encode(message, writer = new import_wire4.BinaryWriter()) {
@@ -387,11 +387,14 @@ var TokenMintInput = {
387
387
  if (message.issuerProvidedTimestamp !== 0) {
388
388
  writer.uint32(16).uint64(message.issuerProvidedTimestamp);
389
389
  }
390
+ if (message.tokenIdentifier !== void 0) {
391
+ writer.uint32(26).bytes(message.tokenIdentifier);
392
+ }
390
393
  return writer;
391
394
  },
392
395
  decode(input, length) {
393
396
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
394
- let end = length === void 0 ? reader.len : reader.pos + length;
397
+ const end = length === void 0 ? reader.len : reader.pos + length;
395
398
  const message = createBaseTokenMintInput();
396
399
  while (reader.pos < end) {
397
400
  const tag = reader.uint32();
@@ -410,6 +413,13 @@ var TokenMintInput = {
410
413
  message.issuerProvidedTimestamp = longToNumber2(reader.uint64());
411
414
  continue;
412
415
  }
416
+ case 3: {
417
+ if (tag !== 26) {
418
+ break;
419
+ }
420
+ message.tokenIdentifier = reader.bytes();
421
+ continue;
422
+ }
413
423
  }
414
424
  if ((tag & 7) === 4 || tag === 0) {
415
425
  break;
@@ -421,7 +431,8 @@ var TokenMintInput = {
421
431
  fromJSON(object) {
422
432
  return {
423
433
  issuerPublicKey: isSet2(object.issuerPublicKey) ? bytesFromBase64(object.issuerPublicKey) : new Uint8Array(0),
424
- issuerProvidedTimestamp: isSet2(object.issuerProvidedTimestamp) ? globalThis.Number(object.issuerProvidedTimestamp) : 0
434
+ issuerProvidedTimestamp: isSet2(object.issuerProvidedTimestamp) ? globalThis.Number(object.issuerProvidedTimestamp) : 0,
435
+ tokenIdentifier: isSet2(object.tokenIdentifier) ? bytesFromBase64(object.tokenIdentifier) : void 0
425
436
  };
426
437
  },
427
438
  toJSON(message) {
@@ -432,6 +443,9 @@ var TokenMintInput = {
432
443
  if (message.issuerProvidedTimestamp !== 0) {
433
444
  obj.issuerProvidedTimestamp = Math.round(message.issuerProvidedTimestamp);
434
445
  }
446
+ if (message.tokenIdentifier !== void 0) {
447
+ obj.tokenIdentifier = base64FromBytes(message.tokenIdentifier);
448
+ }
435
449
  return obj;
436
450
  },
437
451
  create(base) {
@@ -441,6 +455,158 @@ var TokenMintInput = {
441
455
  const message = createBaseTokenMintInput();
442
456
  message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
443
457
  message.issuerProvidedTimestamp = object.issuerProvidedTimestamp ?? 0;
458
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
459
+ return message;
460
+ }
461
+ };
462
+ function createBaseTokenCreateInput() {
463
+ return {
464
+ issuerPublicKey: new Uint8Array(0),
465
+ tokenName: "",
466
+ tokenTicker: "",
467
+ decimals: 0,
468
+ maxSupply: new Uint8Array(0),
469
+ isFreezable: false,
470
+ creationEntityPublicKey: void 0
471
+ };
472
+ }
473
+ var TokenCreateInput = {
474
+ encode(message, writer = new import_wire4.BinaryWriter()) {
475
+ if (message.issuerPublicKey.length !== 0) {
476
+ writer.uint32(10).bytes(message.issuerPublicKey);
477
+ }
478
+ if (message.tokenName !== "") {
479
+ writer.uint32(18).string(message.tokenName);
480
+ }
481
+ if (message.tokenTicker !== "") {
482
+ writer.uint32(26).string(message.tokenTicker);
483
+ }
484
+ if (message.decimals !== 0) {
485
+ writer.uint32(32).uint32(message.decimals);
486
+ }
487
+ if (message.maxSupply.length !== 0) {
488
+ writer.uint32(42).bytes(message.maxSupply);
489
+ }
490
+ if (message.isFreezable !== false) {
491
+ writer.uint32(48).bool(message.isFreezable);
492
+ }
493
+ if (message.creationEntityPublicKey !== void 0) {
494
+ writer.uint32(58).bytes(message.creationEntityPublicKey);
495
+ }
496
+ return writer;
497
+ },
498
+ decode(input, length) {
499
+ const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
500
+ const end = length === void 0 ? reader.len : reader.pos + length;
501
+ const message = createBaseTokenCreateInput();
502
+ while (reader.pos < end) {
503
+ const tag = reader.uint32();
504
+ switch (tag >>> 3) {
505
+ case 1: {
506
+ if (tag !== 10) {
507
+ break;
508
+ }
509
+ message.issuerPublicKey = reader.bytes();
510
+ continue;
511
+ }
512
+ case 2: {
513
+ if (tag !== 18) {
514
+ break;
515
+ }
516
+ message.tokenName = reader.string();
517
+ continue;
518
+ }
519
+ case 3: {
520
+ if (tag !== 26) {
521
+ break;
522
+ }
523
+ message.tokenTicker = reader.string();
524
+ continue;
525
+ }
526
+ case 4: {
527
+ if (tag !== 32) {
528
+ break;
529
+ }
530
+ message.decimals = reader.uint32();
531
+ continue;
532
+ }
533
+ case 5: {
534
+ if (tag !== 42) {
535
+ break;
536
+ }
537
+ message.maxSupply = reader.bytes();
538
+ continue;
539
+ }
540
+ case 6: {
541
+ if (tag !== 48) {
542
+ break;
543
+ }
544
+ message.isFreezable = reader.bool();
545
+ continue;
546
+ }
547
+ case 7: {
548
+ if (tag !== 58) {
549
+ break;
550
+ }
551
+ message.creationEntityPublicKey = reader.bytes();
552
+ continue;
553
+ }
554
+ }
555
+ if ((tag & 7) === 4 || tag === 0) {
556
+ break;
557
+ }
558
+ reader.skip(tag & 7);
559
+ }
560
+ return message;
561
+ },
562
+ fromJSON(object) {
563
+ return {
564
+ issuerPublicKey: isSet2(object.issuerPublicKey) ? bytesFromBase64(object.issuerPublicKey) : new Uint8Array(0),
565
+ tokenName: isSet2(object.tokenName) ? globalThis.String(object.tokenName) : "",
566
+ tokenTicker: isSet2(object.tokenTicker) ? globalThis.String(object.tokenTicker) : "",
567
+ decimals: isSet2(object.decimals) ? globalThis.Number(object.decimals) : 0,
568
+ maxSupply: isSet2(object.maxSupply) ? bytesFromBase64(object.maxSupply) : new Uint8Array(0),
569
+ isFreezable: isSet2(object.isFreezable) ? globalThis.Boolean(object.isFreezable) : false,
570
+ creationEntityPublicKey: isSet2(object.creationEntityPublicKey) ? bytesFromBase64(object.creationEntityPublicKey) : void 0
571
+ };
572
+ },
573
+ toJSON(message) {
574
+ const obj = {};
575
+ if (message.issuerPublicKey.length !== 0) {
576
+ obj.issuerPublicKey = base64FromBytes(message.issuerPublicKey);
577
+ }
578
+ if (message.tokenName !== "") {
579
+ obj.tokenName = message.tokenName;
580
+ }
581
+ if (message.tokenTicker !== "") {
582
+ obj.tokenTicker = message.tokenTicker;
583
+ }
584
+ if (message.decimals !== 0) {
585
+ obj.decimals = Math.round(message.decimals);
586
+ }
587
+ if (message.maxSupply.length !== 0) {
588
+ obj.maxSupply = base64FromBytes(message.maxSupply);
589
+ }
590
+ if (message.isFreezable !== false) {
591
+ obj.isFreezable = message.isFreezable;
592
+ }
593
+ if (message.creationEntityPublicKey !== void 0) {
594
+ obj.creationEntityPublicKey = base64FromBytes(message.creationEntityPublicKey);
595
+ }
596
+ return obj;
597
+ },
598
+ create(base) {
599
+ return TokenCreateInput.fromPartial(base ?? {});
600
+ },
601
+ fromPartial(object) {
602
+ const message = createBaseTokenCreateInput();
603
+ message.issuerPublicKey = object.issuerPublicKey ?? new Uint8Array(0);
604
+ message.tokenName = object.tokenName ?? "";
605
+ message.tokenTicker = object.tokenTicker ?? "";
606
+ message.decimals = object.decimals ?? 0;
607
+ message.maxSupply = object.maxSupply ?? new Uint8Array(0);
608
+ message.isFreezable = object.isFreezable ?? false;
609
+ message.creationEntityPublicKey = object.creationEntityPublicKey ?? void 0;
444
610
  return message;
445
611
  }
446
612
  };
@@ -451,7 +617,8 @@ function createBaseTokenOutput() {
451
617
  revocationCommitment: void 0,
452
618
  withdrawBondSats: void 0,
453
619
  withdrawRelativeBlockLocktime: void 0,
454
- tokenPublicKey: new Uint8Array(0),
620
+ tokenPublicKey: void 0,
621
+ tokenIdentifier: void 0,
455
622
  tokenAmount: new Uint8Array(0)
456
623
  };
457
624
  }
@@ -472,9 +639,12 @@ var TokenOutput = {
472
639
  if (message.withdrawRelativeBlockLocktime !== void 0) {
473
640
  writer.uint32(40).uint64(message.withdrawRelativeBlockLocktime);
474
641
  }
475
- if (message.tokenPublicKey.length !== 0) {
642
+ if (message.tokenPublicKey !== void 0) {
476
643
  writer.uint32(50).bytes(message.tokenPublicKey);
477
644
  }
645
+ if (message.tokenIdentifier !== void 0) {
646
+ writer.uint32(66).bytes(message.tokenIdentifier);
647
+ }
478
648
  if (message.tokenAmount.length !== 0) {
479
649
  writer.uint32(58).bytes(message.tokenAmount);
480
650
  }
@@ -482,7 +652,7 @@ var TokenOutput = {
482
652
  },
483
653
  decode(input, length) {
484
654
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
485
- let end = length === void 0 ? reader.len : reader.pos + length;
655
+ const end = length === void 0 ? reader.len : reader.pos + length;
486
656
  const message = createBaseTokenOutput();
487
657
  while (reader.pos < end) {
488
658
  const tag = reader.uint32();
@@ -529,6 +699,13 @@ var TokenOutput = {
529
699
  message.tokenPublicKey = reader.bytes();
530
700
  continue;
531
701
  }
702
+ case 8: {
703
+ if (tag !== 66) {
704
+ break;
705
+ }
706
+ message.tokenIdentifier = reader.bytes();
707
+ continue;
708
+ }
532
709
  case 7: {
533
710
  if (tag !== 58) {
534
711
  break;
@@ -551,7 +728,8 @@ var TokenOutput = {
551
728
  revocationCommitment: isSet2(object.revocationCommitment) ? bytesFromBase64(object.revocationCommitment) : void 0,
552
729
  withdrawBondSats: isSet2(object.withdrawBondSats) ? globalThis.Number(object.withdrawBondSats) : void 0,
553
730
  withdrawRelativeBlockLocktime: isSet2(object.withdrawRelativeBlockLocktime) ? globalThis.Number(object.withdrawRelativeBlockLocktime) : void 0,
554
- tokenPublicKey: isSet2(object.tokenPublicKey) ? bytesFromBase64(object.tokenPublicKey) : new Uint8Array(0),
731
+ tokenPublicKey: isSet2(object.tokenPublicKey) ? bytesFromBase64(object.tokenPublicKey) : void 0,
732
+ tokenIdentifier: isSet2(object.tokenIdentifier) ? bytesFromBase64(object.tokenIdentifier) : void 0,
555
733
  tokenAmount: isSet2(object.tokenAmount) ? bytesFromBase64(object.tokenAmount) : new Uint8Array(0)
556
734
  };
557
735
  },
@@ -572,9 +750,12 @@ var TokenOutput = {
572
750
  if (message.withdrawRelativeBlockLocktime !== void 0) {
573
751
  obj.withdrawRelativeBlockLocktime = Math.round(message.withdrawRelativeBlockLocktime);
574
752
  }
575
- if (message.tokenPublicKey.length !== 0) {
753
+ if (message.tokenPublicKey !== void 0) {
576
754
  obj.tokenPublicKey = base64FromBytes(message.tokenPublicKey);
577
755
  }
756
+ if (message.tokenIdentifier !== void 0) {
757
+ obj.tokenIdentifier = base64FromBytes(message.tokenIdentifier);
758
+ }
578
759
  if (message.tokenAmount.length !== 0) {
579
760
  obj.tokenAmount = base64FromBytes(message.tokenAmount);
580
761
  }
@@ -590,7 +771,8 @@ var TokenOutput = {
590
771
  message.revocationCommitment = object.revocationCommitment ?? void 0;
591
772
  message.withdrawBondSats = object.withdrawBondSats ?? void 0;
592
773
  message.withdrawRelativeBlockLocktime = object.withdrawRelativeBlockLocktime ?? void 0;
593
- message.tokenPublicKey = object.tokenPublicKey ?? new Uint8Array(0);
774
+ message.tokenPublicKey = object.tokenPublicKey ?? void 0;
775
+ message.tokenIdentifier = object.tokenIdentifier ?? void 0;
594
776
  message.tokenAmount = object.tokenAmount ?? new Uint8Array(0);
595
777
  return message;
596
778
  }
@@ -607,6 +789,9 @@ var TokenTransaction = {
607
789
  case "transferInput":
608
790
  TokenTransferInput.encode(message.tokenInputs.transferInput, writer.uint32(18).fork()).join();
609
791
  break;
792
+ case "createInput":
793
+ TokenCreateInput.encode(message.tokenInputs.createInput, writer.uint32(42).fork()).join();
794
+ break;
610
795
  }
611
796
  for (const v of message.tokenOutputs) {
612
797
  TokenOutput.encode(v, writer.uint32(26).fork()).join();
@@ -621,7 +806,7 @@ var TokenTransaction = {
621
806
  },
622
807
  decode(input, length) {
623
808
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
624
- let end = length === void 0 ? reader.len : reader.pos + length;
809
+ const end = length === void 0 ? reader.len : reader.pos + length;
625
810
  const message = createBaseTokenTransaction();
626
811
  while (reader.pos < end) {
627
812
  const tag = reader.uint32();
@@ -643,6 +828,13 @@ var TokenTransaction = {
643
828
  };
644
829
  continue;
645
830
  }
831
+ case 5: {
832
+ if (tag !== 42) {
833
+ break;
834
+ }
835
+ message.tokenInputs = { $case: "createInput", createInput: TokenCreateInput.decode(reader, reader.uint32()) };
836
+ continue;
837
+ }
646
838
  case 3: {
647
839
  if (tag !== 26) {
648
840
  break;
@@ -674,7 +866,7 @@ var TokenTransaction = {
674
866
  },
675
867
  fromJSON(object) {
676
868
  return {
677
- tokenInputs: isSet2(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet2(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : void 0,
869
+ tokenInputs: isSet2(object.mintInput) ? { $case: "mintInput", mintInput: TokenMintInput.fromJSON(object.mintInput) } : isSet2(object.transferInput) ? { $case: "transferInput", transferInput: TokenTransferInput.fromJSON(object.transferInput) } : isSet2(object.createInput) ? { $case: "createInput", createInput: TokenCreateInput.fromJSON(object.createInput) } : void 0,
678
870
  tokenOutputs: globalThis.Array.isArray(object?.tokenOutputs) ? object.tokenOutputs.map((e) => TokenOutput.fromJSON(e)) : [],
679
871
  sparkOperatorIdentityPublicKeys: globalThis.Array.isArray(object?.sparkOperatorIdentityPublicKeys) ? object.sparkOperatorIdentityPublicKeys.map((e) => bytesFromBase64(e)) : [],
680
872
  network: isSet2(object.network) ? networkFromJSON(object.network) : 0
@@ -686,6 +878,8 @@ var TokenTransaction = {
686
878
  obj.mintInput = TokenMintInput.toJSON(message.tokenInputs.mintInput);
687
879
  } else if (message.tokenInputs?.$case === "transferInput") {
688
880
  obj.transferInput = TokenTransferInput.toJSON(message.tokenInputs.transferInput);
881
+ } else if (message.tokenInputs?.$case === "createInput") {
882
+ obj.createInput = TokenCreateInput.toJSON(message.tokenInputs.createInput);
689
883
  }
690
884
  if (message.tokenOutputs?.length) {
691
885
  obj.tokenOutputs = message.tokenOutputs.map((e) => TokenOutput.toJSON(e));
@@ -722,6 +916,15 @@ var TokenTransaction = {
722
916
  }
723
917
  break;
724
918
  }
919
+ case "createInput": {
920
+ if (object.tokenInputs?.createInput !== void 0 && object.tokenInputs?.createInput !== null) {
921
+ message.tokenInputs = {
922
+ $case: "createInput",
923
+ createInput: TokenCreateInput.fromPartial(object.tokenInputs.createInput)
924
+ };
925
+ }
926
+ break;
927
+ }
725
928
  }
726
929
  message.tokenOutputs = object.tokenOutputs?.map((e) => TokenOutput.fromPartial(e)) || [];
727
930
  message.sparkOperatorIdentityPublicKeys = object.sparkOperatorIdentityPublicKeys?.map((e) => e) || [];
@@ -744,7 +947,7 @@ var SignatureWithIndex = {
744
947
  },
745
948
  decode(input, length) {
746
949
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
747
- let end = length === void 0 ? reader.len : reader.pos + length;
950
+ const end = length === void 0 ? reader.len : reader.pos + length;
748
951
  const message = createBaseSignatureWithIndex();
749
952
  while (reader.pos < end) {
750
953
  const tag = reader.uint32();
@@ -812,7 +1015,7 @@ var OperatorSpecificTokenTransactionSignablePayload = {
812
1015
  },
813
1016
  decode(input, length) {
814
1017
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
815
- let end = length === void 0 ? reader.len : reader.pos + length;
1018
+ const end = length === void 0 ? reader.len : reader.pos + length;
816
1019
  const message = createBaseOperatorSpecificTokenTransactionSignablePayload();
817
1020
  while (reader.pos < end) {
818
1021
  const tag = reader.uint32();
@@ -880,7 +1083,7 @@ var OperatorSpecificOwnerSignature = {
880
1083
  },
881
1084
  decode(input, length) {
882
1085
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
883
- let end = length === void 0 ? reader.len : reader.pos + length;
1086
+ const end = length === void 0 ? reader.len : reader.pos + length;
884
1087
  const message = createBaseOperatorSpecificOwnerSignature();
885
1088
  while (reader.pos < end) {
886
1089
  const tag = reader.uint32();
@@ -948,7 +1151,7 @@ var RevocationSecretWithIndex = {
948
1151
  },
949
1152
  decode(input, length) {
950
1153
  const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
951
- let end = length === void 0 ? reader.len : reader.pos + length;
1154
+ const end = length === void 0 ? reader.len : reader.pos + length;
952
1155
  const message = createBaseRevocationSecretWithIndex();
953
1156
  while (reader.pos < end) {
954
1157
  const tag = reader.uint32();
@@ -1,4 +1,4 @@
1
- import { T as TokenTransaction, O as OperatorSpecificOwnerSignature, R as RevocationSecretWithIndex, E as Empty, M as MessageFns$1 } from '../spark-C4ZrsgjC.cjs';
1
+ import { f as TokenTransaction, O as OperatorSpecificOwnerSignature, R as RevocationSecretWithIndex, E as Empty, M as MessageFns$1 } from '../spark-DbzGfse6.cjs';
2
2
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
3
3
  import { CallOptions, CallContext } from 'nice-grpc-common';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as TokenTransaction, O as OperatorSpecificOwnerSignature, R as RevocationSecretWithIndex, E as Empty, M as MessageFns$1 } from '../spark-C4ZrsgjC.js';
1
+ import { f as TokenTransaction, O as OperatorSpecificOwnerSignature, R as RevocationSecretWithIndex, E as Empty, M as MessageFns$1 } from '../spark-DbzGfse6.js';
2
2
  import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
3
3
  import { CallOptions, CallContext } from 'nice-grpc-common';
4
4
 
@@ -43,8 +43,8 @@ import {
43
43
  protobufPackage,
44
44
  sparkTransactionStatusFromJSON,
45
45
  sparkTransactionStatusToJSON
46
- } from "../chunk-SQKXGAIR.js";
47
- import "../chunk-4Q2ZDYYU.js";
46
+ } from "../chunk-NTFKFRQ2.js";
47
+ import "../chunk-BGGEVUJK.js";
48
48
  import "../chunk-MVRQ5US7.js";
49
49
  export {
50
50
  BlockInfo,