Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Decred. #230

Merged
merged 1 commit into from
Sep 9, 2019
Merged

Add support for Decred. #230

merged 1 commit into from
Sep 9, 2019

Conversation

jholdstock
Copy link
Contributor

@jholdstock jholdstock commented Sep 8, 2019

This pull request adds full support for Decred.

Decred does not support p2wkh addresses as it already had a malleability fix upon launch. The only supported address type in dcrlnd right now is p2pkh, so this PR adds a AddressType for each supported currency to utils/constants.ts. The AddressType is passed to newaddress RPC.

Copy link
Member

@wbobeirne wbobeirne left a comment

Choose a reason for hiding this comment

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

Looks great, I'll probably follow up with a minor refactor of AddressType on my own. Thanks for the contribution, and good luck with your work on Lightning!

@@ -3,7 +3,7 @@ export type Macaroon = string;

export type Response<T> = Promise<T>;

export type AddressType = 'np2wkh' | 'p2wkh';
export type AddressType = '0' | '2';
Copy link
Member

Choose a reason for hiding this comment

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

Ah thanks for this, wasn't sure why it didn't like these string args. This is likely a bug on LND's side, as they document it as being a string argument, and the CLI takes in those strings: https://api.lightning.community/rest/index.html#v1-newaddress

I would prefer these become enums so we're not passing around magic numbers, but I nothing that needs to happen in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://api.lightning.community/#addresstype

This is where I got the idea to try integers

},
testnet: {
tx: 'https://testnet.decred.org/tx/$TX_ID',
block: 'https://testnet.decred.org/block/$BLOCK_ID',
Copy link
Member

Choose a reason for hiding this comment

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

I noticed y'all don't have a privacy policy. Not merge blocking by any means, but it'd be nice to know if / how you're using user data when they visit your explorer.

@wbobeirne wbobeirne merged commit 53f10b4 into joule-labs:develop Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants