@buildonspark/issuer-sdk 0.0.64 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,571 @@
1
+ # @buildonspark/issuer-sdk
2
+
3
+ ## 0.0.66
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixes
8
+ - Updated dependencies
9
+ - @buildonspark/lrc20-sdk@0.0.56
10
+ - @buildonspark/spark-sdk@0.1.35
11
+
12
+ ## 0.0.65
13
+
14
+ ### Patch Changes
15
+
16
+ - Add signer interface
17
+ - Updated dependencies
18
+ - @buildonspark/lrc20-sdk@0.0.55
19
+ - @buildonspark/spark-sdk@0.1.34
20
+
21
+ ## 0.0.64
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @buildonspark/spark-sdk@0.1.33
27
+
28
+ ## 0.0.63
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+ - @buildonspark/spark-sdk@0.1.32
34
+
35
+ ## 0.0.62
36
+
37
+ ### Patch Changes
38
+
39
+ - Fixes
40
+ - Updated dependencies
41
+ - @buildonspark/lrc20-sdk@0.0.54
42
+ - @buildonspark/spark-sdk@0.1.31
43
+
44
+ ## 0.0.61
45
+
46
+ ### Patch Changes
47
+
48
+ - Update issuer-wallet directory
49
+ - Updated dependencies
50
+ - @buildonspark/lrc20-sdk@0.0.53
51
+ - @buildonspark/spark-sdk@0.1.30
52
+
53
+ ## 0.0.60
54
+
55
+ ### Patch Changes
56
+
57
+ - - Proto files for lrc20 monitoring operations have been moved to @buildonspark/issuer-sdk/proto/lrc20
58
+ - The monitoring operations have been modified to accept either strings or enums, generated from protos
59
+ - Updated dependencies
60
+ - Updated dependencies
61
+ - @buildonspark/lrc20-sdk@0.0.52
62
+ - @buildonspark/spark-sdk@0.1.29
63
+
64
+ ## 0.0.59
65
+
66
+ ### Patch Changes
67
+
68
+ - - Fixes
69
+ - Updated dependencies
70
+ - Updated dependencies
71
+ - @buildonspark/lrc20-sdk@0.0.51
72
+ - @buildonspark/spark-sdk@0.1.28
73
+
74
+ ## 0.0.58
75
+
76
+ ### Patch Changes
77
+
78
+ - Fixes
79
+ - Updated dependencies
80
+ - @buildonspark/lrc20-sdk@0.0.50
81
+ - @buildonspark/spark-sdk@0.1.27
82
+
83
+ ## 0.0.57
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies
88
+ - @buildonspark/spark-sdk@0.1.26
89
+
90
+ ## 0.0.56
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies
95
+ - @buildonspark/spark-sdk@0.1.25
96
+
97
+ ## 0.0.55
98
+
99
+ ### Patch Changes
100
+
101
+ - - Add tracer
102
+ - Token transfer with multiple outputs
103
+ - Updated dependencies
104
+ - @buildonspark/spark-sdk@0.1.24
105
+
106
+ ## 0.0.54
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies
111
+ - @buildonspark/lrc20-sdk@0.0.49
112
+ - @buildonspark/spark-sdk@0.1.23
113
+
114
+ ## 0.0.53
115
+
116
+ ### Patch Changes
117
+
118
+ - Update homepage URL
119
+ - Updated dependencies
120
+ - @buildonspark/lrc20-sdk@0.0.48
121
+ - @buildonspark/spark-sdk@0.1.22
122
+
123
+ ## 0.0.52
124
+
125
+ ### Patch Changes
126
+
127
+ - Fixes
128
+ - Updated dependencies
129
+ - @buildonspark/lrc20-sdk@0.0.47
130
+ - @buildonspark/spark-sdk@0.1.21
131
+
132
+ ## 0.0.51
133
+
134
+ ### Patch Changes
135
+
136
+ - Fixes
137
+ - Updated dependencies
138
+ - @buildonspark/lrc20-sdk@0.0.46
139
+ - @buildonspark/spark-sdk@0.1.20
140
+
141
+ ## 0.0.50
142
+
143
+ ### Patch Changes
144
+
145
+ - React Native support
146
+ - Updated dependencies
147
+ - @buildonspark/lrc20-sdk@0.0.45
148
+ - @buildonspark/spark-sdk@0.1.19
149
+
150
+ ## 0.0.49
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies
155
+ - @buildonspark/spark-sdk@0.1.18
156
+
157
+ ## 0.0.48
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies
162
+ - Updated dependencies
163
+ - @buildonspark/lrc20-sdk@0.0.44
164
+ - @buildonspark/spark-sdk@0.1.17
165
+
166
+ ## 0.0.47
167
+
168
+ ### Patch Changes
169
+
170
+ - Fixes
171
+ - Updated dependencies
172
+ - @buildonspark/lrc20-sdk@0.0.43
173
+ - @buildonspark/spark-sdk@0.1.16
174
+
175
+ ## 0.0.46
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies
180
+ - @buildonspark/spark-sdk@0.1.15
181
+
182
+ ## 0.0.45
183
+
184
+ ### Patch Changes
185
+
186
+ - Fixes
187
+ - Updated dependencies
188
+ - @buildonspark/lrc20-sdk@0.0.42
189
+ - @buildonspark/spark-sdk@0.1.14
190
+
191
+ ## 0.0.44
192
+
193
+ ### Patch Changes
194
+
195
+ - Fixes
196
+ - Updated dependencies
197
+ - @buildonspark/lrc20-sdk@0.0.41
198
+ - @buildonspark/spark-sdk@0.1.13
199
+
200
+ ## 0.0.43
201
+
202
+ ### Patch Changes
203
+
204
+ - Fixes
205
+ - Updated dependencies
206
+ - @buildonspark/lrc20-sdk@0.0.40
207
+ - @buildonspark/spark-sdk@0.1.12
208
+
209
+ ## 0.0.42
210
+
211
+ ### Patch Changes
212
+
213
+ - Fixes
214
+ - Updated dependencies
215
+ - @buildonspark/lrc20-sdk@0.0.39
216
+ - @buildonspark/spark-sdk@0.1.11
217
+
218
+ ## 0.0.41
219
+
220
+ ### Patch Changes
221
+
222
+ - Fixes
223
+ - Updated dependencies
224
+ - @buildonspark/lrc20-sdk@0.0.38
225
+ - @buildonspark/spark-sdk@0.1.10
226
+
227
+ ## 0.0.40
228
+
229
+ ### Patch Changes
230
+
231
+ - Fixes
232
+ - Updated dependencies
233
+ - @buildonspark/lrc20-sdk@0.0.37
234
+ - @buildonspark/spark-sdk@0.1.9
235
+
236
+ ## 0.0.39
237
+
238
+ ### Patch Changes
239
+
240
+ - Fixes
241
+ - Updated dependencies
242
+ - @buildonspark/lrc20-sdk@0.0.36
243
+ - @buildonspark/spark-sdk@0.1.8
244
+
245
+ ## 0.0.38
246
+
247
+ ### Patch Changes
248
+
249
+ - Fixes
250
+ - Updated dependencies
251
+ - @buildonspark/lrc20-sdk@0.0.35
252
+ - @buildonspark/spark-sdk@0.1.7
253
+
254
+ ## 0.0.37
255
+
256
+ ### Patch Changes
257
+
258
+ - Fixes
259
+ - Updated dependencies
260
+ - @buildonspark/lrc20-sdk@0.0.34
261
+ - @buildonspark/spark-sdk@0.1.6
262
+
263
+ ## 0.0.36
264
+
265
+ ### Patch Changes
266
+
267
+ - Fixes
268
+ - Updated dependencies
269
+ - @buildonspark/lrc20-sdk@0.0.33
270
+ - @buildonspark/spark-sdk@0.1.5
271
+
272
+ ## 0.0.35
273
+
274
+ ### Patch Changes
275
+
276
+ - Fixes
277
+ - Updated dependencies
278
+ - @buildonspark/lrc20-sdk@0.0.32
279
+ - @buildonspark/spark-sdk@0.1.4
280
+
281
+ ## 0.0.34
282
+
283
+ ### Patch Changes
284
+
285
+ - Fixes
286
+ - Updated dependencies
287
+ - @buildonspark/lrc20-sdk@0.0.31
288
+ - @buildonspark/spark-sdk@0.1.3
289
+
290
+ ## 0.0.33
291
+
292
+ ### Patch Changes
293
+
294
+ - Fixes
295
+ - Updated dependencies
296
+ - @buildonspark/lrc20-sdk@0.0.30
297
+ - @buildonspark/spark-sdk@0.1.2
298
+
299
+ ## 0.0.32
300
+
301
+ ### Patch Changes
302
+
303
+ - Fixes
304
+ - Updated dependencies
305
+ - @buildonspark/lrc20-sdk@0.0.29
306
+ - @buildonspark/spark-sdk@0.1.1
307
+
308
+ ## 0.0.31
309
+
310
+ ### Patch Changes
311
+
312
+ - Updated dependencies
313
+ - @buildonspark/spark-sdk@0.1.0
314
+
315
+ ## 0.0.30
316
+
317
+ ### Patch Changes
318
+
319
+ - Fixes
320
+ - Updated dependencies
321
+ - @buildonspark/lrc20-sdk@0.0.28
322
+ - @buildonspark/spark-sdk@0.0.30
323
+
324
+ ## 0.0.29
325
+
326
+ ### Patch Changes
327
+
328
+ - Fixes
329
+ - Updated dependencies
330
+ - @buildonspark/lrc20-sdk@0.0.27
331
+ - @buildonspark/spark-sdk@0.0.29
332
+
333
+ ## 0.0.28
334
+
335
+ ### Patch Changes
336
+
337
+ - Fixes
338
+ - Updated dependencies
339
+ - @buildonspark/lrc20-sdk@0.0.26
340
+ - @buildonspark/spark-sdk@0.0.28
341
+
342
+ ## 0.0.27
343
+
344
+ ### Patch Changes
345
+
346
+ - Fixes
347
+ - Updated dependencies
348
+ - @buildonspark/lrc20-sdk@0.0.25
349
+ - @buildonspark/spark-sdk@0.0.27
350
+
351
+ ## 0.0.26
352
+
353
+ ### Patch Changes
354
+
355
+ - Fixes
356
+ - Updated dependencies
357
+ - @buildonspark/lrc20-sdk@0.0.24
358
+ - @buildonspark/spark-sdk@0.0.26
359
+
360
+ ## 0.0.25
361
+
362
+ ### Patch Changes
363
+
364
+ - Fixes
365
+ - Updated dependencies
366
+ - @buildonspark/lrc20-sdk@0.0.23
367
+ - @buildonspark/spark-sdk@0.0.25
368
+
369
+ ## 0.0.24
370
+
371
+ ### Patch Changes
372
+
373
+ - Fixes
374
+ - Updated dependencies
375
+ - @buildonspark/lrc20-sdk@0.0.22
376
+ - @buildonspark/spark-sdk@0.0.24
377
+
378
+ ## 0.0.23
379
+
380
+ ### Patch Changes
381
+
382
+ - CJS support and package improvements
383
+ - Updated dependencies
384
+ - @buildonspark/lrc20-sdk@0.0.21
385
+ - @buildonspark/spark-sdk@0.0.23
386
+
387
+ ## 0.0.22
388
+
389
+ ### Patch Changes
390
+
391
+ - Fixes
392
+ - Updated dependencies
393
+ - @buildonspark/lrc20-sdk@0.0.20
394
+ - @buildonspark/spark-sdk@0.0.22
395
+
396
+ ## 0.0.21
397
+
398
+ ### Patch Changes
399
+
400
+ - Fixes
401
+ - Updated dependencies
402
+ - @buildonspark/lrc20-sdk@0.0.19
403
+ - @buildonspark/spark-sdk@0.0.21
404
+
405
+ ## 0.0.20
406
+
407
+ ### Patch Changes
408
+
409
+ - Fixes
410
+ - Updated dependencies
411
+ - @buildonspark/lrc20-sdk@0.0.18
412
+ - @buildonspark/spark-sdk@0.0.20
413
+
414
+ ## 0.0.19
415
+
416
+ ### Patch Changes
417
+
418
+ - Fixes
419
+ - Updated dependencies
420
+ - @buildonspark/lrc20-sdk@0.0.17
421
+ - @buildonspark/spark-sdk@0.0.19
422
+
423
+ ## 0.0.18
424
+
425
+ ### Patch Changes
426
+
427
+ - Fixes
428
+ - Updated dependencies
429
+ - @buildonspark/lrc20-sdk@0.0.16
430
+ - @buildonspark/spark-sdk@0.0.18
431
+
432
+ ## 0.0.17
433
+
434
+ ### Patch Changes
435
+
436
+ - Fixes
437
+ - Updated dependencies
438
+ - @buildonspark/lrc20-sdk@0.0.15
439
+ - @buildonspark/spark-sdk@0.0.17
440
+
441
+ ## 0.0.16
442
+
443
+ ### Patch Changes
444
+
445
+ - Fixes
446
+ - Updated dependencies
447
+ - @buildonspark/lrc20-sdk@0.0.14
448
+ - @buildonspark/spark-sdk@0.0.16
449
+
450
+ ## 0.0.15
451
+
452
+ ### Patch Changes
453
+
454
+ - Fixes
455
+ - Updated dependencies
456
+ - @buildonspark/lrc20-sdk@0.0.13
457
+ - @buildonspark/spark-sdk@0.0.15
458
+
459
+ ## 0.0.14
460
+
461
+ ### Patch Changes
462
+
463
+ - Fixes
464
+ - Updated dependencies
465
+ - @buildonspark/lrc20-sdk@0.0.12
466
+ - @buildonspark/spark-sdk@0.0.14
467
+
468
+ ## 0.0.13
469
+
470
+ ### Patch Changes
471
+
472
+ - Fixes
473
+ - Updated dependencies
474
+ - @buildonspark/lrc20-sdk@0.0.11
475
+ - @buildonspark/spark-sdk@0.0.13
476
+
477
+ ## 0.0.12
478
+
479
+ ### Patch Changes
480
+
481
+ - Fixes
482
+ - Updated dependencies
483
+ - @buildonspark/lrc20-sdk@0.0.10
484
+ - @buildonspark/spark-sdk@0.0.12
485
+
486
+ ## 0.0.11
487
+
488
+ ### Patch Changes
489
+
490
+ - Fixes
491
+ - Updated dependencies
492
+ - @buildonspark/lrc20-sdk@0.0.9
493
+ - @buildonspark/spark-sdk@0.0.11
494
+
495
+ ## 0.0.10
496
+
497
+ ### Patch Changes
498
+
499
+ - Fixes
500
+ - Updated dependencies
501
+ - @buildonspark/lrc20-sdk@0.0.8
502
+ - @buildonspark/spark-sdk@0.0.10
503
+
504
+ ## 0.0.9
505
+
506
+ ### Patch Changes
507
+
508
+ - Fixes
509
+ - Updated dependencies
510
+ - @buildonspark/lrc20-sdk@0.0.7
511
+ - @buildonspark/spark-sdk@0.0.9
512
+
513
+ ## 0.0.8
514
+
515
+ ### Patch Changes
516
+
517
+ - Fixes
518
+ - Updated dependencies
519
+ - @buildonspark/lrc20-sdk@0.0.6
520
+ - @buildonspark/spark-sdk@0.0.8
521
+
522
+ ## 0.0.7
523
+
524
+ ### Patch Changes
525
+
526
+ - Fixes
527
+ - Updated dependencies
528
+ - @buildonspark/lrc20-sdk@0.0.5
529
+ - @buildonspark/spark-sdk@0.0.7
530
+
531
+ ## 0.0.6
532
+
533
+ ### Patch Changes
534
+
535
+ - Fixes
536
+ - Updated dependencies
537
+ - @buildonspark/lrc20-sdk@0.0.4
538
+ - @buildonspark/spark-sdk@0.0.6
539
+
540
+ ## 0.0.4
541
+
542
+ ### Patch Changes
543
+
544
+ - Fixes
545
+ - Updated dependencies
546
+ - @buildonspark/lrc20-sdk@0.0.2
547
+ - @buildonspark/spark-sdk@0.0.4
548
+
549
+ ## 0.0.3
550
+
551
+ ### Patch Changes
552
+
553
+ - Fixes
554
+ - Updated dependencies
555
+ - @buildonspark/lrc20-sdk@0.0.1
556
+ - @buildonspark/spark-sdk@0.0.3
557
+
558
+ ## 0.0.2
559
+
560
+ ### Patch Changes
561
+
562
+ - Updated dependencies
563
+ - @buildonspark/spark-sdk@0.0.2
564
+
565
+ ## 0.0.1
566
+
567
+ ### Patch Changes
568
+
569
+ - Fixes
570
+ - Updated dependencies
571
+ - @buildonspark/spark-sdk@0.0.1
package/dist/index.cjs CHANGED
@@ -291,12 +291,14 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk3.Spark
291
291
  * @param options - Configuration options for the wallet
292
292
  * @returns An object containing the initialized wallet and initialization response
293
293
  */
294
- static async initialize(options) {
295
- const wallet = new _IssuerSparkWallet(options.options);
296
- const initResponse = await wallet.initWallet(
297
- options.mnemonicOrSeed,
298
- options.accountNumber
299
- );
294
+ static async initialize({
295
+ mnemonicOrSeed,
296
+ accountNumber,
297
+ signer,
298
+ options
299
+ }) {
300
+ const wallet = new _IssuerSparkWallet(options, signer);
301
+ const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
300
302
  if (import_core.isNode) {
301
303
  wallet.wrapIssuerSparkWalletWithTracing();
302
304
  }
@@ -343,8 +345,8 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk3.Spark
343
345
  this.announceTokenL1.bind(this)
344
346
  );
345
347
  }
346
- constructor(configOptions) {
347
- super(configOptions);
348
+ constructor(configOptions, signer) {
349
+ super(configOptions, signer);
348
350
  this.issuerTokenTransactionService = new IssuerTokenTransactionService(
349
351
  this.config,
350
352
  this.connectionManager
@@ -608,9 +610,10 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk3.Spark
608
610
  announcement,
609
611
  feeRateSatsPerVb
610
612
  );
611
- return await this.lrc20Wallet.broadcastRawBtcTransaction(
613
+ const txId = await this.lrc20Wallet.broadcastRawBtcTransaction(
612
614
  tx.bitcoin_tx.toHex()
613
615
  );
616
+ return txId;
614
617
  } catch (error) {
615
618
  throw new import_spark_sdk3.NetworkError(
616
619
  "Failed to broadcast announcement transaction on L1",
package/dist/index.d.cts CHANGED
@@ -3,6 +3,7 @@ import { OutputWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto
3
3
  import { Layer, OperationType } from '@buildonspark/spark-sdk/proto/lrc20';
4
4
  import { ConfigOptions } from '@buildonspark/spark-sdk/services/wallet-config';
5
5
  import { TokenActivityResponse, TokenDistribution } from './types.cjs';
6
+ import { SparkSigner } from '@buildonspark/spark-sdk/signer';
6
7
 
7
8
  type IssuerTokenInfo = {
8
9
  tokenPublicKey: string;
@@ -27,12 +28,12 @@ declare class IssuerSparkWallet extends SparkWallet {
27
28
  * @param options - Configuration options for the wallet
28
29
  * @returns An object containing the initialized wallet and initialization response
29
30
  */
30
- static initialize(options: SparkWalletProps): Promise<{
31
+ static initialize({ mnemonicOrSeed, accountNumber, signer, options, }: SparkWalletProps): Promise<{
31
32
  mnemonic?: string | undefined;
32
33
  wallet: IssuerSparkWallet;
33
34
  }>;
34
35
  private wrapIssuerSparkWalletWithTracing;
35
- protected constructor(configOptions?: ConfigOptions);
36
+ protected constructor(configOptions?: ConfigOptions, signer?: SparkSigner);
36
37
  /**
37
38
  * Gets the token balance for the issuer's token.
38
39
  * @returns An object containing the token balance as a bigint
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { OutputWithPreviousTransactionData } from '@buildonspark/spark-sdk/proto
3
3
  import { Layer, OperationType } from '@buildonspark/spark-sdk/proto/lrc20';
4
4
  import { ConfigOptions } from '@buildonspark/spark-sdk/services/wallet-config';
5
5
  import { TokenActivityResponse, TokenDistribution } from './types.js';
6
+ import { SparkSigner } from '@buildonspark/spark-sdk/signer';
6
7
 
7
8
  type IssuerTokenInfo = {
8
9
  tokenPublicKey: string;
@@ -27,12 +28,12 @@ declare class IssuerSparkWallet extends SparkWallet {
27
28
  * @param options - Configuration options for the wallet
28
29
  * @returns An object containing the initialized wallet and initialization response
29
30
  */
30
- static initialize(options: SparkWalletProps): Promise<{
31
+ static initialize({ mnemonicOrSeed, accountNumber, signer, options, }: SparkWalletProps): Promise<{
31
32
  mnemonic?: string | undefined;
32
33
  wallet: IssuerSparkWallet;
33
34
  }>;
34
35
  private wrapIssuerSparkWalletWithTracing;
35
- protected constructor(configOptions?: ConfigOptions);
36
+ protected constructor(configOptions?: ConfigOptions, signer?: SparkSigner);
36
37
  /**
37
38
  * Gets the token balance for the issuer's token.
38
39
  * @returns An object containing the token balance as a bigint
package/dist/index.js CHANGED
@@ -276,12 +276,14 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends SparkWallet {
276
276
  * @param options - Configuration options for the wallet
277
277
  * @returns An object containing the initialized wallet and initialization response
278
278
  */
279
- static async initialize(options) {
280
- const wallet = new _IssuerSparkWallet(options.options);
281
- const initResponse = await wallet.initWallet(
282
- options.mnemonicOrSeed,
283
- options.accountNumber
284
- );
279
+ static async initialize({
280
+ mnemonicOrSeed,
281
+ accountNumber,
282
+ signer,
283
+ options
284
+ }) {
285
+ const wallet = new _IssuerSparkWallet(options, signer);
286
+ const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
285
287
  if (isNode) {
286
288
  wallet.wrapIssuerSparkWalletWithTracing();
287
289
  }
@@ -328,8 +330,8 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends SparkWallet {
328
330
  this.announceTokenL1.bind(this)
329
331
  );
330
332
  }
331
- constructor(configOptions) {
332
- super(configOptions);
333
+ constructor(configOptions, signer) {
334
+ super(configOptions, signer);
333
335
  this.issuerTokenTransactionService = new IssuerTokenTransactionService(
334
336
  this.config,
335
337
  this.connectionManager
@@ -593,9 +595,10 @@ var IssuerSparkWallet = class _IssuerSparkWallet extends SparkWallet {
593
595
  announcement,
594
596
  feeRateSatsPerVb
595
597
  );
596
- return await this.lrc20Wallet.broadcastRawBtcTransaction(
598
+ const txId = await this.lrc20Wallet.broadcastRawBtcTransaction(
597
599
  tx.bitcoin_tx.toHex()
598
600
  );
601
+ return txId;
599
602
  } catch (error) {
600
603
  throw new NetworkError2(
601
604
  "Failed to broadcast announcement transaction on L1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildonspark/issuer-sdk",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "Spark Issuer SDK for token issuance",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.js",
@@ -35,7 +35,8 @@
35
35
  },
36
36
  "files": [
37
37
  "dist",
38
- "src"
38
+ "src",
39
+ "CHANGELOG.md"
39
40
  ],
40
41
  "scripts": {
41
42
  "build": "yarn tsc && tsup",
@@ -61,9 +62,9 @@
61
62
  "types": "tsc"
62
63
  },
63
64
  "dependencies": {
64
- "@buildonspark/lrc20-sdk": "0.0.54",
65
- "@buildonspark/spark-sdk": "0.1.33",
66
- "@lightsparkdev/core": "^1.4.0",
65
+ "@buildonspark/lrc20-sdk": "0.0.56",
66
+ "@buildonspark/spark-sdk": "0.1.35",
67
+ "@lightsparkdev/core": "^1.4.1",
67
68
  "@noble/curves": "^1.8.0",
68
69
  "@scure/btc-signer": "^1.5.0",
69
70
  "bitcoinjs-lib": "^6.1.5",
@@ -27,6 +27,7 @@ import {
27
27
  ListAllTokenTransactionsCursor,
28
28
  OperationType,
29
29
  } from "@buildonspark/spark-sdk/proto/lrc20";
30
+ import { SparkSigner } from "@buildonspark/spark-sdk/signer";
30
31
 
31
32
  const BURN_ADDRESS = "02".repeat(33);
32
33
 
@@ -55,13 +56,15 @@ export class IssuerSparkWallet extends SparkWallet {
55
56
  * @param options - Configuration options for the wallet
56
57
  * @returns An object containing the initialized wallet and initialization response
57
58
  */
58
- public static async initialize(options: SparkWalletProps) {
59
- const wallet = new IssuerSparkWallet(options.options);
59
+ public static async initialize({
60
+ mnemonicOrSeed,
61
+ accountNumber,
62
+ signer,
63
+ options,
64
+ }: SparkWalletProps) {
65
+ const wallet = new IssuerSparkWallet(options, signer);
60
66
 
61
- const initResponse = await wallet.initWallet(
62
- options.mnemonicOrSeed,
63
- options.accountNumber,
64
- );
67
+ const initResponse = await wallet.initWallet(mnemonicOrSeed, accountNumber);
65
68
 
66
69
  if (isNode) {
67
70
  wallet.wrapIssuerSparkWalletWithTracing();
@@ -112,8 +115,8 @@ export class IssuerSparkWallet extends SparkWallet {
112
115
  );
113
116
  }
114
117
 
115
- protected constructor(configOptions?: ConfigOptions) {
116
- super(configOptions);
118
+ protected constructor(configOptions?: ConfigOptions, signer?: SparkSigner) {
119
+ super(configOptions, signer);
117
120
  this.issuerTokenTransactionService = new IssuerTokenTransactionService(
118
121
  this.config,
119
122
  this.connectionManager,
@@ -420,6 +423,7 @@ export class IssuerSparkWallet extends SparkWallet {
420
423
  }
421
424
 
422
425
  await this.lrc20Wallet!.syncWallet();
426
+
423
427
  const tokenPublicKey = new TokenPubkey(this.lrc20Wallet!.pubkey);
424
428
 
425
429
  const announcement = new TokenPubkeyAnnouncement(
@@ -437,9 +441,11 @@ export class IssuerSparkWallet extends SparkWallet {
437
441
  feeRateSatsPerVb,
438
442
  );
439
443
 
440
- return await this.lrc20Wallet!.broadcastRawBtcTransaction(
444
+ const txId = await this.lrc20Wallet!.broadcastRawBtcTransaction(
441
445
  tx.bitcoin_tx.toHex(),
442
446
  );
447
+
448
+ return txId;
443
449
  } catch (error) {
444
450
  throw new NetworkError(
445
451
  "Failed to broadcast announcement transaction on L1",
@@ -515,6 +515,42 @@ describe("token integration tests", () => {
515
515
  expect(tokenBalance.balance).toEqual(tokenAmount);
516
516
  });
517
517
 
518
+ it("it should be able to announce a token with name of size equal to MAX_SYMBOL_SIZE", async () => {
519
+ const { wallet: issuerWallet } = await IssuerSparkWalletTesting.initialize({
520
+ options: LOCAL_WALLET_CONFIG_SCHNORR,
521
+ });
522
+
523
+ await fundAndAnnounce(issuerWallet, 1n, 0, "MaxSupply", "TESTAA");
524
+ });
525
+
526
+ it("it should be able to announce a token with symbol of size equal to MAX_NAME_SIZE", async () => {
527
+ const { wallet: issuerWallet } = await IssuerSparkWalletTesting.initialize({
528
+ options: LOCAL_WALLET_CONFIG_SCHNORR,
529
+ });
530
+
531
+ await fundAndAnnounce(issuerWallet, 1n, 0, "ABCDEFGHIJKLMNOPQ", "MQS");
532
+ });
533
+
534
+ it("it should NOT be able to announce a token with ( symbol size + name size ) > MAX_NAME_AND_SYMBOL_SIZE", async () => {
535
+ const { wallet: issuerWallet } = await IssuerSparkWalletTesting.initialize({
536
+ options: LOCAL_WALLET_CONFIG_SCHNORR,
537
+ });
538
+
539
+ await expect(
540
+ fundAndAnnounce(issuerWallet, 1n, 0, "ABCDEFGHIJKLMNOPQ", "TESTAB"),
541
+ ).rejects.toThrow();
542
+ });
543
+
544
+ it("it should NOT be able to announce a token with ( symbol size + name size ) > MAX_NAME_AND_SYMBOL_SIZE, and size is calculated in bytes", async () => {
545
+ const { wallet: issuerWallet } = await IssuerSparkWalletTesting.initialize({
546
+ options: LOCAL_WALLET_CONFIG_SCHNORR,
547
+ });
548
+
549
+ await expect(
550
+ fundAndAnnounce(issuerWallet, 1n, 0, "ABCDEFGHIJKLMNOPQ", "🥸🥸"),
551
+ ).rejects.toThrow();
552
+ });
553
+
518
554
  // freeze is hardcoded to mainnet
519
555
  brokenTestFn(
520
556
  "should announce, mint, freeze and unfreeze tokens with ECDSA",