🖱️Data Processing-action Serialization
action serialization
const client = await getClient();
const contract = await client.contract("testmulsign1");
const data = {
issuer: "testmulsign1",
wallet_id: "0",
mulsigner: "solo11111111",
weight: 1,
};
// 102673386a99b1ca000000000000000010420821844023c501000000
const hex = contract.fc
.toBuffer(
"setmulsigner", // Contract method
data,
)
.toString("hex");
action deserialization
const client = await getClient();
const contract = await client.contract("testmulsign1");
// {issuer: "testmulsign1", wallet_id: "0", mulsigner: "solo11111111", weight: 1}
const data = contract.fc.fromBuffer(
"setmulsigner", // Contract method
Buffer.from(
// Serialized string corresponding to method
"102673386a99b1ca000000000000000010420821844023c501000000",
"hex",
),
);
Firstly, you need to know which contract, and then which action (i.e. the contract method being called). In this way, the corresponding parameters can be specified, and then deserialized based on the serialized HEX (102673386a99b1ca4000000000010420821844023c501000000).
Last updated