Skip to main content
This function is used to get the cost of uploading a file to Arweave. It returns the required and additional cost for upload in atomic as well as formatted units.

Usage

Input Parameters

  • size: number: The size of the file in bytes.

Return Value

It returns and object with the following properties:
  • token: string: The token to be used for upload, depends on irys instance.
  • balance: object: The balance of the wallet.
    • atomic: string: The balance of the wallet in atomic units.
    • formatted: string: The balance of the wallet in formatted units.
  • cost: object: The required cost for upload.
    • atomic: string: The required cost for upload in atomic units.
    • formatted: string: The required cost for upload in formatted units.
  • additional: object: The additional cost for upload.
    • atomic: string: The additional cost for upload in atomic units.
    • formatted: string: The additional cost for upload in formatted units.

Example

Response: