Skip to content

Commit db33191

Browse files
authored
Merge pull request #2106 from AmbireTech/config/remove-og-fee-waiver
Config / Remove the Swap & Bridge fee waiver for Ambire OGs
2 parents c4fdbb4 + d6d38d3 commit db33191

6 files changed

Lines changed: 4 additions & 20 deletions

File tree

src/controllers/main/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ export class MainController extends EventEmitter implements IMainController {
379379
selectedAccount: this.selectedAccount,
380380
networks: this.networks,
381381
activity: this.activity,
382-
invite: this.invite,
383382
storage: this.storage,
384383
phishing: this.phishing,
385384
swapProvider: new SwapProviderParallelExecutor([LiFiProvider, SocketProvider]),

src/controllers/swapAndBridge/swapAndBridge.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import { IAccountsController } from '../../interfaces/account'
1111
import { IActivityController } from '../../interfaces/activity'
1212
import { Statuses } from '../../interfaces/eventEmitter'
13-
import { IInviteController } from '../../interfaces/invite'
1413
import { ExternalSignerControllers, IKeystoreController } from '../../interfaces/keystore'
1514
import { INetworksController, Network } from '../../interfaces/network'
1615
import { IPhishingController } from '../../interfaces/phishing'
@@ -131,8 +130,6 @@ export class SwapAndBridgeController extends EventEmitter implements ISwapAndBri
131130

132131
#activity: IActivityController
133132

134-
#invite: IInviteController
135-
136133
#storage: IStorageController
137134

138135
#serviceProviderAPI: SwapProvider
@@ -278,7 +275,6 @@ export class SwapAndBridgeController extends EventEmitter implements ISwapAndBri
278275
activity,
279276
storage,
280277
phishing,
281-
invite,
282278
portfolioUpdate,
283279
relayerUrl,
284280
isMainSignAccountOpThrowingAnEstimationError,
@@ -299,7 +295,6 @@ export class SwapAndBridgeController extends EventEmitter implements ISwapAndBri
299295
activity: IActivityController
300296
storage: IStorageController
301297
phishing: IPhishingController
302-
invite: IInviteController
303298
relayerUrl: string
304299
portfolioUpdate?: (chainsToUpdate: Network['chainId'][]) => void
305300
isMainSignAccountOpThrowingAnEstimationError?: Function
@@ -325,7 +320,6 @@ export class SwapAndBridgeController extends EventEmitter implements ISwapAndBri
325320
this.#serviceProviderAPI = swapProvider
326321
this.#storage = storage
327322
this.#phishing = phishing
328-
this.#invite = invite
329323
this.#relayerUrl = relayerUrl
330324
this.#getUserRequests = getUserRequests
331325
this.#getVisibleUserRequests = getVisibleUserRequests
@@ -1568,7 +1562,6 @@ export class SwapAndBridgeController extends EventEmitter implements ISwapAndBri
15681562
userAddress: this.#selectedAccount.account.addr,
15691563
sort: this.routePriority,
15701564
isWrapOrUnwrap,
1571-
isOG: this.#invite.isOG,
15721565
accountNativeBalance: this.#accountNativeBalance(bigintFromAmount),
15731566
nativeSymbol: network?.nativeAssetSymbol || 'ETH'
15741567
})

src/interfaces/swapAndBridge.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ export interface ProviderQuoteParams {
479479
fromAmount: bigint
480480
userAddress: string
481481
sort: 'time' | 'output'
482-
isOG: boolean
483482
isWrapOrUnwrap: boolean
484483
accountNativeBalance: bigint
485484
nativeSymbol: string
@@ -522,7 +521,6 @@ export interface SwapProvider {
522521
fromAmount,
523522
userAddress,
524523
sort,
525-
isOG,
526524
accountNativeBalance,
527525
nativeSymbol
528526
}: ProviderQuoteParams): Promise<SwapAndBridgeQuote>

src/services/lifi/api.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
ExtendedChain as LiFiExtendedChain,
3-
Step as LiFiIncludedStep,
3+
LiFiStep,
44
Route as LiFiRoute,
55
RoutesResponse as LiFiRoutesResponse,
66
StatusResponse as LiFiRouteStatusResponse,
7-
LiFiStep,
7+
Step as LiFiIncludedStep,
88
Token as LiFiToken,
99
TokensResponse as LiFiTokensResponse,
1010
ToolError
@@ -446,8 +446,6 @@ export class LiFiAPI implements SwapProvider {
446446
userAddress,
447447
sort,
448448
isWrapOrUnwrap,
449-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
450-
isOG,
451449
accountNativeBalance,
452450
nativeSymbol
453451
}: ProviderQuoteParams): Promise<SwapAndBridgeQuote> {
@@ -505,8 +503,7 @@ export class LiFiAPI implements SwapProvider {
505503
}
506504
}
507505

508-
const shouldRemoveConvenienceFee =
509-
isOG || isWrapOrUnwrap || isNoFeeToken(fromChainId, fromTokenAddress)
506+
const shouldRemoveConvenienceFee = isWrapOrUnwrap || isNoFeeToken(fromChainId, fromTokenAddress)
510507
if (shouldRemoveConvenienceFee) delete body.options.fee
511508

512509
const url = `${this.#baseUrl}/advanced/routes`

src/services/socket/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ export class SocketAPI implements SwapProvider {
265265
toTokenAddress,
266266
fromAmount,
267267
userAddress,
268-
isOG,
269268
isWrapOrUnwrap,
270269
accountNativeBalance,
271270
nativeSymbol
@@ -288,7 +287,7 @@ export class SocketAPI implements SwapProvider {
288287
})
289288
const feeTakerAddress = AMBIRE_FEE_TAKER_ADDRESSES[fromChainId]
290289
const shouldIncludeConvenienceFee =
291-
!!feeTakerAddress && !isOG && !isWrapOrUnwrap && !isNoFeeToken(fromChainId, fromTokenAddress)
290+
!!feeTakerAddress && !isWrapOrUnwrap && !isNoFeeToken(fromChainId, fromTokenAddress)
292291
if (shouldIncludeConvenienceFee) {
293292
params.append('feeTakerAddress', feeTakerAddress)
294293
params.append('feeBps', (FEE_PERCENT * 100).toString())

src/services/swapIntegrators/swapProviderParallelExecutor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ export class SwapProviderParallelExecutor {
232232
fromAmount,
233233
userAddress,
234234
sort,
235-
isOG,
236235
accountNativeBalance,
237236
nativeSymbol,
238237
isWrapOrUnwrap
@@ -250,7 +249,6 @@ export class SwapProviderParallelExecutor {
250249
fromAmount,
251250
userAddress,
252251
sort,
253-
isOG,
254252
accountNativeBalance,
255253
nativeSymbol,
256254
isWrapOrUnwrap

0 commit comments

Comments
 (0)