How to use the bytebuffer.btoa function in bytebuffer

To help you get started, we’ve selected a few bytebuffer 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 lino-network / lino-js / lib / lino-js.esm.js View on Github external
pub_key: convertToInternalPubKey(rawPubKey, _TYPE.PubKeySecp256k1),
        signature: ByteBuffer.fromHex(rawSigDER).toString('base64'),
        account_number: '0',
        sequence: String(seq)
    };
    const stdTx = {
        msg: msgs,
        signatures: [stdSig],
        fee: getZeroFee()
    };
    const authStdTx = {
        type: 'auth/StdTx',
        value: number2StringInObject(stdTx)
    };
    const jsonStr = JSON.stringify(authStdTx);
    return ByteBuffer.btoa(jsonStr);
}
function decodeObject(result) {
github lino-network / lino-js / src / transport / encoder.ts View on Github external
};
    sigs.push(stdSig);
  }

  const stdTx: StdTx = {
    msg: msgs,
    signatures: sigs,
    fee: getFee(maxFeeInCoin)
  };

  const authStdTx: StdMsg = {
    type: 'auth/StdTx',
    value: number2StringInObject(stdTx)
  };
  const jsonStr = JSON.stringify(authStdTx);
  return ByteBuffer.btoa(jsonStr);
}