Existing blockchain accounts can be imported through the library in an Account object to allow for the use of the private key to sign messages.
Different options are available to make the connection:
the chain account private key
the chain account secret phrase
Not all options are available on each chain module. Please refer below to see the connecting methods available for the needed chain.
From Private key or Mnemonics
You can connect with any existing blockchain account by using the relevant import function and passing in either the private key or the mnemonics of the account depending on the chain used.
// FUNCTION SIGNATUREawaitethereum.ImportAccountFromMnemonic(mnemonic: null, derivationPath: "m/44'/60'/0'/0/0")-----------------------// EXAMPLE FROM MNEMONICSimport { ethereum } from'aleph-js'account =awaitethereum.ImportAccountFromMnemonic('<Your Mnemonic Here>')----------------------------------------------------------------------------------------------------------------------------------// FUNCTION SIGNATUREawaitethereum.ImportAccountFromPrivateKey(privateKey: null)-----------------------// EXAMPLE FROM PRIVATE KEYimport { ethereum } from'aleph-sdk-ts/accounts'account =awaitethereum.ImportAccountFromPrivateKey('<Your Private Key Here>')// RETURNS THE ACCOUNT OBJECT{ public_key:'<PUBLIC KEY>', address:'<ADDRESS>', wallet: <Walletobject { }>}
// FUNCTION SIGNATUREawaitsolana.ImportAccountFromPrivateKey(privateKey: null)-----------------------------------------------------------// EXAMPLE FROM PRIVATE KEYimport { solana } from'aleph-sdk-ts/accounts'// Import account from private keyaccount =awaitsolana.ImportAccountFromPrivateKey('<Your Private Key>')// RETURNS THE ACCOUNT OBJECT{ public_key:'<PUBLIC KEY>', address:'<ADDRESS>', wallet: <Walletobject { }>}