diff --git a/src/main/kotlin/id/walt/nftkit/Values.kt b/src/main/kotlin/id/walt/nftkit/Values.kt index 55e2dc2c..d03c08a5 100644 --- a/src/main/kotlin/id/walt/nftkit/Values.kt +++ b/src/main/kotlin/id/walt/nftkit/Values.kt @@ -12,14 +12,14 @@ object Values { const val MOONBEAM_MAINNET_CHAIN_ID: Long = 1284 const val ASTAR_MAINNET_CHAIN_ID: Long = 592 const val SHIMMEREVM_TESTNET_CHAIN_ID: Long = 1073 - const val SHIMMEREVM_APPCHAIN_CHAIN_ID: Long = 1074 + const val IOTA_TESTNET_CHAIN_ID: Long = 1075 const val ETHEREUM_MAINNET_SCAN_API_URL= "api.etherscan.io" const val ETHEREUM_TESTNET_GOERLI_SCAN_API_URL = "api-goerli.etherscan.io" const val ETHEREUM_TESTNET_SEPOLIA_SCAN_API_URL = "api-sepolia.etherscan.io" const val POLYGON_MAINNET_SCAN_API_URL = "api.polygonscan.com" const val POLYGON_TESTNET_AMOY_SCAN_API_URL = "api-testnet.polygonscan.com" - const val SHIMMEREVM_APPCHAIN_BLOCK_EXPLORER_URL = "" + const val IOTA_TESTNET_BLOCK_EXPLORER_URL = "https://explorer.evm.testnet.iotaledger.net" const val ETHEREUM_MAINNET_BLOCK_EXPLORER_URL = "https://etherscan.io" const val ETHEREUM_TESTNET_GOERLI_BLOCK_EXPLORER_URL = "https://goerli.etherscan.io/" diff --git a/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/Erc721TokenStandard.kt b/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/Erc721TokenStandard.kt index 1a6c88fc..fbd151ff 100644 --- a/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/Erc721TokenStandard.kt +++ b/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/Erc721TokenStandard.kt @@ -294,7 +294,7 @@ object Erc721TokenStandard : IErc721TokenStandard { EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID - EVMChain.SHIMMEREVM_APPCHAIN -> Values.SHIMMEREVM_APPCHAIN_CHAIN_ID + EVMChain.IOTA_TESTNET -> Values.IOTA_TESTNET_CHAIN_ID } val transactionManager: TransactionManager = RawTransactionManager( web3j, credentials, chainId diff --git a/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/SoulBoundTokenStandard.kt b/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/SoulBoundTokenStandard.kt index e3fef8eb..752d5b19 100644 --- a/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/SoulBoundTokenStandard.kt +++ b/src/main/kotlin/id/walt/nftkit/chains/evm/erc721/SoulBoundTokenStandard.kt @@ -27,8 +27,8 @@ object SoulBoundTokenStandard : ISoulBoundTokenStandard { private fun loadContract(chain: EVMChain, address: String, signedAccount: String? ="") : WaltidSoulBound { val web3j = ProviderFactory.getProvider(chain)?.getWeb3j() - val privateKey: String = if((signedAccount == null || "" == (signedAccount)) && chain == EVMChain.SHIMMEREVM_APPCHAIN){ - WaltIdServices.loadChainConfig().privateKeyAppchain + val privateKey: String = if((signedAccount == null || "" == (signedAccount)) && chain == EVMChain.IOTA_TESTNET){ + WaltIdServices.loadChainConfig().privateKeyIotaTestnet }else if(signedAccount == null || "" == (signedAccount) ) { WaltIdServices.loadChainConfig().privateKey } @@ -49,7 +49,7 @@ object SoulBoundTokenStandard : ISoulBoundTokenStandard { EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID - EVMChain.SHIMMEREVM_APPCHAIN -> Values.SHIMMEREVM_APPCHAIN_CHAIN_ID + EVMChain.IOTA_TESTNET -> Values.IOTA_TESTNET_CHAIN_ID } val transactionManager: TransactionManager = RawTransactionManager( web3j, credentials, chainId @@ -106,7 +106,7 @@ object SoulBoundTokenStandard : ISoulBoundTokenStandard { EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID - EVMChain.SHIMMEREVM_APPCHAIN -> Values.SHIMMEREVM_APPCHAIN_CHAIN_ID + EVMChain.IOTA_TESTNET -> Values.IOTA_TESTNET_CHAIN_ID } val web3j = ProviderFactory.getProvider(chain)?.getWeb3j() diff --git a/src/main/kotlin/id/walt/nftkit/rest/NftKitApi.kt b/src/main/kotlin/id/walt/nftkit/rest/NftKitApi.kt index f33730f8..8c620afa 100644 --- a/src/main/kotlin/id/walt/nftkit/rest/NftKitApi.kt +++ b/src/main/kotlin/id/walt/nftkit/rest/NftKitApi.kt @@ -210,6 +210,12 @@ object NftKitApi { "chain/{chain}/contract/{contractAddress}/token/{tokenId}/getapproved", documented(NftController.getApprovedDocs(), NftController::getApproved) ) + path("IOTA_TESTNET"){ + post( + "contract/{contractAddress}/token/instances", + documented(NftController.getShimmerNFTinstancesDocs(), NftController::getShimmerNFTinstances) + ) + } path("ShimmerEVM"){ post( "contract/{contractAddress}/token/instances", diff --git a/src/main/kotlin/id/walt/nftkit/services/NftService.kt b/src/main/kotlin/id/walt/nftkit/services/NftService.kt index 8b211f1c..4e8a47bd 100644 --- a/src/main/kotlin/id/walt/nftkit/services/NftService.kt +++ b/src/main/kotlin/id/walt/nftkit/services/NftService.kt @@ -95,7 +95,7 @@ enum class Chain { ALGORAND_TESTNET, ALGORAND_BETANET, SHIMMEREVM, - SHIMMEREVM_APPCHAIN + IOTA_TESTNET } enum class EVMChain { @@ -107,7 +107,8 @@ enum class EVMChain { ASTAR, MOONBEAM, SHIMMEREVM, - SHIMMEREVM_APPCHAIN + // SHIMMEREVM_APPCHAIN, + IOTA_TESTNET } enum class TokenStandard { @@ -517,7 +518,7 @@ object NftService { fun getShimmerNFTinstances(smartContractAddress: String) : shimmerNFT { return runBlocking { - val url = "https://explorer.evm.testnet.shimmer.network/api/v2/tokens/${smartContractAddress}/instances" + val url = "https://explorer.evm.testnet.iotaledger.net/api/v2/tokens/${smartContractAddress}/instances" val nfts = client.get(url) { contentType(ContentType.Application.Json) diff --git a/src/main/kotlin/id/walt/nftkit/services/WaltIdServices.kt b/src/main/kotlin/id/walt/nftkit/services/WaltIdServices.kt index 93ec98bb..854a775b 100644 --- a/src/main/kotlin/id/walt/nftkit/services/WaltIdServices.kt +++ b/src/main/kotlin/id/walt/nftkit/services/WaltIdServices.kt @@ -19,10 +19,10 @@ data class Providers( val opal: String, val unique: String, val shimmerevm: String, - val shimmerevmAppChain : String + val iotatestnet : String ) -data class ChainConfig(val providers: Providers, val privateKey: String , val privateKeyAppchain: String) +data class ChainConfig(val providers: Providers, val privateKey: String , val privateKeyIotaTestnet: String) data class KeysConfig(val keys: Map) @@ -147,7 +147,7 @@ object WaltIdServices { EVMChain.POLYGON -> Values.POLYGON_MAINNET_BLOCK_EXPLORER_URL EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_BLOCK_EXPLORER_URL EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_BLOCK_EXPLORER_URL - EVMChain.SHIMMEREVM_APPCHAIN -> Values.SHIMMEREVM_APPCHAIN_BLOCK_EXPLORER_URL + EVMChain.IOTA_TESTNET -> Values.IOTA_TESTNET_BLOCK_EXPLORER_URL else -> { throw Exception("${chain.toString()} is not supported") } diff --git a/src/main/kotlin/id/walt/nftkit/utilis/Common.kt b/src/main/kotlin/id/walt/nftkit/utilis/Common.kt index 2e48c2fd..e8bb8b3f 100644 --- a/src/main/kotlin/id/walt/nftkit/utilis/Common.kt +++ b/src/main/kotlin/id/walt/nftkit/utilis/Common.kt @@ -114,7 +114,7 @@ object Common { } fun isEVMChain(chain: Chain): Boolean{ - val EVMChains= listOf(Chain.ETHEREUM, Chain.POLYGON, Chain.GOERLI, Chain.SEPOLIA, Chain.AMOY, Chain.SHIMMEREVM , Chain.SHIMMEREVM_APPCHAIN) + val EVMChains= listOf(Chain.ETHEREUM, Chain.POLYGON, Chain.GOERLI, Chain.SEPOLIA, Chain.AMOY, Chain.SHIMMEREVM , Chain.IOTA_TESTNET) return chain in EVMChains } diff --git a/src/main/kotlin/id/walt/nftkit/utilis/providers/ShimmerAppChain.kt b/src/main/kotlin/id/walt/nftkit/utilis/providers/IotaTestnet.kt similarity index 77% rename from src/main/kotlin/id/walt/nftkit/utilis/providers/ShimmerAppChain.kt rename to src/main/kotlin/id/walt/nftkit/utilis/providers/IotaTestnet.kt index 653283d1..05e0972e 100644 --- a/src/main/kotlin/id/walt/nftkit/utilis/providers/ShimmerAppChain.kt +++ b/src/main/kotlin/id/walt/nftkit/utilis/providers/IotaTestnet.kt @@ -4,8 +4,8 @@ import id.walt.nftkit.services.WaltIdServices import org.web3j.protocol.Web3j import org.web3j.protocol.http.HttpService -class ShimmerAppChain : Web3jInstance { +class IotaTestnet : Web3jInstance { override fun getWeb3j(): Web3j { - return Web3j.build(HttpService(WaltIdServices.loadChainConfig().providers.shimmerevmAppChain)) + return Web3j.build(HttpService(WaltIdServices.loadChainConfig().providers.iotatestnet)) } } diff --git a/src/main/kotlin/id/walt/nftkit/utilis/providers/ProviderFactory.kt b/src/main/kotlin/id/walt/nftkit/utilis/providers/ProviderFactory.kt index 2cfbf9b7..469b8989 100644 --- a/src/main/kotlin/id/walt/nftkit/utilis/providers/ProviderFactory.kt +++ b/src/main/kotlin/id/walt/nftkit/utilis/providers/ProviderFactory.kt @@ -13,7 +13,7 @@ object ProviderFactory { EVMChain.ASTAR -> AstarWeb3() EVMChain.MOONBEAM -> MoonbeamWeb3() EVMChain.SHIMMEREVM -> IotaWeb3() - EVMChain.SHIMMEREVM_APPCHAIN -> ShimmerAppChain() + EVMChain.IOTA_TESTNET -> IotaTestnet() } } diff --git a/src/main/resources/walt-default.yaml b/src/main/resources/walt-default.yaml index 9279f24d..ad2c5cdb 100644 --- a/src/main/resources/walt-default.yaml +++ b/src/main/resources/walt-default.yaml @@ -21,11 +21,12 @@ providers: moonbeam: "https://rpc.api.moonbeam.network" unique: "https://rpc.unique.network" opal: "https://rpc-opal.unique.network" - shimmerevmAppChain: "https://fpgaonkrwz.dune.spyce5.com/wasp/api/v1/chains/rms1pzhlaz2aalpsktkqacayyl2xr6s3rsa5h69lmc7mleq4wnaryejkgnprd6k/evm" + iotatestnet: "https://json-rpc.evm.testnet.iotaledger.net" shimmerevm : "https://json-rpc.evm.testnet.shimmer.network" #privateKey: "bd4cb3e507f342ee3a710370cef39dda48f17b0a158b0b8dd3f000fbd5b2c2d9" -privateKeyAppchain: "57901fd46ccf70f3f21e3f16815c9b18add89e0d7f2fcb3c847882ad8126408d" +privateKeyIotaTestnet: "3166cf13febd8b817cdd2a88dac1e76ddd3fc413f16c1c3dcb7b2c2eb0cd3b63" +#"57901fd46ccf70f3f21e3f16815c9b18add89e0d7f2fcb3c847882ad8126408d" #privateKey: "a1fcab9b58015f452c9a89d4cde4807a80111ab27142730bfb96be936e576be1" #privateKey: "bd4cb3e507f342ee3a710370cef39dda48f17b0a158b0b8dd3f000fbd5b2c2d9" privateKey: "9224cd6478dc789815e4baaf3771709c69e55432ac8eb38dec4826a48840ddca" @@ -66,6 +67,7 @@ apiKeys: + algorandConfig: algorand_seed_Mnemonic: "famous hood lend donate orange globe spatial stamp opinion universe found gown river identify negative climb defy galaxy turkey height duty doctor hazard ability athlete"