Skip to content

Commit

Permalink
Merge pull request #334 from near/SQAC-173/remove-betanet
Browse files Browse the repository at this point in the history
refactor: Remove `betanet` Network Preset
  • Loading branch information
lewis-sqa authored Jun 27, 2022
2 parents 70918cb + 5879992 commit 73bd137
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const selector = await setupWalletSelector({

## Options

- `network` (`NetworkId | Network`): Network ID or object matching that of your dApp configuration . Network ID can be either `mainnet`, `testnet` or `betanet`.
- `network` (`NetworkId | Network`): Network ID or object matching that of your dApp configuration . Network ID can be either `mainnet` or `testnet`.
- `networkId` (`string`): Custom network ID (e.g. `localnet`).
- `nodeUrl` (`string`): Custom URL for RPC requests.
- `helperUrl` (`string`): Custom URL for creating accounts.
Expand Down
13 changes: 0 additions & 13 deletions packages/core/src/lib/options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ describe("getNetworkPreset", () => {
indexerUrl: "https://testnet-api.kitwallet.app",
});
});

it("returns the correct config for 'betanet'", () => {
const networkId: NetworkId = "betanet";
const network = getNetworkPreset(networkId);

expect(network).toEqual({
networkId,
nodeUrl: "https://rpc.betanet.near.org",
helperUrl: "https://helper.betanet.near.org",
explorerUrl: "https://explorer.betanet.near.org",
indexerUrl: "",
});
});
});

describe("resolveNetwork", () => {
Expand Down
9 changes: 0 additions & 9 deletions packages/core/src/lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ export const getNetworkPreset = (networkId: NetworkId): Network => {
explorerUrl: "https://explorer.testnet.near.org",
indexerUrl: "https://testnet-api.kitwallet.app",
};
case "betanet":
return {
networkId,
nodeUrl: "https://rpc.betanet.near.org",
helperUrl: "https://helper.betanet.near.org",
explorerUrl: "https://explorer.betanet.near.org",
//TODO: Update value with the correct endpoint once it's available.
indexerUrl: "",
};
default:
throw Error(`Failed to find config for: '${networkId}'`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/options.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type NetworkId = "mainnet" | "testnet" | "betanet";
export type NetworkId = "mainnet" | "testnet";

export interface Network {
networkId: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/my-near-wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const selector = await setupWalletSelector({

## Options

- `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required for `betanet` and custom network configuration.
- `walletUrl` (`string?`): Wallet URL used to redirect when signing transactions. This parameter is required for custom network configuration.
- `iconUrl`: (`string?`): Image URL for the icon shown in the modal. This can also be a relative path or base64 encoded image. Defaults to `./assets/my-near-wallet-icon.png`.

## Assets
Expand Down
2 changes: 0 additions & 2 deletions packages/near-wallet/src/lib/near-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const resolveWalletUrl = (network: Network, walletUrl?: string) => {
return "https://wallet.near.org";
case "testnet":
return "https://wallet.testnet.near.org";
case "betanet":
return "https://wallet.betanet.near.org";
default:
throw new Error("Invalid wallet url");
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-connect/src/lib/wallet-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const WalletConnect: WalletBehaviourFactory<

const { networkId } = options.network;

if (["mainnet", "testnet", "betanet"].includes(networkId)) {
if (["mainnet", "testnet"].includes(networkId)) {
return `near:${networkId}`;
}

Expand Down

0 comments on commit 73bd137

Please sign in to comment.