Skip to content

Commit

Permalink
chore: fix weird ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Sep 8, 2023
1 parent 2e768f4 commit 056835d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/query/stacks/bns/bns.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ async function fetchBnsxName(client: StacksClient, address: string): Promise<str
});
if (!res.okay || !res.result) return null;
const { result } = res;
const cv = deserializeCV(result) ;
const cv = deserializeCV(result) as OptionalCV<
TupleCV<{ name: BufferCV; namespace: BufferCV }>
>;
if (cv.type === ClarityType.OptionalNone) return null;
const { name, namespace } = cv.value.data;
const fullName = `${bytesToAscii(name.buffer)}.${bytesToAscii(namespace.buffer)}`;
Expand Down Expand Up @@ -81,7 +83,7 @@ async function fetchBnsxOwner(client: StacksClient, fqn: string): Promise<string

if (!res.okay || !res.result) return null;
const { result } = res;
const cv = deserializeCV(result) ;
const cv = deserializeCV(result) as OptionalCV<TupleCV<{ owner: PrincipalCV; id: UIntCV }>>;
if (cv.type === ClarityType.OptionalNone) return null;
const ownerCV = cv.value.data.owner;
return principalToString(ownerCV);
Expand Down

0 comments on commit 056835d

Please sign in to comment.