☁️
Zus Docs
  • About Züs
  • System
    • Providers and Services
      • Miner
      • Sharder
      • Blobber
      • Validator
      • Authorizer
      • Node Locator (0DNS)
    • Storage
      • Architecture and Data Management
      • Protocol
        • Allocations
        • Reference Objects
        • Challenges
        • Write Markers
          • Chain Hashing
          • Two Commit
        • Blobber Repair Protocol
      • ZS3 Server
        • Backup, Recovery and Replication
        • Encryption and Compression
        • S3FS Setup and Usage
        • Backup & Recovery with Restic on Blimp + ZS3 Server
        • Backup & Recovery with Veeam on Blimp + ZS3 Server
      • File Operations
        • Upload
        • Download
        • File Sharing
        • Partial Error Recovery
        • Streaming
        • Rent a Blobber
    • Smart Contracts
      • Storage S.C.
      • Miner S.C.
      • ZCN S.C.
      • ERC-20 S.C.s
      • Bridge Protocol
    • Blockchain & Consensus
      • Entities
    • User Authentication and Wallet Management System
      • OKTA Integration
      • Key Management System (KMS)
  • APIs
    • 0DNS API
    • JS API
    • Mobile API
  • CLIs
    • Storage CLI
      • Quickstart
      • Configuring the tool
    • Wallet CLI
      • Wallet Configuration
      • Quickstart
      • Configuring the tool
  • SDKs
    • Go SDK
      • GO SDK Microservices
    • JS SDK
  • Tokenomics
    • Staking
    • Reward & Penalty
  • ✨Züs Apps
    • 🗝️Vult
      • Getting Started
        • Web
        • Mobile
      • Vult AI
        • Batch Processing
        • Memory Retention
        • Technical Implementation
        • Architecture Overview
      • Login / Register
      • File Management Pages
      • File Sharing
      • Storage Management Dashboard
      • Storage Maintenance and Troubleshooting
      • Züs Subscription
      • Wallet Management
      • Refer a friend
      • Settings
    • 🏗️Blimp
      • Getting Started
      • Login / Register
      • Configure Storage
        • Create Standard Storage Allocation
        • Create Enterprise Allocation
        • Create S3 Server Allocation
        • Create Cloud Migration Allocation
        • Allocation Maintenance and Troubleshooting
      • File Management Pages
      • File Sharing
      • Manage Allocations
      • Upgrade Storage
      • Blimp Vault
      • Refer a friend
      • Settings
      • Launching ZS3 Server
      • Using CLI to backup files into Blimp + ZS3 Server
    • 🏠Chimney
      • Getting Started
      • Login / Register
      • Create New Deployment
      • Manage Your Deployments
      • Homepage
      • Staking Dashboard
      • Rank Dashboard
      • Monitor Dashboard
      • Stats Dashboard
      • Logs Dashboard
      • Wallet Dashboard
      • Operations on your Deployments
      • Restricted Blobbers
      • Settings
        • Manage Profile
        • Wallet Settings
        • Update Blobber Settings
        • Update Blobber Version
        • Refer a friend
        • Help
    • 🌐Atlus
      • Getting Started
      • Home page
      • Service Providers Page
      • Charts Page
        • Market Charts
        • Network Charts
        • Storage Charts
      • Blockchain Page
      • Server Map Page
      • Storage Explainer Page
      • Details Pages
        • Block Details Page
        • Transaction Details Page
        • Wallet Details Page
        • Miner Details Page
        • Sharder Details Page
        • Blobber Details Page
        • Validator Details Page
        • Authorizer Details Page
        • Allocation Details Page
      • Appendix: Common Components
    • ⚡Bolt
      • Getting Started
        • Web
        • Mobile
      • Login / Register
      • Sign In with external wallet
      • Staking Dashboard
      • Staking/Unstaking a provider
      • Claiming Rewards
      • Send/Receive ZCN tokens
      • Buy ZCN
      • Deposit/Withdraw ZCN tokens
      • Activity Dashboard
      • Refer a friend
      • Settings
  • Releases
    • Hardfork
Powered by GitBook
On this page
  1. APIs

JS API

After initializing the SDK, you can use the Züs JS SDK to perform various operations such as creating and managing allocations, uploading and downloading files, executing smart contracts, and more.

SDK Methods Index

In this guide, we will introduce you to all the available methods provided by the Züs JS SDK.

Wallet Methods

The wallet methods allow you to create and manage wallets, set the wallet, and get wallet information.

Method
Description

createWallet

Create a new wallet. Also, helps to recover a wallet using its mnemonic phrase.

createWalletKeys

Create a new wallet keys and mnemonic.

getPublicEncryptionKey

Get the public encryption key by wallet mnemonic.

isWalletId

Check whether thef wallet id is valid.

send

Send token from one wallet to another.

getWalletBalance

Get the balance of a wallet.

getUSDRate

Get the USD rate by token symbol. (e.g. zcn, eth)

Burn & Mint Methods

The initBridge method must be called to initialize the bridge client before using the any of the burn and mint methods.

Method
Description

initBridge

Initialize the bridge for calling burn and mint functions.

burnZCN

Bridge method to burn ZCN tokens.

mintZCN

Bridge method to mint ZCN tokens.

getMintWZCNPayload

Bridge method to get Mint WZCN Payload for a given burn transaction hash.

getUnprocessedWZCNBurnEvents

Get all unprocessed WZCN burn events from the Ethereum network.

getProcessedZCNBurnTickets

Get all processed ZCN burn tickets burned for a certain Ethereum address.

estimateMintWZCNGasAmount

Perform gas amount estimation for the given Mint WZCN transaction.

estimateBurnWZCNGasAmount

Perform gas amount estimation for the given burn WZCN transaction.

estimateGasPrice

Perform gas estimation for the given transaction using Alchemy enhanced API returning approximate final gas fee.

{/*

getFaucetToken

Allocation Storage Methods

The allocation storage methods allow you to create, update, and manage allocations.

Method
Description

createAllocation

Creates an allocation with the specified allocation terms and preferred blobber IDs.

getAllocationMinLock

Retrieves the minimum lock value for the allocation creation.

listAllocations

List all the allocations.

getAllocation

Gets allocation details for a given allocationId from cache or the blockchain.

reloadAllocation

Re-fetches allocation details using allocationId from blockchain and updates cache.

getAllocationWith

Get allocation details of a free allocation or a shared allocation details by using an authTicket.

freezeAllocation

Freeze an allocation so that the allocation data can no longer be modified.

cancelAllocation

Cancel an Allocation

updateAllocation

Update the allocation settings

updateAllocationWithRepair

Updates your allocation settings and repairs the allocation if any blobber was replaced or added

getUpdateAllocationMinLock

Retrieves the minimum lock value for the allocation after update.

updateForbidAllocation

UpdateForbidAllocation updates the permissions of an allocation, given the permission parameters in a forbid-first manner.

getUpdateAllocTicket

Generates and signs an "Update Allocation ticket", which authorizes the "add blobber" or "replace blobber" operation from other wallets.

checkAllocStatus

Check the health status of the allocation.

skipStatusCheck

Skips the checkAlloctionStatus health status check of the allocation.

repairAllocation

Start a repair process for an allocation.

repairSize

Retrieves the repair size for a specific path in an allocation.

createWorkers

Manually create local workers that sync with the allocation.

terminateWorkers

Remove local workers that sync with the allocation. This is useful when switching between allocations.

{/*

transferAllocation

{/* createFreeAllocation // DOTODO */}

Blobber Methods

The blobber methods allow you to retrieve information, manage and interact with blobbers.

Method
Description

getBlobbers

Retrieves a list of active blobbers details from the network

getBlobberIds

Get Blobber IDs from a list of blobber URLs

getAllocationBlobbers

Retrieves a list of blobber IDs of blobber which match your allocation terms

updateBlobberSettings

Updates the blobber settings

getContainers

GetContainers returns all the running containers in a given domain.

searchContainer

searchContainer searches for a container with a given name in a given domain.

updateContainer

UpdateContainer updates the given container ID with a new image ID in a given domain.

File Operation Methods

The file operation methods allow you to perform various operations on files.

Method
Description

getLookupHash

Generate lookup hash for a given file path and allocation ID

createDir

Create a folder on the blobbers

setUploadMode

Sets the upload mode for modifying the upload speed and CPU usage

multiUpload

Upload multiple files in a batch. Also, used to resume a paused upload.

pauseUpload

Pause the upload operation of the file.

cancelUpload

Cancel the upload operation of the file.

getFileStats

Gets the file stats

listObjects

List the files for a given allocation ID and remote path

getFileMetaByName

Get file metadata by name. (File Search)

multiDownload

Download multiple files together

downloadBlocks

Downloads a specified range of blocks from a file.

cancelDownloadBlocks

Cancels the download of a specified range of blocks from a file.

downloadDirectory

Download files in a directory.

cancelDownloadDirectory

Cancel the download of a directory.

multiOperation

Perform multiple file operations (copy, move, delete, create directory) together

deleteFile

Deletes a file from an allocation. Only the owner of the allocation can delete a file. Prefer multiOperation for deleting multiple files.

share

Generate an authToken that provides the authorization to the holder to the specified file on the remotepath.

listObjectsFromAuthTicket

List objects from an auth ticket. It's useful for accessing a shared resource by a non-owner

Smart Contract Methods

The smart contract methods allow you to interact with smart contracts.

Method
Description

makeSCRestAPICall

Issues a request to the public API of the smart contracts

getStakePoolInfo

Get information about the stake pool for the allocation

lockWritePool

Lock given number of tokens for given duration in write pool

lockStakePool

Stake number of tokens for a given provider given its type and ID

unlockStakePool

Unlock the write pool

collectRewards

Collect all rewards for a given delegate and provider pair.

Utility Functions

Method
Description

decodeAuthTicket

Decode the AuthTicket of a shared file

getGosdkVersion

Retrieves the version of the initialized GoSDK WASM.

getWasmType

Returns the type of the GoSDK WASM file (standard or enterprise).

sasTokenToZcn

Converts SAS token value in ZCN

zcnToSasToken

Converts ZCN value in SAS token

checkIfWasmLoaded

Waits until the "desired mode" GoSDK WASM is loaded and initialized.

awaitWasmLoad

Waits until the GoSDK WASM is loaded and initialized.

updateWasmMode

Updates the "desired mode" value of the GoSDK WASM.

getDesiredMode

Returns the "desired mode" value of the GoSDK WASM.

isDesiredWasmInitialized

Checks if the desired GoSDK WASM mode is initialized. Returns true if the WASM is initialized, false otherwise.

Previous0DNS APINextMobile API

Last updated 1 month ago