2023-05-03 01:19:28 +03:00
|
|
|
import { Relayer, RegularHttpClient } from '@tornado/sdk-web'
|
2023-04-08 22:17:52 +03:00
|
|
|
import * as dotenv from 'dotenv'
|
|
|
|
dotenv.config()
|
2023-04-27 20:34:22 +03: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
|
|
|
|
}
|