Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AinftJs

A class that establishes a blockchain and ainft server connection and initializes other classes.

Hierarchy

  • AinftJs

Index

Constructors

Properties

_baseUrl: string
_blockchainUrl: string
_chainId: 0 | 1
activity: Activity
ai: Ai
ain: default
ainize: default
assistant: Assistants
auth: Auth
credit: Credit
discord: Discord
eth: Eth
event: Event
message: Messages
nft: Nft
personaModels: PersonaModels
store: Store
textToArt: TextToArt
thread: Threads

Methods

  • Connects to the blockchain endpoint.

    Parameters

    Returns Promise<void>

  • disconnect(): Promise<void>
  • Disconnects from the blockchain endpoint.

    Returns Promise<void>

  • getAccessAccount(): null | Account
  • Return the currently registered Access Account.

    Returns null | Account

  • getStage(endpoint: string): "dev" | "prod"
  • getStatus(): Promise<{ health: boolean }>
  • Return the status of the AINFT server.

    Returns Promise<{ health: boolean }>

  • isConnected(): boolean
  • Checks whether the client is connected to the blockchain endpoint.

    Returns boolean

    Returns true if connected, false otherwise.

  • setAiNetworkInfo(providerUrl: string, chainId: number, axiosConfig?: any): void
  • Set AIN blockchain network info

    Parameters

    • providerUrl: string
    • chainId: number
    • Optional axiosConfig: any

    Returns void

  • setAinWalletSigner(): void
  • setBaseUrl(baseUrl: string): void
  • Set a new baseUrl. Enter the AINFT server endpoint.

    Parameters

    • baseUrl: string

    Returns void

  • setCredentials(privateKey?: string, signer?: Signer): void
  • Parameters

    • Optional privateKey: string
    • Optional signer: Signer

    Returns void

  • setPrivateKey(privateKey: string): void
  • Set a new privateKey. From now on, you can access the apps that match your new privateKey.

    Parameters

    • privateKey: string

    Returns void

  • setSigner(signer: Signer): void
  • createAccount(): Account

Generated using TypeDoc