Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ShdwDrive

Index

Constructors

  • new ShdwDrive(connection: Connection, wallet: any): ShdwDrive
  • Parameters

    • connection: Connection

      connection - initialized web3 connection object

    • wallet: any

      Web3 wallet

    Returns ShdwDrive

Properties

addStorage: (key: PublicKey, size: string) => Promise<ShadowDriveResponse> = addStorage

Type declaration

    • Parameters

      • key: PublicKey

        Public Key of the existing storage to increase size on

      • size: string

        Amount of storage you are requesting to add to your storage account. Should be in a string like '1KB', '1MB', '1GB'. Only KB, MB, and GB storage delineations are supported currently.

      Returns Promise<ShadowDriveResponse>

      Confirmed transaction ID

cancelDeleteStorageAccount: (key: PublicKey) => Promise<{ txid: string }> = cancelDeleteStorageAccount

Type declaration

    • (key: PublicKey): Promise<{ txid: string }>
    • Parameters

      • key: PublicKey

        Publickey of a Storage Account

      Returns Promise<{ txid: string }>

      • Confirmed transaction ID
claimStake: (key: PublicKey) => Promise<{ txid: string }> = claimStake

Type declaration

    • (key: PublicKey): Promise<{ txid: string }>
    • Parameters

      • key: PublicKey

        PublicKey of a Storage Account

      Returns Promise<{ txid: string }>

      • Confirmed transaction ID
createStorageAccount: (name: string, size: string) => Promise<CreateStorageResponse> = createStorageAccount

Type declaration

    • Parameters

      • name: string

        What you want your storage account to be named. (Does not have to be unique)

      • size: string

        Amount of storage you are requesting to create. Should be in a string like '1KB', '1MB', '1GB'. Only KB, MB, and GB storage delineations are supported currently.

      Returns Promise<CreateStorageResponse>

      Created bucket and transaction signature

deleteFile: (key: PublicKey, url: string) => Promise<ShadowDriveResponse> = deleteFile

Type declaration

    • Parameters

      • key: PublicKey

        Publickey of Storage Account

      • url: string

        Shadow Drive URL of the file you are requesting to delete.

      Returns Promise<ShadowDriveResponse>

      • Confirmed transaction ID
deleteStorageAccount: (key: PublicKey) => Promise<{ txid: string }> = deleteStorageAccount

Type declaration

    • (key: PublicKey): Promise<{ txid: string }>
    • Parameters

      • key: PublicKey

        PublicKey of a StorageAccount

      Returns Promise<{ txid: string }>

      • Confirmed transaction ID
editFile: (key: PublicKey, url: string, data: File | ShadowFile) => Promise<ShadowEditResponse> = editFile

Type declaration

    • Parameters

      • key: PublicKey

        Publickey of Storage Account

      • url: string

        URL of existing file

      • data: File | ShadowFile

        File or ShadowFile object, file extensions should be included in the name property of ShadowFiles.

      Returns Promise<ShadowEditResponse>

      • File location
getStorageAccount: (key: PublicKey) => Promise<{ account: StorageAccountV2; publicKey: web3.PublicKey }> = getStorageAcc

Type declaration

    • (key: PublicKey): Promise<{ account: StorageAccountV2; publicKey: web3.PublicKey }>
    • Get a single storage account for the current user

      Parameters

      • key: PublicKey

        Publickey of a Storage Account

      Returns Promise<{ account: StorageAccountV2; publicKey: web3.PublicKey }>

      • Requested Storage Account
getStorageAccountInfo: (key: PublicKey) => Promise<StorageAccountInfo> = getStorageAccInfo

Type declaration

    • Get storage account details

      Parameters

      • key: PublicKey

        Publickey of a Storage Account

      Returns Promise<StorageAccountInfo>

      Storage Account

getStorageAccounts: () => Promise<{ account: StorageAccountV2; publicKey: web3.PublicKey }[]> = getStorageAccs

Type declaration

    • Get all storage accounts for the current user

      Returns Promise<{ account: StorageAccountV2; publicKey: web3.PublicKey }[]>

      • List of storage accounts
listObjects: (storageAccount: PublicKey) => Promise<ListObjectsResponse> = listObjects

Type declaration

makeStorageImmutable: (key: PublicKey) => Promise<ShadowDriveResponse> = makeStorageImmutable

Type declaration

migrate: (key: PublicKey) => Promise<{ step1_sig: string; step2_sig: string }> = migrate

Type declaration

    • (key: PublicKey): Promise<{ step1_sig: string; step2_sig: string }>
    • Parameters

      • key: PublicKey

        PublicKey of a Storage Account

      Returns Promise<{ step1_sig: string; step2_sig: string }>

      • Confirmed transaction ID
reduceStorage: (key: PublicKey, size: string) => Promise<ShadowDriveResponse> = reduceStorage

Type declaration

    • Parameters

      • key: PublicKey

        Publickey of a Storage Account

      • size: string

        Amount of storage you are requesting to reduce from your storage account. Should be in a string like '1KB', '1MB', '1GB'. Only KB, MB, and GB storage delineations are supported currently.

      Returns Promise<ShadowDriveResponse>

      • Confirmed transaction ID
refreshStake: (key: PublicKey) => Promise<{ txid: string }> = refreshStake

Type declaration

    • (key: PublicKey): Promise<{ txid: string }>
    • Parameters

      • key: PublicKey

        Public Key of the existing storage to increase size on

      Returns Promise<{ txid: string }>

      • confirmed transaction id
storageConfigPDA: PublicKey
topUp: (key: PublicKey, amount: number) => Promise<{ txid: string }> = topUp

Type declaration

    • (key: PublicKey, amount: number): Promise<{ txid: string }>
    • Parameters

      • key: PublicKey

        Public Key of the existing storage account

      • amount: number

        amount of $SHDW to transfer to stake account

      Returns Promise<{ txid: string }>

      • confirmed transaction id
uploadFile: (key: PublicKey, data: File | ShadowFile) => Promise<ShadowUploadResponse> = uploadFile

Type declaration

    • Parameters

      • key: PublicKey

        Publickey of Storage Account.

      • data: File | ShadowFile

        File or ShadowFile object, file extensions should be included in the name property of ShadowFiles.

      Returns Promise<ShadowUploadResponse>

      File location and transaction signature.

uploadMultipleFiles: (key: PublicKey, data: FileList | ShadowFile[], concurrent?: number, callback?: Function) => Promise<ShadowBatchUploadResponse[]> = uploadMultipleFiles

Type declaration

    • Parameters

      • key: PublicKey

        Storage account PublicKey to upload the files to.

      • data: FileList | ShadowFile[]
      • concurrent: number = 3

        Number of files to concurrently upload. Default: 3

      • Optional callback: Function

        Callback function for every batch of files uploaded. A number will be passed into the callback like callback(num) indicating the number of files that were confirmed in that specific batch.

      Returns Promise<ShadowBatchUploadResponse[]>

      • File names, locations and transaction signatures for uploaded files.
userInfo: PublicKey

Methods

Generated using TypeDoc