diff --git a/docs/src/content/docs/book/message-mode.mdx b/docs/src/content/docs/book/message-mode.mdx index b3478f9c6..53e7ce634 100644 --- a/docs/src/content/docs/book/message-mode.mdx +++ b/docs/src/content/docs/book/message-mode.mdx @@ -5,10 +5,12 @@ description: "Messages are sent with the mode param of a struct SendParameters. import { Badge } from '@astrojs/starlight/components'; -As it was previously mentioned, messages are sent with the `mode` param of a struct `SendParameters{:tact}`. It's an [`Int{:tact}`][int] value, which is combined from base modes and optional flags, which are also [`Int{:tact}`][int] values. +As it was previously mentioned, messages sent via [`send(){:tact}`](/ref/core-common#send) function utilize the `mode` param of the `SendParameters{:tact}` structure. The `mode` is an [`Int{:tact}`][int] value, which is combined from base modes and optional flags, which are also [`Int{:tact}`][int] values. It's possible to use raw [`Int{:tact}`][int] values and manually provide them for the `mode`, but for your convenience there's a set of constants which you may use to construct the compound `mode` with ease. Take a look at the following tables for more information on base modes and optional flags. +Note that there are other [message sending functions](/book/send#message-sending-functions) — they do not use the `SendParameters{:tact}` [Struct](/book/structs-and-messages#structs), but accept the `mode` as one of their parameters. + ## Base modes Mode value | Constant name | Description @@ -16,6 +18,7 @@ Mode value | Constant name | Description $0$ | `SendDefaultMode{:tact}` | Ordinary message (default). $64$ | `SendRemainingValue{:tact}` | Carry all the remaining value of the inbound message in addition to the value initially indicated in the new message. $128$ | `SendRemainingBalance{:tact}` | Carry all the remaining balance of the current smart contract instead of the value originally indicated in the message. +$1024$ | `SendOnlyEstimateFee{:tact}` | Doesn't send the message, only estimates the forward fees if the [message sending function](/book/send#message-sending-functions) computes those. ## Optional flags diff --git a/docs/src/content/docs/ref/core-advanced.mdx b/docs/src/content/docs/ref/core-advanced.mdx index e85cf8cda..af3afa52d 100644 --- a/docs/src/content/docs/ref/core-advanced.mdx +++ b/docs/src/content/docs/ref/core-advanced.mdx @@ -442,6 +442,24 @@ Attempts to queue more than $255$ messages throw an exception with an [exit code ::: +## nativeSendMessageReturnForwardFee + +

+ +```tact +fun nativeSendMessageReturnForwardFee(cell: Cell, mode: Int): Int; +``` + +Similar to [`nativeSendMessage(){:tact}`](#nativesendmessage), but also calculates and returns the [forward fee][forward-fee] in [nanoToncoins][nanotoncoin]. + +Attempts to queue more than $255$ messages throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`. + +:::note + + Prefer using a much more common and user-friendly [`send(){:tact}`](/ref/core-common#send) function unless you have a complex logic that can't be expressed otherwise. + +::: + ## nativeReserve ```tact