@lukso/transaction-decoder 1.3.6-dev.6843bdd → 1.3.6-dev.84ae4e5
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 +70 -70
- 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
package/dist/browser.cjs
CHANGED
|
@@ -3972,170 +3972,6 @@ async function enhanceSetData(result, pluginOptions, options) {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
__name(enhanceSetData, "enhanceSetData");
|
|
3974
3974
|
|
|
3975
|
-
// src/decoder/plugins/universalReceiverTypeIds.ts
|
|
3976
|
-
import {
|
|
3977
|
-
decodeAbiParameters as decodeAbiParameters3,
|
|
3978
|
-
encodeAbiParameters,
|
|
3979
|
-
getAddress,
|
|
3980
|
-
keccak256,
|
|
3981
|
-
slice as slice4,
|
|
3982
|
-
toHex
|
|
3983
|
-
} from "viem";
|
|
3984
|
-
function encodeEventLog(eventName, params, values) {
|
|
3985
|
-
const sig = `${eventName}(${params.map((p) => p.type).join(",")})`;
|
|
3986
|
-
const topic0 = keccak256(toHex(sig));
|
|
3987
|
-
const data = encodeAbiParameters(params, values);
|
|
3988
|
-
return { topics: [topic0], data };
|
|
3989
|
-
}
|
|
3990
|
-
__name(encodeEventLog, "encodeEventLog");
|
|
3991
|
-
var TYPEID_LSP26_FOLLOW = "0x71e02f9f05bcd5816ec4f3134aa2e5a916669537ec6c77fe66ea595fabc2d51a";
|
|
3992
|
-
var TYPEID_LSP26_UNFOLLOW = "0x9d3c0b4012b69658977b099bdaa51eff0f0460f421fba96d15669506c00d1c4f";
|
|
3993
|
-
var TYPEID_LSP7_TOKENSSENDER = "0x429ac7a06903dbc9c13dfcb3c9d11df8194581fa047c96d7a4171fc7402958ea";
|
|
3994
|
-
var TYPEID_LSP7_TOKENSRECIPIENT = "0x20804611b3e2ea21c480dc465142210acf4a2485947541770ec1fb87dee4a55c";
|
|
3995
|
-
var TYPEID_LSP8_TOKENSSENDER = "0xb23eae7e6d1564b295b4c3e3be402d9a2f0776c57bdf365903496f6fa481ab00";
|
|
3996
|
-
var TYPEID_LSP8_TOKENSRECIPIENT = "0x0b084a55ebf70fd3c06fd755269dac2212c4d3f0f4d09079780bfa50c1b2984d";
|
|
3997
|
-
var followParams = [
|
|
3998
|
-
{ name: "follower", type: "address" },
|
|
3999
|
-
{ name: "addr", type: "address" }
|
|
4000
|
-
];
|
|
4001
|
-
var unfollowParams = [
|
|
4002
|
-
{ name: "unfollower", type: "address" },
|
|
4003
|
-
{ name: "addr", type: "address" }
|
|
4004
|
-
];
|
|
4005
|
-
var lsp7TransferParams = [
|
|
4006
|
-
{ name: "operator", type: "address" },
|
|
4007
|
-
{ name: "from", type: "address" },
|
|
4008
|
-
{ name: "to", type: "address" },
|
|
4009
|
-
{ name: "amount", type: "uint256" },
|
|
4010
|
-
{ name: "force", type: "bool" },
|
|
4011
|
-
{ name: "data", type: "bytes" }
|
|
4012
|
-
];
|
|
4013
|
-
var lsp8TransferParams = [
|
|
4014
|
-
{ name: "operator", type: "address" },
|
|
4015
|
-
{ name: "from", type: "address" },
|
|
4016
|
-
{ name: "to", type: "address" },
|
|
4017
|
-
{ name: "tokenId", type: "bytes32" },
|
|
4018
|
-
{ name: "force", type: "bool" },
|
|
4019
|
-
{ name: "data", type: "bytes" }
|
|
4020
|
-
];
|
|
4021
|
-
var notificationParams = [
|
|
4022
|
-
{ name: "from", type: "address" },
|
|
4023
|
-
{ name: "typeId", type: "bytes32" },
|
|
4024
|
-
{ name: "data", type: "bytes" }
|
|
4025
|
-
];
|
|
4026
|
-
function unwrapLSP26Follow(receivedData, _from, profileAddress, _eventName) {
|
|
4027
|
-
if (!receivedData || receivedData.length < 42) {
|
|
4028
|
-
return void 0;
|
|
4029
|
-
}
|
|
4030
|
-
const followerAddress = getAddress(slice4(receivedData, 0, 20));
|
|
4031
|
-
const values = [followerAddress, profileAddress];
|
|
4032
|
-
return {
|
|
4033
|
-
eventName: "URDFollow",
|
|
4034
|
-
...createNamedArgs(values, followParams),
|
|
4035
|
-
...encodeEventLog("URDFollow", followParams, values),
|
|
4036
|
-
standard: "LSP26FollowerSystem"
|
|
4037
|
-
};
|
|
4038
|
-
}
|
|
4039
|
-
__name(unwrapLSP26Follow, "unwrapLSP26Follow");
|
|
4040
|
-
function unwrapLSP26Unfollow(receivedData, _from, profileAddress, _eventName) {
|
|
4041
|
-
if (!receivedData || receivedData.length < 42) {
|
|
4042
|
-
return void 0;
|
|
4043
|
-
}
|
|
4044
|
-
const unfollowerAddress = getAddress(slice4(receivedData, 0, 20));
|
|
4045
|
-
const values = [unfollowerAddress, profileAddress];
|
|
4046
|
-
return {
|
|
4047
|
-
eventName: "URDUnfollow",
|
|
4048
|
-
...createNamedArgs(values, unfollowParams),
|
|
4049
|
-
...encodeEventLog("URDUnfollow", unfollowParams, values),
|
|
4050
|
-
standard: "LSP26FollowerSystem"
|
|
4051
|
-
};
|
|
4052
|
-
}
|
|
4053
|
-
__name(unwrapLSP26Unfollow, "unwrapLSP26Unfollow");
|
|
4054
|
-
function unwrapLSP7Transfer(receivedData, _from, _profileAddress, eventName) {
|
|
4055
|
-
try {
|
|
4056
|
-
const [operator, sender, recipient, amount, data] = decodeAbiParameters3(
|
|
4057
|
-
[
|
|
4058
|
-
{ name: "operator", type: "address" },
|
|
4059
|
-
{ name: "from", type: "address" },
|
|
4060
|
-
{ name: "to", type: "address" },
|
|
4061
|
-
{ name: "amount", type: "uint256" },
|
|
4062
|
-
{ name: "data", type: "bytes" }
|
|
4063
|
-
],
|
|
4064
|
-
receivedData
|
|
4065
|
-
);
|
|
4066
|
-
const values = [operator, sender, recipient, amount, true, data];
|
|
4067
|
-
return {
|
|
4068
|
-
eventName,
|
|
4069
|
-
...createNamedArgs(values, lsp7TransferParams),
|
|
4070
|
-
...encodeEventLog(eventName, lsp7TransferParams, values),
|
|
4071
|
-
standard: "LSP7DigitalAsset"
|
|
4072
|
-
};
|
|
4073
|
-
} catch {
|
|
4074
|
-
return void 0;
|
|
4075
|
-
}
|
|
4076
|
-
}
|
|
4077
|
-
__name(unwrapLSP7Transfer, "unwrapLSP7Transfer");
|
|
4078
|
-
function unwrapLSP8Transfer(receivedData, _from, _profileAddress, eventName) {
|
|
4079
|
-
try {
|
|
4080
|
-
const [operator, sender, recipient, tokenId, data] = decodeAbiParameters3(
|
|
4081
|
-
[
|
|
4082
|
-
{ name: "operator", type: "address" },
|
|
4083
|
-
{ name: "from", type: "address" },
|
|
4084
|
-
{ name: "to", type: "address" },
|
|
4085
|
-
{ name: "tokenId", type: "bytes32" },
|
|
4086
|
-
{ name: "data", type: "bytes" }
|
|
4087
|
-
],
|
|
4088
|
-
receivedData
|
|
4089
|
-
);
|
|
4090
|
-
const values = [operator, sender, recipient, tokenId, true, data];
|
|
4091
|
-
return {
|
|
4092
|
-
eventName,
|
|
4093
|
-
...createNamedArgs(values, lsp8TransferParams),
|
|
4094
|
-
...encodeEventLog(eventName, lsp8TransferParams, values),
|
|
4095
|
-
standard: "LSP8IdentifiableDigitalAsset"
|
|
4096
|
-
};
|
|
4097
|
-
} catch {
|
|
4098
|
-
return void 0;
|
|
4099
|
-
}
|
|
4100
|
-
}
|
|
4101
|
-
__name(unwrapLSP8Transfer, "unwrapLSP8Transfer");
|
|
4102
|
-
var typeIdUnwrappers = {
|
|
4103
|
-
[TYPEID_LSP26_FOLLOW]: { fn: unwrapLSP26Follow, eventName: "Follow" },
|
|
4104
|
-
[TYPEID_LSP26_UNFOLLOW]: { fn: unwrapLSP26Unfollow, eventName: "Unfollow" },
|
|
4105
|
-
[TYPEID_LSP7_TOKENSSENDER]: {
|
|
4106
|
-
fn: unwrapLSP7Transfer,
|
|
4107
|
-
eventName: "URDTokensSent"
|
|
4108
|
-
},
|
|
4109
|
-
[TYPEID_LSP7_TOKENSRECIPIENT]: {
|
|
4110
|
-
fn: unwrapLSP7Transfer,
|
|
4111
|
-
eventName: "URDTokensReceived"
|
|
4112
|
-
},
|
|
4113
|
-
[TYPEID_LSP8_TOKENSSENDER]: {
|
|
4114
|
-
fn: unwrapLSP8Transfer,
|
|
4115
|
-
eventName: "URDTokensSent"
|
|
4116
|
-
},
|
|
4117
|
-
[TYPEID_LSP8_TOKENSRECIPIENT]: {
|
|
4118
|
-
fn: unwrapLSP8Transfer,
|
|
4119
|
-
eventName: "URDTokensReceived"
|
|
4120
|
-
}
|
|
4121
|
-
};
|
|
4122
|
-
function unwrapUniversalReceiver(typeId, receivedData, from, profileAddress) {
|
|
4123
|
-
const entry = typeIdUnwrappers[typeId];
|
|
4124
|
-
if (entry) {
|
|
4125
|
-
const result = entry.fn(receivedData, from, profileAddress, entry.eventName);
|
|
4126
|
-
if (result) {
|
|
4127
|
-
return result;
|
|
4128
|
-
}
|
|
4129
|
-
}
|
|
4130
|
-
const values = [from, typeId, receivedData];
|
|
4131
|
-
return {
|
|
4132
|
-
eventName: "URDNotification",
|
|
4133
|
-
...createNamedArgs(values, notificationParams),
|
|
4134
|
-
...encodeEventLog("Notification", notificationParams, values)
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
__name(unwrapUniversalReceiver, "unwrapUniversalReceiver");
|
|
4138
|
-
|
|
4139
3975
|
// src/decoder/plugins/enhanceLSP0ERC725Account.ts
|
|
4140
3976
|
var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
4141
3977
|
UniversalProfile,
|
|
@@ -4147,33 +3983,7 @@ var enhanceLSP0ERC725AccountPlugin = standardPlugin(
|
|
|
4147
3983
|
{
|
|
4148
3984
|
enhance: enhanceLSP0ERC725Account,
|
|
4149
3985
|
decodeEvent: /* @__PURE__ */ __name(async (log, options) => {
|
|
4150
|
-
|
|
4151
|
-
if (!decoded || decoded.eventName !== "UniversalReceiver") {
|
|
4152
|
-
return decoded;
|
|
4153
|
-
}
|
|
4154
|
-
const typeId = decoded.args.find((a) => a.name === "typeId")?.value;
|
|
4155
|
-
const receivedData = decoded.args.find((a) => a.name === "receivedData")?.value;
|
|
4156
|
-
const from = decoded.args.find((a) => a.name === "from")?.value;
|
|
4157
|
-
const profileAddress = decoded.address;
|
|
4158
|
-
if (!typeId || !receivedData || !from) {
|
|
4159
|
-
return decoded;
|
|
4160
|
-
}
|
|
4161
|
-
const unwrapped = unwrapUniversalReceiver(
|
|
4162
|
-
typeId,
|
|
4163
|
-
receivedData,
|
|
4164
|
-
from,
|
|
4165
|
-
profileAddress
|
|
4166
|
-
);
|
|
4167
|
-
const { wrappers: _w, standard: _s, ...logBase } = decoded;
|
|
4168
|
-
return {
|
|
4169
|
-
...logBase,
|
|
4170
|
-
eventName: unwrapped.eventName,
|
|
4171
|
-
args: unwrapped.args,
|
|
4172
|
-
standard: unwrapped.standard,
|
|
4173
|
-
topics: unwrapped.topics,
|
|
4174
|
-
data: unwrapped.data,
|
|
4175
|
-
wrappers: [logBase]
|
|
4176
|
-
};
|
|
3986
|
+
return decodeEvent(options.chain, UniversalProfile, log);
|
|
4177
3987
|
}, "decodeEvent")
|
|
4178
3988
|
}
|
|
4179
3989
|
);
|
|
@@ -6088,9 +5898,9 @@ var abi2 = [
|
|
|
6088
5898
|
|
|
6089
5899
|
// src/decoder/functionSignature.ts
|
|
6090
5900
|
import {
|
|
6091
|
-
decodeAbiParameters as
|
|
6092
|
-
encodeAbiParameters
|
|
6093
|
-
getAddress
|
|
5901
|
+
decodeAbiParameters as decodeAbiParameters3,
|
|
5902
|
+
encodeAbiParameters,
|
|
5903
|
+
getAddress,
|
|
6094
5904
|
isAddress as isAddress2,
|
|
6095
5905
|
isAddressEqual as isAddressEqual2,
|
|
6096
5906
|
parseAbiParameters,
|
|
@@ -6245,7 +6055,7 @@ async function fetchAbi(chain, address, options) {
|
|
|
6245
6055
|
const explorer = chain.blockExplorers?.default?.apiUrl;
|
|
6246
6056
|
if (!explorer) return void 0;
|
|
6247
6057
|
const cache = options?.cache ?? defaultCache;
|
|
6248
|
-
let key =
|
|
6058
|
+
let key = getAddress(address);
|
|
6249
6059
|
const cacheKey = makeCacheKey("abi" /* ABI */, key, String(chain.id));
|
|
6250
6060
|
return cache.getOrSet(
|
|
6251
6061
|
cacheKey,
|
|
@@ -6387,7 +6197,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
6387
6197
|
const params = generateNamedAbiParameters(
|
|
6388
6198
|
result.text_signature || result.name
|
|
6389
6199
|
);
|
|
6390
|
-
const args =
|
|
6200
|
+
const args = decodeAbiParameters3(params, `0x${data.slice(8)}`);
|
|
6391
6201
|
const encodeArgs = Array.from({ length: params.length }).map(
|
|
6392
6202
|
(_val, index) => {
|
|
6393
6203
|
if (params[index].type === "bool") {
|
|
@@ -6405,7 +6215,7 @@ var getFunctionSignature = /* @__PURE__ */ __name(async (chain, input, to, prefe
|
|
|
6405
6215
|
return args[`${index}`] ?? "0x";
|
|
6406
6216
|
}
|
|
6407
6217
|
);
|
|
6408
|
-
const newData =
|
|
6218
|
+
const newData = encodeAbiParameters(
|
|
6409
6219
|
params,
|
|
6410
6220
|
encodeArgs
|
|
6411
6221
|
).slice(2);
|
|
@@ -6747,7 +6557,7 @@ __name(createMemoryAddressCache, "createMemoryAddressCache");
|
|
|
6747
6557
|
// src/server/lsp23Resolver.ts
|
|
6748
6558
|
import {
|
|
6749
6559
|
bytesToHex,
|
|
6750
|
-
decodeAbiParameters as
|
|
6560
|
+
decodeAbiParameters as decodeAbiParameters4,
|
|
6751
6561
|
isHex as isHex4,
|
|
6752
6562
|
parseAbiParameters as parseAbiParameters2
|
|
6753
6563
|
} from "viem";
|
|
@@ -6756,7 +6566,7 @@ var DEPLOY_ERC1167_PROXIES_SELECTOR = "0x6a66a753";
|
|
|
6756
6566
|
function decodeDeploymentCalldata(input) {
|
|
6757
6567
|
try {
|
|
6758
6568
|
const params = `0x${input.slice(10)}`;
|
|
6759
|
-
const decoded =
|
|
6569
|
+
const decoded = decodeAbiParameters4(
|
|
6760
6570
|
parseAbiParameters2(
|
|
6761
6571
|
"(bytes32,uint256,address,bytes), (uint256,address,bytes,bool,bytes), address, bytes"
|
|
6762
6572
|
),
|
|
@@ -6788,7 +6598,7 @@ function decodeDeploymentCalldata(input) {
|
|
|
6788
6598
|
__name(decodeDeploymentCalldata, "decodeDeploymentCalldata");
|
|
6789
6599
|
function decodeDeploymentOutput(output) {
|
|
6790
6600
|
try {
|
|
6791
|
-
const decoded =
|
|
6601
|
+
const decoded = decodeAbiParameters4(
|
|
6792
6602
|
parseAbiParameters2("address, address"),
|
|
6793
6603
|
output
|
|
6794
6604
|
);
|
|
@@ -6807,7 +6617,7 @@ function extractControllersFromInitCalldata(initializationCalldata) {
|
|
|
6807
6617
|
if (!initializationCalldata || initializationCalldata === "0x") {
|
|
6808
6618
|
return [];
|
|
6809
6619
|
}
|
|
6810
|
-
const decoded =
|
|
6620
|
+
const decoded = decodeAbiParameters4(
|
|
6811
6621
|
parseAbiParameters2("bytes32[], bytes[]"),
|
|
6812
6622
|
initializationCalldata
|
|
6813
6623
|
);
|
|
@@ -7023,7 +6833,7 @@ var getTransactionCount = consumerModel.getTransactionCount.bind(consumerModel);
|
|
|
7023
6833
|
var getDecodedCount = consumerModel.getDecodedCount.bind(consumerModel);
|
|
7024
6834
|
var getDecodedTransactions = consumerModel.getDecodedTransactions.bind(consumerModel);
|
|
7025
6835
|
var getTransactionsInOrder = consumerModel.getTransactionsInOrder.bind(consumerModel);
|
|
7026
|
-
var
|
|
6836
|
+
var getAddress2 = consumerModel.getAddress.bind(consumerModel);
|
|
7027
6837
|
var getSignal = consumerModel.getSignal.bind(consumerModel);
|
|
7028
6838
|
var subscribe = consumerModel.subscribe.bind(consumerModel);
|
|
7029
6839
|
var getState = consumerModel.getState.bind(consumerModel);
|
|
@@ -7062,7 +6872,7 @@ export {
|
|
|
7062
6872
|
extractControllersFromInitCalldata,
|
|
7063
6873
|
fetchMultipleAddresses,
|
|
7064
6874
|
fetchProfilesByControllers,
|
|
7065
|
-
|
|
6875
|
+
getAddress2 as getAddress,
|
|
7066
6876
|
getAllData,
|
|
7067
6877
|
getAllKeys,
|
|
7068
6878
|
getAllTransactions,
|