Skip to content

Commit 3f53d6e

Browse files
authored
Merge pull request #385 from greg-rhinestone/greg/intent-cost-fee-breakdown
feat: add fee breakdown typings to IntentCost
2 parents 78378d2 + 9529d31 commit 3f53d6e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

src/orchestrator/types.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,28 @@ interface GasCostBreakdown {
155155
totalUSD: number
156156
}
157157

158+
interface FeeBreakdown {
159+
gasFee: string
160+
bridgeFee: string
161+
protocolFee: string
162+
swapFee: string
163+
settlementFee: string
164+
}
165+
166+
interface FeesByTokenEntry {
167+
amount: string
168+
breakdown: FeeBreakdown
169+
}
170+
171+
interface FeeBreakdownUSD {
172+
gasFeeUSD: number
173+
bridgeFeeUSD: number
174+
protocolFeeUSD: number
175+
swapFeeUSD: number
176+
settlementFeeUSD: number
177+
totalFeeUSD: number
178+
}
179+
158180
interface IntentCost {
159181
hasFulfilledAll: boolean
160182
tokensReceived: [
@@ -164,6 +186,8 @@ interface IntentCost {
164186
amountSpent: string
165187
destinationAmount: string
166188
fee: string
189+
feeBreakdown?: FeeBreakdown
190+
feesByToken?: Record<Address, FeesByTokenEntry>
167191
},
168192
]
169193
sponsoredFee: {
@@ -180,6 +204,7 @@ interface IntentCost {
180204
}
181205
}
182206
gasCost?: GasCostBreakdown
207+
feeBreakdownUSD?: FeeBreakdownUSD
183208
}
184209

185210
export interface Op {
@@ -459,6 +484,9 @@ export type {
459484
SettlementLayer,
460485
IntentInput,
461486
IntentCost,
487+
FeeBreakdown,
488+
FeesByTokenEntry,
489+
FeeBreakdownUSD,
462490
IntentRoute,
463491
IntentOp,
464492
IntentOpElement,

0 commit comments

Comments
 (0)