INNER CODE UNIT · TypeScript
programdata
blueshift-gg/doppler · packages/core/index.ts:237
const programdata = PROGRAMDATA_HEADER + this.elf().length;
return budget(updateCu(this.size), 3 * ACCOUNT_OVERHEAD + PROGRAM_LEN + programdata + HEADER + this.size, 1, unitPrice);
}
/** One deploy: buffer, program, programdata, feed, the system and loader programs, two sysvars; the admin signs. */
deployBudget(unitPrice: number | bigint): Budget {
return budget(DEPLOY_CU, 8 * ACCOUNT_OVERHEAD + DEPLOY_LOADED_DATA, 1, unitPrice);
}
/** Update instruction data, which is also the feed account layout. */
encode(sequence: number | bigint, value: Payload<F>): Uint8Array {
const u64 = typeof sequence === 'bigint' ? sequence : Number.isSafeInteger(sequence) ? BigInt(sequence) : -1n;
if (u64 < 0n || u64 > MAX_SEQUENCE) throw new RangeError('sequence: expected a non-negative u64, and a number must be a safe integer');
const data = new Uint8Array(HEADER + this.size);
const view = new DataView(data.buffer);
view.setBigUint64(0, u64, true);
const fields = value as Record<string, unknown>;
for (const slot of this.slots) {