Skip to content

Commit

Permalink
fix!: consolidate poxaddress return types
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Convert `version` of PoXAddress from array to number.
  • Loading branch information
janniks committed Dec 18, 2023
1 parent 20efe27 commit ec42224
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/stacking/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};

Expand Down Expand Up @@ -1344,7 +1342,7 @@ export class StackingClient {
const delegatedTo = tupleCV.data['delegated-to'] as PrincipalCV;

const poxAddress = unwrapMap(tupleCV.data['pox-addr'] as OptionalCV<TupleCV>, 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<UIntCV>);
Expand Down

0 comments on commit ec42224

Please sign in to comment.