MoralisWeb3 / Moralis-JS-SDK

Moralis Official Javascript SDK
https://docs.moralis.io
Other
368 stars 257 forks source link

Unexpected error when executing `getWalletHistory` through the SDK #1219

Closed pastushenkoy closed 3 months ago

pastushenkoy commented 4 months ago

New Bug Report

Checklist

Issue Description

When executing the code below, I receive an error. Seems like it happens because some from_address fields in the response are filled with the wrong data, but I don't see any undefined or null in from_address in response.

Steps + code to reproduce

import Moralis from 'moralis';
import { EvmChain } from '@moralisweb3/common-evm-utils';

describe('Moralis notepad', () => {
  it('fetch wallet history', async () => {
    await Moralis.start({
      apiKey:
        '<API_KEY>',
    });
    let responsePage = await Moralis.EvmApi.wallets.getWalletHistory({
      address: '0x16D8a51ff9297F9e35409B9a1eceFA187599ddC6',
      chain: EvmChain.GNOSIS,
    });
  });
});

Actual Outcome

[C0005] Invalid address provided: undefined
Moralis SDK Core Error: [C0005] Invalid address provided: undefined
    at Function.Object.<anonymous>.EvmAddress.parse (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:299:19)
    at new EvmAddress (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:265:34)
    at Function.Object.<anonymous>.EvmAddress.fromJSON (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:295:16)
    at Function.Object.<anonymous>.EvmWalletHistoryTransaction.fromJSON (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:7645:37)
    at /Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:7728:90
    at Array.map (<anonymous>)
    at Function.Object.<anonymous>.EvmWalletHistory.fromJSON (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:7728:33)
    at Object.parseResponse (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/common-evm-utils/lib/cjs/index.cjs:9775:33)
    at OperationV3Resolver.<anonymous> (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/api-utils/lib/cjs/index.cjs:439:58)
    at step (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/api-utils/lib/cjs/index.cjs:151:23)
    at Object.next (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/api-utils/lib/cjs/index.cjs:132:53)
    at fulfilled (/Users/yurypastushenko/projects/alphalink-backend-monorepo/node_modules/@moralisweb3/api-utils/lib/cjs/index.cjs:122:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected Outcome

Parsed response

Environment

Server

Client

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. for your contributions. If this issue is still affecting you, please leave any comment, and we'll keep it open We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! Thank you.

stale[bot] commented 3 months ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!