From 5d6959bcb334514bd4def0f2e800834522ec5460 Mon Sep 17 00:00:00 2001 From: ahsan-javaiid Date: Mon, 22 Jul 2024 10:49:41 +0500 Subject: [PATCH] devop: add rootstock integration --- README.md | 1 + .../datasource/indexer/gql/rootstock.graphql | 85 +++++++++++++++++++ packages/evm/src/manifests.ts | 18 ++++ 3 files changed, 104 insertions(+) create mode 100644 packages/evm/src/datasource/indexer/gql/rootstock.graphql diff --git a/README.md b/README.md index fdb722cd..651294e5 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/packages/evm/src/datasource/indexer/gql/rootstock.graphql b/packages/evm/src/datasource/indexer/gql/rootstock.graphql new file mode 100644 index 00000000..8cf18677 --- /dev/null +++ b/packages/evm/src/datasource/indexer/gql/rootstock.graphql @@ -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 + } + } +} \ No newline at end of file diff --git a/packages/evm/src/manifests.ts b/packages/evm/src/manifests.ts index 46de6efe..09f32e5a 100644 --- a/packages/evm/src/manifests.ts +++ b/packages/evm/src/manifests.ts @@ -12,6 +12,7 @@ export enum EVMChains { optimism = 'optimism', klaytn = 'klaytn', cronos = 'cronos', + rootstock = 'rootstock', } export const EVM_MANIFESTS: { [key in EVMChains]: Chain.Manifest } = { @@ -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: '',