Skip to content
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

add dchain #2354

Merged
merged 8 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/proud-baboons-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"viem": patch
---

Added dchain chain
Binary file modified bun.lockb
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess u can add it to .gitignore for better future PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please revert this change.

all done, can u approve?

Copy link
Member

Choose a reason for hiding this comment

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

Revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be removing the bun.lockb file – just reverting it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We shouldn't be removing the bun.lockb file – just reverting it.

done

Binary file not shown.
24 changes: 24 additions & 0 deletions src/chains/definitions/dchain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

export const dchain = /*#__PURE__*/ defineChain({
...chainConfig,
id: 2716446429837000,
name: 'Dchain',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://dchain-2716446429837000-1.jsonrpc.sagarpc.io'],
},
},
blockExplorers: {
default: {
name: 'Dchain Explorer',
url: 'https://dchain-2716446429837000-1.sagaexplorer.io',
apiUrl: 'https://api-dchain-2716446429837000-1.sagaexplorer.io/api',
},
},
contracts: {
...chainConfig.contracts,
},
})
27 changes: 27 additions & 0 deletions src/chains/definitions/dchainTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { chainConfig } from '../../op-stack/chainConfig.js'
import { defineChain } from '../../utils/chain/defineChain.js'

export const dchainTestnet = /*#__PURE__*/ defineChain({
...chainConfig,
id: 2713017997578000,
name: 'Dchain Testnet',
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: [
'https://dchaintestnet-2713017997578000-1.jsonrpc.testnet.sagarpc.io',
],
},
},
blockExplorers: {
default: {
name: 'Dchain Explorer',
url: 'https://dchaintestnet-2713017997578000-1.testnet.sagaexplorer.io',
apiUrl:
'https://api-dchaintestnet-2713017997578000-1.testnet.sagaexplorer.io/api',
},
},
contracts: {
...chainConfig.contracts,
},
})
2 changes: 2 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export { crossbell } from './definitions/crossbell.js'
export { cyber } from './definitions/cyber.js'
export { cyberTestnet } from './definitions/cyberTestnet.js'
export { darwinia } from './definitions/darwinia.js'
export { dchain } from './definitions/dchain.js'
export { dchainTestnet } from './definitions/dchainTestnet.js'
export { defichainEvm } from './definitions/defichainEvm.js'
export { defichainEvmTestnet } from './definitions/defichainEvmTestnet.js'
export { degen } from './definitions/degen.js'
Expand Down