Skip to main content

File

Index

Constructors

constructor

  • Parameters

    • filename: string
    • optionalfileType: FileDataType
    • optionalfileMetadata: Field

    Returns File

Properties

fileMetadata

fileMetadata: Field

fileType

fileType: FileDataType

filename

filename: string

optionalheight

height?: number

optionalleavesNumber

leavesNumber?: number

optionalmimeType

mimeType?: string

optionalroot

root?: Field

optionalsha3_512_hash

sha3_512_hash?: string

optionalsize

size?: number

storage

storage: string

Methods

publicbinaryFields

  • binaryFields(): Promise<Field[]>
  • Returns Promise<Field[]>

publicdata

publicmetadata

  • metadata(): Promise<{ mimeType: string; size: number }>
  • Returns Promise<{ mimeType: string; size: number }>

publicpin

  • pin(params: { arweaveKey?: string; keyvalues?: object; pinataJWT?: string }): Promise<string>
  • Parameters

    • params: { arweaveKey?: string; keyvalues?: object; pinataJWT?: string }

    Returns Promise<string>

publicpngFields

  • pngFields(): Promise<Field[]>
  • Returns Promise<Field[]>

publicsetMetadata

  • setMetadata(): Promise<void>
  • Returns Promise<void>

publicsha3_512

  • sha3_512(): Promise<string>
  • Returns Promise<string>

publictreeData

  • treeData(calculateRoot: boolean, fastCalculation?: boolean): Promise<{ height: number; leavesNumber: number; root: Field }>
  • Parameters

    • calculateRoot: boolean
    • fastCalculation: boolean = true

    Returns Promise<{ height: number; leavesNumber: number; root: Field }>

publicstaticfillFields

  • fillFields(bytes: Uint8Array): Field[]
  • Parameters

    • bytes: Uint8Array

    Returns Field[]