diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 5f2ef7e..53e926c 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -47,24 +47,28 @@ fun buildNum(): Int { } } -fun majorNumber(): Int { - return if (project.hasProperty("MAJOR_NUMBER")) { - project.property("MAJOR_NUMBER").toString().toInt() +fun versionTag(): String { + return if (project.hasProperty("VERSION_TAG")) { + project.property("VERSION_TAG").toString() } else { - extra["versionMajor"] as Int + "0.0.0" } } -fun isInternalBuild(): Boolean { - return majorNumber() == 0 - +fun isPublicRelease(): Boolean { + return if (project.hasProperty("IS_PUBLIC_RELEASE")) { + project.property("IS_PUBLIC_RELEASE").toString().toBoolean() + } else { + false + } } fun apiVersion(): String { - return if (isInternalBuild()) { - "${majorNumber()}.${extra["versionMedium"]}.${extra["versionMinorPublished"]}-${buildNum()}" // internal build's buildNum is action build number + val tag = versionTag().removePrefix("v") // Remove "v" prefix for Maven compatibility + return if (isPublicRelease()) { + tag // Public release: use tag version directly (e.g., "1.3.1") } else { - "${majorNumber()}.${extra["versionMedium"]}.${buildNum()}" // release build's buildNum is extracted from the git tag + "${tag}-${buildNum()}" // Internal build: tag + build number (e.g., "1.3.1-35") } } @@ -109,7 +113,7 @@ android { minSdk = 28 version = libraryVersion() buildConfigField("String", "version", "\"${version}\"") - buildConfigField("boolean", "INTERNAL_BUILD", "${isInternalBuild()}") + buildConfigField("boolean", "INTERNAL_BUILD", "${!isPublicRelease()}") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments += mapOf( "notPackage" to "com.circle.modularwallets.core.manual" diff --git a/lib/src/main/java/com/circle/modularwallets/core/chains/Avalanche.kt b/lib/src/main/java/com/circle/modularwallets/core/chains/Avalanche.kt new file mode 100644 index 0000000..6f39379 --- /dev/null +++ b/lib/src/main/java/com/circle/modularwallets/core/chains/Avalanche.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2025 Circle Internet Group, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at. + * + * Http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.circle.modularwallets.core.chains + +object Avalanche : Chain() { + override val chainId: Long + get() = 43_114 +} \ No newline at end of file diff --git a/lib/src/main/java/com/circle/modularwallets/core/chains/AvalancheFuji.kt b/lib/src/main/java/com/circle/modularwallets/core/chains/AvalancheFuji.kt new file mode 100644 index 0000000..499358d --- /dev/null +++ b/lib/src/main/java/com/circle/modularwallets/core/chains/AvalancheFuji.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2025 Circle Internet Group, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at. + * + * Http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.circle.modularwallets.core.chains + +object AvalancheFuji : Chain() { + override val chainId: Long + get() = 43_113 +} \ No newline at end of file diff --git a/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt b/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt index 2ea464b..916b0ee 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt @@ -27,6 +27,8 @@ internal val CONTRACT_ADDRESS: Map = mapOf( Token.Arbitrum_USDC.name to "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", Token.Arbitrum_ARB.name to "0x912CE59144191C1204E64559FE8253a0e49E6548", Token.ArbitrumSepolia_USDC.name to "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d", + Token.Avalanche_USDC.name to "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + Token.AvalancheFuji_USDC.name to "0x5425890298aed601595a70AB815c96711a31Bc65", Token.Base_USDC.name to "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", Token.BaseSepolia_USDC.name to "0x036CbD53842c5426634e7929541eC2318f3dCF7e", Token.Optimism_USDC.name to "0x0b2c639c533813f4aa9d7837caf62653d097ff85", diff --git a/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt b/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt index 75f79b7..4669659 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt @@ -27,6 +27,8 @@ enum class Token { Arbitrum_USDC, Arbitrum_ARB, ArbitrumSepolia_USDC, + Avalanche_USDC, + AvalancheFuji_USDC, Base_USDC, BaseSepolia_USDC, Optimism_USDC,