From d947b872acce5bb10016304c4de626b1bdcd5ca7 Mon Sep 17 00:00:00 2001 From: janniks Date: Thu, 22 Jun 2023 14:30:57 +0200 Subject: [PATCH] fix!: consolidate poxaddress return types BREAKING CHANGE: Convert `version` of PoXAddress from array to number. --- packages/stacking/src/index.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/stacking/src/index.ts b/packages/stacking/src/index.ts index 6ffb25db6..5bef6a0fd 100644 --- a/packages/stacking/src/index.ts +++ b/packages/stacking/src/index.ts @@ -152,13 +152,11 @@ export type DelegationInfo = details: { amount_micro_stx: bigint; delegated_to: string; - pox_address: - | { - version: Uint8Array; - hashbytes: Uint8Array; - } - | undefined; - until_burn_ht: number | undefined; + pox_address?: { + version: number; + hashbytes: Uint8Array; + }; + until_burn_ht?: number; }; }; @@ -1344,7 +1342,7 @@ export class StackingClient { const delegatedTo = tupleCV.data['delegated-to'] as PrincipalCV; const poxAddress = unwrapMap(tupleCV.data['pox-addr'] as OptionalCV, tuple => ({ - version: (tuple.data['version'] as BufferCV).buffer, + version: (tuple.data['version'] as BufferCV).buffer[0], hashbytes: (tuple.data['hashbytes'] as BufferCV).buffer, })); const untilBurnBlockHeight = unwrap(tupleCV.data['until-burn-ht'] as OptionalCV);