@gala-chain/connect ∙ API
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)
- Properties
- options
- wallet
- Accessors
- ethereumAddress
- galaChainAddress
- Methods
- calculatePersonalSignPrefix()
- getPublicKey()
- sign()
- submit()
Extends
Constructors
new SigningClient(privateKey, options)
new SigningClient(
privateKey,options?):SigningClient
Parameters
▪ privateKey: string
▪ options?: GalaChainProviderOptions
Overrides
Source
chain-connect/src/customClients/SigningClient.ts:42
Properties
options
protectedoptions?:GalaChainProviderOptions
Configuration options for the provider
Inherited from
Source
chain-connect/src/GalaChainClient.ts:58
wallet
privatewallet:Wallet
Source
chain-connect/src/customClients/SigningClient.ts:40
Accessors
ethereumAddress
getethereumAddress():string
The Ethereum address associated with this client
Source
chain-connect/src/customClients/SigningClient.ts:24
galaChainAddress
getgalaChainAddress():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
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
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
Throws
When the request fails