-
Notifications
You must be signed in to change notification settings - Fork 110
Conversation
src/entities/protocols/uniswap.ts
Outdated
if(this.options.payerIsUser === undefined) { | ||
// default to user as payer | ||
Object.assign(this.options, { payerIsUser: true }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR also allows for the overriding of payerIsUser within SwapOptions. This is intended to be fully backward compatible - in that the default value is true if not specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good just few thoughts!
src/entities/protocols/uniswap.ts
Outdated
@@ -31,6 +31,7 @@ export type FlatFeeOptions = { | |||
// so we extend swap options with the permit2 permit | |||
// when safe mode is enabled, the SDK will add an extra ETH sweep for security | |||
export type SwapOptions = Omit<RouterSwapOptions, 'inputTokenPermit'> & { | |||
directSend?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little comment explaining what this means would be useful, and not 100% sure on the name but can't think of anything much better haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok maybe something like useRouterBalance
is more appropriate and comment like // when useRouterBalance is enabled the SDK will use the balance in the router for the swap
The code for converting a response from our routing services (classic quote) into Trade SDK objects is fragmented and duplicated in many areas: notably in the interface and external api.
This PR introduces a helper class
RouterTradeAdapter
which has a static methodfromClassicQuote
that constructs the underlyingRouterTrade
entity (from router-sdk). TheRouterTrade
entity can easily be used to create the UniversalRouterTrade entity in this SDK.