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:
Ethereum Solana Substrate
Copy // 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 : { } }
Copy // FUNCTION SIGNATURE
await solana .NewAccount ()
------------------------------------------------
//EXAMPLE
import { solana } from 'aleph-sdk-ts/accounts'
account = await solana .NewAccount ()
// RETURNS THE ACCOUNT OBJECT
{ address : '<ADDRESS>' ,
publicKey : '<PUBLIC KEY>' ,
wallet : { < Wallet object > } }
Copy // FUNCTION SIGNATURE
await substrate .NewAccount ()
------------------------------------------------
//EXAMPLE
import { substrate } from 'aleph-sdk-ts/accounts'
account = await substrate ()
// RETURNS THE ACCOUNT OBJECT
{ address : '<ADDRESS>' ,
publicKey : '<PUBLIC KEY>' ,
wallet : { < Wallet object > } }
Some of the chains allow for passing extra parameters to create the blockchain account. Below you will find a table of the optional parameters.
Chain Parameters Default value