diff --git a/packages/account/src/api/index.ts b/packages/account/src/api/index.ts index f216f884..0578f9bd 100644 --- a/packages/account/src/api/index.ts +++ b/packages/account/src/api/index.ts @@ -13,7 +13,7 @@ export class AccountClient extends BaseApiClient { } protected getApiUrl(): string { - return process.env.DEFENDER_API_URL ?? 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL ?? 'https://defender-api.openzeppelin.com/'; } public async getUsage(params?: { date?: string | Date; quotas: string[] }): Promise { diff --git a/packages/action/src/api.ts b/packages/action/src/api.ts index 87dc0f56..eadbb197 100644 --- a/packages/action/src/api.ts +++ b/packages/action/src/api.ts @@ -33,8 +33,7 @@ export class ActionClient extends BaseApiClient { } protected getApiUrl(): string { - // TODO: update to /action when available - return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; } public async list(): Promise { diff --git a/packages/deploy/src/api/index.ts b/packages/deploy/src/api/index.ts index d3e6babc..3774efe4 100644 --- a/packages/deploy/src/api/index.ts +++ b/packages/deploy/src/api/index.ts @@ -28,7 +28,7 @@ export class DeployClient extends BaseApiClient { } protected getApiUrl(): string { - return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; } public async deployContract(params: DeployContractRequest): Promise { diff --git a/packages/network/src/api/index.ts b/packages/network/src/api/index.ts index 1c867bf6..1b453f98 100644 --- a/packages/network/src/api/index.ts +++ b/packages/network/src/api/index.ts @@ -22,8 +22,7 @@ export class NetworkClient extends BaseApiClient { } protected getApiUrl(): string { - // TODO: update to /monitor when available - return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; } public async listSupportedNetworks(params?: ListNetworkRequestOptions): Promise { diff --git a/packages/proposal/src/api/index.ts b/packages/proposal/src/api/index.ts index 600cd7e3..c9806b87 100644 --- a/packages/proposal/src/api/index.ts +++ b/packages/proposal/src/api/index.ts @@ -27,7 +27,7 @@ export class ProposalClient extends BaseApiClient { } protected getApiUrl(): string { - return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; } public async addContract(contract: Contract): Promise { diff --git a/packages/relay-signer/src/api/index.ts b/packages/relay-signer/src/api/index.ts index 9444c5f7..4f7f404a 100644 --- a/packages/relay-signer/src/api/index.ts +++ b/packages/relay-signer/src/api/index.ts @@ -17,9 +17,7 @@ import { import { JsonRpcResponse, SignMessagePayload, SignTypedDataPayload, SignedMessagePayload } from '../models/rpc'; import { AuthType } from '@openzeppelin/defender-sdk-base-client/lib/api/auth-v2'; -export const getAdminApiUrl = () => process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; - -export const getRelaySignerApiUrl = () => process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; +export const getApiUrl = () => process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; export class RelaySignerClient extends BaseApiClient implements IRelayer { private jsonRpcRequestNextId: number; @@ -38,7 +36,7 @@ export class RelaySignerClient extends BaseApiClient implements IRelayer { } protected getApiUrl(type?: AuthType): string { - return getAdminApiUrl(); + return getApiUrl(); } public async getRelayer(): Promise { diff --git a/packages/relay-signer/src/ethers/provider-v5.ts b/packages/relay-signer/src/ethers/provider-v5.ts index f72e0af2..9e42c015 100644 --- a/packages/relay-signer/src/ethers/provider-v5.ts +++ b/packages/relay-signer/src/ethers/provider-v5.ts @@ -4,14 +4,14 @@ import { DefenderRelaySignerV5 } from './signer-v5'; import { defineReadOnly, getStatic } from '@ethersproject/properties'; import { Networkish } from '@ethersproject/networks'; import { BigNumber } from '@ethersproject/bignumber'; -import { getRelaySignerApiUrl } from '../api'; import { Relayer } from '../relayer'; +import { getApiUrl } from '../api'; export class DefenderRelayProviderV5 extends StaticJsonRpcProvider { private relayer: Relayer; constructor(readonly credentials: RelayerParams) { - super(getRelaySignerApiUrl()); + super(getApiUrl()); this.relayer = new Relayer(credentials); } diff --git a/packages/relay-signer/src/ethers/provider.ts b/packages/relay-signer/src/ethers/provider.ts index 00aa2932..a4379e2a 100644 --- a/packages/relay-signer/src/ethers/provider.ts +++ b/packages/relay-signer/src/ethers/provider.ts @@ -1,6 +1,6 @@ import { EthersVersion, RelayerParams } from '../models/relayer'; import { DefenderRelaySigner } from './signer'; -import { getRelaySignerApiUrl } from '../api'; +import { getApiUrl } from '../api'; import { Relayer } from '../relayer'; import { JsonRpcError, @@ -22,7 +22,7 @@ export class DefenderRelayProvider extends JsonRpcProvider { private pendingNetwork: Promise | null = null; constructor(readonly credentials: RelayerParams) { - super(getRelaySignerApiUrl()); + super(getApiUrl()); this.relayer = new Relayer(credentials); } diff --git a/packages/relay/src/api/index.ts b/packages/relay/src/api/index.ts index c40e87b4..46de4b1d 100644 --- a/packages/relay/src/api/index.ts +++ b/packages/relay/src/api/index.ts @@ -20,7 +20,7 @@ export class RelayClient extends BaseApiClient { } protected getApiUrl(): string { - return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/v2/'; + return process.env.DEFENDER_API_URL || 'https://defender-api.openzeppelin.com/'; } public async get(id: string): Promise {