Skip to content

Commit 7716252

Browse files
authored
Merge branch 'code/cash' into feat/buy-options-cache
2 parents aafb280 + 86c65eb commit 7716252

141 files changed

Lines changed: 3152 additions & 940 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.well-known/release-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"updated": "2026-06-12T16:11:14Z",
2+
"updated": "2026-06-13T22:45:37Z",
33
"tracks": {
44
"production": {
55
"versionCode": 3740,
@@ -8,7 +8,7 @@
88
"beta": null,
99
"alpha": null,
1010
"internal": {
11-
"versionCode": 3861,
11+
"versionCode": 3872,
1212
"versionName": "2026.6.1"
1313
}
1414
}

apps/flipcash/app/src/main/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@
162162
android:scheme="https" />
163163
</intent-filter>
164164

165+
<intent-filter android:autoVerify="true">
166+
<action android:name="android.intent.action.VIEW" />
167+
168+
<category android:name="android.intent.category.DEFAULT" />
169+
<category android:name="android.intent.category.BROWSABLE" />
170+
171+
<data
172+
android:host="app.flipcash.com"
173+
android:pathPattern="/chat/.*"
174+
android:scheme="https" />
175+
</intent-filter>
176+
165177

166178
<intent-filter android:autoVerify="true">
167179
<action android:name="android.intent.action.VIEW" />

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui/navigation/AppScreenContent.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import com.flipcash.app.currency.RegionSelectionScreen
3131
import com.flipcash.app.deposit.DepositFlowScreen
3232
import com.flipcash.app.directsend.SendFlowScreen
3333
import com.flipcash.app.invite.InviteContactScreen
34-
import com.flipcash.app.messenger.MessengerScreen
34+
import com.flipcash.app.messenger.ChatFlowScreen
3535
import com.flipcash.app.messenger.ChatAmountEntryScreen
3636
import com.flipcash.app.discovery.TokenDiscoveryScreen
3737
import com.flipcash.app.internal.ui.navigation.decorators.rememberNavMessagingEntryDecorator
@@ -96,10 +96,10 @@ fun appEntryProvider(
9696

9797
// Messaging
9898
annotatedEntry<AppRoute.Messaging.Chat> { key ->
99-
MessengerScreen(key.e164, key.displayName)
99+
ChatFlowScreen(route = key, resultStateRegistry = resultStateRegistry)
100100
}
101101
annotatedEntry<AppRoute.Messaging.AmountEntry> { key ->
102-
ChatAmountEntryScreen(key.e164, key.displayName)
102+
ChatAmountEntryScreen(key.identifier)
103103
}
104104

105105
// Tokens

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/AppRoute.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.flipcash.app.core
22

33
import android.os.Parcelable
44
import androidx.navigation3.runtime.NavKey
5+
import com.flipcash.app.core.chat.ChatIdentifier
56
import com.flipcash.app.core.deposit.DepositResult
67
import com.flipcash.app.core.deposit.DepositStep
78
import com.flipcash.app.core.tokens.CurrencyCreatorResult
@@ -14,6 +15,7 @@ import com.flipcash.app.core.verification.VerificationResult
1415
import com.flipcash.app.core.verification.VerificationStep
1516
import com.flipcash.app.core.withdrawal.WithdrawalResult
1617
import com.flipcash.app.core.withdrawal.WithdrawalStep
18+
import com.flipcash.app.core.chat.ChatStep
1719
import com.flipcash.app.core.onboarding.OnboardingStep
1820
import com.getcode.navigation.flow.FlowRoute
1921
import com.getcode.navigation.flow.FlowRouteWithResult
@@ -240,16 +242,13 @@ sealed interface AppRoute : NavKey, Parcelable {
240242
@Parcelize
241243
sealed interface Messaging : AppRoute {
242244
@Serializable
243-
data class Chat(
244-
val e164: String,
245-
val displayName: String,
246-
) : Messaging
245+
data class Chat(val identifier: ChatIdentifier) : Messaging, FlowRoute {
246+
override val initialStack: List<NavKey>
247+
get() = listOf(ChatStep.Conversation)
248+
}
247249

248250
@Serializable
249-
data class AmountEntry(
250-
val e164: String,
251-
val displayName: String,
252-
) : Messaging
251+
data class AmountEntry(val identifier: ChatIdentifier) : Messaging
253252
}
254253

255254
@Serializable
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.flipcash.app.core.chat
2+
3+
import android.os.Parcelable
4+
import com.flipcash.services.models.chat.ChatId
5+
import kotlinx.parcelize.Parcelize
6+
import kotlinx.serialization.Serializable
7+
8+
@Serializable
9+
@Parcelize
10+
sealed interface ChatIdentifier : Parcelable {
11+
val key: String
12+
13+
@Serializable
14+
@Parcelize
15+
data class ByChatId(val chatId: ChatId) : ChatIdentifier {
16+
override val key: String get() = chatId.toString()
17+
}
18+
19+
@Serializable
20+
@Parcelize
21+
data class ByContact(val e164: String, val displayName: String, val chatId: ChatId? = null) : ChatIdentifier {
22+
override val key: String get() = e164
23+
}
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.flipcash.app.core.chat
2+
3+
import android.os.Parcelable
4+
import com.getcode.navigation.flow.FlowStep
5+
import kotlinx.parcelize.Parcelize
6+
import kotlinx.serialization.Serializable
7+
8+
@Serializable
9+
sealed interface ChatStep : FlowStep, Parcelable {
10+
@Parcelize
11+
@Serializable
12+
data object Conversation : ChatStep
13+
14+
@Parcelize
15+
@Serializable
16+
data object AmountEntry : ChatStep
17+
}

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/feed/ActivityFeedMessage.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data class ActivityFeedMessage(
2828
get() {
2929
metadata ?: return false
3030
val metadata =
31-
(metadata as? MessageMetadata.SentCrypto) ?: return false
31+
(metadata as? MessageMetadata.IndirectlySentCrypto) ?: return false
3232
return metadata.canCancel
3333
}
3434
}
@@ -53,16 +53,20 @@ sealed interface MessageMetadata {
5353
data object Unknown : MessageMetadata
5454

5555
@Serializable
56-
data object GaveCrypto : MessageMetadata
56+
data class DirectlySentCrypto(
57+
val phoneNumber: String? = null,
58+
) : MessageMetadata
5759

5860
@Serializable
59-
data class SentCrypto(
61+
data class IndirectlySentCrypto(
6062
val creator: PublicKey,
6163
val canCancel: Boolean,
6264
) : MessageMetadata
6365

6466
@Serializable
65-
data object ReceivedCrypto : MessageMetadata
67+
data class ReceivedCrypto(
68+
val phoneNumber: String? = null,
69+
) : MessageMetadata
6670

6771
@Serializable
6872
data object WithdrewCrypto : MessageMetadata

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/navigation/DeeplinkType.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.flipcash.app.core.navigation
22

33
import android.net.Uri
44
import android.os.Parcelable
5+
import com.flipcash.services.models.chat.ChatId
56
import com.getcode.solana.keys.Mint
67
import kotlinx.parcelize.Parcelize
78
import kotlinx.serialization.Serializable
@@ -15,6 +16,8 @@ sealed interface DeeplinkType: Parcelable {
1516

1617
@Serializable data class TokenInfo(val mint: Mint): DeeplinkType, Navigatable
1718

19+
@Serializable data class Chat(val chatId: ChatId): DeeplinkType, Navigatable
20+
1821
@Serializable
1922
data class EmailVerification(
2023
val email: String,

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/util/Linkify.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.flipcash.app.core.util
22

3+
import com.flipcash.services.models.chat.ChatId
34
import com.getcode.opencode.model.financial.Token
45
import com.getcode.solana.keys.Mint
56
import com.getcode.solana.keys.base58
7+
import com.getcode.utils.encodeBase64
68
import com.getcode.utils.urlEncode
79

810
object Linkify {
@@ -13,4 +15,5 @@ object Linkify {
1315
fun tweet(message: String): String = "https://www.twitter.com/intent/tweet?text=${message.urlEncode()}"
1416
fun tokenInfo(token: Token): String = tokenInfo(token.address)
1517
fun tokenInfo(mint: Mint): String = "https://app.flipcash.com/token/${mint.base58()}"
18+
fun chat(chatId: ChatId): String = "https://app.flipcash.com/chat/${chatId.bytes.encodeBase64(urlSafe = true)}"
1619
}

apps/flipcash/core/src/test/kotlin/com/flipcash/app/core/feed/ActivityFeedMessageTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ class ActivityFeedMessageTest {
5858
}
5959

6060
@Test
61-
fun metadataFromGaveCrypto() {
62-
val json = """{"type":"com.flipcash.app.core.feed.MessageMetadata.GaveCrypto"}"""
61+
fun metadataFromDirectlySentCrypto() {
62+
val json = """{"type":"com.flipcash.app.core.feed.MessageMetadata.DirectlySentCrypto"}"""
6363
val result = MessageMetadata.from(json)
64-
assertEquals(MessageMetadata.GaveCrypto, result)
64+
assertEquals(MessageMetadata.DirectlySentCrypto(), result)
6565
}
6666

6767
@Test
6868
fun metadataFromReceivedCrypto() {
6969
val json = """{"type":"com.flipcash.app.core.feed.MessageMetadata.ReceivedCrypto"}"""
7070
val result = MessageMetadata.from(json)
71-
assertEquals(MessageMetadata.ReceivedCrypto, result)
71+
assertEquals(MessageMetadata.ReceivedCrypto(), result)
7272
}
7373

7474
@Test

0 commit comments

Comments
 (0)