Skip to content

Commit

Permalink
variables loading from local.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sajalbnl committed Sep 21, 2024
1 parent b398faf commit a9b4934
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 4 additions & 6 deletions wallet_app/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ android {
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"



buildConfigField("String", "DEMO_RPC_URL", "\"https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/${properties.getProperty("KEY_NAME")}\"")
buildConfigField("String", "DEMO_ACCOUNT_ADDRESS", "\"0x02dc260794e4c2eeae87b1403a88385a72c18a5844d220b88117b2965a8cf3a5\"")
buildConfigField("String", "DEMO_PRIVATE_KEY", "\"rFAP8fkTAz9TmYw8_V5Fyzxi-WSoQdhk\"")
buildConfigField("String", "DEMO_RECIPIENT_ACCOUNT_ADDRESS", "\"0xc1c7db92d22ef773de96f8bde8e56c85\"")
buildConfigField("String", "DEMO_RPC_URL", "\"https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/rFAP8fkTAz9TmYw8_V5Fyzxi-WSoQdhk\"")
buildConfigField("String", "ACCOUNT_ADDRESS", "\"${properties.getProperty("ACCOUNT_ADDRESS")}\"")
buildConfigField("String", "PRIVATE_KEY", "\"${properties.getProperty("KEY_NAME")}\"")
}

buildTypes {
Expand Down Expand Up @@ -97,7 +95,7 @@ dependencies {
implementation(libs.hilt.android)
implementation(libs.androidx.hilt.navigation.fragment)
implementation (libs.androidx.hilt.navigation.compose.v100alpha03)
implementation("com.swmansion.starknet:starknet:0.12.2")


implementation(libs.androidx.ui.tooling.preview)
debugImplementation(libs.androidx.ui.tooling)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.example.walletapp.BuildConfig
import com.swmansion.starknet.account.StandardAccount
import com.swmansion.starknet.data.types.Call
import com.swmansion.starknet.data.types.Felt
Expand All @@ -12,12 +13,15 @@ const val ETH_ERC20_ADDRESS = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741
class StarknetClient(private val rpcUrl: String) {

private val provider = JsonRpcProvider(rpcUrl)
private val privateKey=BuildConfig.PRIVATE_KEY
private val accountAddress=BuildConfig.ACCOUNT_ADDRESS

suspend fun deployAccount() {


// Predefined values for account creation
val privateKey = Felt.fromHex("0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a") // TODO(#80): Load from local.properties
val accountAddress = Felt.fromHex("0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca") // TODO(#80): Load from local.properties
val privateKey = Felt.fromHex(privateKey) // TODO(#80): Load from local.properties
val accountAddress = Felt.fromHex(accountAddress) // TODO(#80): Load from local.properties

val signer = StarkCurveSigner(privateKey)
val chainId = provider.getChainId().sendAsync().await()
Expand Down

0 comments on commit a9b4934

Please sign in to comment.