Skip to content

@gala-chain/connectAPI


API > GalaChainProvider

Class: abstract GalaChainProvider

Abstract base class for GalaChain providers that handle communication with GalaChain networks. Provides common functionality for signing transactions and submitting requests.

Contents

Extended By

Constructors

new GalaChainProvider(options)

new GalaChainProvider(options?): GalaChainProvider

Creates a new GalaChain provider instance.

Parameters

options?: GalaChainProviderOptions

Configuration options for the provider

Source

chain-connect/src/GalaChainClient.ts:58

Properties

legacyCredentials

private legacyCredentials: Record\<string, string>

Source

chain-connect/src/GalaChainClient.ts:52


options

protected options?: GalaChainProviderOptions

Configuration options for the provider

Source

chain-connect/src/GalaChainClient.ts:58

Methods

abstract sign()

abstract sign\<T>(method, dto, signingType?): Promise\<T & object>

Signs a payload using the provider's signing mechanism.

Type parameters

T extends object

Parameters

method: string

The method name being called

dto: T

The data transfer object to sign

signingType?: SigningType

Optional signing type override

Returns

The signed payload with signature and optional prefix

Source

chain-connect/src/GalaChainClient.ts:74


submit()

submit\<T, U>(params): Promise\<GalaChainResponseSuccess\<T>>

Submits a request to the GalaChain network.

Type parameters

T

U extends object

Parameters

params: object

The submission parameters

params.headers?: Record\<string, string>

Additional HTTP headers

params.method: string

The method name to call

params.payload: ConstructorArgs\<U>

The request payload

params.requestConstructor?: ClassConstructor\<ChainCallDTO>

Constructor for request validation

params.responseConstructor?: NonArrayClassConstructor\<T>

Constructor for response transformation

params.sign?: boolean

Whether to sign the request

params.signingType?: SigningType

Type of signing to use

params.url: string

The base URL for the request

Returns

Promise resolving to a successful response

Throws

When the request fails

Source

chain-connect/src/GalaChainClient.ts:93