-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update PR with debug build ci: remove slackbot notifications
- Loading branch information
1 parent
4a4cfe4
commit 9f7a565
Showing
5 changed files
with
40 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { AddressHashMode } from '@stacks/transactions'; | ||
import BN from 'bn.js'; | ||
import { address } from 'bitcoinjs-lib'; | ||
|
||
const poxKeyToVersionBytesMap = { | ||
[AddressHashMode.SerializeP2PKH]: 0, | ||
[AddressHashMode.SerializeP2SH]: 5, | ||
}; | ||
|
||
interface ConvertToPoxAddressBtc { | ||
version: Buffer; | ||
hashbytes: Buffer; | ||
} | ||
export function convertPoxAddressToBtc({ version, hashbytes }: ConvertToPoxAddressBtc) { | ||
const ver = new BN(version).toNumber(); | ||
if (ver === AddressHashMode.SerializeP2WPKH || ver === AddressHashMode.SerializeP2WSH) return ''; | ||
return address.toBase58Check(hashbytes, (poxKeyToVersionBytesMap as any)[ver]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters