Skip to content

Commit

Permalink
Feat/689 analyze route (#102)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: nnoln <[email protected]>
Co-authored-by: Anthony Lau <[email protected]>

---------

Co-authored-by: corysquid <[email protected]>
Co-authored-by: J <[email protected]>
Co-authored-by: nnoln <[email protected]>
  • Loading branch information
4 people authored Aug 7, 2024
1 parent 7204644 commit 1ce967e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/bridges/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum BridgeType {
NOBLE_CCTP = "noble-cctp",
IBC = "ibc",
CHAINFLIP = "chainflip",
RFQ = "rfq",
}

export enum BridgeProvider {
Expand All @@ -14,6 +15,7 @@ export enum BridgeProvider {
IBC = "IBC",
PFM = "IBC Packet forward middleware",
CHAINFLIP = "Chainflip",
RFQ = "RFQ",
}

export type BridgeConfig = Record<string, string>;
1 change: 1 addition & 0 deletions src/path/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface ActionBaseData {
// bridges
name: string;
provider: string;
liquidityProvider: string;
}

export interface PathAction {
Expand Down
3 changes: 2 additions & 1 deletion src/quote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PathAction,
WrapDetails,
FeeDetails,
LiquidityProviderDetails,
} from "../index";

export interface Quote {
Expand All @@ -29,5 +30,5 @@ export interface QuoteAction extends Omit<PathAction, "data"> {
exchangeRate: string;
priceImpact: string;
stage?: ActionStage;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails | LiquidityProviderDetails;
}
27 changes: 25 additions & 2 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,27 @@ export interface Route {
export interface RouteActionResponse extends Omit<RouteAction, "fromChain" | "toChain" | "data"> {
fromChain: string;
toChain: string;
data: _SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
data:
| _SwapDetails
| WrapDetails
| BridgeDetails
| CustomCallDetails
| FeeDetails
| LiquidityProviderDetails;
}

export interface RouteAction extends QuoteAction {
provider?: string;
description?: string;
logoURI?: string;
estimatedDuration?: number;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails;
data:
| SwapDetails
| WrapDetails
| BridgeDetails
| CustomCallDetails
| FeeDetails
| LiquidityProviderDetails;
}

export enum ActionType {
Expand All @@ -98,6 +110,7 @@ export enum ActionType {
IBC_TRANSFER = "ibc-transfer",
CUSTOM = "custom",
FEE = "fee",
RFQ = "rfq",
}

export interface WrapDetails {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/squid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1ce967e

Please sign in to comment.