You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 for version, therefore PoxAddress should adopt type number as well. PoXAddressVersion uses number as well.
The text was updated successfully, but these errors were encountered:
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
{ version: Uint8Array; hashbytes: Uint8Array; }
- Btc addresses use type number forversion
, therefore PoxAddress should adopt type number as well. PoXAddressVersion uses number as well.The text was updated successfully, but these errors were encountered: