Skip to content

Commit

Permalink
added support for drep_vkh1
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman committed Nov 15, 2024
1 parent 40bdc47 commit f5c7592
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ export function dRepToMaybeCredentialHex(s: string): ?string {
try {
if (s.startsWith('drep1')) {
if (s.length === 58) {
// CIP129 drep1 encoding is extended value with internal prefix
return maybe(base32ToHex(s), dRepToMaybeCredentialHex);
}
// Pre CIP129 drep1 encoding means same as drep_vkh1 now
return Module.WalletV4.Credential
.from_keyhash(Module.WalletV4.Ed25519KeyHash.from_bech32(s)).to_hex();
}
if (s.startsWith('drep_vkh1')) {
return Module.WalletV4.Credential
.from_keyhash(Module.WalletV4.Ed25519KeyHash.from_bech32(s)).to_hex();
}
Expand Down

0 comments on commit f5c7592

Please sign in to comment.