How to use the @taquito/utils.prefix.p2sig 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
import sodium from 'libsodium-wrappers';
import { b58cencode, b58cdecode, prefix, buf2hex } from '@taquito/utils';
import toBuffer from 'typedarray-to-buffer';
import elliptic from 'elliptic';

const pref = {
  p256: {
    pk: prefix['p2pk'],
    sk: prefix['p2sk'],
    pkh: prefix.tz3,
    sig: prefix.p2sig,
  },
  secp256k1: {
    pk: prefix['sppk'],
    sk: prefix['spsk'],
    pkh: prefix.tz2,
    sig: prefix.spsig,
  },
};

/**
 * @description Provide signing logic for elliptic curve based key (tz2, tz3)
 */
export class ECKey {
  private _key: Uint8Array;
  private _publicKey: Uint8Array;