polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.06k stars 342 forks source link

Polkadot xcm type cannot be parsed (Bifrost chain) #5887

Open hqwangningbo opened 1 month ago

hqwangningbo commented 1 month ago
    const wsProvider = new WsProvider("wss://hk.p.bifrost-rpc.liebi.com/ws");
    const parachain_api =  await ApiPromise.create({ provider: wsProvider });

    const result = await parachain_api.query.polkadotXcm.queries(0);
    console.log(result.toString()) // {"versionNotifier":{"origin":{"v2":{"parents":1,"interior":{"here":null}}},"isActive":true}}
    const result1 = await parachain_api.query.polkadotXcm.queries(1);
    // error: Error: Unable to decode storage polkadotXcm.queries

full logs: Error: Unable to decode storage polkadotXcm.queries: entry 0:: createType(PalletXcmQueryStatus):: {"_enum":{"Pending":"{\"responder\":\"XcmVersionedMultiLocation\",\"maybeMatchQuerier\":\"Option\",\"maybeNotify\":\"Option<(u8,u8)>\",\"timeout\":\"u32\"}","VersionNotifier":"{\"origin\":\"XcmVersionedMultiLocation\",\"isActive\":\"bool\"}","Ready":"{\"response\":\"XcmVersionedResponse\",\"at\":\"u32\"}"}}:: Decoded input doesn't match input, received 0x0001010000e0d80900 (9 bytes), created 0x000101000001d80900000000 (12 bytes)

TarikGul commented 1 month ago

Looks to be an issue with the provided types. Is PalletXcmQueryStatus a Bifrost speciifc type?

Was this working before then there was some sort of update with bifrost?

hqwangningbo commented 1 month ago

Since polkadotXcm is maintained by the polkadot sdk, I didn't pay attention to it, but just stumbled upon this problem

TarikGul commented 1 month ago

Thanks, I'll have a look into this and see if It can be resolved today!