Skip to content

Commit

Permalink
Merge branch 'release/5.18.0' into feature/check-multiple-tokenlist
Browse files Browse the repository at this point in the history
  • Loading branch information
piyalbasu committed Mar 29, 2024
2 parents adc4549 + d00cd85 commit 1f01a17
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions extension/src/popup/components/manageAssets/AddToken/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,21 @@ export const AddToken = () => {
const indexerLookup = async () => {
// lookup contract
setIsVerifiedToken(false);
const tokenUrl = new URL(`${INDEXER_URL}/token-details/${contractId}`);
tokenUrl.searchParams.append("network", networkDetails.network);
tokenUrl.searchParams.append("pub_key", publicKey);
tokenUrl.searchParams.append(
"soroban_url",
networkDetails.sorobanRpcUrl!,
);
const tokenDetailsResponse = await getTokenDetails({
contractId,
publicKey,
networkDetails,
});

const res = await fetch(tokenUrl.href);
const resJson = await res.json();
if (!res.ok) {
throw new Error(JSON.stringify(resJson));
if (!tokenDetailsResponse) {
throw new Error(JSON.stringify(contractId));
} else {
setAssetRows([
{
code: resJson.symbol,
code: tokenDetailsResponse.symbol,
issuer: contractId,
domain: "",
name: resJson.name,
name: tokenDetailsResponse.name,
},
]);
}
Expand Down

0 comments on commit 1f01a17

Please sign in to comment.