-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NO CHANGELOG][Add Funds Widget] Add funds update useRoutes to handle…
… rate limiting (#2189)
- Loading branch information
1 parent
c94d48d
commit a154af5
Showing
5 changed files
with
175 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/checkout/widgets-lib/src/widgets/add-funds/functions/delay.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const delay = (ms: number) => new Promise((resolve) => { | ||
setTimeout(resolve, ms); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/checkout/widgets-lib/src/widgets/add-funds/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
import { TokenBalance } from '@0xsquid/sdk/dist/types'; | ||
import { RouteResponse, Token } from '@0xsquid/squid-types'; | ||
|
||
export type Chain = { | ||
id: string; | ||
type: string; | ||
name: string; | ||
iconUrl: string; | ||
}; | ||
|
||
export type AmountData = { | ||
fromToken: Token; | ||
fromAmount: string; | ||
toToken: Token; | ||
toAmount: string; | ||
balance: TokenBalance; | ||
}; | ||
|
||
export type RouteData = { | ||
amountData: AmountData; | ||
route: RouteResponse; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters