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

fix: fromDate type. #1220

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .changeset/wet-paws-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@moralisweb3/common-evm-utils': patch
'@moralisweb3/evm-api': patch
'moralis': patch
---

Updated the types of `fromDate` request fields. This change affects the `getNFTTrades` and `getWalletHistory` endpoints.
4 changes: 4 additions & 0 deletions packages/common/evmUtils/generator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
{
"names": "to_date",
"nativeType": "Date"
},
{
"names": "from_date",
"nativeType": "Date"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export abstract class AbstractClient {
* * Provide the param 'from_block' or 'from_date'
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
* @param {Number} [request.toBlock] The block number to get the trades from (optional)
* @param {String} [request.fromDate] The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* @param {Date} [request.fromDate] The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* * Provide the param 'from_block' or 'from_date'
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
* @param {Date} [request.toDate] The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
Expand Down Expand Up @@ -402,7 +402,7 @@ export abstract class AbstractClient {
* @param {Number} [request.toBlock] The maximum block number from which to get the transactions.
* * Provide the param 'to_block' or 'to_date'
* * If 'to_date' and 'to_block' are provided, 'to_block' will be used. (optional)
* @param {String} [request.fromDate] The start date from which to get the transactions (format in seconds or datestring accepted by momentjs)
* @param {Date} [request.fromDate] The start date from which to get the transactions (format in seconds or datestring accepted by momentjs)
* * Provide the param 'from_block' or 'from_date'
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
* @param {Date} [request.toDate] Get the transactions up to this date (format in seconds or datestring accepted by momentjs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface GetNFTTradesOperationRequest {
* * Provide the param 'from_block' or 'from_date'
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used.
*/
readonly fromDate?: string;
readonly fromDate?: Date;
/**
* @description The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
* * Provide the param 'to_block' or 'to_date'
Expand Down Expand Up @@ -107,7 +107,7 @@ export const GetNFTTradesOperation = {
chain: chain ? chain.toJSON() : undefined,
from_block: fromBlock,
to_block: toBlock !== undefined ? String(toBlock) : undefined,
from_date: fromDate,
from_date: fromDate !== undefined ? fromDate.toISOString() : undefined,
to_date: toDate !== undefined ? toDate.toISOString() : undefined,
marketplace: marketplace ? marketplace : undefined,
cursor: cursor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface GetWalletHistoryOperationRequest {
* * Provide the param 'from_block' or 'from_date'
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used.
*/
readonly fromDate?: string;
readonly fromDate?: Date;
/**
* @description Get the transactions up to this date (format in seconds or datestring accepted by momentjs)
* * Provide the param 'to_block' or 'to_date'
Expand Down Expand Up @@ -130,7 +130,7 @@ export const GetWalletHistoryOperation = {
chain: chain ? chain.toJSON() : undefined,
from_block: fromBlock,
to_block: toBlock,
from_date: fromDate,
from_date: fromDate !== undefined ? fromDate.toISOString() : undefined,
to_date: toDate !== undefined ? toDate.toISOString() : undefined,
address: address.toJSON(),
include_internal_transactions: includeInternalTransactions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// $ref: #/components/schemas/discoveryApiChainsList
// typeName: discoveryApiChainsList

export type EvmDiscoveryApiChainsListJSON = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
export type EvmDiscoveryApiChainsListInput = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
export type EvmDiscoveryApiChainsListValue = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
export type EvmDiscoveryApiChainsListJSON = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105" | "linea" | "0xe708";
export type EvmDiscoveryApiChainsListInput = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105" | "linea" | "0xe708";
export type EvmDiscoveryApiChainsListValue = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105" | "linea" | "0xe708";

export abstract class EvmDiscoveryApiChainsList {
public static create(input: EvmDiscoveryApiChainsListInput | EvmDiscoveryApiChainsListValue): EvmDiscoveryApiChainsListValue {
Expand Down
Loading