Skip to content

Commit 77d1254

Browse files
authored
fix: fromDate type. (#1220)
1 parent 7f8893b commit 77d1254

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

.changeset/wet-paws-fail.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@moralisweb3/common-evm-utils': patch
3+
'@moralisweb3/evm-api': patch
4+
'moralis': patch
5+
---
6+
7+
Updated the types of `fromDate` request fields. This change affects the `getNFTTrades` and `getWalletHistory` endpoints.

packages/common/evmUtils/generator.config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
{
8787
"names": "to_date",
8888
"nativeType": "Date"
89+
},
90+
{
91+
"names": "from_date",
92+
"nativeType": "Date"
8993
}
9094
]
9195
},

packages/common/evmUtils/src/generated/client/abstractClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export abstract class AbstractClient {
196196
* * Provide the param 'from_block' or 'from_date'
197197
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
198198
* @param {Number} [request.toBlock] The block number to get the trades from (optional)
199-
* @param {String} [request.fromDate] The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
199+
* @param {Date} [request.fromDate] The start date from which to get the transfers (format in seconds or datestring accepted by momentjs)
200200
* * Provide the param 'from_block' or 'from_date'
201201
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
202202
* @param {Date} [request.toDate] The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
@@ -402,7 +402,7 @@ export abstract class AbstractClient {
402402
* @param {Number} [request.toBlock] The maximum block number from which to get the transactions.
403403
* * Provide the param 'to_block' or 'to_date'
404404
* * If 'to_date' and 'to_block' are provided, 'to_block' will be used. (optional)
405-
* @param {String} [request.fromDate] The start date from which to get the transactions (format in seconds or datestring accepted by momentjs)
405+
* @param {Date} [request.fromDate] The start date from which to get the transactions (format in seconds or datestring accepted by momentjs)
406406
* * Provide the param 'from_block' or 'from_date'
407407
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used. (optional)
408408
* @param {Date} [request.toDate] Get the transactions up to this date (format in seconds or datestring accepted by momentjs)

packages/common/evmUtils/src/generated/operations/GetNFTTradesOperation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface GetNFTTradesOperationRequest {
3434
* * Provide the param 'from_block' or 'from_date'
3535
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used.
3636
*/
37-
readonly fromDate?: string;
37+
readonly fromDate?: Date;
3838
/**
3939
* @description The end date from which to get the transfers (format in seconds or datestring accepted by momentjs)
4040
* * Provide the param 'to_block' or 'to_date'
@@ -107,7 +107,7 @@ export const GetNFTTradesOperation = {
107107
chain: chain ? chain.toJSON() : undefined,
108108
from_block: fromBlock,
109109
to_block: toBlock !== undefined ? String(toBlock) : undefined,
110-
from_date: fromDate,
110+
from_date: fromDate !== undefined ? fromDate.toISOString() : undefined,
111111
to_date: toDate !== undefined ? toDate.toISOString() : undefined,
112112
marketplace: marketplace ? marketplace : undefined,
113113
cursor: cursor,

packages/common/evmUtils/src/generated/operations/GetWalletHistoryOperation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface GetWalletHistoryOperationRequest {
3939
* * Provide the param 'from_block' or 'from_date'
4040
* * If 'from_date' and 'from_block' are provided, 'from_block' will be used.
4141
*/
42-
readonly fromDate?: string;
42+
readonly fromDate?: Date;
4343
/**
4444
* @description Get the transactions up to this date (format in seconds or datestring accepted by momentjs)
4545
* * Provide the param 'to_block' or 'to_date'
@@ -130,7 +130,7 @@ export const GetWalletHistoryOperation = {
130130
chain: chain ? chain.toJSON() : undefined,
131131
from_block: fromBlock,
132132
to_block: toBlock,
133-
from_date: fromDate,
133+
from_date: fromDate !== undefined ? fromDate.toISOString() : undefined,
134134
to_date: toDate !== undefined ? toDate.toISOString() : undefined,
135135
address: address.toJSON(),
136136
include_internal_transactions: includeInternalTransactions,

packages/common/evmUtils/src/generated/types/EvmDiscoveryApiChainsList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// $ref: #/components/schemas/discoveryApiChainsList
22
// typeName: discoveryApiChainsList
33

4-
export type EvmDiscoveryApiChainsListJSON = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
5-
export type EvmDiscoveryApiChainsListInput = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
6-
export type EvmDiscoveryApiChainsListValue = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105";
4+
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";
5+
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";
6+
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";
77

88
export abstract class EvmDiscoveryApiChainsList {
99
public static create(input: EvmDiscoveryApiChainsListInput | EvmDiscoveryApiChainsListValue): EvmDiscoveryApiChainsListValue {

0 commit comments

Comments
 (0)