From 1ce967e34b61b6afdf078597d57bdea6ba24c2d6 Mon Sep 17 00:00:00 2001 From: Anthony <75007+kwongpan@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:08:56 -0700 Subject: [PATCH] Feat/689 analyze route (#102) * add new action type and LP provider details * add/fix encoding types (#101) * feat: improve path finder request type (#99) * added chainflip types (#100) * added chainflip types * bump version * bump version * add/fix encoding types * increase version number --------- Co-authored-by: J Co-authored-by: nnoln <48334589+nnoln@users.noreply.github.com> Co-authored-by: Anthony Lau <75007+kwongpan@users.noreply.github.com> --------- Co-authored-by: corysquid <146833132+corysquid@users.noreply.github.com> Co-authored-by: J Co-authored-by: nnoln <48334589+nnoln@users.noreply.github.com> --- package.json | 2 +- src/bridges/index.ts | 2 ++ src/path/index.ts | 1 + src/quote/index.ts | 3 ++- src/routes/index.ts | 27 +++++++++++++++++++++++++-- src/squid/index.ts | 2 ++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5113b0c..9973ce8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xsquid/squid-types", - "version": "0.1.95", + "version": "0.1.96", "description": "JS and TS types relating to 0xsquid related projects.", "main": "dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/bridges/index.ts b/src/bridges/index.ts index cf8c819..94c5f17 100644 --- a/src/bridges/index.ts +++ b/src/bridges/index.ts @@ -5,6 +5,7 @@ export enum BridgeType { NOBLE_CCTP = "noble-cctp", IBC = "ibc", CHAINFLIP = "chainflip", + RFQ = "rfq", } export enum BridgeProvider { @@ -14,6 +15,7 @@ export enum BridgeProvider { IBC = "IBC", PFM = "IBC Packet forward middleware", CHAINFLIP = "Chainflip", + RFQ = "RFQ", } export type BridgeConfig = Record; diff --git a/src/path/index.ts b/src/path/index.ts index 3b42635..75c8947 100644 --- a/src/path/index.ts +++ b/src/path/index.ts @@ -65,6 +65,7 @@ export interface ActionBaseData { // bridges name: string; provider: string; + liquidityProvider: string; } export interface PathAction { diff --git a/src/quote/index.ts b/src/quote/index.ts index 00d2f2a..5d01818 100644 --- a/src/quote/index.ts +++ b/src/quote/index.ts @@ -6,6 +6,7 @@ import { PathAction, WrapDetails, FeeDetails, + LiquidityProviderDetails, } from "../index"; export interface Quote { @@ -29,5 +30,5 @@ export interface QuoteAction extends Omit { exchangeRate: string; priceImpact: string; stage?: ActionStage; - data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails; + data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails | LiquidityProviderDetails; } diff --git a/src/routes/index.ts b/src/routes/index.ts index 9d8748c..238976d 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -80,7 +80,13 @@ export interface Route { export interface RouteActionResponse extends Omit { fromChain: string; toChain: string; - data: _SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails; + data: + | _SwapDetails + | WrapDetails + | BridgeDetails + | CustomCallDetails + | FeeDetails + | LiquidityProviderDetails; } export interface RouteAction extends QuoteAction { @@ -88,7 +94,13 @@ export interface RouteAction extends QuoteAction { description?: string; logoURI?: string; estimatedDuration?: number; - data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails; + data: + | SwapDetails + | WrapDetails + | BridgeDetails + | CustomCallDetails + | FeeDetails + | LiquidityProviderDetails; } export enum ActionType { @@ -98,6 +110,7 @@ export enum ActionType { IBC_TRANSFER = "ibc-transfer", CUSTOM = "custom", FEE = "fee", + RFQ = "rfq", } export interface WrapDetails { @@ -158,6 +171,16 @@ export interface CustomCallDetails { calls: ChainCall[]; } +export interface LiquidityProviderDetails { + liquidityProvider: string; + target: string; + provider: string; + type: BridgeType; + name: string; + logoURI?: string; + calls?: ChainCall[]; +} + export interface Integrator { id: string; enabled: boolean; diff --git a/src/squid/index.ts b/src/squid/index.ts index b61fdd7..3cdea63 100644 --- a/src/squid/index.ts +++ b/src/squid/index.ts @@ -8,6 +8,8 @@ export enum SquidRouteType { BRIDGE = "BRIDGE", EVM_ONLY = "EVM_ONLY", COSMOS_ONLY = "COSMOS_ONLY", + RFQ = "RFQ", + FUND_AND_RUN_MULTICALL = "FUND_AND_RUN_MULTICALL", } export interface SquidData {