Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Eth

This class allows app to register and manage ETH Contracts. This allows you to enrich tokenomics.
Do not create it directly; Get it from AinftJs instance.

Hierarchy

Index

Constructors

  • new Eth(baseUrl: string, route: null | string, ain: default, ainize?: default): Eth

Properties

ain: default

The Ain object for sign and send transaction to AIN blockchain.

ainize?: default

The Ainize object for send request to AIN blockchain.

baseUrl: string = ''

The base url of api server of AINFT Factory.

chain: string = 'ETH'
route: string

The subpath of api server request url.

Methods

  • Gets NFT symbol list in app.

    Parameters

    Returns Promise<string[]>

    Returns a list of symbols registered in the app.

  • Gets NFT info by network, contractAddress and tokenId. Symbol must be added.

    Parameters

    • GetNftParams: GetNftParams

      The parameters to get NFT information.

    Returns Promise<NftToken>

    Returns NFT information.

  • Gets contract info by network and contractAddress. Symbol must be added.

    Parameters

    Returns Promise<NftContractInfo>

    Returns contract information.

  • Gets NFT list by user address.

    Parameters

    Returns Promise<NftCollections>

    Returns NFTs owned by the user along with their contract information.

  • sendFormRequest(method: POST | PUT, trailingUrl: string, stringFields: {}, fileFields: {}): Promise<any>
  • Sends request that include form to api server of AINFT Factory. Used to upload asset data.

    Parameters

    • method: POST | PUT

      The method of Http request.

    • trailingUrl: string

      The suffix of request url.

    • stringFields: {}

      The string fields of form.

      • [key: string]: string
    • fileFields: {}

      The file fields of form.

      • [key: string]: { buffer: Buffer; filename: string }
        • buffer: Buffer
        • filename: string

    Returns Promise<any>

    Returns response of api request.

  • sendRequest(method: HttpMethod, trailingUrl: string, data?: Record<string, any>): Promise<any>
  • Sends request to api server of AINFT Factory. Authenticate by signing data.

    Parameters

    • method: HttpMethod

      The method of Http request.

    • trailingUrl: string

      The suffix of request url.

    • Optional data: Record<string, any>

      The data to be included in the api request.

    Returns Promise<any>

    Returns response of api request.

  • sendRequestWithoutSign(method: HttpMethod, trailingUrl: string, data?: Record<string, any>, headers?: AxiosRequestHeaders): Promise<any>
  • Sends request to api server of AINFT Factory. Used when authentication is not required.

    Parameters

    • method: HttpMethod

      The method of Http request.

    • trailingUrl: string

      The suffix of request url.

    • Optional data: Record<string, any>

      The data to be included in the api request.

    • Optional headers: AxiosRequestHeaders

      The headers of Http api request.

    Returns Promise<any>

    Returns response of api request.

  • setBaseUrl(baseUrl: string): void
  • signData(data: any): string | Promise<string>
  • Sign the data with the private key that the user has registered.

    Parameters

    • data: any

      The data to sign.

    Returns string | Promise<string>

    Returns signature string.

Generated using TypeDoc