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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.getcode.opencode.internal.manager.VerifiedState
import com.getcode.opencode.model.financial.Fiat
import com.getcode.opencode.model.financial.LocalFiat
import com.getcode.opencode.model.financial.Token
import com.getcode.opencode.model.financial.usdf
import com.getcode.solana.keys.Mint
import kotlin.time.Duration

Expand Down Expand Up @@ -125,6 +126,7 @@ sealed interface Bill {
val kind: Kind = Kind.cash,
val verifiedState: VerifiedState? = null,
val nonce: List<Byte> = emptyList(),
val renderAsBill: Boolean = token.address != Mint.usdf,
) : Bill {
override val canFlip: Boolean = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class InternalBillPlaygroundController(
token = token.copy(billCustomizations = customizations),
amount = demoAmount,
disableGestures = true,
data = payloadInfo.codeData.toList()
data = payloadInfo.codeData.toList(),
renderAsBill = true,
)

_state.update { current ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,24 @@ fun RenderedBill(
modifier: Modifier = Modifier,
bill: Bill,
) {
if (bill.token.address == Mint.usdf) {
GoldBar(
modifier = modifier
.padding(horizontal = CodeTheme.dimens.inset),
payloadData = bill.data,
amount = bill.amount.underlyingTokenAmount,
)
} else {
CashBill(
modifier = modifier,
payloadData = bill.data,
amount = bill.amount,
token = bill.token
)
when (bill) {
is Bill.Cash -> {
if (bill.renderAsBill) {
CashBill(
modifier = modifier,
payloadData = bill.data,
amount = bill.amount,
token = bill.token
)
} else {
GoldBar(
modifier = modifier
.padding(horizontal = CodeTheme.dimens.inset),
payloadData = bill.data,
amount = bill.amount.underlyingTokenAmount,
)
}
}
}
}

Expand Down
Loading