Add fixed url for the backed sdk (#502)

* add testnet url

* hardcode rpc url
This commit is contained in:
nicoshark
2025-04-03 13:22:59 +08:00
committed by GitHub
parent 1f4cc63324
commit 83db48508f
2 changed files with 6 additions and 3 deletions

View File

@@ -19,6 +19,9 @@ import { packForbiddenCountriesList } from '../../../common/src/utils/contracts/
import { Country3LetterCode, commonNames } from '../../../common/src/constants/countries';
import { hashEndpointWithScope } from '../../../common/src/utils/scope';
const CELO_MAINNET_RPC_URL = "https://forno.celo.org";
const CELO_TESTNET_RPC_URL = "https://alfajores-forno.celo-testnet.org";
export class SelfBackendVerifier {
protected scope: string;
protected attestationId: number = 1;
@@ -55,12 +58,12 @@ export class SelfBackendVerifier {
protected mockPassport: boolean;
constructor(
rpcUrl: string,
scope: string,
endpoint: string,
user_identifier_type: UserIdType = 'uuid',
mockPassport: boolean = false
) {
const rpcUrl = mockPassport ? CELO_TESTNET_RPC_URL : CELO_MAINNET_RPC_URL;
const provider = new ethers.JsonRpcProvider(rpcUrl);
const registryAddress = mockPassport ? REGISTRY_ADDRESS_STAGING : REGISTRY_ADDRESS;
const verifyAllAddress = mockPassport ? VERIFYALL_ADDRESS_STAGING : VERIFYALL_ADDRESS;

View File

@@ -1,4 +1,4 @@
export const REGISTRY_ADDRESS = '0x37F5CB8cB1f6B00aa768D8aA99F1A9289802A968';
export const REGISTRY_ADDRESS_STAGING = '0x9AcA2112D34Ef021084264F6f5eef2a99a5bA7b1';
export const REGISTRY_ADDRESS_STAGING = '0xD961B67B35739cCF16326B087C9aD2c0095cCc4E';
export const VERIFYALL_ADDRESS = '0xe6D61680A6ED381bb5A0dB5cF4E9Cc933cF43915';
export const VERIFYALL_ADDRESS_STAGING = '0xFE847E95C9e090Cc34E69ee3A3F7fE8aCacB0328';
export const VERIFYALL_ADDRESS_STAGING = '0x03237E7b4c2b1AdEBdBC33d91478Eaef05D0fF85';