Skip to main content

Interface: PostageBatch

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

Properties​

amount​

amount: NumberString

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


batchID​

batchID: BatchId

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


blockNumber​

blockNumber: number

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


bucketDepth​

bucketDepth: number

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


depth​

depth: number

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


duration​

duration: Duration

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

Estimated time until the batch expires


immutableFlag​

immutableFlag: boolean

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


label​

label: string

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


remainingSize​

remainingSize: Size

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

Estimated remaining size


size​

size: Size

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

Effective size


theoreticalSize​

theoreticalSize: Size

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

Theoretical size in bytes


usable​

usable: boolean

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


usage​

usage: number

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

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:554

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


utilization​

utilization: number

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

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:576

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:571

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