Generate & Connect New Chain Account

To create a new account, use the NewAccount function. Aleph will create a blockchain account on the chain of your choice and import it as an Account object.

Call the NewAccount() function on the corresponding chain module of your choice:

// FUNCTION SIGNATURE
await ethereum.NewAccount(derivationPath?: "m/44'/60'/0'/0/0")

-----------------------------------------------

//EXAMPLE
import { ethereum } from 'aleph-sdk-ts'

account = await ethereum.NewAccount()

// --> RETURNS THE ACCOUNT OBJECT
{ address: '<Address generated>',
  publicKey: '<PUBLIC KEY>',
  wallet: { } }

Some of the chains allow for passing extra parameters to create the blockchain account. Below you will find a table of the optional parameters.

ChainParametersDefault value

Ethereum

derivationPath

"m/44'/60'/0'/0/0"

Last updated