JS API Reference

Class: YagnaApi

shared/yagna/yagnaApi.YagnaApi

Utility class that groups various Yagna APIs under a single wrapper

This class has the following responsibilities:

  • selectively exposes services from ya-ts-client in a more user-friendly manner
  • implements an event reader that collects events from Yagna endpoints and allows subscribing to them as Observables for agreements, debit notes and invoices. These observables emit ya-ts-client types on outputs

End users of the SDK should not use this class and make use of golem-network/golem-network.GolemNetwork instead. This class is designed for SDK developers to use.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new YagnaApi(options?): YagnaApi

Parameters

NameType
options?YagnaOptions

Returns

YagnaApi

Defined in

src/shared/yagna/yagnaApi.ts:85

Properties

appSessionId

Readonly appSessionId: string

Defined in

src/shared/yagna/yagnaApi.ts:51


yagnaOptions

Readonly yagnaOptions: YagnaOptions

Defined in

src/shared/yagna/yagnaApi.ts:53


basePath

Readonly basePath: string

Base path used to build paths to Yagna's API

Example

http://localhost:7465

Defined in

src/shared/yagna/yagnaApi.ts:59


identity

Readonly identity: DefaultService

Defined in

src/shared/yagna/yagnaApi.ts:61


market

market: RequestorService

Defined in

src/shared/yagna/yagnaApi.ts:62


activity

activity: Object

Type declaration

NameType
controlRequestorControlService
stateRequestorStateService
execYagnaExeScriptObserver

Defined in

src/shared/yagna/yagnaApi.ts:63


net

net: RequestorService

Defined in

src/shared/yagna/yagnaApi.ts:68


payment

payment: RequestorService

Defined in

src/shared/yagna/yagnaApi.ts:69


gsb

gsb: RequestorService

Defined in

src/shared/yagna/yagnaApi.ts:70


version

version: DefaultService

Defined in

src/shared/yagna/yagnaApi.ts:71


debitNoteEvents$

debitNoteEvents$: Subject<{}>

Defined in

src/shared/yagna/yagnaApi.ts:73


invoiceEvents$

invoiceEvents$: Subject<{}>

Defined in

src/shared/yagna/yagnaApi.ts:76


agreementEvents$

agreementEvents$: Subject<{} & {}>

Defined in

src/shared/yagna/yagnaApi.ts:79

Methods

connect

connect(): Promise<{}>

Effectively starts the Yagna API client including subscribing to events exposed via rxjs subjects

Returns

Promise<{}>

Defined in

src/shared/yagna/yagnaApi.ts:181


disconnect

disconnect(): Promise<void>

Terminates the Yagna API related activities

Returns

Promise<void>

Defined in

src/shared/yagna/yagnaApi.ts:198


getVersion

getVersion(): Promise<string>

Returns

Promise<string>

Defined in

src/shared/yagna/yagnaApi.ts:204