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

[Discuss] XDefi <> Rootstock integration #32

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This library currently supports the following blockchain networks:
| Ethereum | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| BNB Smart Chain | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| Polygon | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| Rootstock | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| Avalanche | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| Fantom | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
| Arbitrum | [EVM](https://github.com/XDeFi-tech/chains/pkgs/npm/chains-evm) | Indexer, Chain | SeedPhrase, PrivateKey, Ledger, Trezor | Yes |
Expand Down
85 changes: 85 additions & 0 deletions packages/evm/src/datasource/indexer/gql/rootstock.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
query GetRootstockBalance($address: String!) {
rootstock {
balances(address: $address) {
address
asset {
symbol
contract
id
name
image
chain
decimals
price {
amount
dayPriceChange
}
}
amount {
value
}
}
}
}

query RootstockDefaultGasFees {
rootstock {
fee {
high
low
medium
}
}
}

query GetRootstockTransactions($address: String!, $first: Int) {
rootstock {
transactions(address: $address, first: $first) {
pageInfo {
endCursor
hasNextPage
}
edges {
node {
hash
blockIndex
blockNumber
status
value
timestamp
fromAddress
transfers {
amount {
value
}
asset {
... on CryptoAsset {
chain
contract
decimals
id
image
name
price {
amount
scalingFactor
}
symbol
}
}
fromAddress
toAddress
}
}
}
}
}
}

query GetRootstockStatus {
rootstock {
status {
lastBlock
}
}
}
18 changes: 18 additions & 0 deletions packages/evm/src/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum EVMChains {
optimism = 'optimism',
klaytn = 'klaytn',
cronos = 'cronos',
rootstock = 'rootstock',
}

export const EVM_MANIFESTS: { [key in EVMChains]: Chain.Manifest } = {
Expand Down Expand Up @@ -66,6 +67,23 @@ export const EVM_MANIFESTS: { [key in EVMChains]: Chain.Manifest } = {
multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11',
maxGapAmount: 0,
},
[EVMChains.rootstock]: {
name: 'Rootstock',
description: 'EVM compatible bitcoin sidechain',
rpcURL: 'https://public-node.rsk.co',
chainSymbol: 'RBTC',
blockExplorerURL: 'https://explorer.rootstock.io',
chainId: '30',
chain: 'rootstock',
decimals: 18,
feeGasStep: {
high: 1.5,
medium: 1.25,
low: 1,
},
multicallContractAddress: '0xcA11bde05977b3631167028862bE2a173976CA11',
maxGapAmount: 0,
},
[EVMChains.avalanche]: {
name: 'Avalanche',
description: '',
Expand Down