diff --git a/pages/book/config.mdx b/pages/book/config.mdx index dcc8867b..91c30976 100644 --- a/pages/book/config.mdx +++ b/pages/book/config.mdx @@ -119,7 +119,7 @@ In [Blueprint][bp], they act as default unless modified in `wrappers/ContractNam `false{:json}` by default. -If set to `true{:json}`, enables debug output of a contract and allows usage of [`dump(){:tact}`](/ref/api-debug#dump) function, which is useful for [debugging purposes](/book/debug). With this option enabled, the contract will report that it was compiled in debug mode using the `supported_interfaces` method. +If set to `true{:json}`, enables debug output of a contract and allows usage of [`dump(){:tact}`](/ref/core-debug#dump) function, which is useful for [debugging purposes](/book/debug). With this option enabled, the contract will report that it was compiled in debug mode using the `supported_interfaces` method. ```json filename="tact.config.json" {8,14} { diff --git a/pages/book/expressions.mdx b/pages/book/expressions.mdx index 9a832265..0159d8e4 100644 --- a/pages/book/expressions.mdx +++ b/pages/book/expressions.mdx @@ -127,7 +127,7 @@ Tact strings support a range of [escape sequences](https://en.wikipedia.org/wiki Read more about strings and [`String{:tact}`][p] type:\ [Primitive types in the Book][p]\ - [Strings and StringBuilders in the Reference](/ref/api-strings) + [Strings and StringBuilders in the Reference](/ref/core-strings) diff --git a/pages/book/integers.mdx b/pages/book/integers.mdx index 6d749e2e..1833d99d 100644 --- a/pages/book/integers.mdx +++ b/pages/book/integers.mdx @@ -46,7 +46,7 @@ Use underscores (`_`) to improve readability: $\mathrm{0b111\_111\_111}$ is equa For example, arithmetic with dollars requires two decimal places after the dot — those are used for the cents value. But how would we represent the number \$$1.25$ if we're only able to work with integers? The solution is to work with _cents_ directly. This way, \$$1.25$ becomes $125$ cents. We simply memorize that the two rightmost digits represent the numbers after the decimal point. -Similarly, working with Toncoins requires nine decimal places instead of the two. Therefore, the amount of $1.25$ TON, which can be represented in Tact as [`ton("1.25"){:tact}`](/ref/api-comptime#ton), is actually the number $1250000000$. We refer to such numbers as _nano-tons_ (or _nanoToncoins_) rather than _cents_. +Similarly, working with Toncoins requires nine decimal places instead of the two. Therefore, the amount of $1.25$ TON, which can be represented in Tact as [`ton("1.25"){:tact}`](/ref/core-comptime#ton), is actually the number $1250000000$. We refer to such numbers as _nano-tons_ (or _nanoToncoins_) rather than _cents_. ## Serialization diff --git a/pages/book/operators.mdx b/pages/book/operators.mdx index 5832e5ff..08502ad8 100644 --- a/pages/book/operators.mdx +++ b/pages/book/operators.mdx @@ -8,7 +8,7 @@ This page lists all the operators in Tact in decreasing order of their [preceden - Note, that there are no implicit type conversions in Tact, so operators can't be used to, say, add values of different type or compare them in terms of equality without explicitly casting to the same type. That's done with certain functions from the standard library. See [`Int.toString(){:tact}`](/ref/api-strings#inttostring) for an example of such function. + Note, that there are no implicit type conversions in Tact, so operators can't be used to, say, add values of different type or compare them in terms of equality without explicitly casting to the same type. That's done with certain functions from the standard library. See [`Int.toString(){:tact}`](/ref/core-strings#inttostring) for an example of such function. @@ -211,7 +211,7 @@ two % 1; // 1 -1 % -5; // -1 ``` -The simplest way to avoid confusion between the two is to prefer using positive values via [`abs(x: Int){:tact}`](/ref/api-math#abs): +The simplest way to avoid confusion between the two is to prefer using positive values via [`abs(x: Int){:tact}`](/ref/core-math#abs): ```tact abs(-1) % abs(-5); // 1 diff --git a/pages/book/structs-and-messages.mdx b/pages/book/structs-and-messages.mdx index fd72d811..a9a0dedd 100644 --- a/pages/book/structs-and-messages.mdx +++ b/pages/book/structs-and-messages.mdx @@ -198,8 +198,8 @@ fun convertationFun() { See those extension functions in the Reference:\ - [`Struct.toCell(){:tact}`](/book/api-cells#structtocell)\ - [`Message.toCell(){:tact}`](/book/api-cells#messagetocell) + [`Struct.toCell(){:tact}`](/ref/api-cells#structtocell)\ + [`Message.toCell(){:tact}`](/ref/api-cells#messagetocell) diff --git a/pages/ref/core-advanced.mdx b/pages/ref/core-advanced.mdx index 4363e3ff..21e9bb78 100644 --- a/pages/ref/core-advanced.mdx +++ b/pages/ref/core-advanced.mdx @@ -10,13 +10,13 @@ Various niche, dangerous or unstable features which can produce unexpected resul -## readForwardFee +## Context.readForwardFee ```tact extends fun readForwardFee(self: Context): Int ``` -Extension function for the [`Context{:tact}`](/ref/api-common#context). +Extension function for the [`Context{:tact}`](/ref/core-common#context). Reads [forward fee](https://docs.ton.org/develop/smart-contracts/guidelines/processing) and returns it as [`Int{:tact}`][int] value in nanoToncoins (nano-tons). @@ -101,7 +101,7 @@ throw(42); // and this won't fail it fun nativePrepareRandom(); ``` -Prepares a random number generator by using [`nativeRandomizeLt(){:tact}`](#nativerandomizelt). Automatically called by [`randomInt(){:tact}`](/ref/api-random#randomint) and [`random(){:tact}`](/ref/api-random#random) functions. +Prepares a random number generator by using [`nativeRandomizeLt(){:tact}`](#nativerandomizelt). Automatically called by [`randomInt(){:tact}`](/ref/core-random#randomint) and [`random(){:tact}`](/ref/core-random#random) functions. Usage example: @@ -148,11 +148,11 @@ let idk: Int = randomInt(); // ???, it's random! fun nativeRandom(): Int; ``` -Generates and returns an $256$-bit random number just like [`randomInt(){:tact}`](/ref/api-random#randomint), but doesn't initialize the random generator with [`nativePrepareRandom(){:tact}`](#nativepreparerandom) beforehand. +Generates and returns an $256$-bit random number just like [`randomInt(){:tact}`](/ref/core-random#randomint), but doesn't initialize the random generator with [`nativePrepareRandom(){:tact}`](#nativepreparerandom) beforehand. - Don't use this function directly, and prefer using [`randomInt(){:tact}`](/ref/api-random#randomint) instead. + Don't use this function directly, and prefer using [`randomInt(){:tact}`](/ref/core-random#randomint) instead. @@ -162,11 +162,11 @@ Generates and returns an $256$-bit random number just like [`randomInt(){:tact}` fun nativeRandomInterval(max: Int): Int; ``` -Generates and returns a $256$-bit random number in the range from $0$ to `max` similar to [`random(){:tact}`](/ref/api-random#random), but doesn't initialize the random generator with [`nativePrepareRandom(){:tact}`](#nativepreparerandom) beforehand. +Generates and returns a $256$-bit random number in the range from $0$ to `max` similar to [`random(){:tact}`](/ref/core-random#random), but doesn't initialize the random generator with [`nativePrepareRandom(){:tact}`](#nativepreparerandom) beforehand. - Don't use this function directly, and prefer using [`random(){:tact}`](/ref/api-random#random) instead. + Don't use this function directly, and prefer using [`random(){:tact}`](/ref/core-random#random) instead. @@ -180,7 +180,7 @@ Sends the message by specifying the complete `cell` and the [message `mode`](/bo - Prefer using a much more common and user-friendly [`send(){:tact}`](/ref/api-common#send) function unless you have a complex logic that can't be expressed otherwise. + 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. diff --git a/pages/ref/core-base.mdx b/pages/ref/core-base.mdx index 6da2197b..28a14c8d 100644 --- a/pages/ref/core-base.mdx +++ b/pages/ref/core-base.mdx @@ -88,7 +88,7 @@ In case reservation attempt fails and in the default case without the attempt, t Note, that `self.forward(){:tact}` never sends additional Toncoins on top of what's available on the balance.\ - To be able to send more Toncoins with a single message, use the the [`send(){:tact}`](/ref/api-common#send) function. + To be able to send more Toncoins with a single message, use the the [`send(){:tact}`](/ref/core-common#send) function. diff --git a/pages/ref/core-common.mdx b/pages/ref/core-common.mdx index cfb95a5d..5de85aef 100644 --- a/pages/ref/core-common.mdx +++ b/pages/ref/core-common.mdx @@ -66,7 +66,7 @@ Usage example: ```tact receive() { - let whoSentMeMessage: Address = sender(); + let whoSentMeMessage: Address = sender(); } ``` @@ -120,7 +120,7 @@ fun newAddress(chain: Int, hash: Int): Address; Creates a new [`Address{:tact}`][p] based on the [`chain` id](https://ton-blockchain.github.io/docs/#/overviews/TON_blockchain_overview) and the [SHA-256](/ref/stdlib-math#sha256) encoded [`hash` value](https://docs.ton.org/learn/overviews/addresses#account-id). -This function tries to resolve constant values in [compile-time](/ref/api-comptime) whenever possible. +This function tries to resolve constant values in [compile-time](/ref/core-comptime) whenever possible. Usage example: diff --git a/pages/ref/core-math.mdx b/pages/ref/core-math.mdx index 3a8f32df..81bc9680 100644 --- a/pages/ref/core-math.mdx +++ b/pages/ref/core-math.mdx @@ -120,7 +120,7 @@ fun pow(base: Int, exp: Int): Int; Computes and returns the [exponentiation](https://en.wikipedia.org/wiki/Exponentiation) involving two numbers: the `base` and the exponent (or _power_) `exp`. Exponent `exp` must be non-negative, otherwise an error with [exit code 5](/book/exit-codes#5) will be thrown: `Integer out of expected range`. -Note, that this function works both at run-time and at [compile-time](/ref/api-comptime). +Note, that this function works both at run-time and at [compile-time](/ref/core-comptime). Usage example: @@ -147,7 +147,7 @@ contract Example { - List of functions, that only work at compile-time: [API Comptime](/ref/api-comptime). + List of functions, that only work at compile-time: [API Comptime](/ref/core-comptime). @@ -157,7 +157,7 @@ contract Example { fun pow2(exp: Int): Int; ``` -Similar to [`pow(){:tact}`](#pow), but sets the `base` to $2$. Works both at run-time and at [compile-time](/ref/api-comptime). +Similar to [`pow(){:tact}`](#pow), but sets the `base` to $2$. Works both at run-time and at [compile-time](/ref/core-comptime). Usage examples: @@ -184,7 +184,7 @@ contract Example { - List of functions, that only work at compile-time: [API Comptime](/ref/api-comptime). + List of functions, that only work at compile-time: [API Comptime](/ref/core-comptime). @@ -260,7 +260,7 @@ Computes and returns the [SHA-256](https://en.wikipedia.org/wiki/SHA-2#Hash_stan In case `data` is a [`String{:tact}`][p] it should have a number of bits divisible by $8$, and in case it's a [`Slice{:tact}`][p] it must **also** have no references (i.e. only up to 1023 bits of data in total). -This function tries to resolve constant string values in [compile-time](/ref/api-comptime) whenever possible. +This function tries to resolve constant string values in [compile-time](/ref/core-comptime) whenever possible. Usage examples: diff --git a/pages/ref/core-random.mdx b/pages/ref/core-random.mdx index 8bfa0524..5e1a7bbf 100644 --- a/pages/ref/core-random.mdx +++ b/pages/ref/core-random.mdx @@ -37,7 +37,7 @@ let allYourRandomBelongsToUs: Int = randomInt(); // ???, it's random :) - Advanced functions for working with random numbers are listed on a specialized page: [Advanced APIs](/ref/api-advanced). + Advanced functions for working with random numbers are listed on a specialized page: [Advanced APIs](/ref/core-advanced). diff --git a/pages/ref/core-strings.mdx b/pages/ref/core-strings.mdx index df9a9e83..c32a4e03 100644 --- a/pages/ref/core-strings.mdx +++ b/pages/ref/core-strings.mdx @@ -144,7 +144,7 @@ extends fun toSlice(self: StringBuilder): Slice; Extension function for the [`StringBuilder{:tact}`][p]. -Returns an assembled [`Cell{:tact}`][p] as a [`Slice{:tact}`][p] from a [`StringBuilder{:tact}`][p]. Alias to [`self.toCell().asSlice(){:tact}`](/ref/api-cells#cellasslice). +Returns an assembled [`Cell{:tact}`][p] as a [`Slice{:tact}`][p] from a [`StringBuilder{:tact}`][p]. Alias to [`self.toCell().asSlice(){:tact}`](/ref/core-cells#cellasslice). Usage example: