Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added packages/swap/src/common/icons/li.fi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions packages/swap/src/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import changellyIcon from "./common/icons/changelly-logo.png";
import jupiterIcon from "./common/icons/jupiter-logo.png";
import okxIcon from "./common/icons/okx-logo.png";
import rangoIcon from "./common/icons/rango-logo.png";
import lifiIcon from "./common/icons/li.fi.png";

export type SwapFeeConfig = {
referrer: string;
Expand Down Expand Up @@ -57,6 +58,10 @@ const PROVIDER_INFO: Record<
name: ProviderNameProper.changelly,
icon: changellyIcon,
},
[ProviderName.lifi]: {
name: ProviderNameProper.lifi,
icon: lifiIcon,
},
};

const FEE_CONFIGS: Partial<
Expand Down Expand Up @@ -136,6 +141,13 @@ const FEE_CONFIGS: Partial<
fee: 0.01,
},
},
// Add this address in https://portal.li.fi/integrations to collect fees
[ProviderName.lifi]: {
[WalletIdentifier.enkrypt]: {
referrer: "0x8f1c0185bb6276638774b9e94985d69d3cdb444a",
fee: 0.002,
},
},
};

const TOKEN_LISTS: {
Expand Down Expand Up @@ -188,6 +200,10 @@ const GAS_LIMITS = {
Wrap: numberToHex(70000),
};
const NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
const NATIVE_TOKEN_ADDRESS_SOLANA = "11111111111111111111111111111111";

// li.fi integrator Id defined in https://portal.li.fi/integrations
const LIFI_INTEGRATOR_ID = "encrypt-wallet";

/** 0.5% (unit: 0-100 percentage) */
const DEFAULT_SLIPPAGE = "0.5";
Expand All @@ -196,6 +212,8 @@ export {
FEE_CONFIGS,
GAS_LIMITS,
NATIVE_TOKEN_ADDRESS,
NATIVE_TOKEN_ADDRESS_SOLANA,
LIFI_INTEGRATOR_ID,
TOKEN_LISTS,
CHANGELLY_LIST,
TOP_TOKEN_INFO_LIST,
Expand Down
3 changes: 3 additions & 0 deletions packages/swap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { sortByRank, sortNativeToFront } from "./utils/common";
import SwapToken from "./swapToken";
import { Jupiter } from "./providers/jupiter";
import { OKX } from "./providers/okx";
import LiFi from "./providers/lifi";

class Swap extends EventEmitter {
network: SupportedNetworkName;
Expand Down Expand Up @@ -154,6 +155,7 @@ class Swap extends EventEmitter {
new Rango(this.api as Web3Solana, this.network),
new Changelly(this.api, this.network),
new OKX(this.api as Web3Solana, this.network),
new LiFi(this.api as Web3Eth, this.network),
];
break;
default:
Expand All @@ -165,6 +167,7 @@ class Swap extends EventEmitter {
new Changelly(this.api, this.network),
new ZeroX(this.api as Web3Eth, this.network),
new Rango(this.api as Web3Eth, this.network),
new LiFi(this.api as Web3Eth, this.network),
];
break;
}
Expand Down
Loading
Loading