Skip to content

Creit-Tech/Stellar-SEP-0005-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stellar SEP-0005

A key derivation library for Stellar following SEP-0005 based on the popular library stellar-hd-wallet.

Why making a new library? Because the library stellar-hd-wallet uses Node.js features and so it is not compatible with some frameworks and environments if you don't use a polyfill (like Angular, Deno, Vanilla JS, etc.)

Install

# Node
npx jsr add @creit-tech/stellar-sep-0005

# Deno
deno add jsr:@creit-tech/stellar-sep-0005

You can check more installation options in the JSR package.

How to use

import { Keypair } from "@stellar/stellar-sdk";
import { deriveAccount, generateMnemonic, seedFromMnemonic } from "@creit-tech/stellar-sep-0005";

const mnemonic: string = generateMnemonic();
const seed: Uint8Array = await seedFromMnemonic({ mnemonic });
const rawEd25519Seed: Uint8Array = await deriveAccount({ seed, account: 0 });
const keypair: Keypair = Keypair.fromRawEd25519Seed(rawEd25519Seed as any);

Note: In our example we use as any to ignore the Typescript error saying Uint8Array is missing Buffer features, for the Keypair.fromRawEd25519Seed case those are not used so it's safe to ignore the alert.

License

Licensed under the MIT License, Copyright © 2025-present Creit Tech.

Check out the LICENSE.md file for more details.

About

Javascript library for Stellar SEP-0005 without needing NodeJS features.

Resources

License

Stars

Watchers

Forks

Packages

No packages published