-
Notifications
You must be signed in to change notification settings - Fork 3
feat(swaps): add SwapManager and SwapProvider interface #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| /** | ||
| * Base parameters for requesting a swap quote | ||
| */ | ||
| interface SwapQuoteParamsBase<TProviderOptions = unknown> { |
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.
@heyllog @TrueCarry
Correct me if I'm wrong but we are probably would need all models related to Swap it api/models layer, so we could use them in iOS/Android SDK also
If so the they should be moved there and probably simplified (e.g. no generics or classes) so we could generate them
| fromToken: UserFriendlyAddress | 'TON'; | ||
| toToken: UserFriendlyAddress | 'TON'; | ||
| fromAmount: string; | ||
| toAmount: string; |
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.
@heyllog Shouldn't we use TokenAmount type here?
| */ | ||
| export interface SwapQuote { | ||
| fromToken: UserFriendlyAddress | 'TON'; | ||
| toToken: UserFriendlyAddress | 'TON'; |
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.
@heyllog I remember I saw such hack in jettons api caching. Maybe we could find a better way to do it? I understand purposes and logic but it's quite frustrating.
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.
I think it'll be better to represent it same as with do with similar types
export type SwapToken =
| { type: 'jetton'; value: UserFriendlyAddress }
| { type: 'ton'}
...
fromToken: SwapToken;
This also will solve problems with reusing models with mobile SDKs
ProudOfZiggy
left a comment
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.
Need to discuss how we will handle those models according to our current api layer, so we could support those models on all platforms
No description provided.