Context:
I'm trying to fetch datas from an ended crowdloan. The crowdloan is on kusama, for parachain id 2113.
I first connect:
async function connect() {
let endpoint = config.endpoint;
global.endpoint = endpoint;
const provider = new WsProvider(endpoint);
const api = await ApiPromise.create({
provider,
...spec
});
return api;
}
then fetch the addresses of the users that contributed:
async function fetchCrowdloan() {
try {
const api = await connect();
console.log(await api.derive.crowdloan.contributions(2113))
process.exit(0)
// other stuff
} catch (error) {
console.log(error)
process.exit(1)
}
}
Yesterday, when i ran my script, an array of the 478 users i expected to be here, was logged in the terminal. I closed my PC, went to sleep, and this morning, it doesn't work anymore, I get this error:
2022-06-23 12:27:51 RPC-CORE: getKeysPaged(childKey: PrefixedStorageKey, prefix: StorageKey, count: u32, startKey?: StorageKey, at?: Hash): Vec<StorageKey>:: creat
eType(StorageKey):: Expected hex value to convert, found '0x'
2022-06-23 12:27:51 DRR: createType(StorageKey):: Expected hex value to convert, found '0x'
Error: createType(StorageKey):: Expected hex value to convert, found '0x'
at createTypeUnsafe (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/types-create/cjs/create/type.js:73:18)
at TypeRegistry.createTypeUnsafe (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/types/cjs/create/registry.js:333:46)
at /home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/rpc-core/cjs/bundle.js:395:50
at Array.map (<anonymous>)
at RpcCore._formatInputs (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/rpc-core/cjs/bundle.js:395:19)
at callWithRegistry (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/rpc-core/cjs/bundle.js:252:27)
at Observable._subscribe (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/@polkadot/rpc-core/cjs/bundle.js:266:9)
at Observable._trySubscribe (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
at /home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
at Object.errorContext (/home/erudyx/work/rusty-crewmates/polkadot/kusama-crowdloan-snapshot/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
Was there an update in the api of kusama in the night ? How can i solve it ?
Update: all of the other calls are working fine, it's really just the contribution()
function