diff --git a/scripts/generate-types.js b/scripts/generate-types.js index 760d1cb..176df3b 100644 --- a/scripts/generate-types.js +++ b/scripts/generate-types.js @@ -78,8 +78,8 @@ import { WalletService } from '../services/wallet-service'; signingKey: string; }\n\n`, `export enum WalletTypeEnum { - ED25519 = 'ED25519', - SECP256K1 = 'SECP256K1', + Etherum = 'etherum', + Solana = 'solana', }\n\n`, `export interface JWTData { did: string; diff --git a/src/common/types.ts b/src/common/types.ts index bec1341..41dde2f 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -26,8 +26,8 @@ export interface WalletSignMessageType { } export enum WalletTypeEnum { - ED25519 = 'ED25519', - SECP256K1 = 'SECP256K1', + Etherum = 'etherum', + Solana = 'solana', } export interface JWTData { diff --git a/src/helpers/helper.ts b/src/helpers/helper.ts index d13eb04..86372f4 100644 --- a/src/helpers/helper.ts +++ b/src/helpers/helper.ts @@ -46,9 +46,10 @@ export const parameterChecker = ( throw new Error('Need jwt or private key'); } - const urls = ['https://dev.api.gateway.tech']; + const urls = ['https://dev.api.gateway.tech', 'https://api.gateway.tech']; if (environment === 'dev') return { url: urls[0], mode, value }; + else if (environment === 'prod') return { url: urls[1], mode, value }; else throw new Error('No valid url found!. Use sandbox or production url'); }; diff --git a/src/services/wallet-service.ts b/src/services/wallet-service.ts index 9561557..3296081 100644 --- a/src/services/wallet-service.ts +++ b/src/services/wallet-service.ts @@ -16,9 +16,9 @@ export class WalletService { walletType?: WalletTypeEnum | undefined; }) { this.walletPrivateKey = walletPrivateKey; - this.walletType = walletType ? walletType : WalletTypeEnum.SECP256K1; + this.walletType = walletType ? walletType : WalletTypeEnum.Etherum; this.wallet = - this.walletType === WalletTypeEnum.SECP256K1 + this.walletType === WalletTypeEnum.Etherum ? new EtherumService(this.walletPrivateKey) : new SolanaService(this.walletPrivateKey); }