Custom chain adapters
If you need more control over the chain interactions than the included chain adapters provider, you can also implement your own or extend an existing one.
Implementing and using your own chain adapters can lead to a loss of funds if implemented incorrectly. Please make sure to test your adapter on a testnet thoroughly before using it with real funds.
Implementing your own custom chain adapter
All you need to implement your own chain adapter is to implement the ChainAdapter
type exported by the SDK. You can find a list of the required properties in the chain adapter introduction. It would like something like this:
Extending an existing chain adapter
If you only want to tweak a specific aspect of an existing chain adapter, you could simply take one as base and only re-implement some specific functions. Example:
Please check this section for guidance on how to interact with the Rhino bridge contracts if you plan on implementing a custom bridge deposit function.