How to use the @taquito/utils.b58cencode function in @taquito/utils

To help you get started, we’ve selected a few @taquito/utils 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 ecadlabs / taquito / packages / taquito-signer / src / ec-key.ts View on Github external
async publicKey(): Promise {
    return b58cencode(this._publicKey, pref[this.curve].pk);
  }
github ecadlabs / taquito / packages / taquito-signer / src / ed-key.ts View on Github external
async publicKey(): Promise {
    await this.isInit;
    return b58cencode(this._publicKey, prefix['edpk']);
  }
github ecadlabs / taquito / packages / taquito-signer / src / ec-key.ts View on Github external
async publicKeyHash(): Promise {
    await sodium.ready;
    return b58cencode(
      sodium.crypto_generichash(20, new Uint8Array(this._publicKey)),
      pref[this.curve].pkh
    );
  }
github ecadlabs / taquito / packages / taquito-signer / src / ec-key.ts View on Github external
async sign(bytes: string, bytesHash: Uint8Array) {
    const key = new elliptic.ec(this.curve).keyFromPrivate(this._key);
    const sig = key.sign(bytesHash, { canonical: true });
    const signature = new Uint8Array(sig.r.toArray().concat(sig.s.toArray()));
    const signatureBuffer = toBuffer(signature);
    const sbytes = bytes + buf2hex(signatureBuffer);

    return {
      bytes,
      sig: b58cencode(signature, prefix.sig),
      prefixSig: b58cencode(signature, pref[this.curve].sig),
      sbytes,
    };
  }
github ecadlabs / taquito / packages / taquito-signer / src / ec-key.ts View on Github external
async secretKey(): Promise {
    let key = this._key;

    return b58cencode(key, pref[this.curve].sk);
  }
}