Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the api object. You can treat it just like a regular anchor program object, but it has the additional "client" and "server" namespaces for common client and server tasks.

Hierarchy

  • Program<Idl>
    • SolstoryAPI

Index

Constructors

Properties

bundlr: undefined | default | default
bundlrFundingRatio?: number
bundlrReady: boolean
cacheTimeout: number
globalCdn?: string
includeNonValidatedWriters: boolean
internal
metadataCache: MetadataCache
internal

Methods

  • configureBundlrServer(fundingSecretKey: string | Uint8Array, bundlrNetwork: string, bundlrFundingRatio?: number, options?: any): void
  • Parameters

    • fundingSecretKey: string | Uint8Array

      node bundlr expects a string or uint8 of the secret key to use for funding. Please supply it here.

    • bundlrNetwork: string

      the bundlr network to connect to. supplying "devnet" or "mainnet" will automatically connect you to an appropriate bundlr node for those solana chains.

    • bundlrFundingRatio: number = 1.1

      must be at least 1. Bundlr is funded off of an account kept by them. When current funding is insufficient for an upload, solstory will calculate how much the current item costs and add that amount, multiplied by the bundlrFundingRatio, to the account. This takes a full solana transaction confirmation, so selecting a higher ratio will allow you to amortize this cost over a larger number of transaction. For example, a ratio of 100 will allow for effectively 1.01 solana transactions for upload instead of a 2 solana transactions (one for the bundlr fee, one for the solstory stuff) per upload. Use cases with inconsistent or possibly unbounded item sizes may wish instead to manually prefund and set this ratio to something low, like 1.1.

    • options: any = {}

    Returns void

  • configureBundlrWeb(signMessage: (message: Uint8Array) => Promise<Uint8Array>, sendTransaction: (transaction: any, connection: any, options?: any) => Promise<string>, bundlrNetwork: string, bundlrFundingRatio?: number, options?: any): void
  • Parameters

    • signMessage: (message: Uint8Array) => Promise<Uint8Array>

      bundlr needs to sign messages to validate client side transactions, the function to do this can be found in useWallet of the @solana-labs/wallet-adapter github repo.

        • (message: Uint8Array): Promise<Uint8Array>
        • Parameters

          • message: Uint8Array

          Returns Promise<Uint8Array>

    • sendTransaction: (transaction: any, connection: any, options?: any) => Promise<string>

      bundlr needs to sendTransactions to validate client side transactions, the function to do this can be found in useWallet of the @solana-labs/wallet-adapter github repo.

        • (transaction: any, connection: any, options?: any): Promise<string>
        • Parameters

          • transaction: any
          • connection: any
          • Optional options: any

          Returns Promise<string>

    • bundlrNetwork: string

      the bundlr network to connect to. supplying "devnet" or "mainnet" will automatically connect you to an appropriate bundlr node for those solana chains.

    • bundlrFundingRatio: number = 1.1

      must be at least 1. Bundlr is funded off of an account kept by them. When current funding is insufficient for an upload, solstory will calculate how much the current item costs and add that amount, multiplied by the bundlrFundingRatio, to the account. This takes a full solana transaction confirmation, so selecting a higher ratio will allow you to amortize this cost over a larger number of transaction. For example, a ratio of 100 will allow for effectively 1.01 solana transactions for upload instead of a 2 solana transactions (one for the bundlr fee, one for the solstory stuff) per upload. Use cases with inconsistent or possibly unbounded item sizes may wish instead to manually prefund and set this ratio to something low, like 1.1.

    • options: any = {}

    Returns void

Generated using TypeDoc