Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/0xsquid/squid-types into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
jmdev3 committed Jul 15, 2024
1 parent 001c43f commit 149dfee
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsquid/squid-types",
"version": "0.1.88-fee",
"version": "0.1.89-fee",
"description": "JS and TS types relating to 0xsquid related projects.",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -42,9 +42,7 @@
"dependencies": {
"@axelar-network/axelarjs-sdk": "^0.16.1",
"@ethersproject/providers": "^5.7.2",
"long": "^5.2.3",
"typescript": "*",
"ws": "^8.18.0"
"typescript": "*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.4.0",
Expand Down
3 changes: 2 additions & 1 deletion src/quote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SwapDetails,
PathAction,
WrapDetails,
FeeDetails,
} from "../index";

export interface Quote {
Expand All @@ -28,5 +29,5 @@ export interface QuoteAction extends Omit<PathAction, "data"> {
exchangeRate: string;
priceImpact: string;
stage?: ActionStage;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails;
}
62 changes: 61 additions & 1 deletion src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface RouteAction extends QuoteAction {
description?: string;
logoURI?: string;
estimatedDuration?: number;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails;
data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails;
}

export enum ActionType {
Expand Down Expand Up @@ -157,6 +157,66 @@ export interface CustomCallDetails {
calls: ChainCall[];
}

export enum FEES_ENUM {
PLATFORM = "PLATFORM",
INTEGRATOR = "INTEGRATOR",
CHAIN = "CHAIN",
TOKEN = "TOKEN",
TIER = "TIER",
}

export interface FeeDetails {
platformFee: {
type: FEES_ENUM.PLATFORM;
flat: number;
percentage: number;
enabled: boolean;
address: string;
};
integratorFee: {
type: FEES_ENUM.INTEGRATOR;
flat: number;
percentage: number;
flat2?: number;
percentage2?: number;
squidFlat: number;
squidPercentage: number;
enabled: boolean;
waivePlatformFee: boolean;
address: string;
address2?: string;
};
chainFee: {
type: FEES_ENUM.CHAIN;
flat: number;
percentage: number;
enabled: boolean;
waivePlatformFee: boolean;
};
tokenFee: {
type: FEES_ENUM.TOKEN;
flat: number;
percentage: number;
enabled: boolean;
waivePlatformFee: boolean;
};
tierFee: {
type: FEES_ENUM.TIER;
flat: number;
percentage: number;
enabled: boolean;
waivePlatformFee: boolean;
};
totalFeeAmount: bigint;
platformFeeAmount: bigint;
integratorFeeAmount: bigint;
integratorFee2Amount: bigint;
squidFeeAmount: bigint;
chainFeeAmount: bigint;
tokenFeeAmount: bigint;
tierFeeAmount: bigint;
}

export interface Hook {
chainType: ChainType;
fundAmount: string;
Expand Down

0 comments on commit 149dfee

Please sign in to comment.