How to use the @zilliqa-js/crypto.normaliseAddress function in @zilliqa-js/crypto

To help you get started, we’ve selected a few @zilliqa-js/crypto 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
constructor(
    factory: Contracts,
    code?: string,
    abi?: ABI,
    address?: string,
    init?: any,
    state?: any,
  ) {
    this.factory = factory;
    this.provider = factory.provider;
    this.signer = factory.signer;
    // assume that we are accessing an existing contract
    if (address) {
      this.abi = abi;
      this.address = normaliseAddress(address);
      this.init = init;
      this.state = state;
      this.status = ContractStatus.Deployed;
    } else {
      // assume we're deploying
      this.abi = abi;
      this.code = code;
      this.init = init;
      this.status = ContractStatus.Initialised;
    }
  }
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa-js-account / src / transaction.ts View on Github external
constructor(
    params: TxParams,
    provider: Provider,
    status: TxStatus = TxStatus.Initialised,
    toDS: boolean = false,
  ) {
    // private members
    this.version = params.version;
    this.toAddr = normaliseAddress(params.toAddr);
    this.nonce = params.nonce;
    this.pubKey = params.pubKey;
    this.amount = params.amount;
    this.code = params.code || '';
    this.data = params.data || '';
    this.signature = params.signature;
    this.gasPrice = params.gasPrice;
    this.gasLimit = params.gasLimit;
    this.receipt = params.receipt;
    // public members
    this.provider = provider;
    this.status = status;
    this.toDS = toDS;
    this.blockConfirmation = 0;
    this.eventEmitter = new EventEmitter();
  }
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa-js-account / src / transaction.ts View on Github external
private setParams(params: TxParams) {
    this.version = params.version;
    this.toAddr = normaliseAddress(params.toAddr);
    this.nonce = params.nonce;
    this.pubKey = params.pubKey;
    this.amount = params.amount;
    this.code = params.code || '';
    this.data = params.data || '';
    this.signature = params.signature;
    this.gasPrice = params.gasPrice;
    this.gasLimit = params.gasLimit;
    this.receipt = params.receipt;
  }
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa-js-account / src / transaction.ts View on Github external
get txParams(): TxParams {
    return {
      version: this.version,
      toAddr: normaliseAddress(this.toAddr),
      nonce: this.nonce,
      pubKey: this.pubKey,
      amount: this.amount,
      gasPrice: this.gasPrice,
      gasLimit: this.gasLimit,
      code: this.code,
      data: this.data,
      signature: this.signature,
      receipt: this.receipt,
    };
  }