Skip to content

Commit

Permalink
Include quoteId on order placement
Browse files Browse the repository at this point in the history
  • Loading branch information
alfetopito committed Jun 29, 2022
1 parent ed623b0 commit ecf57ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/custom/hooks/useSwapCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ async function _swap(params: SwapParams): Promise<string> {
signer: library.getSigner(),
allowsOffchainSigning,
appDataHash,
quoteId: trade.quoteId,
})

let pendingOrderParams: AddUnserialisedPendingOrderParams
Expand Down
1 change: 1 addition & 0 deletions src/custom/utils/signatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface OrderCreation extends UnsignedOrder {
// - Signature: EIP-712,ETHSIGN
// - Owner address: for PRESIGN
signature: string // 65 bytes encoded as hex without `0x` prefix. r + s + v from the spec
quoteId?: number | null // TODO: replace all of this with SDK. Next PR
}

export interface SingOrderCancellationParams {
Expand Down
3 changes: 3 additions & 0 deletions src/custom/utils/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface PostOrderParams {
recipientAddressOrName: string | null
allowsOffchainSigning: boolean
appDataHash: string
quoteId?: number
}

function _getSummary(params: PostOrderParams): string {
Expand Down Expand Up @@ -72,6 +73,7 @@ export async function signAndPostOrder(params: PostOrderParams): Promise<AddUnse
allowsOffchainSigning,
appDataHash,
sellAmountBeforeFee,
quoteId,
} = params

// fee adjusted input amount
Expand Down Expand Up @@ -117,6 +119,7 @@ export async function signAndPostOrder(params: PostOrderParams): Promise<AddUnse
signingScheme,
// Include the signature
signature,
quoteId,
},
owner: account,
})
Expand Down

0 comments on commit ecf57ba

Please sign in to comment.