cosmjs-util/packages/launchpad/src/paths.ts
2021-02-10 14:08:31 +01:00

16 lines
399 B
TypeScript

import { HdPath, Slip10RawIndex } from "@cosmjs/crypto";
/**
* The Cosmos Hub derivation path in the form `m/44'/118'/0'/0/a`
* with 0-based account index `a`.
*/
export function makeCosmoshubPath(a: number): HdPath {
return [
Slip10RawIndex.hardened(44),
Slip10RawIndex.hardened(118),
Slip10RawIndex.hardened(0),
Slip10RawIndex.normal(0),
Slip10RawIndex.normal(a),
];
}