0x
Configuration
Use the zeroX factory since JavaScript identifiers cannot start with a number.
import { createConfig, zeroX } from "@spandex/core";
export const config = createConfig({
providers: [
zeroX({
// required!
apiKey: "YOUR_0X_API_KEY",
// If you have negotiated surplus sharing with 0x, override negotiatedOptions
// negotiatedFeatures: ["integratorSurplus"],
}),
// ...
],
});Fee Token Preference
0x supports fee-token selection through swapFeeToken. spanDEX forwards
dynamic tokenPreference from integratorFeeFn to that field when an integrator swap fee is
configured. 0x requires the token to be either the sell token or buy token.