@ledgerhq/hw-app-solana
Version:
Ledger Hardware Wallet Solana Application API
12 lines • 451 B
JavaScript
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]);
}
export function buildDescriptor({ data, signature }) {
const SIGNATURE_TAG = Buffer.from(new Uint8Array([0x08]));
return Buffer.concat([data, buildTLV(SIGNATURE_TAG, signature)]);
}
//# sourceMappingURL=descriptor.js.map