@@ -3,7 +3,6 @@ import graphqlFields from 'graphql-fields';
3
3
import castArray from 'lodash/castArray' ;
4
4
import intersection from 'lodash/intersection' ;
5
5
import uniq from 'lodash/uniq' ;
6
- import fetch from 'node-fetch' ;
7
6
import db from '../helpers/mysql' ;
8
7
import { spacesMetadata } from '../helpers/spaces' ;
9
8
import { jsonParse } from '../helpers/utils' ;
@@ -531,18 +530,21 @@ async function getControllerDomains(address: string): Promise<string[]> {
531
530
} ;
532
531
533
532
try {
534
- const response = await fetch ( process . env . STAMP_URL ?? 'https://stamp.fyi' , {
535
- method : 'POST' ,
536
- headers : {
537
- Accept : 'application/json' ,
538
- 'Content-Type' : 'application/json'
539
- } ,
540
- body : JSON . stringify ( {
541
- method : 'lookup_domains' ,
542
- params : address ,
543
- network : network === 'testnet' ? [ '11155111' , '157' ] : [ '1' , '109' ]
544
- } )
545
- } ) ;
533
+ const response = await snapshot . utils . fetch (
534
+ process . env . STAMP_URL ?? 'https://stamp.fyi' ,
535
+ {
536
+ method : 'POST' ,
537
+ headers : {
538
+ Accept : 'application/json' ,
539
+ 'Content-Type' : 'application/json'
540
+ } ,
541
+ body : JSON . stringify ( {
542
+ method : 'lookup_domains' ,
543
+ params : address ,
544
+ network : network === 'testnet' ? [ '11155111' , '157' ] : [ '1' , '109' ]
545
+ } )
546
+ } as any
547
+ ) ;
546
548
const { result, error } = ( await response . json ( ) ) as JsonRpcResponse ;
547
549
548
550
if ( error ) throw new PublicError ( "Failed to resolve controller's domains" ) ;
0 commit comments