Skip to content

Commit 9e3410c

Browse files
authored
Merge branch 'code/cash' into feat/ocp-stateless-swap
2 parents abef94a + c2097b0 commit 9e3410c

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:tools="http://schemas.android.com/tools"
3+
tools:keep="@drawable/ic_flag_*,@drawable/ic_currency_*,@drawable/bill_texture_*" />

apps/flipcash/shared/onramp/deeplinks/src/main/kotlin/com/flipcash/app/onramp/PhantomWalletController.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ class PhantomWalletController @Inject constructor(
7070
onConnectLaunching: () -> Unit = {},
7171
onSignLaunching: (SwapId) -> Unit = {},
7272
): Result<SwapId> {
73-
return phantomConnector.withCeremony {
73+
phantomConnector.beginCeremony()
74+
return try {
7475
onConnectLaunching()
75-
doConnect().getOrElse { return@withCeremony Result.failure(it) }
76+
doConnect().getOrElse { return Result.failure(it) }
7677

7778
executeSwap(
7879
amount = amount,
@@ -82,6 +83,8 @@ class PhantomWalletController @Inject constructor(
8283
onSignLaunching(swapId)
8384
},
8485
)
86+
} finally {
87+
phantomConnector.endCeremony()
8588
}
8689
}
8790

@@ -113,7 +116,6 @@ class PhantomWalletController @Inject constructor(
113116
fee: LocalFiat,
114117
token: Token,
115118
onBeforeSign: (suspend (SwapId) -> Unit)? = null,
116-
onSignLaunched: ((SwapId) -> Unit)? = null,
117119
): Result<SwapId> {
118120
val sender = getSolanaAddress()
119121

@@ -124,9 +126,6 @@ class PhantomWalletController @Inject constructor(
124126
.getOrElse { return Result.failure(it) }
125127

126128
onBeforeSign?.invoke(swapId)
127-
onSignLaunched?.let { cb ->
128-
phantomConnector.setNextCallbacks(onLaunched = { cb(swapId) })
129-
}
130129

131130
val signedTxBase58 = try {
132131
phantomSdk.solana.signTransaction(tx.encode().base64)

0 commit comments

Comments
 (0)