UNPKG

@ledgerhq/hw-app-solana

Version:
16 lines 598 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildDescriptor = void 0; function buildTLV(tag, value) { const length = value.length; if (length > 0xff) { throw new Error("Value length exceeds 255 bytes"); } return Buffer.concat([tag, new Uint8Array([length]), value]); } function buildDescriptor({ data, signature }) { const SIGNATURE_TAG = Buffer.from(new Uint8Array([0x08])); return Buffer.concat([data, buildTLV(SIGNATURE_TAG, signature)]); } exports.buildDescriptor = buildDescriptor; //# sourceMappingURL=descriptor.js.map