Skip to content

@gala-chain/connectAPI


API > SigningClient

Class: SigningClient

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 SigningClient(privateKey, options)

new SigningClient(privateKey, options?): SigningClient

Parameters

privateKey: string

options?: GalaChainProviderOptions

Overrides

CustomClient.constructor

Source

chain-connect/src/customClients/SigningClient.ts:42

Properties

options

protected options?: GalaChainProviderOptions

Configuration options for the provider

Inherited from

CustomClient.options

Source

chain-connect/src/GalaChainClient.ts:58


wallet

private wallet: Wallet

Source

chain-connect/src/customClients/SigningClient.ts:40

Accessors

ethereumAddress

get ethereumAddress(): string

The Ethereum address associated with this client

Source

chain-connect/src/customClients/SigningClient.ts:24


galaChainAddress

get galaChainAddress(): string

The GalaChain address associated with this client

Source

chain-connect/src/customClients/SigningClient.ts:28

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

Inherited from

CustomClient.calculatePersonalSignPrefix

Source

chain-connect/src/GalaChainClient.ts:200


getPublicKey()

getPublicKey(): Promise\<object>

Retrieves the public key and recovered address for the client.

Returns

Promise resolving to public key and recovered address

Overrides

CustomClient.getPublicKey

Source

chain-connect/src/customClients/SigningClient.ts:32


sign()

sign\<U>(method, payload, signingType): Promise\<U & object>

Signs a payload using the provider's signing mechanism.

Type parameters

U extends object

Parameters

method: string

The method name being called

payload: U

The data transfer object to sign

signingType: SigningType= undefined

Optional signing type override

Returns

The signed payload with signature and optional prefix

Overrides

CustomClient.sign

Source

chain-connect/src/customClients/SigningClient.ts:47


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

CustomClient.submit

Throws

When the request fails

Source

chain-connect/src/GalaChainClient.ts:93