Skip to content

Commit

Permalink
Prepare for jsr publish
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jan 3, 2025
1 parent 279b7c2 commit bb8cdde
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 13 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish package to jsr
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- run: npm install -g jsr
- run: jsr publish
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ See [key-producer](https://github.com/paulmillr/micro-key-producer) if you need

> npm install @scure/bip32
> deno add @scure/bip32
> deno doc @scure/bip32 # command-line documentation
This module exports a single class `HDKey`, which should be used like this:

```ts
Expand Down
18 changes: 18 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* BIP32 hierarchical deterministic (HD) wallets over secp256k1.
* @example
import { HDKey } from "@scure/bip32";
const hdkey1 = HDKey.fromMasterSeed(seed);
const hdkey2 = HDKey.fromExtendedKey(base58key);
const hdkey3 = HDKey.fromJSON({ xpriv: string });
// props
[hdkey1.depth, hdkey1.index, hdkey1.chainCode];
console.log(hdkey2.privateKey, hdkey2.publicKey);
console.log(hdkey3.derive("m/0/2147483647'/1"));
const sig = hdkey3.sign(hash);
hdkey3.verify(hash, sig);
* @module
*/
/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
import { hmac } from '@noble/hashes/hmac';
import { ripemd160 } from '@noble/hashes/ripemd160';
Expand Down
20 changes: 20 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@scure/bip32",
"version": "1.6.0",
"exports": {
".": "./index.ts"
},
"imports": {
"@noble/curves": "jsr:@noble/curves@1.8.0",
"@noble/hashes": "jsr:@noble/hashes@1.7.0"
},
"publish": {
"include": [
"index.ts",
"jsr.json",
"LICENSE",
"README.md"
]
},
"license": "MIT"
}
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
}
},
"dependencies": {
"@noble/curves": "~1.7.0",
"@noble/hashes": "~1.6.0",
"@noble/curves": "~1.8.0",
"@noble/hashes": "~1.7.0",
"@scure/base": "~1.2.1"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"module": "es2020",
"moduleResolution": "bundler",
"outDir": "lib/esm"
"outDir": "lib/esm",
"isolatedDeclarations": true
},
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "@paulmillr/jsbt/tsconfig.cjs.json",
"compilerOptions": {
"outDir": "lib"
"outDir": "lib",
"isolatedDeclarations": true
},
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
Expand Down

0 comments on commit bb8cdde

Please sign in to comment.