Skip to content

@gala-chain/connectAPI


API > WalletUtils

Class: WalletUtils

Contents

Constructors

new WalletUtils()

new WalletUtils(): WalletUtils

Methods

createAndRegisterRandomWallet()

static createAndRegisterRandomWallet(uri): Promise\<object>

Registers a new wallet.

Parameters

uri: string

The URI to register the wallet.

Usage:

  • For Stage: https://stage-galaswap.gala.com/v1/CreateHeadlessWallet
  • For Prod: https://api-galaswap.gala.com/v1/CreateHeadlessWallet

Source

chain-connect/src/utils/WalletUtils.ts:74


createRandom()

static createRandom(): object

Returns

ethAddress

ethAddress: string = wallet.address

galachainAddress

galachainAddress: string

mnemonic

mnemonic: null | Mnemonic = wallet.mnemonic

privateKey

privateKey: string = wallet.privateKey

publicKey

publicKey: string = wallet.publicKey

Source

chain-connect/src/utils/WalletUtils.ts:20


registerWallet()

static registerWallet(uri, walletPublicKey): Promise\<string>

Registers a new wallet.

Parameters

uri: string

The URI to register the wallet.

walletPublicKey: string

The public key of the wallet to be registered.

Usage:

  • For Stage: https://dex-api-platform-dex-stage-gala.gala.com/v1/CreateHeadlessWallet
  • For Prod: https://api-galaswap.gala.com/v1/CreateHeadlessWallet

Returns

  • A promise that resolves to a success message if the wallet is registered successfully, or an error message otherwise.

Source

chain-connect/src/utils/WalletUtils.ts:44