Skip to content

Commit

Permalink
📜 Add scroll alpha testnet (#1111)
Browse files Browse the repository at this point in the history
* adding scroll alpha testnet

* Update scroll.ts

* Add missing newline

---------

Co-authored-by: Łukasz Stankiewicz <[email protected]>
  • Loading branch information
afa7789 and nezouse committed May 2, 2023
1 parent 56a7c5f commit 0f7c559
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/add_scroll_alpha.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@@ -0,0 +1,5 @@
---
"@usedapp/core": patch
---

⛓ Add Scroll Alpha Testnet to chain ID
3 changes: 3 additions & 0 deletions packages/core/src/constants/chainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
RootstockTestnet,
KlaytnTestnet,
Klaytn,
ScrollAlphaTestnet,
} from '../model'

// rough alphabet order (put network from the same chain together)
Expand Down Expand Up @@ -122,6 +123,7 @@ export const DEFAULT_SUPPORTED_CHAINS = [
KlaytnTestnet,
Klaytn,
BaseGoerli,
ScrollAlphaTestnet,
]

export enum ChainId {
Expand Down Expand Up @@ -184,4 +186,5 @@ export enum ChainId {
KlaytnTestnet = 1001,
Klaytn = 8217,
BaseGoerli = 84531,
ScrollAlpha = 534353,
}
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useConfig.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('useConfig', () => {
const { result, waitForCurrent } = await renderDAppHook(() => useConfig(), { config: setup.config })
await waitForCurrent((val) => val !== undefined)
expect(result.error).to.be.undefined
expect(result.current.networks?.length).to.eq(59)
expect(result.current.networks?.length).to.eq(60)
expect(result.current.notifications?.checkInterval).to.eq(500)
expect(result.current.notifications?.expirationPeriod).to.eq(5000)
})
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/model/chain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export * from './rootstock'
export * from './klaytn'
export * from './celo'
export * from './base'
export * from './scroll'
22 changes: 22 additions & 0 deletions packages/core/src/model/chain/scroll.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Chain } from '../../constants'
import { getAddressLink, getTransactionLink } from '../../helpers/chainExplorerLink'

const scrollAlphaExplorerUrl = 'https://blockscout.scroll.io/'

export const ScrollAlphaTestnet: Chain = {
chainId: 534353,
chainName: 'Scroll Alpha Testnet',
isTestChain: true,
isLocalChain: false,
multicallAddress: '0xA940214bd0387862617E9E6EA3E801DF158692a6',
multicall2Address: '0xD5A9877C39838676955F487faC80dc9551E4921C',
rpcUrl: 'https://alpha-rpc.scroll.io/l2',
nativeCurrency: {
name: 'ETH',
symbol: 'ETH',
decimals: 18,
},
blockExplorerUrl: scrollAlphaExplorerUrl,
getExplorerAddressLink: getAddressLink(scrollAlphaExplorerUrl),
getExplorerTransactionLink: getTransactionLink(scrollAlphaExplorerUrl),
}

2 comments on commit 0f7c559

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.