From 8bbe0c3d0eae107d248e8f83dc668f295bdf4a4a Mon Sep 17 00:00:00 2001 From: Avenbreaks Date: Tue, 22 Nov 2022 09:55:13 +0800 Subject: [PATCH 1/4] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..9a0bb4cd --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# ethereum-kit-android +Comprehensive EVM SDK (Gitshock, Ethereum, Binance Smart Chain, Avalanche, Arbitrum, Optimism, Polygon) for Android, implemented on Kotlin. Create wallets, watch wallets (read-only) From 0bc6d9bb221bd153c8d514aa8692e293d24a2ec8 Mon Sep 17 00:00:00 2001 From: avenbreaks Date: Tue, 22 Nov 2022 17:08:58 +0800 Subject: [PATCH 2/4] Adding New Chain --- .../main/java/io/horizontalsystems/uniswapkit/TokenFactory.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/uniswapkit/src/main/java/io/horizontalsystems/uniswapkit/TokenFactory.kt b/uniswapkit/src/main/java/io/horizontalsystems/uniswapkit/TokenFactory.kt index 98477fe4..1680c344 100644 --- a/uniswapkit/src/main/java/io/horizontalsystems/uniswapkit/TokenFactory.kt +++ b/uniswapkit/src/main/java/io/horizontalsystems/uniswapkit/TokenFactory.kt @@ -25,6 +25,7 @@ class TokenFactory(chain: Chain) { Chain.Ethereum -> "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" Chain.Optimism -> "0x4200000000000000000000000000000000000006" Chain.BinanceSmartChain -> "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c" + Chain.Gitshock -> "0x9805275fB2f4d75cb1f55ff8ca13541124b7a52B" Chain.Polygon -> "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" Chain.Avalanche -> "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7" Chain.EthereumGoerli -> "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" From f8a8096be0f31da7e96b6d1d5881cc24904e8623 Mon Sep 17 00:00:00 2001 From: avenbreaks Date: Tue, 22 Nov 2022 17:14:32 +0800 Subject: [PATCH 3/4] adding newchain --- .../java/io/horizontalsystems/ethereumkit/models/Chain.kt | 1 + .../io/horizontalsystems/ethereumkit/models/RpcSource.kt | 4 ++++ .../ethereumkit/models/TransactionSource.kt | 6 ++++++ .../main/java/io/horizontalsystems/oneinchkit/OneInchKit.kt | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/Chain.kt b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/Chain.kt index b933519c..232d82d5 100644 --- a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/Chain.kt +++ b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/Chain.kt @@ -12,6 +12,7 @@ enum class Chain( Optimism(10, 60, 15, false), ArbitrumOne(42161, 60, 15, false), Avalanche(43114, 60, 15, true), + Gitshock(212, 1, 15, true), EthereumGoerli(5, 1, 15, true); val isMainNet = coinType != 1 diff --git a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/RpcSource.kt b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/RpcSource.kt index e347b984..12ca331e 100644 --- a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/RpcSource.kt +++ b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/RpcSource.kt @@ -76,5 +76,9 @@ sealed class RpcSource() { return Http(listOf(URL("https://api.avax.network/ext/bc/C/rpc")), null) } + fun gitshockRpcHttp(): Http { + return Http(listOf(URL("https://rpc-cartenz.gitshock.com")), null) + } + } } diff --git a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/TransactionSource.kt b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/TransactionSource.kt index 82220eeb..77751590 100644 --- a/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/TransactionSource.kt +++ b/ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/models/TransactionSource.kt @@ -62,6 +62,12 @@ class TransactionSource(val name: String, val type: SourceType) { ) } + fun gitshockscan(apiKey: String): TransactionSource { + return TransactionSource( + "gitscan.gitshock.com", + SourceType.EtherScan("https://api.scan.gitshock.com", "https://gitscan.gitshock.com", apiKey) + ) + } } } diff --git a/oneinchkit/src/main/java/io/horizontalsystems/oneinchkit/OneInchKit.kt b/oneinchkit/src/main/java/io/horizontalsystems/oneinchkit/OneInchKit.kt index a74eab56..263a2aae 100644 --- a/oneinchkit/src/main/java/io/horizontalsystems/oneinchkit/OneInchKit.kt +++ b/oneinchkit/src/main/java/io/horizontalsystems/oneinchkit/OneInchKit.kt @@ -19,7 +19,7 @@ class OneInchKit( ) { val getRouterAddress: Address = when (evmKit.chain) { - Chain.Ethereum, Chain.BinanceSmartChain, Chain.Polygon, Chain.ArbitrumOne, Chain.Avalanche -> Address("0x1111111254fb6c44bac0bed2854e76f90643097d") + Chain.Ethereum, Chain.BinanceSmartChain, Chain.Polygon, Chain.ArbitrumOne, Chain.Avalanche, Chain.Avalanche, Chain.Gitshock -> Address("0x1111111254fb6c44bac0bed2854e76f90643097d") Chain.Optimism -> Address("0x1111111254760f7ab3f16433eea9304126dcd199") Chain.EthereumGoerli -> Address("0x11111112542d85b3ef69ae05771c2dccff4faa26") else -> throw IllegalArgumentException("Invalid Chain: ${evmKit.chain.id}") From 5744e5182bc5697c3716bf7a71c769fe2dbb297c Mon Sep 17 00:00:00 2001 From: Avenbreaks Date: Tue, 22 Nov 2022 17:18:04 +0800 Subject: [PATCH 4/4] Delete README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 9a0bb4cd..00000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# ethereum-kit-android -Comprehensive EVM SDK (Gitshock, Ethereum, Binance Smart Chain, Avalanche, Arbitrum, Optimism, Polygon) for Android, implemented on Kotlin. Create wallets, watch wallets (read-only)