Contracts API for accessing contract addresses from the Nevermined API info endpoint.

Hierarchy

  • BasePaymentsAPI
    • ContractsAPI

Constructors

Properties

accountAddress: string
appId?: string
deploymentInfo?: DeploymentInfo
environment: EnvironmentInfo
environmentName: EnvironmentName
heliconeApiKey: string
isBrowserInstance: boolean = true
nvmApiKey: string
returnUrl: string
version?: string

Methods

  • It returns the account address associated with the NVM API Key used to initialize the Payments Library instance.

    Returns undefined | string

    The account address extracted from the NVM API Key

  • Internal

    Returns the HTTP options required to query the backend.

    Parameters

    • method: string

      HTTP method.

    • Optional body: any

      Optional request body.

    Returns any

    HTTP options object.

  • Get a contract address by name (e.g., "PayAsYouGoTemplate").

    Parameters

    • contractName: string

    Returns Promise<`0x${string}`>

  • Fetch deployment info (including contract addresses) from the API root. The result is cached after the first call.

    Returns Promise<DeploymentInfo>

  • Get the PayAsYouGoTemplate contract address (convenience accessor).

    Returns Promise<`0x${string}`>

  • Parses the NVM API Key to extract the account address.

    Returns {
        accountAddress: string;
        heliconeApiKey: string;
    }

    • accountAddress: string
    • heliconeApiKey: string

    Throws

    PaymentsError if the API key is invalid.