Skip to content

@gala-chain/connectAPI


API > CustomClient

Class: abstract CustomClient

Abstract custom client that extends GalaChain provider with additional client-specific functionality. Provides methods for public key management and address handling.

Contents

Extends

Constructors

new CustomClient(options)

new CustomClient(options?): CustomClient

Creates a new custom client instance.

Parameters

options?: GalaChainProviderOptions

Configuration options for the provider

Overrides

GalaChainProvider.constructor

Source

chain-connect/src/GalaChainClient.ts:178

Properties

abstract ethereumAddress

abstract ethereumAddress: string

The Ethereum address associated with this client

Source

chain-connect/src/GalaChainClient.ts:189


abstract galaChainAddress

abstract galaChainAddress: string

The GalaChain address associated with this client

Source

chain-connect/src/GalaChainClient.ts:192


options

protected options?: GalaChainProviderOptions

Configuration options for the provider

Inherited from

GalaChainProvider.options

Source

chain-connect/src/GalaChainClient.ts:58

Methods

calculatePersonalSignPrefix()

calculatePersonalSignPrefix(payload): string

Calculates the personal sign prefix for a given payload. This is used for Ethereum personal_sign compatibility.

Parameters

payload: object

The payload to calculate prefix for

Returns

The calculated prefix string

Source

chain-connect/src/GalaChainClient.ts:200


abstract getPublicKey()

abstract getPublicKey(): Promise\<object>

Retrieves the public key and recovered address for the client.

Returns

Promise resolving to public key and recovered address

Source

chain-connect/src/GalaChainClient.ts:186


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

Inherited from

GalaChainProvider.sign

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

Inherited from

GalaChainProvider.submit

Throws

When the request fails

Source

chain-connect/src/GalaChainClient.ts:93