updates to mixin

This commit is contained in:
Noah Khamliche
2022-04-08 14:29:06 -04:00
parent afe77a432c
commit 52a3ffa77c
3 changed files with 11 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ import {
GeistFillData,
GenericRouterFillData,
GMXFillData,
GMXSwapFillData,
KyberDmmFillData,
KyberFillData,
LidoFillData,
@@ -372,7 +373,7 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
break;
case ERC20BridgeSource.GMX:
const gmxFillData = (order as OptimizedMarketBridgeOrder<GMXFillData>).fillData;
bridgeData = encoder.encode([gmxFillData.reader, gmxFillData.vault, gmxFillData.tokenAddressPath]);
bridgeData = encoder.encode([gmxFillData.router,gmxFillData.reader,gmxFillData.vault, gmxFillData.tokenAddressPath]);
break;
default:

View File

@@ -1219,6 +1219,7 @@ export class SamplerOperations {
});
}
public getGMXSellQuotes(
router: string,
reader: string,
vault: string,
tokenAddressPath: string[],
@@ -1226,7 +1227,7 @@ export class SamplerOperations {
): SourceQuoteOperation<GMXFillData> {
return new SamplerContractOperation({
source: ERC20BridgeSource.GMX,
fillData: {reader, vault, tokenAddressPath },
fillData: {router, reader, vault, tokenAddressPath },
contract: this._samplerContract,
function: this._samplerContract.sampleSellsFromGMX,
params: [reader, vault, tokenAddressPath, takerFillAmounts],
@@ -1627,9 +1628,10 @@ export class SamplerOperations {
case ERC20BridgeSource.GMX: {
return this.getGMXSellQuotes(
GMX_ROUTER_BY_CHAIN_ID[this.chainId],
GMX_READER_BY_CHAIN_ID[this.chainId],
GMX_VAULT_BY_CHAIN_ID[this.chainId],
[makerToken, takerToken],
[takerToken, makerToken],
takerFillAmounts,
);
}

View File

@@ -229,10 +229,15 @@ export interface GMXQuoteFillData extends FillData {
vault: string;
}
export interface GMXFillData extends FillData {
router: string;
reader: string;
vault: string;
tokenAddressPath: string[];
}
export interface GMXSwapFillData extends FillData {
router: string;
tokenAddressPath: string[];
}
export interface ShellFillData extends FillData {
poolAddress: string;