Skip to content

Commit c2097b0

Browse files
committed
chore(onramp): remove withCeremony and setNextCallbacks from PhantomWalletController
These APIs were removed from the phantom-connect-kmp SDK. Replace withCeremony with explicit beginCeremony/endCeremony calls and drop the unused onSignLaunched parameter. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 211e11d commit c2097b0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

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)