Skip to content

Commit

Permalink
SendMode
Browse files Browse the repository at this point in the history
- make SendMode init public
- add sendMaxTon method to SendMode
  • Loading branch information
grishamsc committed Dec 28, 2023
1 parent 03dbe1f commit 5224e39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/TonSwift/Contracts/SendMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public struct SendMode {
/// Options for sending the value.
public let value: SendValueOptions

init(payMsgFees: Bool = false, ignoreErrors: Bool = false, value: SendValueOptions = .messageValue) {
public init(payMsgFees: Bool = false, ignoreErrors: Bool = false, value: SendValueOptions = .messageValue) {
self.payMsgFees = payMsgFees
self.ignoreErrors = ignoreErrors
self.value = value
Expand All @@ -27,6 +27,11 @@ public struct SendMode {
public static func walletDefault() -> Self {
return SendMode(payMsgFees: true, ignoreErrors: true)
}

/// Flags to send all available Toncoins
public static func sendMaxTon() -> Self {
return SendMode(payMsgFees: false, ignoreErrors: false, value: .sendRemainingBalance)
}
}

extension SendMode: RawRepresentable {
Expand Down

0 comments on commit 5224e39

Please sign in to comment.