@@ -40,7 +40,7 @@ export const CUSTOM_CHAIN_MAP = new Map<number, Chain>();
4040 * @chain
4141 */
4242export function defineChain (
43- options : number | ChainOptions | ViemChain | LegacyChain
43+ options : number | ChainOptions | ViemChain | LegacyChain ,
4444) : Chain {
4545 const RPC_URL = getThirdwebDomains ( ) . rpc ;
4646 if ( typeof options === "number" ) {
@@ -97,7 +97,7 @@ export function getCachedChainIfExists(id: number) {
9797}
9898
9999function isLegacyChain (
100- chain : ChainOptions | ViemChain | LegacyChain
100+ chain : ChainOptions | ViemChain | LegacyChain ,
101101) : chain is LegacyChain {
102102 return "rpc" in chain && Array . isArray ( chain . rpc ) && "slug" in chain ;
103103}
@@ -128,7 +128,7 @@ export function convertLegacyChain(legacyChain: LegacyChain): Chain {
128128}
129129
130130function isViemChain (
131- chain : ChainOptions | ViemChain | LegacyChain
131+ chain : ChainOptions | ViemChain | LegacyChain ,
132132) : chain is ViemChain {
133133 return "rpcUrls" in chain && ! ( "rpc" in chain ) ;
134134}
@@ -192,7 +192,7 @@ export function getRpcUrlForChain(options: GetRpcUrlForChainOptions): string {
192192 // add on the client ID to the RPC URL if it's a thirdweb URL
193193 if ( isThirdwebUrl ( rpc ) ) {
194194 const rpcUrl = new URL (
195- options . chain . rpc . replace ( DEFAULT_RPC_URL , baseRpcUrl )
195+ options . chain . rpc . replace ( DEFAULT_RPC_URL , baseRpcUrl ) ,
196196 ) ;
197197 if ( rpcUrl . pathname === "/" || rpcUrl . pathname . startsWith ( "/$" ) ) {
198198 rpcUrl . pathname = `/${ options . client . clientId } ` ;
@@ -250,7 +250,7 @@ export async function getChainDecimals(chain: Chain): Promise<number> {
250250 * @internal
251251 */
252252export async function getChainNativeCurrencyName (
253- chain : Chain
253+ chain : Chain ,
254254) : Promise < string > {
255255 if ( ! chain . nativeCurrency ?. name ) {
256256 return getChainMetadata ( chain )
@@ -293,11 +293,11 @@ export function getChainMetadata(chain: Chain): Promise<ChainMetadata> {
293293 async ( ) => {
294294 try {
295295 const res = await fetch (
296- `https://api.thirdweb.com/v1/chains/${ chainId } `
296+ `https://api.thirdweb.com/v1/chains/${ chainId } ` ,
297297 ) ;
298298 if ( ! res . ok ) {
299299 throw new Error (
300- `Failed to fetch chain data for chainId ${ chainId } . ${ res . status } ${ res . statusText } `
300+ `Failed to fetch chain data for chainId ${ chainId } . ${ res . status } ${ res . statusText } ` ,
301301 ) ;
302302 }
303303
@@ -319,7 +319,7 @@ export function getChainMetadata(chain: Chain): Promise<ChainMetadata> {
319319 {
320320 cacheKey : `chain:${ chainId } ` ,
321321 cacheTime : 5 * 60 * 1000 , // 5 minutes
322- }
322+ } ,
323323 ) ;
324324}
325325
@@ -354,11 +354,11 @@ export function getChainServices(chain: Chain): Promise<ChainService[]> {
354354 async ( ) => {
355355 try {
356356 const res = await fetch (
357- `https://api.thirdweb.com/v1/chains/${ chainId } /services`
357+ `https://api.thirdweb.com/v1/chains/${ chainId } /services` ,
358358 ) ;
359359 if ( ! res . ok ) {
360360 throw new Error (
361- `Failed to fetch services for chainId ${ chainId } . ${ res . status } ${ res . statusText } `
361+ `Failed to fetch services for chainId ${ chainId } . ${ res . status } ${ res . statusText } ` ,
362362 ) ;
363363 }
364364
@@ -380,19 +380,19 @@ export function getChainServices(chain: Chain): Promise<ChainService[]> {
380380 {
381381 cacheKey : `chain:${ chainId } :services` ,
382382 cacheTime : 24 * 60 * 60 * 1000 , // 1 day
383- }
383+ } ,
384384 ) ;
385385}
386386
387387export async function getInsightEnabledChainIds ( ) : Promise < number [ ] > {
388388 return withCache (
389389 async ( ) => {
390390 const res = await fetch (
391- `https://api.thirdweb.com/v1/chains/services?service=insight`
391+ `https://api.thirdweb.com/v1/chains/services?service=insight` ,
392392 ) ;
393393 if ( ! res . ok ) {
394394 throw new Error (
395- `Failed to fetch services. ${ res . status } ${ res . statusText } `
395+ `Failed to fetch services. ${ res . status } ${ res . statusText } ` ,
396396 ) ;
397397 }
398398 const response = ( await res . json ( ) ) as { data : Record < number , boolean > } ;
@@ -401,7 +401,7 @@ export async function getInsightEnabledChainIds(): Promise<number[]> {
401401 {
402402 cacheKey : `chain:insight-enabled` ,
403403 cacheTime : 24 * 60 * 60 * 1000 , // 1 day
404- }
404+ } ,
405405 ) ;
406406}
407407
@@ -430,7 +430,7 @@ export function convertApiChainToChain(apiChain: ChainMetadata): Chain {
430430
431431function createChainMetadata (
432432 chain : Chain ,
433- data ?: ChainMetadata
433+ data ?: ChainMetadata ,
434434) : ChainMetadata {
435435 const nativeCurrency = chain . nativeCurrency
436436 ? {
0 commit comments