@lukso/transaction-decoder 1.3.6-dev.0a1e0b9 → 1.3.6-dev.184cdf1
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 +75 -75
- 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-BzXh7poJ.d.cts} +1 -6
- package/dist/{index-BWD9DaG6.d.cts → index-BzXh7poJ.d.ts} +1 -6
- 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-BEpSreRR.d.cts} +2 -2
- package/dist/{utils-4Qdavg8r.d.ts → utils-De_c6fUK.d.ts} +2 -2
- package/package.json +8 -8
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T4H2HHIB.js";
|
|
4
4
|
|
|
5
5
|
// src/shared/addressResolver.ts
|
|
6
6
|
import request, { gql } from "graphql-request";
|
|
@@ -434,4 +434,4 @@ export {
|
|
|
434
434
|
fetchProfilesByControllers,
|
|
435
435
|
getImage
|
|
436
436
|
};
|
|
437
|
-
//# sourceMappingURL=chunk-
|
|
437
|
+
//# sourceMappingURL=chunk-FKBKAWB3.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
decodeTransaction,
|
|
5
5
|
isAsyncOperationEnabled,
|
|
6
6
|
pluginRegistry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-T4H2HHIB.js";
|
|
8
8
|
|
|
9
9
|
// src/core/dataModel.ts
|
|
10
10
|
import { batch, effect, signal } from "@preact/signals-core";
|
|
@@ -812,4 +812,4 @@ export {
|
|
|
812
812
|
decodeTransaction2 as decodeTransaction,
|
|
813
813
|
decodeTransactionAsync
|
|
814
814
|
};
|
|
815
|
-
//# sourceMappingURL=chunk-
|
|
815
|
+
//# sourceMappingURL=chunk-NDBDNXBI.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
consumerModel,
|
|
3
3
|
decodeTransaction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NDBDNXBI.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchMultipleAddresses
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FKBKAWB3.js";
|
|
8
8
|
import {
|
|
9
9
|
__name,
|
|
10
10
|
collectDataKeys,
|
|
11
11
|
defaultPlugins,
|
|
12
12
|
defaultSchemaPlugins
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-T4H2HHIB.js";
|
|
14
14
|
|
|
15
15
|
// src/shared/cache.ts
|
|
16
16
|
function isPromise(value) {
|
|
@@ -801,4 +801,4 @@ export {
|
|
|
801
801
|
getAllData,
|
|
802
802
|
getAllTransactions
|
|
803
803
|
};
|
|
804
|
-
//# sourceMappingURL=chunk-
|
|
804
|
+
//# sourceMappingURL=chunk-SSY7TTU2.js.map
|
|
@@ -2510,170 +2510,6 @@ async function enhanceSetData(result, pluginOptions, options) {
|
|
|
2510
2510
|
}
|
|
2511
2511
|
__name(enhanceSetData, "enhanceSetData");
|
|
2512
2512
|
|
|
2513
|
-
// src/decoder/plugins/universalReceiverTypeIds.ts
|
|
2514
|
-
import {
|
|
2515
|
-
decodeAbiParameters as decodeAbiParameters3,
|
|
2516
|
-
encodeAbiParameters,
|
|
2517
|
-
getAddress,
|
|
2518
|
-
keccak256,
|
|
2519
|
-
slice as slice4,
|
|
2520
|
-
toHex
|
|
2521
|
-
} from "viem";
|
|
2522
|
-
function encodeEventLog(eventName, params, values) {
|
|
2523
|
-
const sig = `${eventName}(${params.map((p) => p.type).join(",")})`;
|
|
2524
|
-
const topic0 = keccak256(toHex(sig));
|
|
2525
|
-
const data = encodeAbiParameters(params, values);
|
|
2526
|
-
return { topics: [topic0], data };
|
|
2527
|
-
}
|
|
2528
|
-
__name(encodeEventLog, "encodeEventLog");
|
|
2529
|
-
var TYPEID_LSP26_FOLLOW = "0x71e02f9f05bcd5816ec4f3134aa2e5a916669537ec6c77fe66ea595fabc2d51a";
|
|
2530
|
-
var TYPEID_LSP26_UNFOLLOW = "0x9d3c0b4012b69658977b099bdaa51eff0f0460f421fba96d15669506c00d1c4f";
|
|
2531
|
-
var TYPEID_LSP7_TOKENSSENDER = "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
|
|
2532
|
-
var TYPEID_LSP7_TOKENSRECIPIENT = "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
|
|
2533
|
-
var TYPEID_LSP8_TOKENSSENDER = "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
|
|
2534
|
-
var TYPEID_LSP8_TOKENSRECIPIENT = "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
|
|
2535
|
-
var followParams = [
|
|
2536
|
-
{ name: "follower", type: "address" },
|
|
2537
|
-
{ name: "addr", type: "address" }
|
|
2538
|
-
];
|
|
2539
|
-
var unfollowParams = [
|
|
2540
|
-
{ name: "unfollower", type: "address" },
|
|
2541
|
-
{ name: "addr", type: "address" }
|
|
2542
|
-
];
|
|
2543
|
-
var lsp7TransferParams = [
|
|
2544
|
-
{ name: "operator", type: "address" },
|
|
2545
|
-
{ name: "from", type: "address" },
|
|
2546
|
-
{ name: "to", type: "address" },
|
|
2547
|
-
{ name: "amount", type: "uint256" },
|
|
2548
|
-
{ name: "force", type: "bool" },
|
|
2549
|
-
{ name: "data", type: "bytes" }
|
|
2550
|
-
];
|
|
2551
|
-
var lsp8TransferParams = [
|
|
2552
|
-
{ name: "operator", type: "address" },
|
|
2553
|
-
{ name: "from", type: "address" },
|
|
2554
|
-
{ name: "to", type: "address" },
|
|
2555
|
-
{ name: "tokenId", type: "bytes32" },
|
|
2556
|
-
{ name: "force", type: "bool" },
|
|
2557
|
-
{ name: "data", type: "bytes" }
|
|
2558
|
-
];
|
|
2559
|
-
var notificationParams = [
|
|
2560
|
-
{ name: "from", type: "address" },
|
|
2561
|
-
{ name: "typeId", type: "bytes32" },
|
|
2562
|
-
{ name: "data", type: "bytes" }
|
|
2563
|
-
];
|
|
2564
|
-
function unwrapLSP26Follow(receivedData, _from, profileAddress, _eventName) {
|
|
2565
|
-
if (!receivedData || receivedData.length < 42) {
|
|
2566
|
-
return void 0;
|
|
2567
|
-
}
|
|
2568
|
-
const followerAddress = getAddress(slice4(receivedData, 0, 20));
|
|
2569
|
-
const values = [followerAddress, profileAddress];
|
|
2570
|
-
return {
|
|
2571
|
-
eventName: "URDFollow",
|
|
2572
|
-
...createNamedArgs(values, followParams),
|
|
2573
|
-
...encodeEventLog("URDFollow", followParams, values),
|
|
2574
|
-
standard: "LSP26FollowerSystem"
|
|
2575
|
-
};
|
|
2576
|
-
}
|
|
2577
|
-
__name(unwrapLSP26Follow, "unwrapLSP26Follow");
|
|
2578
|
-
function unwrapLSP26Unfollow(receivedData, _from, profileAddress, _eventName) {
|
|
2579
|
-
if (!receivedData || receivedData.length < 42) {
|
|
2580
|
-
return void 0;
|
|
2581
|
-
}
|
|
2582
|
-
const unfollowerAddress = getAddress(slice4(receivedData, 0, 20));
|
|
2583
|
-
const values = [unfollowerAddress, profileAddress];
|
|
2584
|
-
return {
|
|
2585
|
-
eventName: "URDUnfollow",
|
|
2586
|
-
...createNamedArgs(values, unfollowParams),
|
|
2587
|
-
...encodeEventLog("URDUnfollow", unfollowParams, values),
|
|
2588
|
-
standard: "LSP26FollowerSystem"
|
|
2589
|
-
};
|
|
2590
|
-
}
|
|
2591
|
-
__name(unwrapLSP26Unfollow, "unwrapLSP26Unfollow");
|
|
2592
|
-
function unwrapLSP7Transfer(receivedData, _from, _profileAddress, eventName) {
|
|
2593
|
-
try {
|
|
2594
|
-
const [operator, sender, recipient, amount, data] = decodeAbiParameters3(
|
|
2595
|
-
[
|
|
2596
|
-
{ name: "operator", type: "address" },
|
|
2597
|
-
{ name: "from", type: "address" },
|
|
2598
|
-
{ name: "to", type: "address" },
|
|
2599
|
-
{ name: "amount", type: "uint256" },
|
|
2600
|
-
{ name: "data", type: "bytes" }
|
|
2601
|
-
],
|
|
2602
|
-
receivedData
|
|
2603
|
-
);
|
|
2604
|
-
const values = [operator, sender, recipient, amount, true, data];
|
|
2605
|
-
return {
|
|
2606
|
-
eventName,
|
|
2607
|
-
...createNamedArgs(values, lsp7TransferParams),
|
|
2608
|
-
...encodeEventLog(eventName, lsp7TransferParams, values),
|
|
2609
|
-
standard: "LSP7DigitalAsset"
|
|
2610
|
-
};
|
|
2611
|
-
} catch {
|
|
2612
|
-
return void 0;
|
|
2613
|
-
}
|
|
2614
|
-
}
|
|
2615
|
-
__name(unwrapLSP7Transfer, "unwrapLSP7Transfer");
|
|
2616
|
-
function unwrapLSP8Transfer(receivedData, _from, _profileAddress, eventName) {
|
|
2617
|
-
try {
|
|
2618
|
-
const [operator, sender, recipient, tokenId, data] = decodeAbiParameters3(
|
|
2619
|
-
[
|
|
2620
|
-
{ name: "operator", type: "address" },
|
|
2621
|
-
{ name: "from", type: "address" },
|
|
2622
|
-
{ name: "to", type: "address" },
|
|
2623
|
-
{ name: "tokenId", type: "bytes32" },
|
|
2624
|
-
{ name: "data", type: "bytes" }
|
|
2625
|
-
],
|
|
2626
|
-
receivedData
|
|
2627
|
-
);
|
|
2628
|
-
const values = [operator, sender, recipient, tokenId, true, data];
|
|
2629
|
-
return {
|
|
2630
|
-
eventName,
|
|
2631
|
-
...createNamedArgs(values, lsp8TransferParams),
|
|
2632
|
-
...encodeEventLog(eventName, lsp8TransferParams, values),
|
|
2633
|
-
standard: "LSP8IdentifiableDigitalAsset"
|
|
2634
|
-
};
|
|
2635
|
-
} catch {
|
|
2636
|
-
return void 0;
|
|
2637
|
-
}
|
|
2638
|
-
}
|
|
2639
|
-
__name(unwrapLSP8Transfer, "unwrapLSP8Transfer");
|
|
2640
|
-
var typeIdUnwrappers = {
|
|
2641
|
-
[TYPEID_LSP26_FOLLOW]: { fn: unwrapLSP26Follow, eventName: "Follow" },
|
|
2642
|
-
[TYPEID_LSP26_UNFOLLOW]: { fn: unwrapLSP26Unfollow, eventName: "Unfollow" },
|
|
2643
|
-
[TYPEID_LSP7_TOKENSSENDER]: {
|
|
2644
|
-
fn: unwrapLSP7Transfer,
|
|
2645
|
-
eventName: "URDTokensSent"
|
|
2646
|
-
},
|
|
2647
|
-
[TYPEID_LSP7_TOKENSRECIPIENT]: {
|
|
2648
|
-
fn: unwrapLSP7Transfer,
|
|
2649
|
-
eventName: "URDTokensReceived"
|
|
2650
|
-
},
|
|
2651
|
-
[TYPEID_LSP8_TOKENSSENDER]: {
|
|
2652
|
-
fn: unwrapLSP8Transfer,
|
|
2653
|
-
eventName: "URDTokensSent"
|
|
2654
|
-
},
|
|
2655
|
-
[TYPEID_LSP8_TOKENSRECIPIENT]: {
|
|
2656
|
-
fn: unwrapLSP8Transfer,
|
|
2657
|
-
eventName: "URDTokensReceived"
|
|
2658
|
-
}
|
|
2659
|
-
};
|
|
2660
|
-
function unwrapUniversalReceiver(typeId, receivedData, from, profileAddress) {
|
|
2661
|
-
const entry = typeIdUnwrappers[typeId];
|
|
2662
|
-
if (entry) {
|
|
2663
|
-
const result = entry.fn(receivedData, from, profileAddress, entry.eventName);
|
|
2664
|
-
if (result) {
|
|
2665
|
-
return result;
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
const values = [from, typeId, receivedData];
|
|
2669
|
-
return {
|
|
2670
|
-
eventName: "URDNotification",
|
|
2671
|
-
...createNamedArgs(values, notificationParams),
|
|
2672
|
-
...encodeEventLog("Notification", notificationParams, values)
|
|
2673
|
-
};
|
|
2674
|
-
}
|
|
2675
|
-
__name(unwrapUniversalReceiver, "unwrapUniversalReceiver");
|
|
2676
|
-
|
|
2677
2513
|
// src/decoder/plugins/enhanceLSP0ERC725Account.ts
|
|
2678
2514
|
var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
2679
2515
|
UniversalProfile,
|
|
@@ -2685,33 +2521,7 @@ var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
|
2685
2521
|
{
|
|
2686
2522
|
enhance: enhanceLSP0ERC725Account,
|
|
2687
2523
|
decodeEvent: /* @__PURE__ */ __name(async (log, options) => {
|
|
2688
|
-
|
|
2689
|
-
if (!decoded || decoded.eventName !== "UniversalReceiver") {
|
|
2690
|
-
return decoded;
|
|
2691
|
-
}
|
|
2692
|
-
const typeId = decoded.args.find((a) => a.name === "typeId")?.value;
|
|
2693
|
-
const receivedData = decoded.args.find((a) => a.name === "receivedData")?.value;
|
|
2694
|
-
const from = decoded.args.find((a) => a.name === "from")?.value;
|
|
2695
|
-
const profileAddress = decoded.address;
|
|
2696
|
-
if (!typeId || !receivedData || !from) {
|
|
2697
|
-
return decoded;
|
|
2698
|
-
}
|
|
2699
|
-
const unwrapped = unwrapUniversalReceiver(
|
|
2700
|
-
typeId,
|
|
2701
|
-
receivedData,
|
|
2702
|
-
from,
|
|
2703
|
-
profileAddress
|
|
2704
|
-
);
|
|
2705
|
-
const { wrappers: _w, standard: _s, ...logBase } = decoded;
|
|
2706
|
-
return {
|
|
2707
|
-
...logBase,
|
|
2708
|
-
eventName: unwrapped.eventName,
|
|
2709
|
-
args: unwrapped.args,
|
|
2710
|
-
standard: unwrapped.standard,
|
|
2711
|
-
topics: unwrapped.topics,
|
|
2712
|
-
data: unwrapped.data,
|
|
2713
|
-
wrappers: [logBase]
|
|
2714
|
-
};
|
|
2524
|
+
return decodeEvent(options.chain, UniversalProfile, log);
|
|
2715
2525
|
}, "decodeEvent")
|
|
2716
2526
|
}
|
|
2717
2527
|
);
|
|
@@ -4626,9 +4436,9 @@ var abi2 = [
|
|
|
4626
4436
|
|
|
4627
4437
|
// src/decoder/functionSignature.ts
|
|
4628
4438
|
import {
|
|
4629
|
-
decodeAbiParameters as
|
|
4630
|
-
encodeAbiParameters
|
|
4631
|
-
getAddress
|
|
4439
|
+
decodeAbiParameters as decodeAbiParameters3,
|
|
4440
|
+
encodeAbiParameters,
|
|
4441
|
+
getAddress,
|
|
4632
4442
|
isAddress as isAddress2,
|
|
4633
4443
|
isAddressEqual as isAddressEqual2,
|
|
4634
4444
|
parseAbiParameters,
|
|
@@ -4783,7 +4593,7 @@ async function fetchAbi(chain, address, options) {
|
|
|
4783
4593
|
const explorer = chain.blockExplorers?.default?.apiUrl;
|
|
4784
4594
|
if (!explorer) return void 0;
|
|
4785
4595
|
const cache = options?.cache ?? defaultCache;
|
|
4786
|
-
let key =
|
|
4596
|
+
let key = getAddress(address);
|
|
4787
4597
|
const cacheKey = makeCacheKey("abi" /* ABI */, key, String(chain.id));
|
|
4788
4598
|
return cache.getOrSet(
|
|
4789
4599
|
cacheKey,
|
|
@@ -4925,7 +4735,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
4925
4735
|
const params = generateNamedAbiParameters(
|
|
4926
4736
|
result.text_signature || result.name
|
|
4927
4737
|
);
|
|
4928
|
-
const args =
|
|
4738
|
+
const args = decodeAbiParameters3(params, `0x${data.slice(8)}`);
|
|
4929
4739
|
const encodeArgs = Array.from({ length: params.length }).map(
|
|
4930
4740
|
(_val, index) => {
|
|
4931
4741
|
if (params[index].type === "bool") {
|
|
@@ -4943,7 +4753,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
4943
4753
|
return args[`${index}`] ?? "0x";
|
|
4944
4754
|
}
|
|
4945
4755
|
);
|
|
4946
|
-
const newData =
|
|
4756
|
+
const newData = encodeAbiParameters(
|
|
4947
4757
|
params,
|
|
4948
4758
|
encodeArgs
|
|
4949
4759
|
).slice(2);
|
|
@@ -5105,4 +4915,4 @@ export {
|
|
|
5105
4915
|
decodeKeyValue,
|
|
5106
4916
|
decodeKeyValueRaw
|
|
5107
4917
|
};
|
|
5108
|
-
//# sourceMappingURL=chunk-
|
|
4918
|
+
//# sourceMappingURL=chunk-T4H2HHIB.js.map
|