# Error with both avail and polkadot sdk calling api.rpc.chain.getBlock

**URL:** <https://forum.availproject.org/t/error-with-both-avail-and-polkadot-sdk-calling-api-rpc-chain-getblock/1174>\
**Category:** Q&A/Troubleshooting\
**Tags:** goldberg\
**Created:** [March 6, 2024, 2:11pm UTC](https://forum.availproject.org/t/error-with-both-avail-and-polkadot-sdk-calling-api-rpc-chain-getblock/1174 "2024-03-06T14:11:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JozzyScript](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/jozzyscript/32/681_2.png) [@JozzyScript](https://forum.availproject.org/u/JozzyScript)\
**Post date:** [March 6, 2024, 2:11pm UTC](https://forum.availproject.org/t/error-with-both-avail-and-polkadot-sdk-calling-api-rpc-chain-getblock/1174/1 "2024-03-06T14:11:05Z")

</div>

Hello, i am trying to interact with blockchain via @polkadot ts library and the starting point is to get the latest finalized block. However, i could not manage to get a block with  
(I am connecting to testnet with `wss://goldberg.avail.tools/ws`)

```ts
    const signedBlock = await this.api.rpc.chain.getBlock(
      blockHash,
    );

```

the error message is:

```auto
createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: findMetaCall: Unable to find Call with index [0, 29]/[0,29]

```

The `api.rpc.chain.getFinalizedHead` function retrieves the correct blockhash.

can anyone help me about this?

---

<div class="post-metadata">

**Author:** ![robin-rrt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/robin-rrt/32/15_2.png) [@robin-rrt](https://forum.availproject.org/u/robin-rrt)\
**Post date:** [March 7, 2024, 5:39pm UTC](https://forum.availproject.org/t/error-with-both-avail-and-polkadot-sdk-calling-api-rpc-chain-getblock/1174/2 "2024-03-07T17:39:57Z")

</div>

Hey, I tried recreating your issue with avail-js, and it works fine for me.

Please try running the same query with [avail/avail-js at main · availproject/avail · GitHub](https://github.com/availproject/avail/tree/main/avail-js)

The Avail DA chain has some modifications that make it slightly different when compared to out-of-the-box Substrate chains. So it’s best to use AvailJS wherever possible to interact with the chain.

---

<div class="post-metadata">

**Author:** ![JozzyScript](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/jozzyscript/32/681_2.png) [@JozzyScript](https://forum.availproject.org/u/JozzyScript)\
**Post date:** [March 8, 2024, 6:13am UTC](https://forum.availproject.org/t/error-with-both-avail-and-polkadot-sdk-calling-api-rpc-chain-getblock/1174/3 "2024-03-08T06:13:12Z")

</div>

Hello, looks like i did something wrong with the `avail-js` libarary. This time it worked. I looked into the library code and i saw that it creates the api with some additional parameters:` rpc, types and signedExtentions`. Copied those and used with `@polkadot` library and it works.

```ts
      const api = await ApiPromise.create({
        provider,
        throwOnConnect: true,
        noInitWarn: true, // prob optional
        types,
        rpc,
        signedExtensions,
      });

```
