From API
This guide will help you migrate to the SDK if you have been using the API directly before. Depending on how sophisticated your use case is, you can choose between different levels of using the SDK.
Use the bridge functions
For the vast majority of use cases you should be able to replace your manual API and blockchain calls with the bridge or prepareBridge function and the included chain adapters. Those will handle all the intricacies of the Rhino API and smart contracts correctly.
However, if you have a use case that is not covered by those, read further to learn how to use the underlying primitives of the SDK directly.
If the included chain adapters do not cover your use case, you can implement a custom chain adapter and use that with the bridge
or prepareBridge
function.
Using the SDK API wrapper
If your use case requires you to be in control of all API calls, you can still replace your manual API calls with the wrappers from the SDK to reduce the amount of code significantly:
Under api.bridge
and api.config
in the SDK you will find equivalent functions to all the manual API calls that you may have used before. The parameters are mostly the same, although some minor convenience tweaks have been made in certain wrappers.
Using the SDK chain adapters
If you would like to be directly in control of the blockchain interactions, you can use the included chain adapters directly: