Skip to content

[BUG]: Unknown field "baseVariableBorrowRate" on type "ReserveBorrowInfo" #141

@MattMsh

Description

@MattMsh

Hi.
I'm using "@aave/client": "^0.9.1"

Want to get list of markets for Etherum network.

Here is the script:

import { chainId } from '@aave/client';
import { markets } from '@aave/client/actions';
import { client } from './client.ts';

// Fetch all chains supported by Aave
const result = await markets(client, {
  chainIds: [chainId(1)],
});

if (result.isErr()) {
  console.error(result.error);
} else {
  // result.value: Market[]
  console.log(result.value);
}

Expect to receive list of markets.

Instead, I receive runtime error:

1 | import {errAsync,err}from'neverthrow';export*from'neverthrow';var r=class extends Error{name="InvariantError"};function s(e,t){if(!e)throw new r(t)}function x(e){let t=typeof e;return e!=null&&(t==="object"||t==="function")}function w(e){if(!x(e)||!Error.prototype.isPrototypeOf(e))throw e}function S(e,t=`Unexpected object: ${String(e)}`){throw new r(t)}function I(e){if(e.isErr())throw new r(`Expected result to be Ok: ${e.error.message}`)}function k(e){if(e.isOk())throw new r(`Expected result to be Err: ${e.value}`)}function v(e){if(e===null)throw new r("Expected value to be not null")}var p=class{promise;resolve;reject;constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n;});}};function T(e){return e}var _=T;function D(e="Unexpected call to never()"){throw new r(e)}function j(e){if(e==null)throw new r("Value should not be null or undefined");return e}function O(e){return t=>{if(t.__typename!==e)throw new r(`Expected __typename to be "${e}", but got "${t.__typename}"`);return t}}function  | ... truncated 

InvariantError: Expected a value, got: [GraphQL] Unknown field "baseVariableBorrowRate" on type "ReserveBorrowInfo".
      at s (/node_modules/@aave/types/dist/index.js:1:140)
      at h (/node_modules/@aave/core/dist/index.js:2:4609)
      at <anonymous> (/node_modules/neverthrow/dist/index.cjs.js:133:33)
      at <anonymous> (/node_modules/neverthrow/dist/index.cjs.js:43:71)
      at new Promise (1:11)
      at __awaiter (/node_modules/neverthrow/dist/index.cjs.js:39:12)

Bun v1.3.4 (macOS arm64)
error: script "start" exited with code 1

I don't think that this is correct behaviour. Probably this bug is part of #139

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions