Configuring the SDK
Get up and running in just a few easy steps.
Generating your config
Once you have installed the Shogun SDK, you can begin to configure it by using generateConfig
. This is where you'll setup the basic configuration for the SDK, including your RPC endpoints, routing options, and fee settings.
The only required param is affiliateName
to assign a unique identifier for your integration.
Available parameters
The following parameters enable you to customize your SDK setup:
affiliateName
Identifies the integrator of the SDK and enables activity monitoring and pro-active support.
string (required)
apiKey
Unique key given by Shogun to authenticate integrator and allow for higher rate-limits.
string (optional)
baseUrl
Base url for the Shogun API. All requests are routed through this endpoint.
string (optional)
routingFilters
Configurable settings to include/exclude specific routes, liquidity venues, chains, tokens, etc.
RoutingFilter (optional)
rpcs
Map of chain IDs to their respective RPC urls.
RPCs (optional)
chains
Array of chains that you'll support in your integration.
Chain[] (optional)
When generating your config, simply add any of the above parameters to the generateConfig
call. While affiliateName
is the only required parameter, it is highly recommended specifying your own RPC endpoints in rpcs
to avoid congestion and other issues associated with public RPC endpoints.
The following is an example of adding customized RPC urls for Arbitrum and Solana:
Updating your config
If you'd like to update your config after the initial setup, you can do so by importing the baseConfig
object. This contains all of the parameters you setup in your initial setup.
You can use baseConfig
to view your existing configs, as well as setting new values for each parameter.
Configuration Methods
getBaseConfig()
Returns all configuration parameters of the existing baseConfig
object.
getChains()
Returns a promise that resolves to a list of all enabled chains set in your baseConfig
.
getRpcs()
Returns a promise that resolves to a list of all RPC endpoints set in your baseConfig
.
set()
Set any parameter in the baseConfig
. Takes in an object of the BaseConfig
type.
After you've configured your SDK, you're ready to start submitting intents:
Last updated