Skip to content

Commit 49e9e07

Browse files
committed
Initial commit
0 parents  commit 49e9e07

File tree

9 files changed

+752
-0
lines changed

9 files changed

+752
-0
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+"
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Publish package
19+
run: npx jsr publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

LICENCE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Creit Tech.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8+
persons to whom the Software is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11+
Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Stellar SEP-0005
2+
3+
A key derivation library for Stellar following
4+
[SEP-0005](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md) based on the popular library
5+
[stellar-hd-wallet](https://github.com/chatch/stellar-hd-wallet).
6+
7+
Why making a new library? Because the library `stellar-hd-wallet` uses Node.js features and so it is not compatible with
8+
some frameworks and environments if you don't use a polyfill (like Angular, Deno, Vanilla JS, etc.)
9+
10+
# Install
11+
12+
```shell
13+
# Node
14+
npx jsr add @creit-tech/stellar-sep-0005
15+
16+
# Deno
17+
deno add jsr:@creit-tech/stellar-sep-0005
18+
```
19+
20+
You can check more installation options in the [JSR package](https://jsr.io/@creit-tech/stellar-sep-0005).
21+
22+
# How to use
23+
24+
```typescript
25+
import { Keypair } from "@stellar/stellar-sdk";
26+
import { deriveAccount, generateMnemonic, seedFromMnemonic } from "@creit-tech/stellar-sep-0005";
27+
28+
const mnemonic: string = generateMnemonic();
29+
const seed: Uint8Array = await seedFromMnemonic({ mnemonic });
30+
const rawEd25519Seed: Uint8Array = await deriveAccount({ seed, account: 0 });
31+
const keypair: Keypair = Keypair.fromRawEd25519Seed(rawEd25519Seed as any);
32+
```
33+
34+
> Note: In our example we use `as any` to ignore the Typescript error saying Uint8Array is missing Buffer features, for
35+
> the `Keypair.fromRawEd25519Seed` case those are not used so it's safe to ignore the alert.
36+
37+
## License
38+
39+
![](https://img.shields.io/badge/License-MIT-lightgrey)
40+
41+
Licensed under the MIT License, Copyright © 2025-present Creit Tech.
42+
43+
Check out the `LICENSE.md` file for more details.

deno.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@creit-tech/stellar-sep-0005",
3+
"version": "0.1.0",
4+
"license": "MIT",
5+
"exports": "./main.ts",
6+
"tasks": {
7+
"test": "deno test"
8+
},
9+
"imports": {
10+
"@scure/bip39": "jsr:@scure/bip39@1.6.0",
11+
"@std/assert": "jsr:@std/assert@^1.0.14",
12+
"@std/crypto": "jsr:@std/crypto@^1.0.5",
13+
"@std/encoding": "jsr:@std/encoding@^1.0.10",
14+
"@std/testing": "jsr:@std/testing@^1.0.15",
15+
"@stellar/stellar-sdk": "npm:@stellar/stellar-sdk@^14.0.0"
16+
},
17+
"fmt": {
18+
"lineWidth": 120
19+
},
20+
"lint": {
21+
"rules": {
22+
"tags": ["recommended", "jsr"],
23+
"include": [
24+
"no-sync-fn-in-async-fn",
25+
"single-var-declarator"
26+
]
27+
}
28+
},
29+
"publish": {
30+
"exclude": ["main.test.ts"]
31+
}
32+
}

0 commit comments

Comments
 (0)