Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoints and types refactor for evm #787

Merged
merged 43 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d9a35f9
feat: first iteration codegen reader added
Oct 26, 2022
7f5de8f
feat: Evm Operations gen added
Oct 27, 2022
624c4d0
Merge branch 'beta' of https://github.com/MoralisWeb3/Moralis-JS-SDK …
Oct 27, 2022
fc52db4
feat: added path and method
Oct 27, 2022
59c2958
feat: getRequestUrlParams parser added
Oct 28, 2022
58531e0
failed dataType parser
Oct 31, 2022
efb6085
feat: fresh generated actions
Oct 31, 2022
19dba2e
refactor: use dataTypes in evm utils operations
ErnoW Nov 1, 2022
f2e5fc4
Merge remote-tracking branch 'origin/beta' into endpoints-and-types-r…
ErnoW Nov 1, 2022
ad09c38
chore: renameand add more operations
ErnoW Nov 2, 2022
b2cfcd2
Merge remote-tracking branch 'origin/beta' into endpoints-and-types-r…
ErnoW Nov 2, 2022
1f91d40
refactor(evmutils): fix todos and serialisation typing
sogunshola Nov 2, 2022
a5207a0
fix pretter
sogunshola Nov 2, 2022
63e559d
tests for balance and block operations
sogunshola Nov 3, 2022
08b412e
authutils build fix
sogunshola Nov 3, 2022
af0fe76
test for defi
sogunshola Nov 3, 2022
339c250
event operations test
sogunshola Nov 3, 2022
b50ea12
preetier fix
sogunshola Nov 3, 2022
3094363
add a lot of tests to validate operations serialization and deseriali…
FedericoAmura Nov 3, 2022
814bdad
chore: correct runContractFunctions test and prettier fix
sogunshola Nov 4, 2022
33300e5
refactor: change resolvers in evmApi to operations
sogunshola Nov 4, 2022
47cdfdf
update decentralise response for transaction operations
sogunshola Nov 4, 2022
39d6b06
use DateInput type for remaining unverified dates
FedericoAmura Nov 4, 2022
46b913f
fix integration tests for refactor
sogunshola Nov 5, 2022
65f5266
Merge branch 'endpoints-and-types-refactor-for-evm' of https://github…
sogunshola Nov 5, 2022
d5a6a32
Merge branch 'beta' of https://github.com/MoralisWeb3/Moralis-JS-SDK …
sogunshola Nov 5, 2022
a23074e
proper imports and decription generator
sogunshola Nov 5, 2022
0376130
prettier fix
sogunshola Nov 5, 2022
76ac20e
ignore hbs files in prettier
sogunshola Nov 7, 2022
664a340
archive codegen package
sogunshola Nov 7, 2022
7901902
undo camelizong of toJSON
sogunshola Nov 7, 2022
6770ad9
fix prettier
sogunshola Nov 7, 2022
f5957e0
change Nft to NFT accross code
sogunshola Nov 8, 2022
bd5b72a
Merge branch 'beta' of https://github.com/MoralisWeb3/Moralis-JS-SDK …
sogunshola Nov 8, 2022
f943ab5
fix prettier
sogunshola Nov 8, 2022
f649c88
generate client evm api
sogunshola Nov 8, 2022
c7c012b
fix test failure
sogunshola Nov 8, 2022
5a36dd0
add ignoreBodyCheckOperationNames to test
sogunshola Nov 8, 2022
c0c444b
polishing
sogunshola Nov 8, 2022
523a4b6
change to ignore operation, not param name
sogunshola Nov 9, 2022
aa44714
return type to response adapter
sogunshola Nov 9, 2022
2f62ed2
polishing
sogunshola Nov 9, 2022
d6e1b49
fix prettier
sogunshola Nov 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ packages/**/coverage
TODO.md
archive/**/*
.vscode/
.idea/
dump.rdb
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ demos/**/build/**/*

# Docs
docs/**/*

#Template files
packages/**/src/**/*.hbs
5 changes: 3 additions & 2 deletions demos/express-proxy/src/api/proxyGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Moralis from 'moralis';
import { operations } from '@moralisweb3/common-sol-utils';
import { operations } from 'moralis/common-sol-utils';
import { operations as evmOperations } from 'moralis/common-evm-utils';
import express from 'express';
import axios from 'axios';
import { errorHandler } from '../middlewares/errorHandler';
Expand All @@ -24,7 +25,7 @@ export class ProxyGenerator {
let baseUrl: string;
switch (this.api) {
case 'evm':
descriptors = Moralis.EvmApi.endpoints.getDescriptors();
descriptors = evmOperations.map(convertOperationToDescriptor);
baseUrl = Moralis.EvmApi.baseUrl;
break;
case 'solana':
Expand Down
5 changes: 3 additions & 2 deletions demos/parse-server/src/api/proxyGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Moralis from 'moralis';
import express from 'express';
import axios from 'axios';
import { errorHandler } from '../middlewares/errorHandler';
import { operations } from '@moralisweb3/common-sol-utils';
import { operations } from 'moralis/common-sol-utils';
import { operations as evmOperations } from 'moralis/common-evm-utils';
import { convertOperationToDescriptor } from '@moralisweb3/api-utils';

const proxyRouter = express.Router();
Expand All @@ -24,7 +25,7 @@ export class ProxyGenerator {
let baseUrl: string;
switch (this.api) {
case 'evm':
descriptors = Moralis.EvmApi.endpoints.getDescriptors();
descriptors = evmOperations.map(convertOperationToDescriptor);
baseUrl = Moralis.EvmApi.baseUrl;
break;
case 'solana':
Expand Down
8 changes: 4 additions & 4 deletions packages/apiUtils/src/resolvers2/OperationRequestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ export class OperationRequestBuilder<Request> {

let urlPath = this.operation.urlPathPattern;

for (const paramName of this.operation.urlPathParamNames) {
for (const paramName of this.operation.urlPathParamNames ?? []) {
const paramValue = urlParams[paramName as string];
if (!paramValue) {
throw new Error(`Param ${paramName as string} is required`);
}
urlPath = urlPath.replace(`{${paramName as string}}`, paramValue);
urlPath = urlPath.replace(`{${paramName as string}}`, paramValue as string);
}
const url = `${baseUrl}${urlPath}`;

const urlSearchParams: Record<string, string> = {};
const urlSearchParams: Record<string, string | string[]> = {};
Object.keys(urlParams)
.filter((paramName) => !this.operation.urlPathParamNames.includes(paramName as keyof Request))
.filter((paramName) => !this.operation.urlPathParamNames?.includes(paramName as keyof Request))
.forEach((paramName) => {
const paramValue = urlParams[paramName];
if (paramValue) {
Expand Down
1 change: 1 addition & 0 deletions packages/apiUtils/src/resolvers2/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './OperationResolver';
export * from './NullableOperationResolver';
export * from './PaginatedOperationResolver';
export * from './NullableOperationResolver';
155 changes: 151 additions & 4 deletions packages/client/evmApi/src/generated/ClientEvmApi.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,168 @@

// CAUTION: This file is automatically generated. Do not edit it manually!

import { getWalletTokenTransfersOperation, GetWalletTokenTransfersRequest, GetWalletTokenTransfersResponse, GetWalletTokenTransfersJSONResponse, runContractFunctionOperation, RunContractFunctionRequest, RunContractFunctionResponse, RunContractFunctionJSONResponse } from '@moralisweb3/common-evm-utils';
import { endpointWeightsOperation, EndpointWeightsRequest, EndpointWeightsResponse, EndpointWeightsJSONResponse, runContractFunctionOperation, RunContractFunctionRequest, RunContractFunctionResponse, RunContractFunctionJSONResponse, web3ApiVersionOperation, Web3ApiVersionRequest, Web3ApiVersionResponse, Web3ApiVersionJSONResponse, getBlockOperation, GetBlockRequest, GetBlockResponse, GetBlockJSONResponse, getDateToBlockOperation, GetDateToBlockRequest, GetDateToBlockResponse, GetDateToBlockJSONResponse, getContractEventsOperation, GetContractEventsRequest, GetContractEventsResponse, GetContractEventsJSONResponse, getContractLogsOperation, GetContractLogsRequest, GetContractLogsResponse, GetContractLogsJSONResponse, getContractNFTsOperation, GetContractNFTsRequest, GetContractNFTsResponse, GetContractNFTsJSONResponse, getNFTContractMetadataOperation, GetNFTContractMetadataRequest, GetNFTContractMetadataResponse, GetNFTContractMetadataJSONResponse, getNFTContractTransfersOperation, GetNFTContractTransfersRequest, GetNFTContractTransfersResponse, GetNFTContractTransfersJSONResponse, getNFTLowestPriceOperation, GetNFTLowestPriceRequest, GetNFTLowestPriceResponse, GetNFTLowestPriceJSONResponse, getNFTMetadataOperation, GetNFTMetadataRequest, GetNFTMetadataResponse, GetNFTMetadataJSONResponse, getNFTOwnersOperation, GetNFTOwnersRequest, GetNFTOwnersResponse, GetNFTOwnersJSONResponse, getNFTTokenIdOwnersOperation, GetNFTTokenIdOwnersRequest, GetNFTTokenIdOwnersResponse, GetNFTTokenIdOwnersJSONResponse, getNFTTradesOperation, GetNFTTradesRequest, GetNFTTradesResponse, GetNFTTradesJSONResponse, getNFTTransfersByBlockOperation, GetNFTTransfersByBlockRequest, GetNFTTransfersByBlockResponse, GetNFTTransfersByBlockJSONResponse, getNFTTransfersFromToBlockOperation, GetNFTTransfersFromToBlockRequest, GetNFTTransfersFromToBlockResponse, GetNFTTransfersFromToBlockJSONResponse, getNFTTransfersOperation, GetNFTTransfersRequest, GetNFTTransfersResponse, GetNFTTransfersJSONResponse, getWalletNFTCollectionsOperation, GetWalletNFTCollectionsRequest, GetWalletNFTCollectionsResponse, GetWalletNFTCollectionsJSONResponse, getWalletNFTsOperation, GetWalletNFTsRequest, GetWalletNFTsResponse, GetWalletNFTsJSONResponse, getWalletNFTTransfersOperation, GetWalletNFTTransfersRequest, GetWalletNFTTransfersResponse, GetWalletNFTTransfersJSONResponse, reSyncMetadataOperation, ReSyncMetadataRequest, ReSyncMetadataResponse, ReSyncMetadataJSONResponse, searchNFTsOperation, SearchNFTsRequest, SearchNFTsResponse, SearchNFTsJSONResponse, syncNFTContractOperation, SyncNFTContractRequest, SyncNFTContractResponse, SyncNFTContractJSONResponse, getNativeBalanceOperation, GetNativeBalanceRequest, GetNativeBalanceResponse, GetNativeBalanceJSONResponse, getPairAddressOperation, GetPairAddressRequest, GetPairAddressResponse, GetPairAddressJSONResponse, getPairReservesOperation, GetPairReservesRequest, GetPairReservesResponse, GetPairReservesJSONResponse, getTokenAllowanceOperation, GetTokenAllowanceRequest, GetTokenAllowanceResponse, GetTokenAllowanceJSONResponse, getTokenMetadataBySymbolOperation, GetTokenMetadataBySymbolRequest, GetTokenMetadataBySymbolResponse, GetTokenMetadataBySymbolJSONResponse, getTokenMetadataOperation, GetTokenMetadataRequest, GetTokenMetadataResponse, GetTokenMetadataJSONResponse, getTokenPriceOperation, GetTokenPriceRequest, GetTokenPriceResponse, GetTokenPriceJSONResponse, getTokenTransfersOperation, GetTokenTransfersRequest, GetTokenTransfersResponse, GetTokenTransfersJSONResponse, getWalletTokenBalancesOperation, GetWalletTokenBalancesRequest, GetWalletTokenBalancesResponse, GetWalletTokenBalancesJSONResponse, getWalletTokenTransfersOperation, GetWalletTokenTransfersRequest, GetWalletTokenTransfersResponse, GetWalletTokenTransfersJSONResponse, getTransactionOperation, GetTransactionRequest, GetTransactionResponse, GetTransactionJSONResponse, getWalletTransactionsOperation, GetWalletTransactionsRequest, GetWalletTransactionsResponse, GetWalletTransactionsJSONResponse, resolveAddressOperation, ResolveAddressRequest, ResolveAddressResponse, ResolveAddressJSONResponse, resolveDomainOperation, ResolveDomainRequest, ResolveDomainResponse, ResolveDomainJSONResponse, uploadFolderOperation, UploadFolderRequest, UploadFolderResponse, UploadFolderJSONResponse } from '@moralisweb3/common-evm-utils';
import { ClientRequestHandler } from '@moralisweb3/client-api-utils';
import { PaginatedResponseAdapter, ResponseAdapter } from '@moralisweb3/common-core';
import { ResponseAdapter, PaginatedResponseAdapter } from '@moralisweb3/common-core';

export class ClientEvmApi {
public constructor(
private readonly requestHandler: ClientRequestHandler) {
}

public readonly utils = {
endpointWeights: (request: EndpointWeightsRequest): Promise<ResponseAdapter<EndpointWeightsResponse, EndpointWeightsJSONResponse>> => {
return this.requestHandler.handle(request, endpointWeightsOperation);
},
runContractFunction: (request: RunContractFunctionRequest): Promise<ResponseAdapter<RunContractFunctionResponse, RunContractFunctionJSONResponse>> => {
return this.requestHandler.handle(request, runContractFunctionOperation);
},
web3ApiVersion: (request: Web3ApiVersionRequest): Promise<ResponseAdapter<Web3ApiVersionResponse, Web3ApiVersionJSONResponse>> => {
return this.requestHandler.handle(request, web3ApiVersionOperation);
},

};

public readonly block = {
getBlock: (request: GetBlockRequest): Promise<ResponseAdapter<GetBlockResponse, GetBlockJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, getBlockOperation);
},
getDateToBlock: (request: GetDateToBlockRequest): Promise<ResponseAdapter<GetDateToBlockResponse, GetDateToBlockJSONResponse>> => {
return this.requestHandler.handle(request, getDateToBlockOperation);
},

};

public readonly events = {
getContractEvents: (request: GetContractEventsRequest): Promise<PaginatedResponseAdapter<GetContractEventsResponse, GetContractEventsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getContractEventsOperation);
},
getContractLogs: (request: GetContractLogsRequest): Promise<PaginatedResponseAdapter<GetContractLogsResponse, GetContractLogsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getContractLogsOperation);
},

};

public readonly nft = {
getContractNFTs: (request: GetContractNFTsRequest): Promise<PaginatedResponseAdapter<GetContractNFTsResponse, GetContractNFTsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getContractNFTsOperation);
},
getNFTContractMetadata: (request: GetNFTContractMetadataRequest): Promise<ResponseAdapter<GetNFTContractMetadataResponse, GetNFTContractMetadataJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, getNFTContractMetadataOperation);
},
getNFTContractTransfers: (request: GetNFTContractTransfersRequest): Promise<PaginatedResponseAdapter<GetNFTContractTransfersResponse, GetNFTContractTransfersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTContractTransfersOperation);
},
getNFTLowestPrice: (request: GetNFTLowestPriceRequest): Promise<ResponseAdapter<GetNFTLowestPriceResponse, GetNFTLowestPriceJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, getNFTLowestPriceOperation);
},
getNFTMetadata: (request: GetNFTMetadataRequest): Promise<ResponseAdapter<GetNFTMetadataResponse, GetNFTMetadataJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, getNFTMetadataOperation);
},
getNFTOwners: (request: GetNFTOwnersRequest): Promise<PaginatedResponseAdapter<GetNFTOwnersResponse, GetNFTOwnersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTOwnersOperation);
},
getNFTTokenIdOwners: (request: GetNFTTokenIdOwnersRequest): Promise<PaginatedResponseAdapter<GetNFTTokenIdOwnersResponse, GetNFTTokenIdOwnersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTTokenIdOwnersOperation);
},
getNFTTrades: (request: GetNFTTradesRequest): Promise<PaginatedResponseAdapter<GetNFTTradesResponse, GetNFTTradesJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTTradesOperation);
},
getNFTTransfersByBlock: (request: GetNFTTransfersByBlockRequest): Promise<PaginatedResponseAdapter<GetNFTTransfersByBlockResponse, GetNFTTransfersByBlockJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTTransfersByBlockOperation);
},
getNFTTransfersFromToBlock: (request: GetNFTTransfersFromToBlockRequest): Promise<PaginatedResponseAdapter<GetNFTTransfersFromToBlockResponse, GetNFTTransfersFromToBlockJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTTransfersFromToBlockOperation);
},
getNFTTransfers: (request: GetNFTTransfersRequest): Promise<PaginatedResponseAdapter<GetNFTTransfersResponse, GetNFTTransfersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getNFTTransfersOperation);
},
getWalletNFTCollections: (request: GetWalletNFTCollectionsRequest): Promise<PaginatedResponseAdapter<GetWalletNFTCollectionsResponse, GetWalletNFTCollectionsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getWalletNFTCollectionsOperation);
},
getWalletNFTs: (request: GetWalletNFTsRequest): Promise<PaginatedResponseAdapter<GetWalletNFTsResponse, GetWalletNFTsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getWalletNFTsOperation);
},
getWalletNFTTransfers: (request: GetWalletNFTTransfersRequest): Promise<PaginatedResponseAdapter<GetWalletNFTTransfersResponse, GetWalletNFTTransfersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getWalletNFTTransfersOperation);
},
reSyncMetadata: (request: ReSyncMetadataRequest): Promise<ResponseAdapter<ReSyncMetadataResponse, ReSyncMetadataJSONResponse>> => {
return this.requestHandler.handle(request, reSyncMetadataOperation);
},
searchNFTs: (request: SearchNFTsRequest): Promise<PaginatedResponseAdapter<SearchNFTsResponse, SearchNFTsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, searchNFTsOperation);
},
syncNFTContract: (request: SyncNFTContractRequest): Promise<ResponseAdapter<SyncNFTContractResponse, SyncNFTContractJSONResponse>> => {
return this.requestHandler.handle(request, syncNFTContractOperation);
},

};

public readonly balance = {
getNativeBalance: (request: GetNativeBalanceRequest): Promise<ResponseAdapter<GetNativeBalanceResponse, GetNativeBalanceJSONResponse>> => {
return this.requestHandler.handle(request, getNativeBalanceOperation);
},

};

public readonly defi = {
getPairAddress: (request: GetPairAddressRequest): Promise<ResponseAdapter<GetPairAddressResponse, GetPairAddressJSONResponse>> => {
return this.requestHandler.handle(request, getPairAddressOperation);
},
getPairReserves: (request: GetPairReservesRequest): Promise<ResponseAdapter<GetPairReservesResponse, GetPairReservesJSONResponse>> => {
return this.requestHandler.handle(request, getPairReservesOperation);
},

};

public readonly token = {
getTokenAllowance: (request: GetTokenAllowanceRequest): Promise<ResponseAdapter<GetTokenAllowanceResponse, GetTokenAllowanceJSONResponse>> => {
return this.requestHandler.handle(request, getTokenAllowanceOperation);
},
getTokenMetadataBySymbol: (request: GetTokenMetadataBySymbolRequest): Promise<ResponseAdapter<GetTokenMetadataBySymbolResponse, GetTokenMetadataBySymbolJSONResponse>> => {
return this.requestHandler.handle(request, getTokenMetadataBySymbolOperation);
},
getTokenMetadata: (request: GetTokenMetadataRequest): Promise<ResponseAdapter<GetTokenMetadataResponse, GetTokenMetadataJSONResponse>> => {
return this.requestHandler.handle(request, getTokenMetadataOperation);
},
getTokenPrice: (request: GetTokenPriceRequest): Promise<ResponseAdapter<GetTokenPriceResponse, GetTokenPriceJSONResponse>> => {
return this.requestHandler.handle(request, getTokenPriceOperation);
},
getTokenTransfers: (request: GetTokenTransfersRequest): Promise<PaginatedResponseAdapter<GetTokenTransfersResponse, GetTokenTransfersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getTokenTransfersOperation);
},
getWalletTokenBalances: (request: GetWalletTokenBalancesRequest): Promise<ResponseAdapter<GetWalletTokenBalancesResponse, GetWalletTokenBalancesJSONResponse>> => {
return this.requestHandler.handle(request, getWalletTokenBalancesOperation);
},
getWalletTokenTransfers: (request: GetWalletTokenTransfersRequest): Promise<PaginatedResponseAdapter<GetWalletTokenTransfersResponse, GetWalletTokenTransfersJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getWalletTokenTransfersOperation);
},
runContractFunction: (request: RunContractFunctionRequest): Promise<ResponseAdapter<RunContractFunctionResponse, RunContractFunctionJSONResponse>> => {
return this.requestHandler.handle(request, runContractFunctionOperation);

};

public readonly transaction = {
getTransaction: (request: GetTransactionRequest): Promise<ResponseAdapter<GetTransactionResponse, GetTransactionJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, getTransactionOperation);
},
getWalletTransactions: (request: GetWalletTransactionsRequest): Promise<PaginatedResponseAdapter<GetWalletTransactionsResponse, GetWalletTransactionsJSONResponse['result']>> => {
return this.requestHandler.handlePaginated(request, getWalletTransactionsOperation);
},

};

public readonly resolve = {
resolveAddress: (request: ResolveAddressRequest): Promise<ResponseAdapter<ResolveAddressResponse, ResolveAddressJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, resolveAddressOperation);
},
resolveDomain: (request: ResolveDomainRequest): Promise<ResponseAdapter<ResolveDomainResponse, ResolveDomainJSONResponse> | null> => {
return this.requestHandler.handleNullable(request, resolveDomainOperation);
},

};

public readonly ipfs = {
uploadFolder: (request: UploadFolderRequest): Promise<ResponseAdapter<UploadFolderResponse, UploadFolderJSONResponse>> => {
return this.requestHandler.handle(request, uploadFolderOperation);
},

};
Expand Down
4 changes: 2 additions & 2 deletions packages/common/core/src/operations/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface Operation<Request, JSONRequest, Response, JSONResponse> {
groupName: string;
method: OperationRequestMethod;
urlPathPattern: string;
urlPathParamNames: (keyof Request)[];
urlPathParamNames?: (keyof Request)[];
urlSearchParamNames?: (keyof Request)[];
bodyType?: OperationBodyType;
bodyParamNames?: (keyof Request)[];
Expand All @@ -22,7 +22,7 @@ export interface Operation<Request, JSONRequest, Response, JSONResponse> {

export type OperationRequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
export type OperationBodyType = 'properties' | 'raw';
export type OperationRequestUrlParams = Record<string, string | undefined>;
export type OperationRequestUrlParams = Record<string, string | string[] | undefined>;
export type OperationRequestBody = OperationRequestPropertiesBody | OperationRequestRawBody;
export type OperationRequestPropertiesBody = Record<string, unknown>;
export type OperationRequestRawBody = string | number | boolean | object;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class OperationRequestValidator<Request> {

public constructor(operation: Operation<Request, unknown, unknown, unknown>) {
this.allParamNames = [
...operation.urlPathParamNames,
...(operation.urlPathParamNames || []),
...(operation.urlSearchParamNames || []),
...(operation.bodyParamNames || []),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { EvmTransactionLogData, EvmTransactionLogInput } from './types';
*/
export type EvmTransactionLogish = EvmTransactionLogInput | EvmTransactionLog;

export type LogTopic = string | null;

/**
* The EvmTransactionLog class is a MoralisData that references an EVM transaction log.
*
Expand Down
Loading