@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/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- export { A as TransactionAddressResolver, T as TransactionDecoderResult, i as consumerModel, j as createAggregationKey, k as createGlobalInstance, f as decodeTransaction, l as decodeTransactionAsync, m as defaultPlugins, n as defaultSchemaPlugins, o as getArgByName, p as needsEnhancement, q as standardPlugin, s as standardSchemaPlugin } from './utils-OR-XzeYG.cjs';
1
+ export { A as TransactionAddressResolver, T as TransactionDecoderResult, i as consumerModel, j as createAggregationKey, k as createGlobalInstance, f as decodeTransaction, l as decodeTransactionAsync, m as defaultPlugins, n as defaultSchemaPlugins, o as getArgByName, p as needsEnhancement, q as standardPlugin, s as standardSchemaPlugin } from './utils-B9wHdaOz.cjs';
2
2
  import * as viem from 'viem';
3
3
  import { Chain, Hex, Address } from 'viem';
4
4
  import * as _preact_signals_core from '@preact/signals-core';
5
- import { b as DataKey, E as EnhancedInfo, I as IDataModel, h as DecoderOptions, c as DecoderResult, T as TransactionState, n as DecoderPlugin, p as ResultAggregate, m as Aggregation, S as SchemaPlugin, e as Info, d as AddressState } from './index-BWD9DaG6.cjs';
6
- export { j as DecodeEventCallback, a as DecodeEventResult, i as EnhancerCallback, g as IDataModelConsumer, P as PluginOptions, q as ResultCreate, r as ResultError, s as ResultExecute, t as ResultExecuteBatch, u as ResultFollowProfile, v as ResultGrafitti, w as ResultRaw, o as ResultSetData, x as ResultSetDataBatch, y as ResultWrapper } from './index-BWD9DaG6.cjs';
5
+ import { b as DataKey, E as EnhancedInfo, I as IDataModel, h as DecoderOptions, c as DecoderResult, T as TransactionState, n as DecoderPlugin, p as ResultAggregate, m as Aggregation, S as SchemaPlugin, e as Info, d as AddressState } from './index-C5YGrCiY.cjs';
6
+ export { j as DecodeEventCallback, a as DecodeEventResult, i as EnhancerCallback, g as IDataModelConsumer, P as PluginOptions, q as ResultCreate, r as ResultError, s as ResultExecute, t as ResultExecuteBatch, u as ResultFollowProfile, v as ResultGrafitti, w as ResultRaw, o as ResultSetData, x as ResultSetDataBatch, y as ResultWrapper } from './index-C5YGrCiY.cjs';
7
7
  import '@erc725/erc725.js';
8
8
 
9
9
  /**
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { A as TransactionAddressResolver, T as TransactionDecoderResult, i as consumerModel, j as createAggregationKey, k as createGlobalInstance, f as decodeTransaction, l as decodeTransactionAsync, m as defaultPlugins, n as defaultSchemaPlugins, o as getArgByName, p as needsEnhancement, q as standardPlugin, s as standardSchemaPlugin } from './utils-4Qdavg8r.js';
1
+ export { A as TransactionAddressResolver, T as TransactionDecoderResult, i as consumerModel, j as createAggregationKey, k as createGlobalInstance, f as decodeTransaction, l as decodeTransactionAsync, m as defaultPlugins, n as defaultSchemaPlugins, o as getArgByName, p as needsEnhancement, q as standardPlugin, s as standardSchemaPlugin } from './utils-BLjnC-HG.js';
2
2
  import * as viem from 'viem';
3
3
  import { Chain, Hex, Address } from 'viem';
4
4
  import * as _preact_signals_core from '@preact/signals-core';
5
- import { b as DataKey, E as EnhancedInfo, I as IDataModel, h as DecoderOptions, c as DecoderResult, T as TransactionState, n as DecoderPlugin, p as ResultAggregate, m as Aggregation, S as SchemaPlugin, e as Info, d as AddressState } from './index-BWD9DaG6.js';
6
- export { j as DecodeEventCallback, a as DecodeEventResult, i as EnhancerCallback, g as IDataModelConsumer, P as PluginOptions, q as ResultCreate, r as ResultError, s as ResultExecute, t as ResultExecuteBatch, u as ResultFollowProfile, v as ResultGrafitti, w as ResultRaw, o as ResultSetData, x as ResultSetDataBatch, y as ResultWrapper } from './index-BWD9DaG6.js';
5
+ import { b as DataKey, E as EnhancedInfo, I as IDataModel, h as DecoderOptions, c as DecoderResult, T as TransactionState, n as DecoderPlugin, p as ResultAggregate, m as Aggregation, S as SchemaPlugin, e as Info, d as AddressState } from './index-C5YGrCiY.js';
6
+ export { j as DecodeEventCallback, a as DecodeEventResult, i as EnhancerCallback, g as IDataModelConsumer, P as PluginOptions, q as ResultCreate, r as ResultError, s as ResultExecute, t as ResultExecuteBatch, u as ResultFollowProfile, v as ResultGrafitti, w as ResultRaw, o as ResultSetData, x as ResultSetDataBatch, y as ResultWrapper } from './index-C5YGrCiY.js';
7
7
  import '@erc725/erc725.js';
8
8
 
9
9
  /**
package/dist/index.js CHANGED
@@ -35,19 +35,19 @@ import {
35
35
  parseLSP23DeploymentsFromHypersync,
36
36
  resolveAddresses,
37
37
  subscribe
38
- } from "./chunk-MSTGEOTX.js";
38
+ } from "./chunk-SSY7TTU2.js";
39
39
  import {
40
40
  consumerModel,
41
41
  createGlobalInstance,
42
42
  decodeTransaction,
43
43
  decodeTransactionAsync
44
- } from "./chunk-RYQVLCCC.js";
44
+ } from "./chunk-NDBDNXBI.js";
45
45
  import {
46
46
  fetchMultipleAddresses,
47
47
  fetchProfilesByControllers,
48
48
  getGraphQLEndpoint,
49
49
  getImage
50
- } from "./chunk-HFBAO6YR.js";
50
+ } from "./chunk-FKBKAWB3.js";
51
51
  import {
52
52
  PluginAggregationEngine,
53
53
  collectDataKeys,
@@ -65,7 +65,7 @@ import {
65
65
  standardAggregation,
66
66
  standardPlugin,
67
67
  standardSchemaPlugin
68
- } from "./chunk-MGPLCACC.js";
68
+ } from "./chunk-T4H2HHIB.js";
69
69
  export {
70
70
  AddressResolver,
71
71
  DEPLOY_ERC1167_PROXIES_SELECTOR,
package/dist/server.cjs CHANGED
@@ -3200,170 +3200,6 @@ async function enhanceSetData(result, pluginOptions, options) {
3200
3200
  }
3201
3201
  __name(enhanceSetData, "enhanceSetData");
3202
3202
 
3203
- // src/decoder/plugins/universalReceiverTypeIds.ts
3204
- import {
3205
- decodeAbiParameters as decodeAbiParameters3,
3206
- encodeAbiParameters,
3207
- getAddress,
3208
- keccak256,
3209
- slice as slice4,
3210
- toHex
3211
- } from "viem";
3212
- function encodeEventLog(eventName, params, values) {
3213
- const sig = `${eventName}(${params.map((p) => p.type).join(",")})`;
3214
- const topic0 = keccak256(toHex(sig));
3215
- const data = encodeAbiParameters(params, values);
3216
- return { topics: [topic0], data };
3217
- }
3218
- __name(encodeEventLog, "encodeEventLog");
3219
- var TYPEID_LSP26_FOLLOW = "0x71e02f9f05bcd5816ec4f3134aa2e5a916669537ec6c77fe66ea595fabc2d51a";
3220
- var TYPEID_LSP26_UNFOLLOW = "0x9d3c0b4012b69658977b099bdaa51eff0f0460f421fba96d15669506c00d1c4f";
3221
- var TYPEID_LSP7_TOKENSSENDER = "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
3222
- var TYPEID_LSP7_TOKENSRECIPIENT = "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
3223
- var TYPEID_LSP8_TOKENSSENDER = "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
3224
- var TYPEID_LSP8_TOKENSRECIPIENT = "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
3225
- var followParams = [
3226
- { name: "follower", type: "address" },
3227
- { name: "addr", type: "address" }
3228
- ];
3229
- var unfollowParams = [
3230
- { name: "unfollower", type: "address" },
3231
- { name: "addr", type: "address" }
3232
- ];
3233
- var lsp7TransferParams = [
3234
- { name: "operator", type: "address" },
3235
- { name: "from", type: "address" },
3236
- { name: "to", type: "address" },
3237
- { name: "amount", type: "uint256" },
3238
- { name: "force", type: "bool" },
3239
- { name: "data", type: "bytes" }
3240
- ];
3241
- var lsp8TransferParams = [
3242
- { name: "operator", type: "address" },
3243
- { name: "from", type: "address" },
3244
- { name: "to", type: "address" },
3245
- { name: "tokenId", type: "bytes32" },
3246
- { name: "force", type: "bool" },
3247
- { name: "data", type: "bytes" }
3248
- ];
3249
- var notificationParams = [
3250
- { name: "from", type: "address" },
3251
- { name: "typeId", type: "bytes32" },
3252
- { name: "data", type: "bytes" }
3253
- ];
3254
- function unwrapLSP26Follow(receivedData, _from, profileAddress, _eventName) {
3255
- if (!receivedData || receivedData.length < 42) {
3256
- return void 0;
3257
- }
3258
- const followerAddress = getAddress(slice4(receivedData, 0, 20));
3259
- const values = [followerAddress, profileAddress];
3260
- return {
3261
- eventName: "URDFollow",
3262
- ...createNamedArgs(values, followParams),
3263
- ...encodeEventLog("URDFollow", followParams, values),
3264
- standard: "LSP26FollowerSystem"
3265
- };
3266
- }
3267
- __name(unwrapLSP26Follow, "unwrapLSP26Follow");
3268
- function unwrapLSP26Unfollow(receivedData, _from, profileAddress, _eventName) {
3269
- if (!receivedData || receivedData.length < 42) {
3270
- return void 0;
3271
- }
3272
- const unfollowerAddress = getAddress(slice4(receivedData, 0, 20));
3273
- const values = [unfollowerAddress, profileAddress];
3274
- return {
3275
- eventName: "URDUnfollow",
3276
- ...createNamedArgs(values, unfollowParams),
3277
- ...encodeEventLog("URDUnfollow", unfollowParams, values),
3278
- standard: "LSP26FollowerSystem"
3279
- };
3280
- }
3281
- __name(unwrapLSP26Unfollow, "unwrapLSP26Unfollow");
3282
- function unwrapLSP7Transfer(receivedData, _from, _profileAddress, eventName) {
3283
- try {
3284
- const [operator, sender, recipient, amount, data] = decodeAbiParameters3(
3285
- [
3286
- { name: "operator", type: "address" },
3287
- { name: "from", type: "address" },
3288
- { name: "to", type: "address" },
3289
- { name: "amount", type: "uint256" },
3290
- { name: "data", type: "bytes" }
3291
- ],
3292
- receivedData
3293
- );
3294
- const values = [operator, sender, recipient, amount, true, data];
3295
- return {
3296
- eventName,
3297
- ...createNamedArgs(values, lsp7TransferParams),
3298
- ...encodeEventLog(eventName, lsp7TransferParams, values),
3299
- standard: "LSP7DigitalAsset"
3300
- };
3301
- } catch {
3302
- return void 0;
3303
- }
3304
- }
3305
- __name(unwrapLSP7Transfer, "unwrapLSP7Transfer");
3306
- function unwrapLSP8Transfer(receivedData, _from, _profileAddress, eventName) {
3307
- try {
3308
- const [operator, sender, recipient, tokenId, data] = decodeAbiParameters3(
3309
- [
3310
- { name: "operator", type: "address" },
3311
- { name: "from", type: "address" },
3312
- { name: "to", type: "address" },
3313
- { name: "tokenId", type: "bytes32" },
3314
- { name: "data", type: "bytes" }
3315
- ],
3316
- receivedData
3317
- );
3318
- const values = [operator, sender, recipient, tokenId, true, data];
3319
- return {
3320
- eventName,
3321
- ...createNamedArgs(values, lsp8TransferParams),
3322
- ...encodeEventLog(eventName, lsp8TransferParams, values),
3323
- standard: "LSP8IdentifiableDigitalAsset"
3324
- };
3325
- } catch {
3326
- return void 0;
3327
- }
3328
- }
3329
- __name(unwrapLSP8Transfer, "unwrapLSP8Transfer");
3330
- var typeIdUnwrappers = {
3331
- [TYPEID_LSP26_FOLLOW]: { fn: unwrapLSP26Follow, eventName: "Follow" },
3332
- [TYPEID_LSP26_UNFOLLOW]: { fn: unwrapLSP26Unfollow, eventName: "Unfollow" },
3333
- [TYPEID_LSP7_TOKENSSENDER]: {
3334
- fn: unwrapLSP7Transfer,
3335
- eventName: "URDTokensSent"
3336
- },
3337
- [TYPEID_LSP7_TOKENSRECIPIENT]: {
3338
- fn: unwrapLSP7Transfer,
3339
- eventName: "URDTokensReceived"
3340
- },
3341
- [TYPEID_LSP8_TOKENSSENDER]: {
3342
- fn: unwrapLSP8Transfer,
3343
- eventName: "URDTokensSent"
3344
- },
3345
- [TYPEID_LSP8_TOKENSRECIPIENT]: {
3346
- fn: unwrapLSP8Transfer,
3347
- eventName: "URDTokensReceived"
3348
- }
3349
- };
3350
- function unwrapUniversalReceiver(typeId, receivedData, from, profileAddress) {
3351
- const entry = typeIdUnwrappers[typeId];
3352
- if (entry) {
3353
- const result = entry.fn(receivedData, from, profileAddress, entry.eventName);
3354
- if (result) {
3355
- return result;
3356
- }
3357
- }
3358
- const values = [from, typeId, receivedData];
3359
- return {
3360
- eventName: "URDNotification",
3361
- ...createNamedArgs(values, notificationParams),
3362
- ...encodeEventLog("Notification", notificationParams, values)
3363
- };
3364
- }
3365
- __name(unwrapUniversalReceiver, "unwrapUniversalReceiver");
3366
-
3367
3203
  // src/decoder/plugins/enhanceLSP0ERC725Account.ts
3368
3204
  var enhanceLSP0ERC725AccountPlugin = standardPlugin(
3369
3205
  UniversalProfile,
@@ -3375,33 +3211,7 @@ var enhanceLSP0ERC725AccountPlugin = standardPlugin(
3375
3211
  {
3376
3212
  enhance: enhanceLSP0ERC725Account,
3377
3213
  decodeEvent: /* @__PURE__ */ __name(async (log, options) => {
3378
- const decoded = decodeEvent(options.chain, UniversalProfile, log);
3379
- if (!decoded || decoded.eventName !== "UniversalReceiver") {
3380
- return decoded;
3381
- }
3382
- const typeId = decoded.args.find((a) => a.name === "typeId")?.value;
3383
- const receivedData = decoded.args.find((a) => a.name === "receivedData")?.value;
3384
- const from = decoded.args.find((a) => a.name === "from")?.value;
3385
- const profileAddress = decoded.address;
3386
- if (!typeId || !receivedData || !from) {
3387
- return decoded;
3388
- }
3389
- const unwrapped = unwrapUniversalReceiver(
3390
- typeId,
3391
- receivedData,
3392
- from,
3393
- profileAddress
3394
- );
3395
- const { wrappers: _w, standard: _s, ...logBase } = decoded;
3396
- return {
3397
- ...logBase,
3398
- eventName: unwrapped.eventName,
3399
- args: unwrapped.args,
3400
- standard: unwrapped.standard,
3401
- topics: unwrapped.topics,
3402
- data: unwrapped.data,
3403
- wrappers: [logBase]
3404
- };
3214
+ return decodeEvent(options.chain, UniversalProfile, log);
3405
3215
  }, "decodeEvent")
3406
3216
  }
3407
3217
  );
@@ -5316,9 +5126,9 @@ var abi2 = [
5316
5126
 
5317
5127
  // src/decoder/functionSignature.ts
5318
5128
  import {
5319
- decodeAbiParameters as decodeAbiParameters4,
5320
- encodeAbiParameters as encodeAbiParameters2,
5321
- getAddress as getAddress2,
5129
+ decodeAbiParameters as decodeAbiParameters3,
5130
+ encodeAbiParameters,
5131
+ getAddress,
5322
5132
  isAddress as isAddress2,
5323
5133
  isAddressEqual as isAddressEqual2,
5324
5134
  parseAbiParameters,
@@ -5473,7 +5283,7 @@ async function fetchAbi(chain, address, options) {
5473
5283
  const explorer = chain.blockExplorers?.default?.apiUrl;
5474
5284
  if (!explorer) return void 0;
5475
5285
  const cache = options?.cache ?? defaultCache;
5476
- let key = getAddress2(address);
5286
+ let key = getAddress(address);
5477
5287
  const cacheKey = makeCacheKey("abi" /* ABI */, key, String(chain.id));
5478
5288
  return cache.getOrSet(
5479
5289
  cacheKey,
@@ -5615,7 +5425,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
5615
5425
  const params = generateNamedAbiParameters(
5616
5426
  result.text_signature || result.name
5617
5427
  );
5618
- const args = decodeAbiParameters4(params, `0x${data.slice(8)}`);
5428
+ const args = decodeAbiParameters3(params, `0x${data.slice(8)}`);
5619
5429
  const encodeArgs = Array.from({ length: params.length }).map(
5620
5430
  (_val, index) => {
5621
5431
  if (params[index].type === "bool") {
@@ -5633,7 +5443,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
5633
5443
  return args[`${index}`] ?? "0x";
5634
5444
  }
5635
5445
  );
5636
- const newData = encodeAbiParameters2(
5446
+ const newData = encodeAbiParameters(
5637
5447
  params,
5638
5448
  encodeArgs
5639
5449
  ).slice(2);