diff --git a/packages/auth/src/Auth.ts b/packages/auth/src/Auth.ts index c4d5299360..96545f7f1c 100644 --- a/packages/auth/src/Auth.ts +++ b/packages/auth/src/Auth.ts @@ -1,14 +1,11 @@ -import { ApiModule, Core, CoreProvider, ResponseAdapter } from '@moralisweb3/common-core'; +import { ApiModule, Core, CoreProvider } from '@moralisweb3/common-core'; import { makeRequestMessage, RequestMessageOptions } from './methods/requestMessage'; import { makeVerify, VerifyEvmOptions, VerifyOptions, VerifySolOptions } from './methods/verify'; -import { VerifyChallengeEvmJSONResponse, VerifyChallengeEvmResponse } from './operations/evm'; -import { VerifyChallengeSolanaJSONResponse, VerifyChallengeSolanaResponse } from './operations/solana'; +import { VerifyChallengeEvmResponseAdapter } from './operations/evm'; +import { VerifyChallengeSolanaResponseAdapter } from './operations/solana'; export const BASE_URL = 'https://authapi.moralis.io'; -type VerifyEvmResponse = Promise>; -type VerifySolanaResponse = Promise>; - export class Auth extends ApiModule { public static readonly moduleName = 'auth'; @@ -31,8 +28,8 @@ export class Auth extends ApiModule { public requestMessage = (options: RequestMessageOptions) => makeRequestMessage(this.core)(options); // Function overloading to make typescript happy - public verify(options: VerifyEvmOptions): VerifyEvmResponse; - public verify(options: VerifySolOptions): VerifySolanaResponse; + public verify(options: VerifyEvmOptions): Promise; + public verify(options: VerifySolOptions): Promise; public verify(options: VerifyOptions) { return makeVerify(this.core)(options); } diff --git a/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts b/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts index cbb1c749a0..1ec2387feb 100644 --- a/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts +++ b/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts @@ -1,4 +1,4 @@ -import { Core, Camelize, Operation, DateInput } from '@moralisweb3/common-core'; +import { Core, Camelize, Operation, DateInput, ResponseAdapter } from '@moralisweb3/common-core'; import { EvmAddress, EvmAddressish, EvmChainish, EvmChainResolver } from '@moralisweb3/common-evm-utils'; import { operations } from '../../generated/types'; @@ -25,6 +25,9 @@ export type RequestChallengeEvmJSONResponse = SuccessResponse; export type RequestChallengeEvmResponse = ReturnType; +export interface RequestChallengeEvmResponseAdapter + extends ResponseAdapter {} + export const requestChallengeEvmOperation: Operation< RequestChallengeEvmRequest, RequestChallengeEvmJSONRequest, diff --git a/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts b/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts index 2930c4ab08..e6e38f8a41 100644 --- a/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts +++ b/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts @@ -1,4 +1,4 @@ -import { Camelize, maybe, Operation } from '@moralisweb3/common-core'; +import { Camelize, maybe, Operation, ResponseAdapter } from '@moralisweb3/common-core'; import { EvmAddress, EvmChain } from '@moralisweb3/common-evm-utils'; import { operations } from '../../generated/types'; @@ -19,6 +19,9 @@ export type VerifyChallengeEvmJSONResponse = SuccessResponse; export type VerifyChallengeEvmResponse = ReturnType; +export interface VerifyChallengeEvmResponseAdapter + extends ResponseAdapter {} + export const verifyChallengeEvmOperation: Operation< VerifyChallengeEvmRequest, VerifyChallengeEvmJSONRequest, diff --git a/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts b/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts index ace1829bec..f464967c37 100644 --- a/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts +++ b/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts @@ -1,4 +1,4 @@ -import { Camelize, Operation, DateInput } from '@moralisweb3/common-core'; +import { Camelize, Operation, DateInput, ResponseAdapter } from '@moralisweb3/common-core'; import { SolAddress, SolAddressish, SolNetwork, SolNetworkish } from '@moralisweb3/common-sol-utils'; import { operations } from '../../generated/types'; @@ -25,6 +25,9 @@ export type RequestChallengeSolanaJSONResponse = SuccessResponse; export type RequestChallengeSolanaResponse = ReturnType; +export interface RequestChallengeSolanaResponseAdapter + extends ResponseAdapter {} + export const requestChallengeSolanaOperation: Operation< RequestChallengeSolanaRequest, RequestChallengeSolanaJSONRequest, diff --git a/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts b/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts index 151f29b84f..90e2521380 100644 --- a/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts +++ b/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts @@ -1,4 +1,4 @@ -import { Camelize, maybe, Operation } from '@moralisweb3/common-core'; +import { Camelize, maybe, Operation, ResponseAdapter } from '@moralisweb3/common-core'; import { SolAddress, SolNetwork } from '@moralisweb3/common-sol-utils'; import { operations } from '../../generated/types'; @@ -19,6 +19,9 @@ export type VerifyChallengeSolanaJSONResponse = SuccessResponse; export type VerifyChallengeSolanaResponse = ReturnType; +export interface VerifyChallengeSolanaResponseAdapter + extends ResponseAdapter {} + export const verifyChallengeSolanaOperation: Operation< VerifyChallengeSolanaRequest, VerifyChallengeSolanaJSONRequest,