src/sigs.js
// the function we use to generate Bitcoin signatures
the function we use to generate Bitcoin signatures
the function we use to generate Bitcoin signatures
async function rawSign(rawDigest) {
  const provider = getProvider();
  const hexDigest = utils.serializeHex(rawDigest);
  const currentAccount = (await provider.enable())[0];
  return new Promise((resolve, reject) => {
    const cb = (err, result) => {
      if (err) return reject(err);
      const signature = result.result;
      return resolve(signature);
    };
    provider.sendAsync({
      method: 'eth_sign',
      params: [currentAccount, hexDigest]
    }, cb);
  });
}
async function rawSign ( rawDigest ) { const provider = getProvider ( ) ; const hexDigest = utils . serializeHex ( rawDigest ) ; const currentAccount = ( await provider . enable ( ) ) [ 0 ] ; return new Promise ( ( resolve , reject ) => { const cb = ( err , result ) => { if ( err ) return reject ( err ) ; const signature = result . result ; return resolve ( signature ) ; } ; provider . sendAsync ( { method : 'eth_sign' , params : [ currentAccount , hexDigest ] } , cb ) ; } ) ; }
the function we use to generate Bitcoin signatures
the function we use to generate Bitcoin signatures