addChain
Adds the new chain to the list of supported chains if it does not already exist, otherwise it updates the existing chain by the genesis hash.
Usage
- main.ts
import { algorand, voi } from '@kibisis/chains';
import { createKatavault } from '@kibisis/katavault-core';
const katavault = await createKatavault({
chains: [voi],
});
await katavault.addChain(algorand);
Parameters
chain
- Type:
ChainWithNetworkParameters
The chain to be added.
Returns
Promise<ChainWithNetworkParameters>
A promise that resolves to the chain with the fetched network parameters.
Throws
FailedToFetchNetworkError
If the chain's network parameters could not be fetched.