Open
Description
Problem
extractPoxAddressFromClarityValue and DelegationInfo define different poxAddress types
Type error like the one below happen when using DelegationInfo and the result of extractPoxAddressFromClarityValue:
Type '{ version: number; hashBytes: Uint8Array; } | undefined' is not assignable to type '{ version: Uint8Array; hashbytes: Uint8Array; } | undefined'.
Solution
Define type PoxAddress as { version: number; hashBytes: Uint8Array; }
and use it everywhere.
Alternatives
- write another extractPoxAddressFromClarityValue2 function that returns a different type - that will confuse developers even more
- define type PoxAddress as
{ version: Uint8Array; hashbytes: Uint8Array; }
- Btc addresses use type number forversion
, therefore PoxAddress should adopt type number as well. PoXAddressVersion uses number as well.
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done