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
4 changes: 2 additions & 2 deletions packages/android/algokit_transact/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ android {
}

dependencies {
// implementation(project(":transact"))
implementation("com.example.transact:algo-transact-ffi:0.0.1")
implementation(project(":transact"))
// implementation("com.example.transact:algo-transact-ffi:0.0.1")
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class MainActivity : ComponentActivity() {
color = MaterialTheme.colorScheme.background
) {
val address = TransactApi()
.createAddressFromString("YVRRLLVBX54N44WG4EZJWPXXA6RROAU5TLHB4XHCMZFVZBVCB6KSDWDSEQ")
Greeting(address.address)
.getPubKeyFromAddress("YVRRLLVBX54N44WG4EZJWPXXA6RROAU5TLHB4XHCMZFVZBVCB6KSDWDSEQ")
Greeting(address.toString())
}
}
}
Expand Down Expand Up @@ -71,4 +71,4 @@ fun GreetingPreview() {
HelloWorldTheme {
Greeting("Android")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.example.transact

import android.R.attr.publicKey
import android.location.Address
import uniffi.algokit_transact_ffi.Transaction
import uniffi.algokit_transact_ffi.addressFromPublicKey
import uniffi.algokit_transact_ffi.publicKeyFromAddress

class TransactApi {
companion object {
Expand All @@ -15,12 +17,12 @@ class TransactApi {
}
}

fun createAddressFromPubKey(publicKey: ByteArray): Address {
fun createAddressFromPubKey(publicKey: ByteArray): String {
return addressFromPublicKey(publicKey)
}

fun createAddressFromString(publicKey: ByteArray): Address {
return addressFromPublicKey(publicKey)
fun getPubKeyFromAddress(address: String): ByteArray {
return publicKeyFromAddress(address)
}

fun encodeTransaction(transaction: Transaction): ByteArray {
Expand Down
Loading