Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

Utility for converting bip32 to addressN closes #4 #12

Merged
merged 3 commits into from
Jan 21, 2019

Conversation

spiceboi
Copy link
Contributor

No description provided.

Copy link
Contributor

@keepkeyjon keepkeyjon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

address = address.slice(1, address.length)
return address.split('/').filter(part => part.length).map(part => {
const insertHarden = part.indexOf(`'`) > -1
const num = parseFloat(part)
return insertHarden ? harden | num : num
})
}

export function bip32Like (address: string): boolean {
return address.slice(0, 2) === 'm/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a regex instead? something like ^m(\/|(\/[0-9]+'?)*$ (though that's not exactly right)

@spiceboi spiceboi merged commit 28ffddb into master Jan 21, 2019
@spiceboi spiceboi deleted the issue-#4/utility-for-bip32-to-addressn branch January 21, 2019 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants