How to use the eosjs.Serialize.getTypesFromAbi function in eosjs

To help you get started, we’ve selected a few eosjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eosdac / eosdac-api / connection.js View on Github external
onMessage(data) {
        try {
            if (!this.abi) {
                this.abi = JSON.parse(data);
                this.types = Serialize.getTypesFromAbi(Serialize.createInitialTypes(), this.abi);
                for (const table of this.abi.tables)
                    this.tables.set(table.name, table.type);
                if (this.receivedAbi)
                    this.receivedAbi();
            } else {
                const [type, response] = this.deserialize('result', data);
                this[type](response);
            }
        } catch (e) {
            console.log(e);
            process.exit(1);
        }
    }
github EOSIO / eosio-reference-chrome-extension-authenticator-app / src / utils / manifest / AssertActionCreator.ts View on Github external
constructor() {
    const rpc = new JsonRpc(null)
    const signatureProvider = new JsSignatureProvider([])
    this.api = new EosApi({
      rpc,
      signatureProvider,
      chainId: null,
    })

    this.api.transactionTypes = Serialize.getTypesFromAbi(Serialize.createInitialTypes(), assertAbi)
  }