Skip to content
Merged
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
26 changes: 15 additions & 11 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ internal val CONTRACT_ADDRESS: Map<String, String> = 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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum class Token {
Arbitrum_USDC,
Arbitrum_ARB,
ArbitrumSepolia_USDC,
Avalanche_USDC,
AvalancheFuji_USDC,
Base_USDC,
BaseSepolia_USDC,
Optimism_USDC,
Expand Down