@lukso/transaction-decoder 1.3.6-dev.637d4ef → 1.3.6-dev.6cff3c3

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 (40) hide show
  1. package/dist/browser.cjs +13 -203
  2. package/dist/browser.cjs.map +1 -1
  3. package/dist/browser.d.cts +2 -2
  4. package/dist/browser.d.ts +2 -2
  5. package/dist/browser.js +4 -4
  6. package/dist/cdn/transaction-decoder.global.js +71 -71
  7. package/dist/cdn/transaction-decoder.global.js.map +1 -1
  8. package/dist/{chunk-HFBAO6YR.js → chunk-FKBKAWB3.js} +2 -2
  9. package/dist/{chunk-RYQVLCCC.js → chunk-NDBDNXBI.js} +2 -2
  10. package/dist/{chunk-MSTGEOTX.js → chunk-SSY7TTU2.js} +4 -4
  11. package/dist/{chunk-MGPLCACC.js → chunk-T4H2HHIB.js} +8 -198
  12. package/dist/chunk-T4H2HHIB.js.map +1 -0
  13. package/dist/data.cjs +7 -197
  14. package/dist/data.cjs.map +1 -1
  15. package/dist/data.d.cts +3 -3
  16. package/dist/data.d.ts +3 -3
  17. package/dist/data.js +2 -2
  18. package/dist/{index-BWD9DaG6.d.ts → index-C5YGrCiY.d.cts} +0 -5
  19. package/dist/{index-BWD9DaG6.d.cts → index-C5YGrCiY.d.ts} +0 -5
  20. package/dist/index.cjs +13 -203
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +3 -3
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +4 -4
  25. package/dist/server.cjs +7 -197
  26. package/dist/server.cjs.map +1 -1
  27. package/dist/server.d.cts +1 -1
  28. package/dist/server.d.ts +1 -1
  29. package/dist/server.js +2 -2
  30. package/dist/{utils-OR-XzeYG.d.cts → utils-B9wHdaOz.d.cts} +1 -1
  31. package/dist/{utils-4Qdavg8r.d.ts → utils-BLjnC-HG.d.ts} +1 -1
  32. package/package.json +3 -3
  33. package/src/decoder/lsp7Mint.test.ts +11 -18
  34. package/src/decoder/plugins/enhanceLSP0ERC725Account.ts +2 -39
  35. package/src/decoder/types.ts +0 -2
  36. package/dist/chunk-MGPLCACC.js.map +0 -1
  37. package/src/decoder/plugins/universalReceiverTypeIds.ts +0 -277
  38. /package/dist/{chunk-HFBAO6YR.js.map → chunk-FKBKAWB3.js.map} +0 -0
  39. /package/dist/{chunk-RYQVLCCC.js.map → chunk-NDBDNXBI.js.map} +0 -0
  40. /package/dist/{chunk-MSTGEOTX.js.map → chunk-SSY7TTU2.js.map} +0 -0
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Chain, Abi } from 'viem';
2
- import { c as DecoderResult, b as DataKey, E as EnhancedInfo, e as Info } from './index-BWD9DaG6.cjs';
2
+ import { c as DecoderResult, b as DataKey, E as EnhancedInfo, e as Info } from './index-C5YGrCiY.cjs';
3
3
  import '@preact/signals-core';
4
4
  import '@erc725/erc725.js';
5
5
 
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Chain, Abi } from 'viem';
2
- import { c as DecoderResult, b as DataKey, E as EnhancedInfo, e as Info } from './index-BWD9DaG6.js';
2
+ import { c as DecoderResult, b as DataKey, E as EnhancedInfo, e as Info } from './index-C5YGrCiY.js';
3
3
  import '@preact/signals-core';
4
4
  import '@erc725/erc725.js';
5
5
 
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fetchMultipleAddresses
3
- } from "./chunk-HFBAO6YR.js";
3
+ } from "./chunk-FKBKAWB3.js";
4
4
  import {
5
5
  __name,
6
6
  collectDataKeys,
@@ -8,7 +8,7 @@ import {
8
8
  decodeTransaction,
9
9
  needsEnhancement,
10
10
  pluginRegistry
11
- } from "./chunk-MGPLCACC.js";
11
+ } from "./chunk-T4H2HHIB.js";
12
12
 
13
13
  // src/server/addressResolver.ts
14
14
  var ServerAddressResolver = class {
@@ -1,4 +1,4 @@
1
- import { g as IDataModelConsumer, I as IDataModel, b as DataKey, c as DecoderResult, T as TransactionState, h as DecoderOptions, P as PluginOptions, i as EnhancerCallback, j as DecodeEventCallback, k as EnhancerAggregationKeyCallback, l as EnhancerSummarizeCallback, m as Aggregation, n as DecoderPlugin, e as Info, S as SchemaPlugin, o as ResultSetData, A as ArrayArgs, C as CustomDecodeFunctionDataReturn, E as EnhancedInfo } from './index-BWD9DaG6.cjs';
1
+ import { g as IDataModelConsumer, I as IDataModel, b as DataKey, c as DecoderResult, T as TransactionState, h as DecoderOptions, P as PluginOptions, i as EnhancerCallback, j as DecodeEventCallback, k as EnhancerAggregationKeyCallback, l as EnhancerSummarizeCallback, m as Aggregation, n as DecoderPlugin, e as Info, S as SchemaPlugin, o as ResultSetData, A as ArrayArgs, C as CustomDecodeFunctionDataReturn, E as EnhancedInfo } from './index-C5YGrCiY.cjs';
2
2
  import { Signal } from '@preact/signals-core';
3
3
  import { Transaction, Abi, Hex, AbiParameter, DecodeFunctionDataParameters, Address, Chain, PublicClient } from 'viem';
4
4
  import { ERC725JSONSchema } from '@erc725/erc725.js';
@@ -1,4 +1,4 @@
1
- import { g as IDataModelConsumer, I as IDataModel, b as DataKey, c as DecoderResult, T as TransactionState, h as DecoderOptions, P as PluginOptions, i as EnhancerCallback, j as DecodeEventCallback, k as EnhancerAggregationKeyCallback, l as EnhancerSummarizeCallback, m as Aggregation, n as DecoderPlugin, e as Info, S as SchemaPlugin, o as ResultSetData, A as ArrayArgs, C as CustomDecodeFunctionDataReturn, E as EnhancedInfo } from './index-BWD9DaG6.js';
1
+ import { g as IDataModelConsumer, I as IDataModel, b as DataKey, c as DecoderResult, T as TransactionState, h as DecoderOptions, P as PluginOptions, i as EnhancerCallback, j as DecodeEventCallback, k as EnhancerAggregationKeyCallback, l as EnhancerSummarizeCallback, m as Aggregation, n as DecoderPlugin, e as Info, S as SchemaPlugin, o as ResultSetData, A as ArrayArgs, C as CustomDecodeFunctionDataReturn, E as EnhancedInfo } from './index-C5YGrCiY.js';
2
2
  import { Signal } from '@preact/signals-core';
3
3
  import { Transaction, Abi, Hex, AbiParameter, DecodeFunctionDataParameters, Address, Chain, PublicClient } from 'viem';
4
4
  import { ERC725JSONSchema } from '@erc725/erc725.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/transaction-decoder",
3
- "version": "1.3.6-dev.637d4ef",
3
+ "version": "1.3.6-dev.6cff3c3",
4
4
  "description": "Transaction decoder for LUKSO blockchain with reactive state management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -51,10 +51,10 @@
51
51
  "graphql-request": "^7.4.0",
52
52
  "graphql-ws": "^6.0.7",
53
53
  "lru-cache": "^11.2.6",
54
- "viem": "^2.46.1"
54
+ "viem": "^2.45.2"
55
55
  },
56
56
  "devDependencies": {
57
- "@biomejs/biome": "^2.4.2",
57
+ "@biomejs/biome": "^2.3.14",
58
58
  "@types/debug": "^4.1.12",
59
59
  "@types/node": "^25.2.3",
60
60
  "tsup": "^8.5.1",
@@ -145,31 +145,24 @@ describe('LSP7 Mint Transaction Decoding', () => {
145
145
  expect(dataChangedLogs.length).toBeGreaterThan(0)
146
146
  console.log(`\nFound ${dataChangedLogs.length} DataChanged events`)
147
147
 
148
- // Look for unwrapped URDTokensReceived event from UniversalReceiver (confirms the mint was received)
149
- // The UniversalReceiver event is now unwrapped into URDTokensReceived with standard: LSP7DigitalAsset
150
- const unwrappedTransferLog = result?.logs?.find(
151
- (log: any) =>
152
- log.eventName === 'URDTokensReceived' &&
153
- log.standard === 'LSP7DigitalAsset'
148
+ // Look for UniversalReceiver event (confirms the mint was received)
149
+ // UniversalReceiver signature: 0x9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c2
150
+ const universalReceiverLog = result?.logs?.find(
151
+ (log: any) => log.eventName === 'UniversalReceiver'
154
152
  )
155
- expect(unwrappedTransferLog).toBeDefined()
156
- expect(unwrappedTransferLog?.address).toBe(
153
+ expect(universalReceiverLog).toBeDefined()
154
+ expect(universalReceiverLog?.address).toBe(
157
155
  '0xda9b727f1718f128008ad025828e7fecfaa8a37b'
158
156
  ) // LSP7 token contract
159
157
 
160
- // Verify the original UniversalReceiver is preserved in wrappers
161
- const wrapper = (unwrappedTransferLog as any)?.wrappers?.[0]
162
- expect(wrapper).toBeDefined()
163
- expect(wrapper?.eventName).toBe('UniversalReceiver')
164
-
165
- // Verify the UniversalReceiver typeId indicates this is a mint recipient notification
166
- // typeId 0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c = _TYPEID_LSP7_TOKENSRECIPIENT
167
- expect(wrapper?.args?.[2]?.value).toBe(
158
+ // Verify the UniversalReceiver typeId indicates this is a mint
159
+ // typeId 0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c = _TYPEID_LSP7_TOKENSSENDER
160
+ expect(universalReceiverLog?.args?.[2]?.value).toBe(
168
161
  '0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c'
169
162
  )
170
163
 
171
- // Verify the 'from' address in the wrapper (the minter, which is the UP)
172
- expect(wrapper?.args?.[0]?.value).toBe(
164
+ // Verify the 'from' address in UniversalReceiver (the minter, which is the UP)
165
+ expect(universalReceiverLog?.args?.[0]?.value).toBe(
173
166
  '0x81A904879F657142d9b5C7e875c786717e2125c0'
174
167
  )
175
168
 
@@ -1,5 +1,5 @@
1
1
  import { universalProfileAbi as UniversalProfile } from '@lukso/universalprofile-contracts/abi'
2
- import type { Address, Hex, Log } from 'viem'
2
+ import type { Address } from 'viem'
3
3
  import { decodeEvent } from '../events'
4
4
  import { decodeTransaction } from '../transaction'
5
5
  import type {
@@ -15,7 +15,6 @@ import type {
15
15
  import { createNamedArgs } from '../utils'
16
16
  import { standardPlugin } from '.'
17
17
  import { enhanceSetData } from './enhanceSetData'
18
- import { unwrapUniversalReceiver } from './universalReceiverTypeIds'
19
18
 
20
19
  export const enhanceLSP0ERC725AccountPlugin = standardPlugin(
21
20
  UniversalProfile,
@@ -27,43 +26,7 @@ export const enhanceLSP0ERC725AccountPlugin = standardPlugin(
27
26
  {
28
27
  enhance: enhanceLSP0ERC725Account,
29
28
  decodeEvent: async (log: DecodeEventResult, options: DecoderOptions) => {
30
- const decoded = decodeEvent(options.chain, UniversalProfile, log)
31
- if (!decoded || decoded.eventName !== 'UniversalReceiver') {
32
- return decoded
33
- }
34
-
35
- // Extract UniversalReceiver args
36
- const typeId = decoded.args.find((a) => a.name === 'typeId')?.value as Hex
37
- const receivedData = decoded.args.find((a) => a.name === 'receivedData')
38
- ?.value as Hex
39
- const from = decoded.args.find((a) => a.name === 'from')?.value as Address
40
- const profileAddress = (decoded as unknown as Log).address as Address
41
-
42
- if (!typeId || !receivedData || !from) {
43
- return decoded
44
- }
45
-
46
- // Unwrap based on typeId (always succeeds — falls back to generic Notification)
47
- const unwrapped = unwrapUniversalReceiver(
48
- typeId,
49
- receivedData,
50
- from,
51
- profileAddress
52
- )
53
-
54
- // Rewrite the event: inner event becomes the main event,
55
- // original UniversalReceiver goes into wrappers.
56
- // Topics and data are rewritten to match the inner event's ABI.
57
- const { wrappers: _w, standard: _s, ...logBase } = decoded
58
- return {
59
- ...logBase,
60
- eventName: unwrapped.eventName,
61
- args: unwrapped.args,
62
- standard: unwrapped.standard,
63
- topics: unwrapped.topics,
64
- data: unwrapped.data,
65
- wrappers: [logBase],
66
- } as DecodeEventResult
29
+ return decodeEvent(options.chain, UniversalProfile, log)
67
30
  },
68
31
  }
69
32
  )
@@ -461,7 +461,5 @@ export type DecodeEventResult =
461
461
  | ({
462
462
  eventName: string
463
463
  args: ArrayArgs
464
- wrappers?: Array<{ eventName: string; args: ArrayArgs } & Log>
465
- standard?: string
466
464
  } & Log)
467
465
  | undefined