UNPKG

@btc-vision/transaction

Version:

OPNet transaction library allows you to create and sign transactions for the OPNet network.

44 lines (43 loc) 1.8 kB
import { AddressMap } from '../deterministic/AddressMap.js'; import { Address } from '../keypair/Address.js'; import { Selector, u16, u32, u64, u8 } from '../utils/types.js'; import { BinaryReader } from './BinaryReader.js'; export declare class BinaryWriter { private currentOffset; private buffer; constructor(length?: number); writeU8(value: u8): void; writeU16(value: u16, be?: boolean): void; writeU32(value: u32, be?: boolean): void; writeU64(value: u64, be?: boolean): void; writeSelector(value: Selector): void; writeBoolean(value: boolean): void; writeI128(bigIntValue: bigint, be?: boolean): void; writeU256(bigIntValue: bigint, be?: boolean): void; writeU128(bigIntValue: bigint, be?: boolean): void; writeBytes(value: Uint8Array | Buffer): void; writeString(value: string): void; writeStringWithLength(value: string): void; writeAddress(value: Address): void; getBuffer(clear?: boolean): Uint8Array; reset(): void; toBytesReader(): BinaryReader; getOffset(): u32; setOffset(offset: u32): void; clear(): void; allocSafe(size: u32): void; writeAddressValueTuple(map: AddressMap<bigint>, be?: boolean): void; writeBytesWithLength(value: Uint8Array): void; writeAddressArray(value: Address[]): void; writeU32Array(value: u32[], be?: boolean): void; writeU256Array(value: bigint[], be?: boolean): void; writeU128Array(value: bigint[], be?: boolean): void; writeStringArray(value: string[]): void; writeU16Array(value: u16[], be?: boolean): void; writeU8Array(value: u8[]): void; writeU64Array(value: bigint[], be?: boolean): void; writeBytesArray(value: Uint8Array[]): void; private verifyAddress; private resize; private getDefaultBuffer; }