Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
add sellAmountBeforeFee to PostOrderParams
Browse files Browse the repository at this point in the history
  • Loading branch information
W3stside committed Mar 14, 2022
1 parent ba97105 commit e1c8be9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/custom/utils/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface PostOrderParams {
kind: OrderKind
inputAmount: CurrencyAmount<Currency>
outputAmount: CurrencyAmount<Currency>
sellAmountBeforeFee: CurrencyAmount<Currency>
feeAmount: CurrencyAmount<Currency> | undefined
sellToken: Token
buyToken: Token
Expand Down Expand Up @@ -70,6 +71,7 @@ export async function signAndPostOrder(params: PostOrderParams): Promise<AddUnse
recipient,
allowsOffchainSigning,
appDataHash,
sellAmountBeforeFee,
} = params

// fee adjusted input amount
Expand Down Expand Up @@ -138,6 +140,9 @@ export async function signAndPostOrder(params: PostOrderParams): Promise<AddUnse

// Additional API info
apiAdditionalInfo: undefined,

// sell amount BEFORE fee - necessary for later calculations (unfilled orders)
sellAmountBeforeFee: sellAmountBeforeFee.quotient.toString(),
}

return {
Expand Down

0 comments on commit e1c8be9

Please sign in to comment.