UNPKG

@yubing744/rooch-sdk

Version:
25 lines (24 loc) 649 B
const SIGNATURE_SCHEME_TO_FLAG = { ED25519: 0 }; const SIGNATURE_FLAG_TO_SCHEME = { 0: "ED25519" }; function toSerializedSignature({ signature, signatureScheme, pubKey }) { const pubKeyBytes = pubKey.toBytes(); const serializedSignature = new Uint8Array(1 + signature.length + pubKeyBytes.length); serializedSignature.set([SIGNATURE_SCHEME_TO_FLAG[signatureScheme]]); serializedSignature.set(signature, 1); serializedSignature.set(pubKeyBytes, 1 + signature.length); return serializedSignature; } export { SIGNATURE_FLAG_TO_SCHEME, SIGNATURE_SCHEME_TO_FLAG, toSerializedSignature }; //# sourceMappingURL=signature.js.map