0

generated files augment-api-runtime.ts has a line augment-api-runtime.ts:136 which looks like this:

      /**
       * Return all the current data for a block in a single runtime call.
       **/
      currentAll: AugmentedCall<ApiType, () => Observable<ITuple<[Option<BlockV2>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>]>>>;

typescript justly throwing errors: Cannot find name 'ReceiptV0' and Cannot find name 'TransactionStatus'.

I suppose this line have to be something like this::

      /**
       * Return all the current data for a block in a single runtime call.
       **/
      currentAll: AugmentedCall<ApiType, () => Observable<ITuple<[Option<BlockV2>, Option<Vec<EthReceiptV3>>, Option<Vec<EthTransactionStatus>>]>>>;

Look at this code: https://github.com/polkadot-js/api/blob/12750bc83d8d7f01957896a80a7ba948ba3690b7/packages/types/src/interfaces/eth/runtime.ts#L180

1 Answer 1

2

It is not missing the types, rather it is applying the type names exactly as specified in the pre-v14 metadata. It doesn't apply transformations to the types received in the metadata.

So with that in mind, it is generally suggested to use a Substrate base that supports v14 metadata where all the types and their definitions are carried in the metadata itself - which removes the need to define your own types.

If you need to use a v13 metadata, for type generation to work correctly, you would need to add the corresponding types for your runtime to a definitions.ts file and pass it along with generation. This would mean either defining the specific types missing of providing aliases from the way it is described in the metadata to the names it is defined as as part of the js api runtime/rpc definitions.

2
  • what is the type ReceiptV0? and why it is only once mentioned in the whole repository? Please correct me, but it looks super weird, can you share the link on a declaration of this type?
    – sesh
    Commented Aug 11, 2022 at 19:41
  • I guess you was wrong, this bag was changed here
    – sesh
    Commented Aug 18, 2022 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.