@@ -3,7 +3,6 @@ import type { Metadata } from "next";
33import Image from "next/image" ;
44import { Bridge , defineChain , toTokens } from "thirdweb" ;
55import { getChainMetadata } from "thirdweb/chains" ;
6- import { resolveScheme } from "thirdweb/storage" ;
76import { shortenAddress } from "thirdweb/utils" ;
87import { getPaymentLink } from "@/api/universal-bridge/links" ;
98import { Badge } from "@/components/ui/badge" ;
@@ -14,6 +13,7 @@ import {
1413} from "@/constants/server-envs" ;
1514import { getConfiguredThirdwebClient } from "@/constants/thirdweb.server" ;
1615import { resolveEns } from "@/lib/ens" ;
16+ import { resolveSchemeWithErrorHandler } from "@/utils/resolveSchemeWithErrorHandler" ;
1717import { PayPageWidget } from "../components/client/PayPageWidget.client" ;
1818import { payAppThirdwebClient } from "../constants" ;
1919
@@ -55,6 +55,7 @@ export default async function PayPage({
5555 } ) ;
5656
5757 const chainPromise = getChainMetadata (
58+ // eslint-disable-next-line no-restricted-syntax
5859 defineChain ( Number ( paymentLink . destinationToken . chainId ) ) ,
5960 ) ;
6061
@@ -86,10 +87,12 @@ export default async function PayPage({
8687 < div className = "flex flex-row items-center justify-start gap-4" >
8788 { projectMetadata . image && (
8889 < Image
89- src = { resolveScheme ( {
90- uri : projectMetadata . image ,
91- client : payAppThirdwebClient ,
92- } ) }
90+ src = {
91+ resolveSchemeWithErrorHandler ( {
92+ uri : projectMetadata . image ,
93+ client : payAppThirdwebClient ,
94+ } ) || ""
95+ }
9396 alt = { projectMetadata . name }
9497 width = { 25 }
9598 height = { 25 }
@@ -113,7 +116,7 @@ export default async function PayPage({
113116 < div className = "flex flex-row items-center gap-2" >
114117 { token . iconUri && (
115118 < img
116- src = { resolveScheme ( {
119+ src = { resolveSchemeWithErrorHandler ( {
117120 uri : token . iconUri ,
118121 client : getConfiguredThirdwebClient ( {
119122 secretKey : DASHBOARD_THIRDWEB_SECRET_KEY ,
@@ -129,11 +132,11 @@ export default async function PayPage({
129132 { toTokens ( BigInt ( paymentLink . amount ) , token . decimals ) } { " " }
130133 { token . symbol }
131134 </ div >
132- { token . prices [ " USD" ] && (
135+ { token . prices . USD && (
133136 < span >
134137 $
135138 { (
136- Number ( token . prices [ " USD" ] ) *
139+ Number ( token . prices . USD ) *
137140 Number (
138141 toTokens ( BigInt ( paymentLink . amount ) , token . decimals ) ,
139142 )
@@ -150,7 +153,7 @@ export default async function PayPage({
150153 < div className = "flex flex-row items-center gap-2" >
151154 { chain . icon ?. url && (
152155 < img
153- src = { resolveScheme ( {
156+ src = { resolveSchemeWithErrorHandler ( {
154157 uri : chain . icon . url ,
155158 client : getConfiguredThirdwebClient ( {
156159 secretKey : DASHBOARD_THIRDWEB_SECRET_KEY ,
0 commit comments