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 Jul 3, 2023
1 parent f425455 commit 57615d1
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 @@ -151,13 +151,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 @@ -1338,7 +1336,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 57615d1

Please sign in to comment.