Skip to main content

Class: PrivateKeySigner

Gala Launchpad SDK 9.0.0-rc.5


Gala Launchpad SDK 9.0.0-rc.5 / index / PrivateKeySigner

Class: PrivateKeySigner

Defined in: packages/launchpad-sdk/dist/signing/signers.d.ts:31

A private-key signer that supports both native GalaChain writes and launchpad bundler typed-data writes.

Example​

const signer = new PrivateKeySigner(`0x${'1'.repeat(64)}`);
const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
console.log(body.signature);

Extends​

  • PrivateKeySigner

Implements​

Constructors​

Constructor​

new PrivateKeySigner(privateKey): PrivateKeySigner

Defined in: packages/launchpad-sdk/dist/signing/signers.d.ts:35

Parameters​

privateKey​

string

Returns​

PrivateKeySigner

Overrides​

CorePrivateKeySigner.constructor

Properties​

walletAddress​

readonly walletAddress: string

Defined in: packages/launchpad-sdk/dist/signing/signers.d.ts:34

The GalaChain identity this key signs for (eth|<checksummed address>, no 0x).

Methods​

signObject()​

signObject<T>(_methodName, dto): Promise<SignedDto<T>>

Defined in: packages/gala-core-sdk/dist/index.d.ts:1358

Signs the DTO with GalaChain native signing.

Type Parameters​

T​

T extends Record<string, unknown>

Parameters​

_methodName​

string

dto​

T

Returns​

Promise<SignedDto<T>>

Example​

const signed = await signer.signObject('RequestTrade', {
token0: 'GALA',
token1: 'GUSDC',
fee: 3000,
});

Implementation of​

LaunchpadSigner.signObject

Inherited from​

CorePrivateKeySigner.signObject


signTypedData()​

signTypedData(method, rawDto): Promise<SignedTypedDataBody>

Defined in: packages/launchpad-sdk/dist/signing/signers.d.ts:43

Sign the same EIP-712 types that the bundler receives.

Parameters​

method​

string

rawDto​

Record<string, unknown>

Returns​

Promise<SignedTypedDataBody>

Example​

const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
console.log(body.domain.name);

Implementation of​

LaunchpadSigner.signTypedData