diff --git a/.github/workflows/bundle-and-deploy.yml b/.github/workflows/bundle-and-deploy.yml index 37af0101..b5278d7d 100644 --- a/.github/workflows/bundle-and-deploy.yml +++ b/.github/workflows/bundle-and-deploy.yml @@ -27,6 +27,14 @@ jobs: cache: 'yarn' - run: yarn install --frozen-lockfile - run: yarn bundle + - env: + ETH_PROVIDER_URL_MAINNET: ${{ secrets.ETH_PROVIDER_URL_MAINNET }} + ETH_PROVIDER_URL_TESTNET: ${{ secrets.ETH_PROVIDER_URL_TESTNET }} + BNB_PROVIDER_URL_MAINNET: ${{ secrets.BNB_PROVIDER_URL_MAINNET }} + BNB_PROVIDER_URL_TESTNET: ${{ secrets.BNB_PROVIDER_URL_TESTNET }} + BTC_PROVIDER_URL_MAINNET: ${{ secrets.BTC_PROVIDER_URL_MAINNET }} + BTC_PROVIDER_URL_TESTNET: ${{ secrets.BTC_PROVIDER_URL_TESTNET }} + - uses: google-github-actions/setup-gcloud@v1 - uses: google-github-actions/auth@v1 with: diff --git a/packages/near-fast-auth-signer/README.md b/packages/near-fast-auth-signer/README.md index edf49c4b..a1f2e911 100644 --- a/packages/near-fast-auth-signer/README.md +++ b/packages/near-fast-auth-signer/README.md @@ -48,3 +48,16 @@ yarn start - Navigates to the appropate UI route (/login) - Returns true if login was successful - Throws error if failed or cancelled by user + + +### Provider URLs +To configure provider urls, configure following environment variables. For local development, simply create `.env` on root directory and configure environment variables. + +```bash +ETH_PROVIDER_URL_MAINNET='' +ETH_PROVIDER_URL_TESTNET='' +BNB_PROVIDER_URL_MAINNET='' +BNB_PROVIDER_URL_TESTNET='' +BTC_PROVIDER_URL_MAINNET='' +BTC_PROVIDER_URL_TESTNET='' +``` \ No newline at end of file diff --git a/packages/near-fast-auth-signer/src/components/SignMultichain/utils.ts b/packages/near-fast-auth-signer/src/components/SignMultichain/utils.ts index ce8b1ae3..d3d6742d 100644 --- a/packages/near-fast-auth-signer/src/components/SignMultichain/utils.ts +++ b/packages/near-fast-auth-signer/src/components/SignMultichain/utils.ts @@ -72,15 +72,15 @@ const FAST_AUTH_RELAYER_URL = 'https://near-relayer-testnet.stage.api.pagoda.co' const CHAIN_CONFIG: ChainMap = { ETH: { - providerUrl: 'https://sepolia.infura.io/v3/6df51ccaa17f4e078325b5050da5a2dd', + providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.ETH_PROVIDER_URL_MAINNET : process.env.ETH_PROVIDER_URL_TESTNET, }, BNB: { - providerUrl: 'https://data-seed-prebsc-1-s1.bnbchain.org:8545', + providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.BNB_PROVIDER_URL_MAINNET : process.env.BNB_PROVIDER_URL_TESTNET, }, BTC: { - networkType: 'testnet', + networkType: environment.NETWORK_ID || 'testnet', // API ref: https://github.com/Blockstream/esplora/blob/master/API.md - providerUrl: 'https://blockstream.info/testnet/api/', + providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.BTC_PROVIDER_URL_MAINNET : process.env.BTC_PROVIDER_URL_TESTNET, }, };