Skip to main content

Interface: PostageBatch

Defined in: bee-js/src/types/index.ts:506

Properties

amount

amount: NumberString

Defined in: bee-js/src/types/index.ts:520


batchID

batchID: BatchId

Defined in: bee-js/src/types/index.ts:507


blockNumber

blockNumber: number

Defined in: bee-js/src/types/index.ts:522


bucketDepth

bucketDepth: number

Defined in: bee-js/src/types/index.ts:521


depth

depth: number

Defined in: bee-js/src/types/index.ts:519


duration

duration: Duration

Defined in: bee-js/src/types/index.ts:527

Estimated time until the batch expires


immutableFlag

immutableFlag: boolean

Defined in: bee-js/src/types/index.ts:523


label

label: string

Defined in: bee-js/src/types/index.ts:518


remainingSize

remainingSize: Size

Defined in: bee-js/src/types/index.ts:543

Estimated remaining size


size

size: Size

Defined in: bee-js/src/types/index.ts:539

Effective size


theoreticalSize

theoreticalSize: Size

Defined in: bee-js/src/types/index.ts:547

Theoretical size in bytes


usable

usable: boolean

Defined in: bee-js/src/types/index.ts:517


usage

usage: number

Defined in: bee-js/src/types/index.ts:531

A floating point number from 0 to 1, where 0 is no usage, 1 is full usage.


usageText

usageText: string

Defined in: bee-js/src/types/index.ts:535

Human readable usage text, like "50%" or "100%", no fractions


utilization

utilization: number

Defined in: bee-js/src/types/index.ts:516

Represents how much of the batch is used up.

Max utilization = 2 ** (depth - bucketDepth)

Since the smallest depth is 17, and one batch has 65,536 buckets, and one chunk is 4,096 bytes, the 512MB theoretical max size for the smallest stamp comes from 2 * 65536 * 4096 = 512MB

Methods

calculateRemainingSize()

calculateRemainingSize(encryption, redundancyLevel): Size

Defined in: bee-js/src/types/index.ts:557

Calculates the remaining size of data that can be uploaded with this postage batch based on whether encryption is used and the desired redundancy level.

Parameters

encryption

boolean

redundancyLevel

RedundancyLevel

Returns

Size


calculateSize()

calculateSize(encryption, redundancyLevel): Size

Defined in: bee-js/src/types/index.ts:552

Calculates the effective size of data that can be uploaded with this postage batch based on whether encryption is used and the desired redundancy level.

Parameters

encryption

boolean

redundancyLevel

RedundancyLevel

Returns

Size

💬 Get Help