@lukso/transaction-decoder 1.3.6-dev.6843bdd → 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.
- package/dist/browser.cjs +13 -203
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +4 -4
- package/dist/cdn/transaction-decoder.global.js +59 -59
- package/dist/cdn/transaction-decoder.global.js.map +1 -1
- package/dist/{chunk-HFBAO6YR.js → chunk-FKBKAWB3.js} +2 -2
- package/dist/{chunk-RYQVLCCC.js → chunk-NDBDNXBI.js} +2 -2
- package/dist/{chunk-MSTGEOTX.js → chunk-SSY7TTU2.js} +4 -4
- package/dist/{chunk-MGPLCACC.js → chunk-T4H2HHIB.js} +8 -198
- package/dist/chunk-T4H2HHIB.js.map +1 -0
- package/dist/data.cjs +7 -197
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.cts +3 -3
- package/dist/data.d.ts +3 -3
- package/dist/data.js +2 -2
- package/dist/{index-BWD9DaG6.d.ts → index-C5YGrCiY.d.cts} +0 -5
- package/dist/{index-BWD9DaG6.d.cts → index-C5YGrCiY.d.ts} +0 -5
- package/dist/index.cjs +13 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/server.cjs +7 -197
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/{utils-OR-XzeYG.d.cts → utils-B9wHdaOz.d.cts} +1 -1
- package/dist/{utils-4Qdavg8r.d.ts → utils-BLjnC-HG.d.ts} +1 -1
- package/package.json +1 -1
- package/src/decoder/lsp7Mint.test.ts +11 -18
- package/src/decoder/plugins/enhanceLSP0ERC725Account.ts +2 -39
- package/src/decoder/types.ts +0 -2
- package/dist/chunk-MGPLCACC.js.map +0 -1
- package/src/decoder/plugins/universalReceiverTypeIds.ts +0 -277
- /package/dist/{chunk-HFBAO6YR.js.map → chunk-FKBKAWB3.js.map} +0 -0
- /package/dist/{chunk-RYQVLCCC.js.map → chunk-NDBDNXBI.js.map} +0 -0
- /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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
@@ -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
|
|
149
|
-
//
|
|
150
|
-
const
|
|
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(
|
|
156
|
-
expect(
|
|
153
|
+
expect(universalReceiverLog).toBeDefined()
|
|
154
|
+
expect(universalReceiverLog?.address).toBe(
|
|
157
155
|
'0xda9b727f1718f128008ad025828e7fecfaa8a37b'
|
|
158
156
|
) // LSP7 token contract
|
|
159
157
|
|
|
160
|
-
// Verify the
|
|
161
|
-
|
|
162
|
-
expect(
|
|
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
|
|
172
|
-
expect(
|
|
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
|
|
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
|
-
|
|
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
|
)
|