@lukso/transaction-view-core 0.6.5 → 0.6.6-dev.2b7df2e

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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/service-auth-simple/service-auth-simple/.npmrc". Failed to replace env in config: ${LUKSO_NPM_TOKEN}
2
2
 
3
- > @lukso/transaction-view-core@0.6.5 build /home/runner/work/service-auth-simple/service-auth-simple/packages/transaction-view-core
3
+ > @lukso/transaction-view-core@0.6.6 build /home/runner/work/service-auth-simple/service-auth-simple/packages/transaction-view-core
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: src/index.ts, src/shared/index.ts, src/styles/index.ts
@@ -11,24 +11,24 @@
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
- CJS dist/index.cjs 276.40 KB
14
+ CJS dist/index.cjs 279.94 KB
15
15
  CJS dist/shared/index.cjs 209.95 KB
16
16
  CJS dist/styles/index.cjs 133.22 KB
17
- CJS dist/styles/index.cjs.map 141.45 KB
18
- CJS dist/index.cjs.map 381.60 KB
17
+ CJS dist/index.cjs.map 388.13 KB
19
18
  CJS dist/shared/index.cjs.map 272.16 KB
20
- CJS ⚡️ Build success in 5349ms
21
- ESM dist/index.js 267.64 KB
19
+ CJS dist/styles/index.cjs.map 141.45 KB
20
+ CJS ⚡️ Build success in 5293ms
21
+ ESM dist/index.js 271.04 KB
22
22
  ESM dist/shared/index.js 204.53 KB
23
23
  ESM dist/styles/index.js 132.18 KB
24
- ESM dist/index.js.map 380.83 KB
24
+ ESM dist/index.js.map 387.37 KB
25
25
  ESM dist/shared/index.js.map 271.29 KB
26
26
  ESM dist/styles/index.js.map 141.39 KB
27
- ESM ⚡️ Build success in 5357ms
28
- DTS ⚡️ Build success in 11101ms
27
+ ESM ⚡️ Build success in 5321ms
28
+ DTS ⚡️ Build success in 10962ms
29
29
  DTS dist/styles/index.d.ts 233.00 B
30
- DTS dist/index.d.ts 16.93 KB
30
+ DTS dist/index.d.ts 17.84 KB
31
31
  DTS dist/shared/index.d.ts 23.60 KB
32
32
  DTS dist/styles/index.d.cts 233.00 B
33
- DTS dist/index.d.cts 16.93 KB
33
+ DTS dist/index.d.cts 17.85 KB
34
34
  DTS dist/shared/index.d.cts 23.60 KB
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/home/runner/work/service-auth-simple/service-auth-simple/.npmrc". Failed to replace env in config: ${LUKSO_NPM_TOKEN}
2
2
 
3
- > @lukso/transaction-view-core@0.6.5 typecheck /home/runner/work/service-auth-simple/service-auth-simple/packages/transaction-view-core
3
+ > @lukso/transaction-view-core@0.6.6 typecheck /home/runner/work/service-auth-simple/service-auth-simple/packages/transaction-view-core
4
4
  > tsc --noEmit
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.6](https://github.com/lukso-network/service-auth-simple/compare/transaction-view-core-v0.6.5...transaction-view-core-v0.6.6) (2026-01-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Allow passing of raw transactions to playback ([#88](https://github.com/lukso-network/service-auth-simple/issues/88)) ([e27d626](https://github.com/lukso-network/service-auth-simple/commit/e27d626303991ad1cba737647d562bdfe246f299))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @lukso/transaction-decoder bumped to 1.3.6
16
+ * @lukso/transaction-view-headless bumped to 0.4.6
17
+
3
18
  ## [0.6.5](https://github.com/lukso-network/service-auth-simple/compare/transaction-view-core-v0.6.4...transaction-view-core-v0.6.5) (2026-01-05)
4
19
 
5
20
 
package/dist/index.cjs CHANGED
@@ -4310,6 +4310,7 @@ PermissionsBlock = __decorateClass([
4310
4310
  ], PermissionsBlock);
4311
4311
 
4312
4312
  // src/components/transaction-playback.ts
4313
+ var import_transaction_decoder = require("@lukso/transaction-decoder");
4313
4314
  var import_transaction_view_headless10 = require("@lukso/transaction-view-headless");
4314
4315
  var import_lit20 = require("lit");
4315
4316
  var import_decorators19 = require("lit/decorators.js");
@@ -4460,6 +4461,7 @@ var TransactionPlayback = class extends CoreLitElement {
4460
4461
  this.index = 1;
4461
4462
  this.debug = false;
4462
4463
  this.isLoading = false;
4464
+ this.isDecoding = false;
4463
4465
  this.componentContainerRef = (0, import_ref.createRef)();
4464
4466
  this.loader = getGlobalLitLoader();
4465
4467
  this.handleHeaderInfo = (event) => {
@@ -4476,7 +4478,13 @@ var TransactionPlayback = class extends CoreLitElement {
4476
4478
  };
4477
4479
  }
4478
4480
  willUpdate(changedProperties) {
4479
- if (changedProperties.has("transaction") || changedProperties.has("index") || changedProperties.has("context") || changedProperties.has("variant")) {
4481
+ if (changedProperties.has("rawTransaction") || changedProperties.has("chain")) {
4482
+ if (this.rawTransaction) {
4483
+ this.decodeRawTransaction();
4484
+ return;
4485
+ }
4486
+ }
4487
+ if (changedProperties.has("transaction") || changedProperties.has("decodedTransaction") || changedProperties.has("index") || changedProperties.has("context") || changedProperties.has("variant")) {
4480
4488
  this.loadView();
4481
4489
  }
4482
4490
  }
@@ -4499,9 +4507,80 @@ var TransactionPlayback = class extends CoreLitElement {
4499
4507
  import_transaction_view_headless10.TransactionViewEvents.HEADER_INFO,
4500
4508
  this.handleHeaderInfo
4501
4509
  );
4510
+ if (this.decodingUnsubscribe) {
4511
+ this.decodingUnsubscribe();
4512
+ this.decodingUnsubscribe = void 0;
4513
+ }
4514
+ }
4515
+ /**
4516
+ * Decode a raw transaction locally (no server API calls)
4517
+ * Accepts transactions with JSON, BigintJSON, or bigint values
4518
+ *
4519
+ * Two-phase decoding:
4520
+ * 1. Immediate sync decoding - shows basic decoded transaction right away
4521
+ * 2. Async enhancement - progressively enhances with additional data
4522
+ */
4523
+ async decodeRawTransaction() {
4524
+ if (!this.rawTransaction) {
4525
+ return;
4526
+ }
4527
+ if (!this.chain) {
4528
+ this.error = "Chain configuration is required when decoding raw transactions";
4529
+ return;
4530
+ }
4531
+ this.isDecoding = true;
4532
+ this.error = void 0;
4533
+ this.decodedTransaction = void 0;
4534
+ if (this.decodingUnsubscribe) {
4535
+ this.decodingUnsubscribe();
4536
+ this.decodingUnsubscribe = void 0;
4537
+ }
4538
+ try {
4539
+ const normalizedTx = import_transaction_decoder.JSONbigString.read(this.rawTransaction);
4540
+ const result = await (0, import_transaction_decoder.decodeTransaction)(normalizedTx, {
4541
+ chain: this.chain,
4542
+ plugins: [],
4543
+ // Use auto-registered plugins
4544
+ schemaPlugins: [],
4545
+ // Use auto-registered schema plugins
4546
+ wrappers: [],
4547
+ // No wrapper detection needed for raw transactions
4548
+ async: true
4549
+ // Enable async enhancement (ABI fetching, address resolution)
4550
+ });
4551
+ if (!Array.isArray(result)) {
4552
+ this.decodedTransaction = result.immediate;
4553
+ this.isDecoding = false;
4554
+ this.loadView();
4555
+ this.decodingUnsubscribe = result.signal.subscribe((state11) => {
4556
+ if (state11.data && state11.data !== this.decodedTransaction) {
4557
+ this.decodedTransaction = state11.data;
4558
+ this.loadView();
4559
+ }
4560
+ });
4561
+ } else {
4562
+ const firstResult = result[0];
4563
+ this.decodedTransaction = firstResult.immediate;
4564
+ this.isDecoding = false;
4565
+ this.loadView();
4566
+ this.decodingUnsubscribe = firstResult.signal.subscribe(
4567
+ (state11) => {
4568
+ if (state11.data && state11.data !== this.decodedTransaction) {
4569
+ this.decodedTransaction = state11.data;
4570
+ this.loadView();
4571
+ }
4572
+ }
4573
+ );
4574
+ }
4575
+ } catch (err) {
4576
+ this.error = err instanceof Error ? err.message : "Failed to decode transaction";
4577
+ this.isDecoding = false;
4578
+ console.error("Transaction decoding error:", err);
4579
+ }
4502
4580
  }
4503
4581
  async loadView() {
4504
- if (!this.transaction) {
4582
+ const txToDisplay = this.decodedTransaction || this.transaction;
4583
+ if (!txToDisplay) {
4505
4584
  this.error = "No transaction provided";
4506
4585
  return;
4507
4586
  }
@@ -4510,7 +4589,7 @@ var TransactionPlayback = class extends CoreLitElement {
4510
4589
  this.loadedComponent = void 0;
4511
4590
  this.headerInfo = void 0;
4512
4591
  try {
4513
- this.playbackState = (0, import_transaction_view_headless10.createTransactionPlayback)(this.transaction, {
4592
+ this.playbackState = (0, import_transaction_view_headless10.createTransactionPlayback)(txToDisplay, {
4514
4593
  framework: "lit",
4515
4594
  fallbackViewId: this.fallbackViewId,
4516
4595
  context: this.context,
@@ -4632,6 +4711,14 @@ var TransactionPlayback = class extends CoreLitElement {
4632
4711
  `;
4633
4712
  }
4634
4713
  render() {
4714
+ if (this.isDecoding) {
4715
+ return import_lit20.html`
4716
+ <div class="flex flex-col items-center justify-center py-15 px-5 text-neutral-60">
4717
+ <div class="text-32 mb-4 animate-spin">🔄</div>
4718
+ <div class="text-16 font-500">Decoding transaction...</div>
4719
+ </div>
4720
+ `;
4721
+ }
4635
4722
  if (this.isLoading) {
4636
4723
  return import_lit20.html`
4637
4724
  <div class="flex flex-col items-center justify-center py-15 px-5 text-neutral-60">
@@ -4684,6 +4771,12 @@ var TransactionPlayback = class extends CoreLitElement {
4684
4771
  __decorateClass([
4685
4772
  (0, import_decorators19.property)({ type: Object })
4686
4773
  ], TransactionPlayback.prototype, "transaction", 2);
4774
+ __decorateClass([
4775
+ (0, import_decorators19.property)({ type: Object })
4776
+ ], TransactionPlayback.prototype, "rawTransaction", 2);
4777
+ __decorateClass([
4778
+ (0, import_decorators19.property)({ type: Object })
4779
+ ], TransactionPlayback.prototype, "chain", 2);
4687
4780
  __decorateClass([
4688
4781
  (0, import_decorators19.property)({ type: Number })
4689
4782
  ], TransactionPlayback.prototype, "index", 2);
@@ -4708,6 +4801,9 @@ __decorateClass([
4708
4801
  __decorateClass([
4709
4802
  (0, import_decorators19.state)()
4710
4803
  ], TransactionPlayback.prototype, "isLoading", 2);
4804
+ __decorateClass([
4805
+ (0, import_decorators19.state)()
4806
+ ], TransactionPlayback.prototype, "isDecoding", 2);
4711
4807
  __decorateClass([
4712
4808
  (0, import_decorators19.state)()
4713
4809
  ], TransactionPlayback.prototype, "error", 2);
@@ -4717,6 +4813,9 @@ __decorateClass([
4717
4813
  __decorateClass([
4718
4814
  (0, import_decorators19.state)()
4719
4815
  ], TransactionPlayback.prototype, "headerInfo", 2);
4816
+ __decorateClass([
4817
+ (0, import_decorators19.state)()
4818
+ ], TransactionPlayback.prototype, "decodedTransaction", 2);
4720
4819
  TransactionPlayback = __decorateClass([
4721
4820
  safeCustomElement("transaction-playback")
4722
4821
  ], TransactionPlayback);