Skip to content

BoxValue

BoxValue<ValueType>: Object

A value saved in box storage

Type parameters

ValueType

Type declaration

delete

delete: () => void

Returns

void

exists

exists: boolean

size

size: uint64

value

value: ValueType

create()

Parameters

size?: uint64

Returns

void

extract()

Parameters

offset: uint64

length: uint64

Returns

Brand<string, "bytes">

replace()

Parameters

offset: uint64

value: Brand<string, "bytes">

Returns

void

resize()

Change the size of the box dding zero bytes to end or removing bytes from the end, as needed. Throws error if the box does not exist or the size is larger than 32,768.

Parameters

size: uint64

The new size of the box

Returns

void

splice()

Remove bytes from the box starting at the given offset and replace them with the given data.

Parameters

offset: uint64

length: uint64

data: Brand<string, "bytes">

Returns

void

Source

types/global.d.ts:593