From 1a579d82f61993bc6d7bd6a518488be4bb3b5985 Mon Sep 17 00:00:00 2001 From: Shreyas Padmakiran Date: Tue, 21 Oct 2025 00:16:47 +0530 Subject: [PATCH] small-touchups-for-moralis-integration --- content/evm/indexer-providers/moralis.mdx | 38 +++-------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/content/evm/indexer-providers/moralis.mdx b/content/evm/indexer-providers/moralis.mdx index efe50328..7f034b6e 100644 --- a/content/evm/indexer-providers/moralis.mdx +++ b/content/evm/indexer-providers/moralis.mdx @@ -276,7 +276,7 @@ class SeiMoralisService { async initialize() { if (!this.initialized) { await Moralis.start({ - apiKey: process.env.MORALIS_API_KEY! + apiKey: process.env.MORALIS_API_KEY }); this.initialized = true; console.log('Moralis initialized for Sei blockchain'); @@ -288,19 +288,15 @@ class SeiMoralisService { try { // Get all wallet data in parallel - const [transactions, nfts, tokenBalances, tokenTransfers] = await Promise.all([this.getWalletTransactions(walletAddress), this.getWalletNFTs(walletAddress), this.getTokenBalances(walletAddress), this.getTokenTransfers(walletAddress)]); + const [nfts, tokenBalances] = await Promise.all([this.getWalletNFTs(walletAddress), this.getTokenBalances(walletAddress)]); return { address: walletAddress, - transactions: transactions.result, nfts: nfts.result, tokenBalances: tokenBalances, - tokenTransfers: tokenTransfers.result, summary: { - totalTransactions: transactions.total, - totalNFTs: nfts.total, - totalTokenTypes: tokenBalances.length, - totalTransfers: tokenTransfers.total + totalNFTs: nfts, + totalTokenTypes: tokenBalances.length } }; } catch (error) { @@ -309,18 +305,6 @@ class SeiMoralisService { } } - async getWalletTransactions(walletAddress: string, options = {}) { - const defaultOptions = { - chain: '0x531', - ...options - }; - - return await Moralis.EvmApi.transaction.getWalletTransactions({ - address: walletAddress, - ...defaultOptions - }); - } - async getWalletNFTs(walletAddress: string) { return await Moralis.EvmApi.nft.getWalletNFTs({ address: walletAddress, @@ -335,20 +319,6 @@ class SeiMoralisService { }); return response.raw; } - - async getTokenTransfers(walletAddress: string) { - return await Moralis.EvmApi.token.getWalletTokenTransfers({ - address: walletAddress, - chain: '0x531' - }); - } - - async getTransactionDetails(txHash: string) { - return await Moralis.EvmApi.transaction.getTransactionVerbose({ - transactionHash: txHash, - chain: '0x531' - }); - } } // Usage example