How to use the @zilliqa-js/core.RPCMethod.GetSmartContractInit function in @zilliqa-js/core

To help you get started, we’ve selected a few @zilliqa-js/core 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 Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa-js-contract / src / contract.ts View on Github external
async getInit(): Promise {
    if (this.status !== ContractStatus.Deployed) {
      return Promise.resolve([]);
    }

    if (!this.address) {
      throw new Error('Cannot get state of uninitialised contract');
    }

    const response = await this.provider.send(
      RPCMethod.GetSmartContractInit,
      this.address.replace('0x', '').toLowerCase(),
    );

    return response.result;
  }
}
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa-js-blockchain / src / chain.ts View on Github external
getSmartContractInit(addr: string): Promise> {
    const address = validation.isBech32(addr) ? fromBech32Address(addr) : addr;
    return this.provider.send(
      RPCMethod.GetSmartContractInit,
      address.replace('0x', '').toLowerCase(),
    );
  }