Skip to content

Commit

Permalink
add sapphire mainnet support for ed25519
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu committed May 31, 2024
1 parent 11a4384 commit 9c8d4c6
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/torus.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
INodePub,
LEGACY_NETWORKS_ROUTE_MAP,
METADATA_MAP,
SIGNER_MAP,
TORUS_LEGACY_NETWORK_TYPE,
TORUS_NETWORK_TYPE,
TORUS_SAPPHIRE_NETWORK,
} from "@toruslabs/constants";
import { INodePub, LEGACY_NETWORKS_ROUTE_MAP, METADATA_MAP, SIGNER_MAP, TORUS_LEGACY_NETWORK_TYPE, TORUS_NETWORK_TYPE } from "@toruslabs/constants";
import { setAPIKey, setEmbedHost } from "@toruslabs/http-helpers";
import BN from "bn.js";
import { curve, ec as EC } from "elliptic";
Expand Down Expand Up @@ -67,7 +59,7 @@ class Torus {
}: TorusCtorOptions) {
if (!clientId) throw new Error("Please provide a valid clientId in constructor");
if (!network) throw new Error("Please provide a valid network in constructor");
if (keyType === "ed25519" && network !== TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET) {
if (keyType === "ed25519" && LEGACY_NETWORKS_ROUTE_MAP[network as TORUS_LEGACY_NETWORK_TYPE]) {
throw new Error(`keyType: ${keyType} is not supported by ${network} network`);
}
this.keyType = keyType;
Expand Down

0 comments on commit 9c8d4c6

Please sign in to comment.