Skip to content

Commit

Permalink
more token fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 3, 2024
1 parent e86a142 commit 1c3cdfb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/js/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ function decode(encoded_token: string) {
*/
function getProofs(decoded_token: Token): WalletProof[] {
if (
!(decoded_token.token.length > 0) ||
!(decoded_token.token[0].proofs.length > 0)
!(decoded_token.proofs.length > 0)
) {
throw new Error("Token format wrong");
}
Expand All @@ -29,8 +28,8 @@ function getMint(decoded_token: Token) {
/*
Returns first mint of a token (very rough way).
*/
if (decoded_token.token != null && decoded_token.token.length > 0) {
return decoded_token.token[0].mint;
if (decoded_token.proofs.length > 0) {
return decoded_token.mint;
} else {
return "";
}
Expand Down

0 comments on commit 1c3cdfb

Please sign in to comment.