2023-05-02 18:19:28 -04:00
|
|
|
import { Relayer, RegularHttpClient } from '@tornado/sdk-web'
|
2023-04-08 15:17:52 -04:00
|
|
|
import * as dotenv from 'dotenv'
|
|
|
|
dotenv.config()
|
2023-04-27 13:34:22 -04:00
|
|
|
|
|
|
|
export async function initializeRelayer(
|
|
|
|
name: string,
|
|
|
|
httpClient = new RegularHttpClient()
|
|
|
|
): Promise<Relayer> {
|
|
|
|
const relayer = new Relayer({
|
|
|
|
url: 'https://' + name,
|
|
|
|
httpClient: httpClient
|
|
|
|
})
|
|
|
|
|
|
|
|
await relayer.fetchProperties()
|
|
|
|
|
|
|
|
return relayer
|
|
|
|
}
|