Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Service

todo

docs

since

v0.17

Hierarchy

  • Service

Index

Methods

bindService

  • bindService(binding: { deposit: Coin[]; pricing: string; serviceName: string }, baseTx: BaseTx): Promise<TxResult>
  • Bind an existing service definition

    since

    v0.17

    Parameters

    • binding: { deposit: Coin[]; pricing: string; serviceName: string }

      Service binding

      • deposit: Coin[]
      • pricing: string
      • serviceName: string
    • baseTx: BaseTx

    Returns Promise<TxResult>

defineService

  • defineService(definition: { author_description?: undefined | string; description?: undefined | string; name: string; schemas: string; tags?: string[] }, baseTx: BaseTx): Promise<TxResult>
  • Creating a new service definition

    since

    v0.17

    Parameters

    • definition: { author_description?: undefined | string; description?: undefined | string; name: string; schemas: string; tags?: string[] }

      Service definition

      • Optional author_description?: undefined | string
      • Optional description?: undefined | string
      • name: string
      • schemas: string
      • Optional tags?: string[]
    • baseTx: BaseTx

    Returns Promise<TxResult>

disableServiceBinding

  • disableServiceBinding(serviceName: string, baseTx: BaseTx): Promise<TxResult>
  • Disable an available service binding

    since

    v0.17

    Parameters

    • serviceName: string

      The unique name of the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

enableServiceBinding

  • enableServiceBinding(serviceName: string, baseTx: BaseTx): Promise<TxResult>
  • Enable an unavailable service binding

    ** Not Supported **

    since

    v0.17

    Parameters

    • serviceName: string

      The unique name of the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

killRequestContext

  • killRequestContext(requestContextID: string, baseTx: BaseTx): Promise<TxResult>
  • Kill the specified request context

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

pauseRequestContext

  • pauseRequestContext(requestContextID: string, baseTx: BaseTx): Promise<TxResult>
  • Pause the specified request context

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

queryBinding

  • queryBinding(serviceName: string, provider: string): Promise<ServiceBinding>
  • Query a service binding

    since

    v0.17

    Parameters

    • serviceName: string

      The unique service name

    • provider: string

      Bech32 provider address

    Returns Promise<ServiceBinding>

queryBindings

  • Query service bindings by service name

    since

    v0.17

    Parameters

    • serviceName: string

      The unique service name

    Returns Promise<ServiceBinding[]>

queryDefinition

  • Query a service definition

    since

    v0.17

    Parameters

    • serviceName: string

      The unique service name

    Returns Promise<ServiceDefinition>

queryFees

  • queryFees(provider: string): Promise<ServiceFee>
  • Query service fee

    since

    v0.17

    Parameters

    • provider: string

      Bech32 provider address

    Returns Promise<ServiceFee>

queryRequest

  • Query a service request

    since

    v0.17

    Parameters

    • requestID: string

      The ID of the request

    Returns Promise<ServiceRequest>

queryRequestContext

  • Query a request context

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    Returns Promise<ServiceRequestContext>

queryRequests

  • queryRequests(serviceName: string, provider: string): Promise<ServiceRequest>
  • Query all requests of a specified service and provider

    since

    v0.17

    Parameters

    • serviceName: string

      The unique service name

    • provider: string

      Bech32 provider address

    Returns Promise<ServiceRequest>

queryRequestsByReqCtx

  • queryRequestsByReqCtx(requestContextID: string, batchCounter: number): Promise<ServiceRequest[]>
  • Query all requests of a specified request context ID and batch counter

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    • batchCounter: number

      The sequence number of the request context

    Returns Promise<ServiceRequest[]>

queryResponse

  • Query a service response

    since

    v0.17

    Parameters

    • requestID: string

      The ID of the request

    Returns Promise<ServiceResponse>

queryResponses

  • queryResponses(requestContextID: string, batchCounter: number): Promise<ServiceResponse>
  • Query service responses

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    • batchCounter: number

      The sequence number of the request context

    Returns Promise<ServiceResponse>

refundServiceDeposit

  • refundServiceDeposit(serviceName: string, baseTx: BaseTx): Promise<TxResult>
  • Refund deposits from the specified service binding

    since

    v0.17

    Parameters

    • serviceName: string

      The unique name of the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

setWithdrawAddress

  • setWithdrawAddress(withdrawAddress: string, baseTx: BaseTx): Promise<TxResult>
  • Set a withdrawal address for a provider

    since

    v0.17

    Parameters

    • withdrawAddress: string

      Bech32 account address

    • baseTx: BaseTx

    Returns Promise<TxResult>

startRequestContext

  • startRequestContext(requestContextID: string, baseTx: BaseTx): Promise<TxResult>
  • Start the specified request context

    since

    v0.17

    Parameters

    • requestContextID: string

      The context ID of the service invocation which is returned when calling the service

    • baseTx: BaseTx

    Returns Promise<TxResult>

updateRequestContext

  • updateRequestContext(request: { providers: string[]; repeated_frequency?: undefined | number; repeated_total?: undefined | number; request_context_id: string; service_fee_cap?: Coin[]; timeout?: undefined | number }, baseTx: BaseTx): Promise<TxResult>
  • Update the specified request context

    since

    v0.17

    Parameters

    • request: { providers: string[]; repeated_frequency?: undefined | number; repeated_total?: undefined | number; request_context_id: string; service_fee_cap?: Coin[]; timeout?: undefined | number }

      Params to be updated

      • providers: string[]
      • Optional repeated_frequency?: undefined | number
      • Optional repeated_total?: undefined | number
      • request_context_id: string
      • Optional service_fee_cap?: Coin[]
      • Optional timeout?: undefined | number
    • baseTx: BaseTx

    Returns Promise<TxResult>

updateServiceBinding

  • updateServiceBinding(binding: { deposit: Coin[]; pricing: string; serviceName: string }, baseTx: BaseTx): Promise<TxResult>
  • Update the specified service binding

    since

    v0.17

    Parameters

    • binding: { deposit: Coin[]; pricing: string; serviceName: string }

      Service binding

      • deposit: Coin[]
      • pricing: string
      • serviceName: string
    • baseTx: BaseTx

    Returns Promise<TxResult>

withdrawEarnedFees

  • Withdraw the earned fees to the specified provider

    since

    v0.17

    Parameters

    Returns Promise<TxResult>

withdrawTax

  • withdrawTax(destAddress: string, amount: Coin[], baseTx: BaseTx): Promise<TxResult>
  • Withdraw the service tax to the speicified destination address by the trustee

    since

    v0.17

    Parameters

    • destAddress: string

      The speicified destination address to receive the service tax

    • amount: Coin[]
    • baseTx: BaseTx

    Returns Promise<TxResult>

Generated using TypeDoc