Closed cc32d9 closed 1 year ago
here's the code I'm trying to work with:
import eosio from '@greymass/eosio';
import shipABIJSON from '../state_history_plugin_abi.json';
export class ChronosClient {
shipABI: eosio.ABI.Def;
constructor(options: cassandra.ClientOptions) {
this.shipABI = shipABIJSON;
}
}
after adding "actions": [], "ricardian_clauses": []
it now complains that Struct is missing the "base" field.
did a dirty hack, but it will be great to have a better solution:
this.shipABI = {
version: '',
types: [],
variants: [],
structs: [],
actions: [],
tables: [],
ricardian_clauses: [],
};
['version', 'types', 'structs', 'tables', 'variants'].forEach((element) => {
this.shipABI[element] = shipABIJSON[element];
});
ended up in this hack, but it needs to be more beautiful https://github.com/EOSChronicleProject/chronos-client-npm/blob/b42154ebbd01a074bc8c87e66cd6ef129841f5db/src/chronos-client.ts
Glad you got it working! (Another solution could be to use the ABIDef
type that allows partial fields in the ABI, or just keeping a reference to a eosio-core ABI object created by ABI.from(abiJson)
) In the future though please use the forums or telegram for support, we want to try to keep the noise at a minimum in our bug tracker. Thanks!
I've got a copy of this JSON locally: https://github.com/AntelopeIO/leap/blob/main/libraries/state_history/abi.cpp
I want to create an ABI object in order to deserialize the state history data, but this JSON doesn't have actions and ricardian clauses: