Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @textile/near-storage

Index

Type aliases

CoreAPI

Type parameters

  • T

Variables

Const DEPOSIT

DEPOSIT: string = ...

Const GAS

GAS: "300000000000000" = "300000000000000"

Const PROVIDER_ID

PROVIDER_ID: "storage-bridge-validator.testnet" = "storage-bridge-validator.testnet"

Const REGISTRY_ID

REGISTRY_ID: "storage-bridge-registry.testnet" = "storage-bridge-registry.testnet"

Functions

createToken

  • Create and sign a JWT token to produce a JWS.

    Parameters

    Returns Promise<string>

    A promise that resolves to a token string.

estimateDeposit

  • estimateDeposit(seconds: number): string
  • Estimate the required deposit size in yocto-NEAR given the session length.

    Parameters

    • seconds: number

      The requested session length in seconds. Should be an integer value. Is passed through Math.floor before being multiplied by current session multiplier.

    Returns string

    A string representation of the required deposit in yocto-NEAR.

init

  • Initialize a Filecoin Storage Interface. This will generate a new JWT token, signed by the user for interacting with a remote Bridge Provider. If no Bridge Provider is given, this will also query the on-chain Bridge Registry to find a suitable Provider.

    Parameters

    • account: Account

      User account as derived from a ConnectedWallet.

    • opts: InitOptions & StandardClaims = {}

      Additional configuration options. Possible values include a pre-signed token, registry contract, provider contract, and standard JWT claims.

    Returns Promise<CoreAPI<string>>

    A promise that resolves to a CoreAPI object.

requestSignIn

  • requestSignIn(connection: WalletConnection, __namedParameters?: SignInOptions): Promise<boolean>
  • Request to sign the user into their local browser wallet.

    Parameters

    • connection: WalletConnection

      A pre-defined Wallet Connection.

    • __namedParameters: SignInOptions = {}

    Returns Promise<boolean>

    A promise that resolves to true (success) or false.

Generated using TypeDoc