Skip to content

Commit f8ef3bf

Browse files
feat(config): set default integrator string (#107)
1 parent 2c180fd commit f8ef3bf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/services/ConfigService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export default class ConfigService {
4949
rpcs: ConfigService.chainIdToObject([]),
5050
multicallAddresses: ConfigService.chainIdToObject(undefined),
5151
defaultExecutionSettings: DefaultExecutionSettings,
52-
defaultRouteOptions: {},
52+
defaultRouteOptions: {
53+
integrator: 'lifi-sdk',
54+
},
5355
}
5456
}
5557

src/services/ConfigService.unit.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChainId, ChainType, getChainById, supportedChains } from '../types'
1+
import { ChainId, getChainById, supportedChains } from '../types'
22
import ConfigService from './ConfigService'
33

44
let configService: ConfigService
@@ -13,7 +13,9 @@ describe('ConfigService', () => {
1313
const defaultConfig = configService.getConfig()
1414

1515
expect(defaultConfig.apiUrl).toEqual('https://li.quest/v1/')
16-
expect(defaultConfig.defaultRouteOptions).toEqual({})
16+
expect(defaultConfig.defaultRouteOptions).toEqual({
17+
integrator: 'lifi-sdk',
18+
})
1719
expect(defaultConfig.rpcs).toBeDefined()
1820
expect(defaultConfig.multicallAddresses).toBeDefined()
1921
expect(
@@ -52,6 +54,7 @@ describe('ConfigService', () => {
5254
const configB = {
5355
defaultRouteOptions: {
5456
slippage: 0,
57+
integrator: 'new-integrator',
5558
},
5659
}
5760
const mergedConfig = configService.updateConfig(configB)
@@ -62,6 +65,9 @@ describe('ConfigService', () => {
6265
expect(mergedConfig.defaultRouteOptions.slippage).toEqual(
6366
configB.defaultRouteOptions.slippage
6467
)
68+
expect(mergedConfig.defaultRouteOptions.integrator).toEqual(
69+
configB.defaultRouteOptions.integrator
70+
)
6571
})
6672

6773
it('should merge the default execution settings', () => {

0 commit comments

Comments
 (0)