@lukso/transaction-decoder 1.3.6 → 1.3.7-dev.2df3eae
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 +214 -24
- 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-NDBDNXBI.js → chunk-C3O7HMFS.js} +2 -2
- package/dist/{chunk-FKBKAWB3.js → chunk-JP3VO7OF.js} +2 -2
- package/dist/{chunk-SSY7TTU2.js → chunk-LZFM5SNN.js} +4 -4
- package/dist/{chunk-T4H2HHIB.js → chunk-XE5YIF5G.js} +209 -19
- package/dist/chunk-XE5YIF5G.js.map +1 -0
- package/dist/data.cjs +208 -18
- 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-BzXh7poJ.d.ts → index-BWD9DaG6.d.cts} +6 -1
- package/dist/{index-BzXh7poJ.d.cts → index-BWD9DaG6.d.ts} +6 -1
- package/dist/index.cjs +214 -24
- 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 +1499 -1258
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +17 -2
- package/dist/server.d.ts +17 -2
- package/dist/server.js +56 -2
- package/dist/server.js.map +1 -1
- package/dist/{utils-De_c6fUK.d.ts → utils-4Qdavg8r.d.ts} +2 -2
- package/dist/{utils-BEpSreRR.d.cts → utils-OR-XzeYG.d.cts} +2 -2
- package/package.json +8 -8
- package/src/decoder/lsp7Mint.test.ts +18 -11
- package/src/decoder/plugins/enhanceLSP0ERC725Account.ts +39 -2
- package/src/decoder/plugins/universalReceiverTypeIds.ts +277 -0
- package/src/decoder/types.ts +2 -0
- package/src/server/decodeEventLogs.ts +71 -0
- package/src/server/index.ts +10 -0
- package/src/server/types.ts +14 -1
- package/src/server.ts +1 -0
- package/src/types/index.ts +5 -1
- package/dist/chunk-T4H2HHIB.js.map +0 -1
- /package/dist/{chunk-NDBDNXBI.js.map → chunk-C3O7HMFS.js.map} +0 -0
- /package/dist/{chunk-FKBKAWB3.js.map → chunk-JP3VO7OF.js.map} +0 -0
- /package/dist/{chunk-SSY7TTU2.js.map → chunk-LZFM5SNN.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
decodeTransaction,
|
|
5
5
|
isAsyncOperationEnabled,
|
|
6
6
|
pluginRegistry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XE5YIF5G.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-C3O7HMFS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__name
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XE5YIF5G.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-JP3VO7OF.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
consumerModel,
|
|
3
3
|
decodeTransaction
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C3O7HMFS.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchMultipleAddresses
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JP3VO7OF.js";
|
|
8
8
|
import {
|
|
9
9
|
__name,
|
|
10
10
|
collectDataKeys,
|
|
11
11
|
defaultPlugins,
|
|
12
12
|
defaultSchemaPlugins
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XE5YIF5G.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-LZFM5SNN.js.map
|
|
@@ -406,7 +406,7 @@ function createNamedPlugin(name, plugin) {
|
|
|
406
406
|
}
|
|
407
407
|
__name(createNamedPlugin, "createNamedPlugin");
|
|
408
408
|
|
|
409
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
409
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP1UniversalReceiverDelegate.json
|
|
410
410
|
var LSP1UniversalReceiverDelegate_default = [
|
|
411
411
|
{
|
|
412
412
|
name: "LSP1UniversalReceiverDelegate",
|
|
@@ -424,7 +424,7 @@ var LSP1UniversalReceiverDelegate_default = [
|
|
|
424
424
|
}
|
|
425
425
|
];
|
|
426
426
|
|
|
427
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
427
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP3ProfileMetadata.json
|
|
428
428
|
var LSP3ProfileMetadata_default = [
|
|
429
429
|
{
|
|
430
430
|
name: "SupportedStandards:LSP3Profile",
|
|
@@ -491,7 +491,7 @@ var LSP3ProfileMetadata_default = [
|
|
|
491
491
|
}
|
|
492
492
|
];
|
|
493
493
|
|
|
494
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
494
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP4DigitalAsset.json
|
|
495
495
|
var LSP4DigitalAsset_default = [
|
|
496
496
|
{
|
|
497
497
|
name: "SupportedStandards:LSP4DigitalAsset",
|
|
@@ -544,7 +544,7 @@ var LSP4DigitalAsset_default = [
|
|
|
544
544
|
}
|
|
545
545
|
];
|
|
546
546
|
|
|
547
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
547
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP4DigitalAssetLegacy.json
|
|
548
548
|
var LSP4DigitalAssetLegacy_default = [
|
|
549
549
|
{
|
|
550
550
|
name: "SupportedStandards:LSP4DigitalCertificate",
|
|
@@ -555,7 +555,7 @@ var LSP4DigitalAssetLegacy_default = [
|
|
|
555
555
|
}
|
|
556
556
|
];
|
|
557
557
|
|
|
558
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
558
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP5ReceivedAssets.json
|
|
559
559
|
var LSP5ReceivedAssets_default = [
|
|
560
560
|
{
|
|
561
561
|
name: "LSP5ReceivedAssets[]",
|
|
@@ -573,7 +573,7 @@ var LSP5ReceivedAssets_default = [
|
|
|
573
573
|
}
|
|
574
574
|
];
|
|
575
575
|
|
|
576
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
576
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP6KeyManager.json
|
|
577
577
|
var LSP6KeyManager_default = [
|
|
578
578
|
{
|
|
579
579
|
name: "AddressPermissions[]",
|
|
@@ -605,7 +605,7 @@ var LSP6KeyManager_default = [
|
|
|
605
605
|
}
|
|
606
606
|
];
|
|
607
607
|
|
|
608
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
608
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP8IdentifiableDigitalAsset.json
|
|
609
609
|
var LSP8IdentifiableDigitalAsset_default = [
|
|
610
610
|
{
|
|
611
611
|
name: "LSP8TokenIdFormat",
|
|
@@ -630,7 +630,7 @@ var LSP8IdentifiableDigitalAsset_default = [
|
|
|
630
630
|
}
|
|
631
631
|
];
|
|
632
632
|
|
|
633
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
633
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP9Vault.json
|
|
634
634
|
var LSP9Vault_default = [
|
|
635
635
|
{
|
|
636
636
|
name: "SupportedStandards:LSP9Vault",
|
|
@@ -662,7 +662,7 @@ var LSP9Vault_default = [
|
|
|
662
662
|
}
|
|
663
663
|
];
|
|
664
664
|
|
|
665
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
665
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP10ReceivedVaults.json
|
|
666
666
|
var LSP10ReceivedVaults_default = [
|
|
667
667
|
{
|
|
668
668
|
name: "LSP10VaultsMap:<address>",
|
|
@@ -680,7 +680,7 @@ var LSP10ReceivedVaults_default = [
|
|
|
680
680
|
}
|
|
681
681
|
];
|
|
682
682
|
|
|
683
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
683
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP12IssuedAssets.json
|
|
684
684
|
var LSP12IssuedAssets_default = [
|
|
685
685
|
{
|
|
686
686
|
name: "LSP12IssuedAssets[]",
|
|
@@ -698,7 +698,7 @@ var LSP12IssuedAssets_default = [
|
|
|
698
698
|
}
|
|
699
699
|
];
|
|
700
700
|
|
|
701
|
-
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.
|
|
701
|
+
// ../../node_modules/.pnpm/@erc725+erc725.js@0.28.2_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/@erc725/erc725.js/schemas/LSP17ContractExtension.json
|
|
702
702
|
var LSP17ContractExtension_default = [
|
|
703
703
|
{
|
|
704
704
|
name: "LSP17Extension:<bytes4>",
|
|
@@ -2510,6 +2510,170 @@ 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
|
+
|
|
2513
2677
|
// src/decoder/plugins/enhanceLSP0ERC725Account.ts
|
|
2514
2678
|
var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
2515
2679
|
UniversalProfile,
|
|
@@ -2521,7 +2685,33 @@ var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
|
2521
2685
|
{
|
|
2522
2686
|
enhance: enhanceLSP0ERC725Account,
|
|
2523
2687
|
decodeEvent: /* @__PURE__ */ __name(async (log, options) => {
|
|
2524
|
-
|
|
2688
|
+
const decoded = decodeEvent(options.chain, UniversalProfile, log);
|
|
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
|
+
};
|
|
2525
2715
|
}, "decodeEvent")
|
|
2526
2716
|
}
|
|
2527
2717
|
);
|
|
@@ -4436,9 +4626,9 @@ var abi2 = [
|
|
|
4436
4626
|
|
|
4437
4627
|
// src/decoder/functionSignature.ts
|
|
4438
4628
|
import {
|
|
4439
|
-
decodeAbiParameters as
|
|
4440
|
-
encodeAbiParameters,
|
|
4441
|
-
getAddress,
|
|
4629
|
+
decodeAbiParameters as decodeAbiParameters4,
|
|
4630
|
+
encodeAbiParameters as encodeAbiParameters2,
|
|
4631
|
+
getAddress as getAddress2,
|
|
4442
4632
|
isAddress as isAddress2,
|
|
4443
4633
|
isAddressEqual as isAddressEqual2,
|
|
4444
4634
|
parseAbiParameters,
|
|
@@ -4593,7 +4783,7 @@ async function fetchAbi(chain, address, options) {
|
|
|
4593
4783
|
const explorer = chain.blockExplorers?.default?.apiUrl;
|
|
4594
4784
|
if (!explorer) return void 0;
|
|
4595
4785
|
const cache = options?.cache ?? defaultCache;
|
|
4596
|
-
let key =
|
|
4786
|
+
let key = getAddress2(address);
|
|
4597
4787
|
const cacheKey = makeCacheKey("abi" /* ABI */, key, String(chain.id));
|
|
4598
4788
|
return cache.getOrSet(
|
|
4599
4789
|
cacheKey,
|
|
@@ -4735,7 +4925,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
4735
4925
|
const params = generateNamedAbiParameters(
|
|
4736
4926
|
result.text_signature || result.name
|
|
4737
4927
|
);
|
|
4738
|
-
const args =
|
|
4928
|
+
const args = decodeAbiParameters4(params, `0x${data.slice(8)}`);
|
|
4739
4929
|
const encodeArgs = Array.from({ length: params.length }).map(
|
|
4740
4930
|
(_val, index) => {
|
|
4741
4931
|
if (params[index].type === "bool") {
|
|
@@ -4753,7 +4943,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
4753
4943
|
return args[`${index}`] ?? "0x";
|
|
4754
4944
|
}
|
|
4755
4945
|
);
|
|
4756
|
-
const newData =
|
|
4946
|
+
const newData = encodeAbiParameters2(
|
|
4757
4947
|
params,
|
|
4758
4948
|
encodeArgs
|
|
4759
4949
|
).slice(2);
|
|
@@ -4915,4 +5105,4 @@ export {
|
|
|
4915
5105
|
decodeKeyValue,
|
|
4916
5106
|
decodeKeyValueRaw
|
|
4917
5107
|
};
|
|
4918
|
-
//# sourceMappingURL=chunk-
|
|
5108
|
+
//# sourceMappingURL=chunk-XE5YIF5G.js.map
|