From 69e4ec4232d50f88ec3529fe517de889b99d2489 Mon Sep 17 00:00:00 2001 From: Oleg Petrov <90647190+olegpetroveth@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:40:54 -0500 Subject: [PATCH] Add block times (#1089) * 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] Co-authored-by: towan <95243956+towanTG@users.noreply.github.com> --- .changeset/great-paws-impress.md | 5 +++++ packages/swapkit/helpers/src/types/chains.ts | 23 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .changeset/great-paws-impress.md diff --git a/.changeset/great-paws-impress.md b/.changeset/great-paws-impress.md new file mode 100644 index 000000000..dbaa053e9 --- /dev/null +++ b/.changeset/great-paws-impress.md @@ -0,0 +1,5 @@ +--- +"@swapkit/helpers": minor +--- + +Add blockchain times diff --git a/packages/swapkit/helpers/src/types/chains.ts b/packages/swapkit/helpers/src/types/chains.ts index 58c8e17d6..4cf0c0669 100644 --- a/packages/swapkit/helpers/src/types/chains.ts +++ b/packages/swapkit/helpers/src/types/chains.ts @@ -119,6 +119,29 @@ export const BaseDecimal: Record = { XRD: 18, }; +export const BlockTimes: Record, 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];