diff --git a/package.json b/package.json index 6741a09..f70f97a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/src/quote/index.ts b/src/quote/index.ts index 4939d5d..00d2f2a 100644 --- a/src/quote/index.ts +++ b/src/quote/index.ts @@ -5,6 +5,7 @@ import { SwapDetails, PathAction, WrapDetails, + FeeDetails, } from "../index"; export interface Quote { @@ -28,5 +29,5 @@ export interface QuoteAction extends Omit { exchangeRate: string; priceImpact: string; stage?: ActionStage; - data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails; + data: SwapDetails | WrapDetails | BridgeDetails | CustomCallDetails | FeeDetails; } diff --git a/src/routes/index.ts b/src/routes/index.ts index f2013ed..617caaa 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -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 { @@ -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;