Skip to content

Commit

Permalink
docs: forgotten entities from the TVM upgrade PR
Browse files Browse the repository at this point in the history
* `SendOnlyEstimateFee` constant
* `nativeSendMessageReturnForwardFee()` function
  • Loading branch information
novusnota committed Jan 28, 2025
1 parent 2c630fa commit 05a11b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/src/content/docs/book/message-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ 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
---------: | :---------------------------- | -----------
$0$ | <Badge text="Since Tact 1.6 (not released yet)" variant="tip"/> `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$ | <Badge text="Since Tact 1.5" variant="tip"/> `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

Expand Down
18 changes: 18 additions & 0 deletions docs/src/content/docs/ref/core-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,24 @@ Attempts to queue more than $255$ messages throw an exception with an [exit code

:::

## nativeSendMessageReturnForwardFee

<Badge text="Available since Tact 1.5" variant="tip" size="medium"/><p/>

```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
Expand Down

0 comments on commit 05a11b6

Please sign in to comment.