This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 462
Deserialize Table_rows #716
Labels
Comments
function deserializeTypeData(contract: Contract, account: string, structName: string, data: string | Uint8Array, textEncoder: TextEncoder, textDecoder: TextDecoder): any {
const type = contract.types.get(structName);
if (typeof data === "string") {
data = hexToUint8Array(data);
}
if(!type) {
throw new Error(`Unknown type ${structName} in contract ${account}`);
}
const buffer = new SerialBuffer({textDecoder, textEncoder});
buffer.pushArray(data);
return type.deserialize(buffer);
} This works but you should know the struct name from contract code |
This was referenced Apr 13, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a way to deserialize the table_rows returned data that are serialized since they are not actions? (preferably through eosjs)
here below is the screenshot of what I was trying to accomplish:
The text was updated successfully, but these errors were encountered: