Skip to content

Commit

Permalink
Add block times (#1089)
Browse files Browse the repository at this point in the history
* feat: add BlockTimes constant for average block times in milliseconds

* Add blockchain times

* changeset

* minor version

* feat: make blocktimes chain optional

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: towan <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent d38de3e commit 69e4ec4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-paws-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/helpers": minor
---

Add blockchain times
23 changes: 23 additions & 0 deletions packages/swapkit/helpers/src/types/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@ export const BaseDecimal: Record<Chain, number> = {
XRD: 18,
};

export const BlockTimes: Record<Partial<Chain>, number> = {
[Chain.Arbitrum]: 0.3,
[Chain.Avalanche]: 3,
[Chain.Base]: 2,
[Chain.BinanceSmartChain]: 3,
[Chain.Bitcoin]: 600,
[Chain.BitcoinCash]: 600,
[Chain.Chainflip]: 5,
[Chain.Cosmos]: 2,
[Chain.Dash]: 150,
[Chain.Dogecoin]: 600,
[Chain.Ethereum]: 12.5,
[Chain.Kujira]: 2.2,
[Chain.Litecoin]: 150,
[Chain.Maya]: 6,
[Chain.Optimism]: 2,
[Chain.Polkadot]: 6,
[Chain.Polygon]: 2.1,
[Chain.Radix]: 5,
[Chain.Solana]: 0.4,
[Chain.THORChain]: 6,
};

export type SubstrateChain = Chain.Polkadot | Chain.Chainflip;
export const SubstrateChains = [Chain.Polkadot, Chain.Chainflip];

Expand Down

0 comments on commit 69e4ec4

Please sign in to comment.