diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4572390 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,60 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Original goal is followed [Tact Compiler Changelog](https://github.com/tact-lang/tact/tree/main), and keep this project in sync. Enjoy! ❤️❤️❤️ + +## [0.6.2] - 2023-10-30 + +- Add 2 PRs from [Breakfast](https://github.com/topics/hacktoberfest) + - https://github.com/tact-lang/tact-by-example/commit/19288b393e07cbf14fa6bffec995eebdad7b06be + - https://github.com/tact-lang/tact-by-example/commit/eb8b47123218b24b5ecf8938eafe9ab31c0482d2 +- Modify and add the new content and fix the grammer errors + +## [0.5.0] - 2023-10-05 + +### Added + +- Add the Jetton Token Standard example. + +## [0.4.0] - 2023-09-29 + +### Changed + +- Turn `src/routes/(examples)/00-hello-world` from 01 to 00. +- Optimzed `src/routes/(examples)/06-communicating-children/contract.tact` code in dump log. +- Optimzed `src/routes/(examples)/06-authenticating-children/contract.tact` code in dump log. +- Change the name of `06-communicating-children` to `06-communicating-subcontract`. + +### Added + +- Added `😃, 😑` in dump log in `src/routes/(examples)/06-authenticating-children` for better understanding. +- `require(sender() == parent, "not the parent");` in `src/routes/(examples)/06-authenticating-children/contract.tact` file. + +## [0.3.0] - 2023-09-27 + +### Added + +- Emoji support in terminal log. (📝, 🔍, 📤) + +### Changed + +- Optimized `src/routes/(examples)/06-unbounded-arrays/content.md` text and add the callout blocks. +- Fixed some type errors in the `src/routes/(examples)/06-unbounded-arrays/content.md` file. +- Fixed the text typo in the terminal log. + +## [0.2.0] - 2023-09-08 + +### Added + +- The first version of ChangeLog.md + +## [0.1.0] - 2023-09-01 + +### Fixed + +- Update the compiler version in the package.json +- Fix the `reply` syntax to the `self.reply`. diff --git a/README.md b/README.md index c6058f7..096e56d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ +- [🔍 Changelog](/CHANGELOG.md) +- [🫂 Telegram Group Chat](https://t.me/tactlang) + ## Developing +### About Tact Source Code + +1. Tact code is under the `src` directory. The `src` directory contains the following files: `src/routes/(examples)` - The source code for the examples. +2. The terminal output is located in `src/routes/(examples)/+layout.svelte` file. +3. Run `npm run tact-build` to compile the Tact code you just added. + +### About the Examples Order + +1. Check the order in the `src/routes/(examples)/examples.json` file. +2. The `id` determines the sequence of the examples in the app. + +### Running the project + Once you've run `npm install` start a development server: ```bash diff --git a/docs/01-hello-world.html b/docs/00-hello-world.html similarity index 68% rename from docs/01-hello-world.html rename to docs/00-hello-world.html index bc62641..3d449c0 100644 --- a/docs/01-hello-world.html +++ b/docs/00-hello-world.html @@ -34,20 +34,20 @@ - + - + - + - - - + + + - - + +
@@ -59,14 +59,7 @@
-

A Simple Counter

-

This is a simple counter contract that allows users to increment its value.

-

This contract has a state variable val that persists between contract calls - the counter value. When persisted, this variable is encoded as uint32 - a 32-bit unsigned integer. Contracts pay rent in proportion to the amount of persistent space they consume, so compact representations are encouraged.

-

State variables should be initialized in init() that runs on deployment of the contract.

-

Receiving messages

-

This contract can receive messages from users. Unlike getters that are just read-only, messages can do write operations and change the contract's persistent state. Incoming messages are processed in receive() methods as transactions and cost gas for the sender.

-

After deploying the contract, send the increment message by pressing the Send increment button in order to increase the counter value by one. Afterwards, call the getter value() to see that the value indeed changed.

- +
@@ -97,21 +90,7 @@

Receiving messages

- - - - - - - - -
+
@@ -121,7 +100,7 @@

Receiving messages

+ + + diff --git a/docs/_app/immutable/chunks/1.306f2f82.js b/docs/_app/immutable/chunks/1.306f2f82.js new file mode 100644 index 0000000..f84cb67 --- /dev/null +++ b/docs/_app/immutable/chunks/1.306f2f82.js @@ -0,0 +1 @@ +import{default as t}from"../entry/error.svelte.94f81033.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/10.4a81625c.js b/docs/_app/immutable/chunks/10.e9c74b54.js similarity index 59% rename from docs/_app/immutable/chunks/10.4a81625c.js rename to docs/_app/immutable/chunks/10.e9c74b54.js index adec844..516ebe1 100644 --- a/docs/_app/immutable/chunks/10.4a81625c.js +++ b/docs/_app/immutable/chunks/10.e9c74b54.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-constants-page.svelte.e3182455.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-constants-page.svelte.60a3c886.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/11.fe07bdf8.js b/docs/_app/immutable/chunks/11.c435e3b3.js similarity index 58% rename from docs/_app/immutable/chunks/11.fe07bdf8.js rename to docs/_app/immutable/chunks/11.c435e3b3.js index e8ff22a..dba5ef7 100644 --- a/docs/_app/immutable/chunks/11.fe07bdf8.js +++ b/docs/_app/immutable/chunks/11.c435e3b3.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-integer-ops-page.svelte.37fc378a.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-integer-ops-page.svelte.3a5c1355.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/12.fb545144.js b/docs/_app/immutable/chunks/12.4f5376a5.js similarity index 60% rename from docs/_app/immutable/chunks/12.fb545144.js rename to docs/_app/immutable/chunks/12.4f5376a5.js index 23bdf00..b665159 100644 --- a/docs/_app/immutable/chunks/12.fb545144.js +++ b/docs/_app/immutable/chunks/12.4f5376a5.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-integers-page.svelte.4c442c50.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-integers-page.svelte.98d16c1c.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/13.8f1f3426.js b/docs/_app/immutable/chunks/13.9a410e37.js similarity index 60% rename from docs/_app/immutable/chunks/13.8f1f3426.js rename to docs/_app/immutable/chunks/13.9a410e37.js index 237ad9a..ea96831 100644 --- a/docs/_app/immutable/chunks/13.8f1f3426.js +++ b/docs/_app/immutable/chunks/13.9a410e37.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-strings-page.svelte.b8782a94.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-strings-page.svelte.598e9ee6.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/14.798a6e54.js b/docs/_app/immutable/chunks/14.f85a0720.js similarity index 59% rename from docs/_app/immutable/chunks/14.798a6e54.js rename to docs/_app/immutable/chunks/14.f85a0720.js index 893f7b7..80d347b 100644 --- a/docs/_app/immutable/chunks/14.798a6e54.js +++ b/docs/_app/immutable/chunks/14.f85a0720.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-variables-page.svelte.a2ce09b8.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-variables-page.svelte.7c71934f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/15.c27c85fa.js b/docs/_app/immutable/chunks/15.7627fd0e.js similarity index 62% rename from docs/_app/immutable/chunks/15.c27c85fa.js rename to docs/_app/immutable/chunks/15.7627fd0e.js index 4f05969..8e18abd 100644 --- a/docs/_app/immutable/chunks/15.c27c85fa.js +++ b/docs/_app/immutable/chunks/15.7627fd0e.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-emit-page.svelte.04ea2a0b.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-emit-page.svelte.a9c5ca71.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/16.efeae659.js b/docs/_app/immutable/chunks/16.df68d324.js similarity index 61% rename from docs/_app/immutable/chunks/16.efeae659.js rename to docs/_app/immutable/chunks/16.df68d324.js index eddcb81..48e1397 100644 --- a/docs/_app/immutable/chunks/16.efeae659.js +++ b/docs/_app/immutable/chunks/16.df68d324.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-errors-page.svelte.d4a69a6f.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-errors-page.svelte.2feac366.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/17.6725fd5e.js b/docs/_app/immutable/chunks/17.baaecd2b.js similarity index 60% rename from docs/_app/immutable/chunks/17.6725fd5e.js rename to docs/_app/immutable/chunks/17.baaecd2b.js index 2ded4f8..fba024f 100644 --- a/docs/_app/immutable/chunks/17.6725fd5e.js +++ b/docs/_app/immutable/chunks/17.baaecd2b.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-getters-page.svelte.c80071cf.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-getters-page.svelte.8a5c130f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/18.4d8c6a18.js b/docs/_app/immutable/chunks/18.99707f3f.js similarity index 51% rename from docs/_app/immutable/chunks/18.4d8c6a18.js rename to docs/_app/immutable/chunks/18.99707f3f.js index 581de50..2a9bf7b 100644 --- a/docs/_app/immutable/chunks/18.4d8c6a18.js +++ b/docs/_app/immutable/chunks/18.99707f3f.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-messages-between-contracts-page.svelte.c9d4d4f9.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-messages-between-contracts-page.svelte.c64b8ae1.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/19.feaa961f.js b/docs/_app/immutable/chunks/19.0da6e726.js similarity index 57% rename from docs/_app/immutable/chunks/19.feaa961f.js rename to docs/_app/immutable/chunks/19.0da6e726.js index be40a9e..511e207 100644 --- a/docs/_app/immutable/chunks/19.feaa961f.js +++ b/docs/_app/immutable/chunks/19.0da6e726.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-receive-coins-page.svelte.a5e74603.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-receive-coins-page.svelte.4a6d677b.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/2.44785e67.js b/docs/_app/immutable/chunks/2.44785e67.js deleted file mode 100644 index b612c47..0000000 --- a/docs/_app/immutable/chunks/2.44785e67.js +++ /dev/null @@ -1 +0,0 @@ -import{default as t}from"../entry/(examples)-layout.svelte.322916d1.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/2.e87ea071.js b/docs/_app/immutable/chunks/2.e87ea071.js new file mode 100644 index 0000000..1cf898a --- /dev/null +++ b/docs/_app/immutable/chunks/2.e87ea071.js @@ -0,0 +1 @@ +import{default as t}from"../entry/(examples)-layout.svelte.01f6cb21.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/20.60154ccd.js b/docs/_app/immutable/chunks/20.89bb9da9.js similarity index 59% rename from docs/_app/immutable/chunks/20.60154ccd.js rename to docs/_app/immutable/chunks/20.89bb9da9.js index 3f3a436..a0c8bdd 100644 --- a/docs/_app/immutable/chunks/20.60154ccd.js +++ b/docs/_app/immutable/chunks/20.89bb9da9.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-receivers-page.svelte.bac11b86.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-receivers-page.svelte.381dfaca.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/21.1d2af7d7.js b/docs/_app/immutable/chunks/21.68d1eafd.js similarity index 59% rename from docs/_app/immutable/chunks/21.1d2af7d7.js rename to docs/_app/immutable/chunks/21.68d1eafd.js index c0848a4..e5dd3b6 100644 --- a/docs/_app/immutable/chunks/21.1d2af7d7.js +++ b/docs/_app/immutable/chunks/21.68d1eafd.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-send-coins-page.svelte.07670f1d.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-send-coins-page.svelte.0ca9331f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/22.8a0b77f5.js b/docs/_app/immutable/chunks/22.8085ed4c.js similarity index 61% rename from docs/_app/immutable/chunks/22.8a0b77f5.js rename to docs/_app/immutable/chunks/22.8085ed4c.js index b2dbb1a..689f8f1 100644 --- a/docs/_app/immutable/chunks/22.8a0b77f5.js +++ b/docs/_app/immutable/chunks/22.8085ed4c.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-sender-page.svelte.3be840de.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-sender-page.svelte.0b2aaa0f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/23.776c5793.js b/docs/_app/immutable/chunks/23.a67378c4.js similarity index 60% rename from docs/_app/immutable/chunks/23.776c5793.js rename to docs/_app/immutable/chunks/23.a67378c4.js index bf5d0b9..d02bea8 100644 --- a/docs/_app/immutable/chunks/23.776c5793.js +++ b/docs/_app/immutable/chunks/23.a67378c4.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-structs-page.svelte.5112e5f1.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-structs-page.svelte.d8304256.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/24.fa313187.js b/docs/_app/immutable/chunks/24.5ce292d8.js similarity index 56% rename from docs/_app/immutable/chunks/24.fa313187.js rename to docs/_app/immutable/chunks/24.5ce292d8.js index d40775b..db5c3c3 100644 --- a/docs/_app/immutable/chunks/24.fa313187.js +++ b/docs/_app/immutable/chunks/24.5ce292d8.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-03-textual-messages-page.svelte.491b23de.js";export{t as component}; +import{default as t}from"../entry/(examples)-03-textual-messages-page.svelte.bcb73eb2.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/25.1b1731d2.js b/docs/_app/immutable/chunks/25.e2289b70.js similarity index 61% rename from docs/_app/immutable/chunks/25.1b1731d2.js rename to docs/_app/immutable/chunks/25.e2289b70.js index cce5a32..91b580a 100644 --- a/docs/_app/immutable/chunks/25.1b1731d2.js +++ b/docs/_app/immutable/chunks/25.e2289b70.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-arrays-page.svelte.17eacec4.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-arrays-page.svelte.865ed365.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/26.f777ce8b.js b/docs/_app/immutable/chunks/26.b6b25ecc.js similarity index 58% rename from docs/_app/immutable/chunks/26.f777ce8b.js rename to docs/_app/immutable/chunks/26.b6b25ecc.js index e540c10..744a234 100644 --- a/docs/_app/immutable/chunks/26.f777ce8b.js +++ b/docs/_app/immutable/chunks/26.b6b25ecc.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-current-time-page.svelte.66041234.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-current-time-page.svelte.b35ef983.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/27.2f5f9fa9.js b/docs/_app/immutable/chunks/27.c7cb7ae2.js similarity index 57% rename from docs/_app/immutable/chunks/27.2f5f9fa9.js rename to docs/_app/immutable/chunks/27.c7cb7ae2.js index 19aa333..fe4042f 100644 --- a/docs/_app/immutable/chunks/27.2f5f9fa9.js +++ b/docs/_app/immutable/chunks/27.c7cb7ae2.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-decimal-point-page.svelte.bde99b18.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-decimal-point-page.svelte.b75e8d41.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/28.00bc53f2.js b/docs/_app/immutable/chunks/28.c6bb4a42.js similarity index 59% rename from docs/_app/immutable/chunks/28.00bc53f2.js rename to docs/_app/immutable/chunks/28.c6bb4a42.js index eee51c3..7f95ae0 100644 --- a/docs/_app/immutable/chunks/28.00bc53f2.js +++ b/docs/_app/immutable/chunks/28.c6bb4a42.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-functions-page.svelte.23d826a6.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-functions-page.svelte.3c89d138.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/29.754cc26b.js b/docs/_app/immutable/chunks/29.754cc26b.js deleted file mode 100644 index 5e9b79e..0000000 --- a/docs/_app/immutable/chunks/29.754cc26b.js +++ /dev/null @@ -1 +0,0 @@ -import{default as t}from"../entry/(examples)-04-if-statements-page.svelte.7ab9cd84.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/29.bdc63a25.js b/docs/_app/immutable/chunks/29.bdc63a25.js new file mode 100644 index 0000000..0c2ff27 --- /dev/null +++ b/docs/_app/immutable/chunks/29.bdc63a25.js @@ -0,0 +1,5 @@ +<<<<<<<< HEAD:docs/_app/immutable/chunks/29.bdc63a25.js +import{default as t}from"../entry/(examples)-04-if-statements-page.svelte.c7e8f278.js";export{t as component}; +======== +import{default as t}from"../entry/(examples)-04-if-statements-page.svelte.dd50a5ed.js";export{t as component}; +>>>>>>>> 58a3455 (FIXED double "need to" on "If statements" page [builded]):docs/_app/immutable/chunks/29.2c63852b.js diff --git a/docs/_app/immutable/chunks/30.e9a3b2dd.js b/docs/_app/immutable/chunks/30.00b47fda.js similarity index 62% rename from docs/_app/immutable/chunks/30.e9a3b2dd.js rename to docs/_app/immutable/chunks/30.00b47fda.js index 5866f19..c5f717b 100644 --- a/docs/_app/immutable/chunks/30.e9a3b2dd.js +++ b/docs/_app/immutable/chunks/30.00b47fda.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-loops-page.svelte.5763d2aa.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-loops-page.svelte.6e785c6e.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/31.56b4bcd3.js b/docs/_app/immutable/chunks/31.c43f1d50.js similarity index 62% rename from docs/_app/immutable/chunks/31.56b4bcd3.js rename to docs/_app/immutable/chunks/31.c43f1d50.js index 7b71aaf..ea5c9f0 100644 --- a/docs/_app/immutable/chunks/31.56b4bcd3.js +++ b/docs/_app/immutable/chunks/31.c43f1d50.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-maps-page.svelte.6d5eb568.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-maps-page.svelte.02c629fd.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/32.87a8bef6.js b/docs/_app/immutable/chunks/32.9d7fe4d2.js similarity index 59% rename from docs/_app/immutable/chunks/32.87a8bef6.js rename to docs/_app/immutable/chunks/32.9d7fe4d2.js index 700f3f0..6bcc94a 100644 --- a/docs/_app/immutable/chunks/32.87a8bef6.js +++ b/docs/_app/immutable/chunks/32.9d7fe4d2.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-04-optionals-page.svelte.73f352b1.js";export{t as component}; +import{default as t}from"../entry/(examples)-04-optionals-page.svelte.85e8f359.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/33.4dfe2d74.js b/docs/_app/immutable/chunks/33.aeaff17d.js similarity index 55% rename from docs/_app/immutable/chunks/33.4dfe2d74.js rename to docs/_app/immutable/chunks/33.aeaff17d.js index f8648dc..0ab4565 100644 --- a/docs/_app/immutable/chunks/33.4dfe2d74.js +++ b/docs/_app/immutable/chunks/33.aeaff17d.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-05-the-ownable-trait-page.svelte.1df58f22.js";export{t as component}; +import{default as t}from"../entry/(examples)-05-the-ownable-trait-page.svelte.b917ff9a.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/34.fa8559b1.js b/docs/_app/immutable/chunks/34.210b7f49.js similarity index 50% rename from docs/_app/immutable/chunks/34.fa8559b1.js rename to docs/_app/immutable/chunks/34.210b7f49.js index f908c40..7c6b803 100644 --- a/docs/_app/immutable/chunks/34.fa8559b1.js +++ b/docs/_app/immutable/chunks/34.210b7f49.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-05-the-ownable-transferable-trait-page.svelte.ae64f791.js";export{t as component}; +import{default as t}from"../entry/(examples)-05-the-ownable-transferable-trait-page.svelte.3d90c8f0.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/35.3dd0bcef.js b/docs/_app/immutable/chunks/35.c33ee646.js similarity index 54% rename from docs/_app/immutable/chunks/35.3dd0bcef.js rename to docs/_app/immutable/chunks/35.c33ee646.js index d9e68b2..af45074 100644 --- a/docs/_app/immutable/chunks/35.3dd0bcef.js +++ b/docs/_app/immutable/chunks/35.c33ee646.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-05-the-resumable-trait-page.svelte.bdeae906.js";export{t as component}; +import{default as t}from"../entry/(examples)-05-the-resumable-trait-page.svelte.910751fd.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/36.33c8d935.js b/docs/_app/immutable/chunks/36.24fe6764.js similarity index 54% rename from docs/_app/immutable/chunks/36.33c8d935.js rename to docs/_app/immutable/chunks/36.24fe6764.js index 8e49782..480591c 100644 --- a/docs/_app/immutable/chunks/36.33c8d935.js +++ b/docs/_app/immutable/chunks/36.24fe6764.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-05-the-stoppable-trait-page.svelte.63297e5f.js";export{t as component}; +import{default as t}from"../entry/(examples)-05-the-stoppable-trait-page.svelte.22f8243f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/37.3ebc71cd.js b/docs/_app/immutable/chunks/37.10eaead1.js similarity index 57% rename from docs/_app/immutable/chunks/37.3ebc71cd.js rename to docs/_app/immutable/chunks/37.10eaead1.js index 7bf73ad..6cb0701 100644 --- a/docs/_app/immutable/chunks/37.3ebc71cd.js +++ b/docs/_app/immutable/chunks/37.10eaead1.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-05-your-own-trait-page.svelte.71da5b94.js";export{t as component}; +import{default as t}from"../entry/(examples)-05-your-own-trait-page.svelte.6378d45b.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/38.6c39d962.js b/docs/_app/immutable/chunks/38.07fd96d3.js similarity index 52% rename from docs/_app/immutable/chunks/38.6c39d962.js rename to docs/_app/immutable/chunks/38.07fd96d3.js index 68fc084..b929d7e 100644 --- a/docs/_app/immutable/chunks/38.6c39d962.js +++ b/docs/_app/immutable/chunks/38.07fd96d3.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-authenticating-children-page.svelte.51d1628e.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-authenticating-children-page.svelte.cd310397.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/39.58decbc1.js b/docs/_app/immutable/chunks/39.90525af2.js similarity index 53% rename from docs/_app/immutable/chunks/39.58decbc1.js rename to docs/_app/immutable/chunks/39.90525af2.js index cc35bd9..a224454 100644 --- a/docs/_app/immutable/chunks/39.58decbc1.js +++ b/docs/_app/immutable/chunks/39.90525af2.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-calc-contract-address-page.svelte.76c19e85.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-calc-contract-address-page.svelte.cb0e43f2.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/4.bc2585d0.js b/docs/_app/immutable/chunks/4.bc2585d0.js new file mode 100644 index 0000000..f512e5c --- /dev/null +++ b/docs/_app/immutable/chunks/4.bc2585d0.js @@ -0,0 +1 @@ +import{default as t}from"../entry/_page.svelte.9d64e26f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/40.1b011323.js b/docs/_app/immutable/chunks/40.1b011323.js deleted file mode 100644 index a290726..0000000 --- a/docs/_app/immutable/chunks/40.1b011323.js +++ /dev/null @@ -1 +0,0 @@ -import{default as t}from"../entry/(examples)-06-communicating-children-page.svelte.b1f7a8a7.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/40.c694dad6.js b/docs/_app/immutable/chunks/40.c694dad6.js new file mode 100644 index 0000000..2bc31a9 --- /dev/null +++ b/docs/_app/immutable/chunks/40.c694dad6.js @@ -0,0 +1 @@ +import{default as t}from"../entry/(examples)-06-communicating-subcontract-page.svelte.a6a9d9a0.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/41.0d70bad5.js b/docs/_app/immutable/chunks/41.0bd2fbbd.js similarity index 52% rename from docs/_app/immutable/chunks/41.0d70bad5.js rename to docs/_app/immutable/chunks/41.0bd2fbbd.js index 3c9c4f0..f73b9cb 100644 --- a/docs/_app/immutable/chunks/41.0d70bad5.js +++ b/docs/_app/immutable/chunks/41.0bd2fbbd.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-contract-deploy-another-page.svelte.820f8c28.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-contract-deploy-another-page.svelte.7deaf25a.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/42.5f1bc88a.js b/docs/_app/immutable/chunks/42.0b7e2b1d.js similarity index 51% rename from docs/_app/immutable/chunks/42.5f1bc88a.js rename to docs/_app/immutable/chunks/42.0b7e2b1d.js index 828064f..3ebd550 100644 --- a/docs/_app/immutable/chunks/42.5f1bc88a.js +++ b/docs/_app/immutable/chunks/42.0b7e2b1d.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-multiple-contract-instances-page.svelte.d7f078ed.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-multiple-contract-instances-page.svelte.11f7331f.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/43.728b77dc.js b/docs/_app/immutable/chunks/43.7c761bea.js similarity index 58% rename from docs/_app/immutable/chunks/43.728b77dc.js rename to docs/_app/immutable/chunks/43.7c761bea.js index c34923d..f1f48f4 100644 --- a/docs/_app/immutable/chunks/43.728b77dc.js +++ b/docs/_app/immutable/chunks/43.7c761bea.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-parent-child-page.svelte.435d7d43.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-parent-child-page.svelte.f0be9530.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/44.c0354187.js b/docs/_app/immutable/chunks/44.322ff436.js similarity index 56% rename from docs/_app/immutable/chunks/44.c0354187.js rename to docs/_app/immutable/chunks/44.322ff436.js index 810f28c..941c3f4 100644 --- a/docs/_app/immutable/chunks/44.c0354187.js +++ b/docs/_app/immutable/chunks/44.322ff436.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-unbounded-arrays-page.svelte.11af6030.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-unbounded-arrays-page.svelte.de373b50.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/45.caca6bb6.js b/docs/_app/immutable/chunks/45.48701329.js similarity index 57% rename from docs/_app/immutable/chunks/45.caca6bb6.js rename to docs/_app/immutable/chunks/45.48701329.js index 2b6c46c..bd0ad56 100644 --- a/docs/_app/immutable/chunks/45.caca6bb6.js +++ b/docs/_app/immutable/chunks/45.48701329.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-06-unbounded-maps-page.svelte.6d1cee49.js";export{t as component}; +import{default as t}from"../entry/(examples)-06-unbounded-maps-page.svelte.437d1ed3.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/46.a920abdf.js b/docs/_app/immutable/chunks/46.a920abdf.js deleted file mode 100644 index 6d24463..0000000 --- a/docs/_app/immutable/chunks/46.a920abdf.js +++ /dev/null @@ -1 +0,0 @@ -import{default as t}from"../entry/all-page.svelte.005e9e8d.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/46.fd1d71ee.js b/docs/_app/immutable/chunks/46.fd1d71ee.js new file mode 100644 index 0000000..a71286f --- /dev/null +++ b/docs/_app/immutable/chunks/46.fd1d71ee.js @@ -0,0 +1 @@ +import{default as t}from"../entry/(examples)-07-jetton-standard-page.svelte.21b6de71.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/47.6557669c.js b/docs/_app/immutable/chunks/47.6557669c.js new file mode 100644 index 0000000..3d8cd3c --- /dev/null +++ b/docs/_app/immutable/chunks/47.6557669c.js @@ -0,0 +1 @@ +import{default as t}from"../entry/all-page.svelte.ad73b83a.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/5.3f1910c0.js b/docs/_app/immutable/chunks/5.3f1910c0.js new file mode 100644 index 0000000..fd30875 --- /dev/null +++ b/docs/_app/immutable/chunks/5.3f1910c0.js @@ -0,0 +1 @@ +import{default as t}from"../entry/(examples)-00-hello-world-page.svelte.16f8154b.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/6.7309403b.js b/docs/_app/immutable/chunks/6.7309403b.js deleted file mode 100644 index eb29b29..0000000 --- a/docs/_app/immutable/chunks/6.7309403b.js +++ /dev/null @@ -1 +0,0 @@ -import{default as t}from"../entry/(examples)-01-hello-world-page.svelte.bd09d3c0.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/5.a8b41a85.js b/docs/_app/immutable/chunks/6.a08e944b.js similarity index 56% rename from docs/_app/immutable/chunks/5.a8b41a85.js rename to docs/_app/immutable/chunks/6.a08e944b.js index 0829f45..4803a31 100644 --- a/docs/_app/immutable/chunks/5.a8b41a85.js +++ b/docs/_app/immutable/chunks/6.a08e944b.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-01-a-simple-counter-page.svelte.60e4d560.js";export{t as component}; +import{default as t}from"../entry/(examples)-01-a-simple-counter-page.svelte.d7d63907.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/7.5be899fa.js b/docs/_app/immutable/chunks/7.b31abf6b.js similarity index 54% rename from docs/_app/immutable/chunks/7.5be899fa.js rename to docs/_app/immutable/chunks/7.b31abf6b.js index 7d8eb71..0b99dac 100644 --- a/docs/_app/immutable/chunks/7.5be899fa.js +++ b/docs/_app/immutable/chunks/7.b31abf6b.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-01-the-deployable-trait-page.svelte.7ca70ba6.js";export{t as component}; +import{default as t}from"../entry/(examples)-01-the-deployable-trait-page.svelte.cab4baf4.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/8.027ef838.js b/docs/_app/immutable/chunks/8.57302d25.js similarity index 59% rename from docs/_app/immutable/chunks/8.027ef838.js rename to docs/_app/immutable/chunks/8.57302d25.js index 4ab3d9f..34829fb 100644 --- a/docs/_app/immutable/chunks/8.027ef838.js +++ b/docs/_app/immutable/chunks/8.57302d25.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-addresses-page.svelte.774753f6.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-addresses-page.svelte.e721ceab.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/9.81c3e510.js b/docs/_app/immutable/chunks/9.5c8d2ece.js similarity index 62% rename from docs/_app/immutable/chunks/9.81c3e510.js rename to docs/_app/immutable/chunks/9.5c8d2ece.js index d6611e6..b4b2cf0 100644 --- a/docs/_app/immutable/chunks/9.81c3e510.js +++ b/docs/_app/immutable/chunks/9.5c8d2ece.js @@ -1 +1 @@ -import{default as t}from"../entry/(examples)-02-bools-page.svelte.4def9755.js";export{t as component}; +import{default as t}from"../entry/(examples)-02-bools-page.svelte.06b72b09.js";export{t as component}; diff --git a/docs/_app/immutable/chunks/examples.2096c2f1.js b/docs/_app/immutable/chunks/examples.ec427188.js similarity index 81% rename from docs/_app/immutable/chunks/examples.2096c2f1.js rename to docs/_app/immutable/chunks/examples.ec427188.js index a9088a3..e1d0c5f 100644 --- a/docs/_app/immutable/chunks/examples.2096c2f1.js +++ b/docs/_app/immutable/chunks/examples.ec427188.js @@ -1 +1 @@ -const e=[{id:"01-hello-world",name:"Hello World"},{id:"01-a-simple-counter",name:"A Simple Counter"},{id:"01-the-deployable-trait",name:"The Deployable Trait"},{id:"02-integers",name:"Integers"},{id:"02-integer-ops",name:"Integer Operations"},{id:"02-bools",name:"Bools"},{id:"02-addresses",name:"Addresses"},{id:"02-strings",name:"Strings"},{id:"02-variables",name:"Variables"},{id:"02-constants",name:"Constants"},{id:"03-getters",name:"Getters"},{id:"03-receivers",name:"Receivers and Messages"},{id:"03-textual-messages",name:"Textual Messages"},{id:"03-structs",name:"Structs"},{id:"03-sender",name:"Message Sender"},{id:"03-errors",name:"Throwing Errors"},{id:"03-receive-coins",name:"Receiving TON Coins"},{id:"03-messages-between-contracts",name:"Messages Between Contracts"},{id:"03-send-coins",name:"Sending TON Coins"},{id:"03-emit",name:"Emitting Logs"},{id:"04-if-statements",name:"If Statements"},{id:"04-loops",name:"Loops"},{id:"04-functions",name:"Functions"},{id:"04-optionals",name:"Optionals"},{id:"04-maps",name:"Maps"},{id:"04-arrays",name:"Arrays"},{id:"04-current-time",name:"Current Time"},{id:"04-decimal-point",name:"Decimal Point"},{id:"05-the-ownable-trait",name:"The Ownable Trait"},{id:"05-the-ownable-transferable-trait",name:"The Ownable-Transferable Trait"},{id:"05-the-stoppable-trait",name:"The Stoppable Trait"},{id:"05-the-resumable-trait",name:"The Resumable Trait"},{id:"05-your-own-trait",name:"Writing Your Own Trait"},{id:"06-calc-contract-address",name:"Calculate Contract Address"},{id:"06-multiple-contract-instances",name:"Multiple Contract Instances"},{id:"06-contract-deploy-another",name:"A Contract Deploying Another"},{id:"06-parent-child",name:"Parent-Child Relationship"},{id:"06-communicating-children",name:"Communicating with Children"},{id:"06-authenticating-children",name:"Authenticating Children"},{id:"06-unbounded-arrays",name:"Unbounded Arrays - Todo List"},{id:"06-unbounded-maps",name:"Unbounded Maps - Simplified Token"}];export{e}; +const e=[{id:"00-hello-world",name:"Hello World"},{id:"01-a-simple-counter",name:"A Simple Counter"},{id:"01-the-deployable-trait",name:"The Deployable Trait"},{id:"02-integers",name:"Integers"},{id:"02-integer-ops",name:"Integer Operations"},{id:"02-bools",name:"Bools"},{id:"02-addresses",name:"Addresses"},{id:"02-strings",name:"Strings"},{id:"02-variables",name:"Variables"},{id:"02-constants",name:"Constants"},{id:"03-getters",name:"Getters"},{id:"03-receivers",name:"Receivers and Messages"},{id:"03-textual-messages",name:"Textual Messages"},{id:"03-structs",name:"Structs"},{id:"03-sender",name:"Message Sender"},{id:"03-errors",name:"Throwing Errors"},{id:"03-receive-coins",name:"Receiving TON Coins"},{id:"03-messages-between-contracts",name:"Messages Between Contracts"},{id:"03-send-coins",name:"Sending TON Coins"},{id:"03-emit",name:"Emitting Logs"},{id:"04-if-statements",name:"If Statements"},{id:"04-loops",name:"Loops"},{id:"04-functions",name:"Functions"},{id:"04-optionals",name:"Optionals"},{id:"04-maps",name:"Maps"},{id:"04-arrays",name:"Arrays"},{id:"04-current-time",name:"Current Time"},{id:"04-decimal-point",name:"Decimal Point"},{id:"05-the-ownable-trait",name:"The Ownable Trait"},{id:"05-the-ownable-transferable-trait",name:"The Ownable-Transferable Trait"},{id:"05-the-stoppable-trait",name:"The Stoppable Trait"},{id:"05-the-resumable-trait",name:"The Resumable Trait"},{id:"05-your-own-trait",name:"Writing Your Own Trait"},{id:"06-calc-contract-address",name:"Calculate Contract Address"},{id:"06-multiple-contract-instances",name:"Multiple Contract Instances"},{id:"06-contract-deploy-another",name:"A Contract Deploying Another"},{id:"06-parent-child",name:"Parent-Child Relationship"},{id:"06-communicating-subcontract",name:"Communicating with Sub-Contract"},{id:"06-authenticating-children",name:"Authenticating Children"},{id:"06-unbounded-arrays",name:"Unbounded Arrays - Todo List"},{id:"06-unbounded-maps",name:"Unbounded Maps - Simplified Token"},{id:"07-jetton-standard",name:"Jetton Token"}];export{e}; diff --git a/docs/_app/immutable/chunks/index.78404594.js b/docs/_app/immutable/chunks/index.c056099e.js similarity index 99% rename from docs/_app/immutable/chunks/index.78404594.js rename to docs/_app/immutable/chunks/index.c056099e.js index 14b48ef..b3928f1 100644 --- a/docs/_app/immutable/chunks/index.78404594.js +++ b/docs/_app/immutable/chunks/index.c056099e.js @@ -1,4 +1,4 @@ -import{aa as kA}from"./index.9fe14626.js";import{d as QA,c as YA,r as EQ}from"./store.d3ab02ad.js";var aI={},EA={};Object.defineProperty(EA,"__esModule",{value:!0});EA.defaultConfig=EA.defaultConfigSeqno=void 0;EA.defaultConfigSeqno=25235362;EA.defaultConfig="te6cckICBb0AAQAA6sgAAAIBIAAGAAECAvUABAACAQOncwADAYHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xStXhEPsEP6P8L5ey7wUE70E447AhKM09sELy1yrrzwZwAAMAQOkMwAFAEDLudEGKVRDmoOpHyeDX7nS4+eYkQNWZQw8STyUYjRkaAIC2AAdAAcCAWIACgAIAQHcAAkBwU1cAhCzXa3aohn6xFnboP3vsfrk6XoNB5dzn+BQ1pTKDr1/+cpw4G6eIqiSL1rnUhGp1qNKgJTo4Vh7YGvbtmKAAAAAAAAAAAAAAAA7U8vSzdFgu5NEtLtb2bo9/o6RB8AADAEB/AALAcHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xTubv9CtUzi5cA8IMzgO4X1GPlHBrmce5vCJAb3ombICgAAAAAAAAAAAAAAALBbDlQ2Ep+JHrvGOnbn5bN8j73jAAAwCASAAFAANAgFYABMADgIBSAASAA8CAVgAEQAQAIG+RKqaadCnje9HfxNfNLilT0+K2YZrFOUkt8Mve5SRAGAAAAAAAAAAAAAAAABz6dEMhlep55agxfMMPf3n7V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EBSAW0AEDlZ1T4NCb2mwkme9h2rJfESCE0W34ma9lWp7+/uY3zXAIBIAW4BbYBAUgFtwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACASAFuwW5AQEgBboAQDMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAQEgBbwAQFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVfY0Hfw==";var XA={},TA={},tA={};Object.defineProperty(tA,"__esModule",{value:!0});tA.base64Decode=void 0;function cI(G){return G>64&&G<91?G-65:G>96&&G<123?G-71:G>47&&G<58?G+4:G===43?62:G===47?63:0}function LI(G){const g=G.replace(/[^A-Za-z0-9+/]/g,""),E=g.length,N=E*3+1>>2,o=new Uint8Array(N);let I,J,q=0,f=0;for(let T=0;T>>(16>>>I&24)&255,I++,f++;q=0}return o}tA.base64Decode=LI;var EB={},HI={get exports(){return EB},set exports(G){EB=G}};(function(G,g){var E=(()=>{var N=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(o){o=o||{};var I=typeof o<"u"?o:{},J,q;I.ready=new Promise(function(A,B){J=A,q=B});var f=Object.assign({},I),T="./this.program",oA=!0,O="";function kQ(A){return I.locateFile?I.locateFile(A,O):O+A}var YQ;typeof document<"u"&&document.currentScript&&(O=document.currentScript.src),N&&(O=N),O.indexOf("blob:")!==0?O=O.substr(0,O.replace(/[?#].*/,"").lastIndexOf("/")+1):O="";var wB=I.print||console.log.bind(console),gA=I.printErr||console.warn.bind(console);Object.assign(I,f),f=null,I.arguments&&I.arguments,I.thisProgram&&(T=I.thisProgram),I.quit&&I.quit;var RA;I.wasmBinary&&(RA=I.wasmBinary),I.noExitRuntime,typeof WebAssembly!="object"&&JA("no native wasm support detected");var ZA,NB=!1,kB=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function eA(A,B,Q){for(var C=B+Q,F=B;A[F]&&!(F>=C);)++F;if(F-B>16&&A.buffer&&kB)return kB.decode(A.subarray(B,F));for(var D="";B>10,56320|R&1023)}}return D}function bA(A,B){return A?eA(_,A,B):""}function PA(A,B,Q,C){if(!(C>0))return 0;for(var F=Q,D=Q+C-1,w=0;w=55296&&Y<=57343){var i=A.charCodeAt(++w);Y=65536+((Y&1023)<<10)|i&1023}if(Y<=127){if(Q>=D)break;B[Q++]=Y}else if(Y<=2047){if(Q+1>=D)break;B[Q++]=192|Y>>6,B[Q++]=128|Y&63}else if(Y<=65535){if(Q+2>=D)break;B[Q++]=224|Y>>12,B[Q++]=128|Y>>6&63,B[Q++]=128|Y&63}else{if(Q+3>=D)break;B[Q++]=240|Y>>18,B[Q++]=128|Y>>12&63,B[Q++]=128|Y>>6&63,B[Q++]=128|Y&63}}return B[Q]=0,Q-F}function iQ(A,B,Q){return PA(A,_,B,Q)}function vA(A){for(var B=0,Q=0;Q=55296&&C<=57343?(B+=4,++Q):B+=3}return B}var YB,Z,_,S,m,uA;function iB(A){YB=A,I.HEAP8=Z=new Int8Array(A),I.HEAP16=new Int16Array(A),I.HEAP32=S=new Int32Array(A),I.HEAPU8=_=new Uint8Array(A),I.HEAPU16=new Uint16Array(A),I.HEAPU32=m=new Uint32Array(A),I.HEAPF32=new Float32Array(A),I.HEAPF64=uA=new Float64Array(A)}I.INITIAL_MEMORY;var oB,RB=[],UB=[],JB=[];function oQ(){if(I.preRun)for(typeof I.preRun=="function"&&(I.preRun=[I.preRun]);I.preRun.length;)JQ(I.preRun.shift());_A(RB)}function RQ(){_A(UB)}function UQ(){if(I.postRun)for(typeof I.postRun=="function"&&(I.postRun=[I.postRun]);I.postRun.length;)SQ(I.postRun.shift());_A(JB)}function JQ(A){RB.unshift(A)}function KQ(A){UB.unshift(A)}function SQ(A){JB.unshift(A)}var IA=0,UA=null;function sQ(A){IA++,I.monitorRunDependencies&&I.monitorRunDependencies(IA)}function MQ(A){if(IA--,I.monitorRunDependencies&&I.monitorRunDependencies(IA),IA==0&&UA){var B=UA;UA=null,B()}}function JA(A){I.onAbort&&I.onAbort(A),A="Aborted("+A+")",gA(A),NB=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw q(B),B}var hQ="data:application/octet-stream;base64,";function KB(A){return A.startsWith(hQ)}var r;r="emulator-emscripten.wasm",KB(r)||(r=kQ(r));function SB(A){try{if(A==r&&RA)return new Uint8Array(RA);throw"both async and sync fetching of the wasm failed"}catch(B){JA(B)}}function yQ(){return!RA&&oA&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+r+"'";return A.arrayBuffer()}).catch(function(){return SB(r)}):Promise.resolve().then(function(){return SB(r)})}function aQ(){var A={a:Wg};function B(w,Y){var i=w.exports;I.asm=i,ZA=I.asm.za,iB(ZA.buffer),oB=I.asm.Ga,KQ(I.asm.Aa),MQ()}sQ();function Q(w){B(w.instance)}function C(w){return yQ().then(function(Y){return WebAssembly.instantiate(Y,A)}).then(function(Y){return Y}).then(w,function(Y){gA("failed to asynchronously prepare wasm: "+Y),JA(Y)})}function F(){return!RA&&typeof WebAssembly.instantiateStreaming=="function"&&!KB(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(function(w){var Y=WebAssembly.instantiateStreaming(w,A);return Y.then(Q,function(i){return gA("wasm streaming compile failed: "+i),gA("falling back to ArrayBuffer instantiation"),C(Q)})}):C(Q)}if(I.instantiateWasm)try{var D=I.instantiateWasm(A,B);return D}catch(w){return gA("Module.instantiateWasm callback failed with error: "+w),!1}return F().catch(q),{}}var cQ={468400:A=>{throw bA(A)}};function _A(A){for(;A.length>0;)A.shift()(I)}function LQ(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function HQ(A,B){Z.set(A,B)}function qQ(A){return dA(A+24)+24}var pA=[];function ZQ(A){A.add_ref()}var mA=0;function bQ(A){var B=new CA(A);return B.get_caught()||(B.set_caught(!0),mA--),B.set_rethrown(!1),pA.push(B),ZQ(B),B.get_exception_ptr()}var $=0;function CA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){m[this.ptr+4>>2]=B},this.get_type=function(){return m[this.ptr+4>>2]},this.set_destructor=function(B){m[this.ptr+8>>2]=B},this.get_destructor=function(){return m[this.ptr+8>>2]},this.set_refcount=function(B){S[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,Z[this.ptr+12>>0]=B},this.get_caught=function(){return Z[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,Z[this.ptr+13>>0]=B},this.get_rethrown=function(){return Z[this.ptr+13>>0]!=0},this.init=function(B,Q){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(Q),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=S[this.ptr>>2];S[this.ptr>>2]=B+1},this.release_ref=function(){var B=S[this.ptr>>2];return S[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){m[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return m[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=mB(this.get_type());if(B)return m[this.excPtr>>2];var Q=this.get_adjusted_ptr();return Q!==0?Q:this.excPtr}}function sB(A){return bB(new CA(A).ptr)}function H(A){return oB.get(A)}function pQ(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&H(B)(A.excPtr),sB(A.excPtr)}}function mQ(){s(0);var A=pA.pop();pQ(A),$=0}function VQ(A){throw $||($=A),A}function dQ(){var A=$;if(!A)return x(0),0;var B=new CA(A);B.set_adjusted_ptr(A);var Q=B.get_type();if(!Q)return x(0),A;for(var C=Array.prototype.slice.call(arguments),F=0;F>2]+S[A+4>>2]*4294967296}function $Q(A,B){var Q=new Date(MB(A)*1e3);S[B>>2]=Q.getUTCSeconds(),S[B+4>>2]=Q.getUTCMinutes(),S[B+8>>2]=Q.getUTCHours(),S[B+12>>2]=Q.getUTCDate(),S[B+16>>2]=Q.getUTCMonth(),S[B+20>>2]=Q.getUTCFullYear()-1900,S[B+24>>2]=Q.getUTCDay();var C=Date.UTC(Q.getUTCFullYear(),0,1,0,0,0,0),F=(Q.getTime()-C)/(1e3*60*60*24)|0;S[B+28>>2]=F}function Ag(A,B){var Q=new Date(MB(A)*1e3);S[B>>2]=Q.getSeconds(),S[B+4>>2]=Q.getMinutes(),S[B+8>>2]=Q.getHours(),S[B+12>>2]=Q.getDate(),S[B+16>>2]=Q.getMonth(),S[B+20>>2]=Q.getFullYear()-1900,S[B+24>>2]=Q.getDay();var C=new Date(Q.getFullYear(),0,1),F=(Q.getTime()-C.getTime())/(1e3*60*60*24)|0;S[B+28>>2]=F,S[B+36>>2]=-(Q.getTimezoneOffset()*60);var D=new Date(Q.getFullYear(),6,1).getTimezoneOffset(),w=C.getTimezoneOffset(),Y=(D!=w&&Q.getTimezoneOffset()==Math.min(w,D))|0;S[B+32>>2]=Y}function Bg(A,B,Q,C,F,D){}function hB(A){var B=vA(A)+1,Q=dA(B);return Q&&PA(A,Z,Q,B),Q}function Qg(A,B,Q){var C=new Date().getFullYear(),F=new Date(C,0,1),D=new Date(C,6,1),w=F.getTimezoneOffset(),Y=D.getTimezoneOffset(),i=Math.max(w,Y);S[A>>2]=i*60,S[B>>2]=Number(w!=Y);function R(V){var X=V.toTimeString().match(/\(([A-Za-z ]+)\)$/);return X?X[1]:"GMT"}var p=R(F),b=R(D),y=hB(p),L=hB(b);Y>2]=y,m[Q+4>>2]=L):(m[Q>>2]=L,m[Q+4>>2]=y)}function $A(A,B,Q){$A.called||($A.called=!0,Qg(A,B,Q))}function gg(){JA("")}var AB=[];function Ig(A,B){AB.length=0;var Q;for(B>>=2;Q=_[A++];)B+=Q!=105&B,AB.push(Q==105?S[B]:uA[B++>>1]),++B;return AB}function Cg(A,B,Q){var C=Ig(B,Q);return cQ[A].apply(null,C)}var yB;yB=()=>performance.now();function Eg(A){return A<0||A===0&&1/A===-1/0}function Dg(A,B){return(A>>>0)+B*4294967296}function Gg(A,B){return(A>>>0)+(B>>>0)*4294967296}function aB(A,B){if(A<=0)return A;var Q=B<=32?Math.abs(1<=Q&&(B<=32||A>Q)&&(A=-2*Q+A),A}function cB(A,B){return A>=0?A:B<=32?2*Math.abs(1<0?Q:vA(A)+1,F=new Array(C),D=PA(A,F,0,F.length);return B&&(F.length=D),F}function wg(A,B){var Q=A,C=B;function F(v,AA){return(AA==="double"||AA==="i64")&&v&7&&(v+=4),v}function D(v){var AA;return C=F(C,v),v==="double"?(AA=uA[C>>3],C+=8):v=="i64"?(AA=[S[C>>2],S[C+4>>2]],C+=8):(v="i32",AA=S[C>>2],C+=4),AA}for(var w=[],Y,i,R;;){var p=Q;if(Y=Z[Q>>0],Y===0)break;if(i=Z[Q+1>>0],Y==37){var b=!1,y=!1,L=!1,V=!1,X=!1;A:for(;;){switch(i){case 43:b=!0;break;case 45:y=!0;break;case 35:L=!0;break;case 48:if(V)break A;V=!0;break;case 32:X=!0;break;default:break A}Q++,i=Z[Q+1>>0]}var c=0;if(i==42)c=D("i32"),Q++,i=Z[Q+1>>0];else for(;i>=48&&i<=57;)c=c*10+(i-48),Q++,i=Z[Q+1>>0];var l=!1,k=-1;if(i==46){if(k=0,l=!0,Q++,i=Z[Q+1>>0],i==42)k=D("i32"),Q++;else for(;;){var K=Z[Q+1>>0];if(K<48||K>57)break;k=k*10+(K-48),Q++}i=Z[Q+1>>0]}k<0&&(k=6,l=!1);var a;switch(String.fromCharCode(i)){case"h":var d=Z[Q+2>>0];d==104?(Q++,a=1):a=2;break;case"l":var d=Z[Q+2>>0];d==108?(Q++,a=8):a=4;break;case"L":case"q":case"j":a=8;break;case"z":case"t":case"I":a=4;break;default:a=null}switch(a&&Q++,i=Z[Q+1>>0],String.fromCharCode(i)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var FA=i==100||i==105;a=a||4,R=D("i"+a*8);var U;if(a==8&&(R=i==117?Gg(R[0],R[1]):Dg(R[0],R[1])),a<=4){var hI=Math.pow(256,a)-1;R=(FA?aB:cB)(R&hI,a*8)}var sA=Math.abs(R),t="";if(i==100||i==105)U=aB(R,8*a).toString(10);else if(i==117)U=cB(R,8*a).toString(10),R=Math.abs(R);else if(i==111)U=(L?"0":"")+sA.toString(8);else if(i==120||i==88){if(t=L&&R!=0?"0x":"",R<0){R=-R,U=(sA-1).toString(16);for(var PB=[],P=0;P=0&&(b?t="+"+t:X&&(t=" "+t)),U.charAt(0)=="-"&&(t="-"+t,U=U.substr(1));t.length+U.lengthgB&&gB>=-4?(i=(i==103?"f":"F").charCodeAt(0),k-=gB+1):(i=(i==103?"e":"E").charCodeAt(0),k--),MA=Math.min(k,20)}i==101||i==69?(U=R.toExponential(MA),/[eE][-+]\d$/.test(U)&&(U=U.slice(0,-1)+"0"+U.slice(-1))):(i==102||i==70)&&(U=R.toFixed(MA),R===0&&Eg(R)&&(U="-"+U));var e=U.split("e");if(vB&&!L)for(;e[0].length>1&&e[0].includes(".")&&(e[0].slice(-1)=="0"||e[0].slice(-1)==".");)e[0]=e[0].slice(0,-1);else for(L&&U.indexOf(".")==-1&&(e[0]+=".");k>MA++;)e[0]+="0";U=e[0]+(e.length>1?"e"+e[1]:""),i==69&&(U=U.toUpperCase()),R>=0&&(b?U="+"+U:X&&(U=" "+U))}for(;U.length>0]);else w=w.concat(LB("(null)".substr(0,wA),!0));if(y)for(;wA0;)w.push(32);y||w.push(D("i8"));break}case"n":{var yI=D("i32*");S[yI>>2]=w.length;break}case"%":{w.push(Y);break}default:for(var P=p;P>0])}Q+=2}else w.push(Y),Q+=1}return w}function BB(A){if(!A||!A.callee||!A.callee.name)return[null,"",""];A.callee.toString();var B=A.callee.name,Q="(",C=!0;for(var F in A){var D=A[F];C||(Q+=", "),C=!1,typeof D=="number"||typeof D=="string"?Q+=D:Q+="("+typeof D+")"}Q+=")";var w=A.callee.caller;return A=w?w.arguments:[],C&&(Q=""),[A,B,Q]}function GA(A){GA.shown||(GA.shown={}),GA.shown[A]||(GA.shown[A]=1,gA(A))}function Ng(A){var B=LQ(),Q=B.lastIndexOf("_emscripten_log"),C=B.lastIndexOf("_emscripten_get_callstack"),F=B.indexOf(` +import{aa as kA}from"./index.9fe14626.js";import{d as QA,c as YA,r as EQ}from"./store.476c3091.js";var aI={},EA={};Object.defineProperty(EA,"__esModule",{value:!0});EA.defaultConfig=EA.defaultConfigSeqno=void 0;EA.defaultConfigSeqno=25235362;EA.defaultConfig="te6cckICBb0AAQAA6sgAAAIBIAAGAAECAvUABAACAQOncwADAYHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xStXhEPsEP6P8L5ey7wUE70E447AhKM09sELy1yrrzwZwAAMAQOkMwAFAEDLudEGKVRDmoOpHyeDX7nS4+eYkQNWZQw8STyUYjRkaAIC2AAdAAcCAWIACgAIAQHcAAkBwU1cAhCzXa3aohn6xFnboP3vsfrk6XoNB5dzn+BQ1pTKDr1/+cpw4G6eIqiSL1rnUhGp1qNKgJTo4Vh7YGvbtmKAAAAAAAAAAAAAAAA7U8vSzdFgu5NEtLtb2bo9/o6RB8AADAEB/AALAcHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xTubv9CtUzi5cA8IMzgO4X1GPlHBrmce5vCJAb3ombICgAAAAAAAAAAAAAAALBbDlQ2Ep+JHrvGOnbn5bN8j73jAAAwCASAAFAANAgFYABMADgIBSAASAA8CAVgAEQAQAIG+RKqaadCnje9HfxNfNLilT0+K2YZrFOUkt8Mve5SRAGAAAAAAAAAAAAAAAABz6dEMhlep55agxfMMPf3n7VtFEACBvmmMMnQNMca8fZIP+x0yN8gWr6U5ByGQu8VgDeEvwxEgAAAAAAAAAAAAAAAP5XdVgp4eMGnNoEM/EKtL7DP8WJAAgb7Sh7LpRZwVdThtIdwoxok0VwOBgOviYK5sYcUz2FIYmAAAAAAAAAAAAAAAAEmbnDTO45niNQamX17RfCFw1j7MAIG/X7BE4d+cHa1Ku+INz+IhIOcCQYgWeItfGbthwsz7nP4AAAAAAAAAAAAAAAGJk3sG1X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};Object.defineProperty(tA,"__esModule",{value:!0});tA.base64Decode=void 0;function cI(G){return G>64&&G<91?G-65:G>96&&G<123?G-71:G>47&&G<58?G+4:G===43?62:G===47?63:0}function LI(G){const g=G.replace(/[^A-Za-z0-9+/]/g,""),E=g.length,N=E*3+1>>2,o=new Uint8Array(N);let I,J,q=0,f=0;for(let T=0;T>>(16>>>I&24)&255,I++,f++;q=0}return o}tA.base64Decode=LI;var EB={},HI={get exports(){return EB},set exports(G){EB=G}};(function(G,g){var E=(()=>{var N=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(o){o=o||{};var I=typeof o<"u"?o:{},J,q;I.ready=new Promise(function(A,B){J=A,q=B});var f=Object.assign({},I),T="./this.program",oA=!0,O="";function kQ(A){return I.locateFile?I.locateFile(A,O):O+A}var YQ;typeof document<"u"&&document.currentScript&&(O=document.currentScript.src),N&&(O=N),O.indexOf("blob:")!==0?O=O.substr(0,O.replace(/[?#].*/,"").lastIndexOf("/")+1):O="";var wB=I.print||console.log.bind(console),gA=I.printErr||console.warn.bind(console);Object.assign(I,f),f=null,I.arguments&&I.arguments,I.thisProgram&&(T=I.thisProgram),I.quit&&I.quit;var RA;I.wasmBinary&&(RA=I.wasmBinary),I.noExitRuntime,typeof WebAssembly!="object"&&JA("no native wasm support detected");var ZA,NB=!1,kB=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function eA(A,B,Q){for(var C=B+Q,F=B;A[F]&&!(F>=C);)++F;if(F-B>16&&A.buffer&&kB)return kB.decode(A.subarray(B,F));for(var D="";B>10,56320|R&1023)}}return D}function bA(A,B){return A?eA(_,A,B):""}function PA(A,B,Q,C){if(!(C>0))return 0;for(var F=Q,D=Q+C-1,w=0;w=55296&&Y<=57343){var i=A.charCodeAt(++w);Y=65536+((Y&1023)<<10)|i&1023}if(Y<=127){if(Q>=D)break;B[Q++]=Y}else if(Y<=2047){if(Q+1>=D)break;B[Q++]=192|Y>>6,B[Q++]=128|Y&63}else if(Y<=65535){if(Q+2>=D)break;B[Q++]=224|Y>>12,B[Q++]=128|Y>>6&63,B[Q++]=128|Y&63}else{if(Q+3>=D)break;B[Q++]=240|Y>>18,B[Q++]=128|Y>>12&63,B[Q++]=128|Y>>6&63,B[Q++]=128|Y&63}}return B[Q]=0,Q-F}function iQ(A,B,Q){return PA(A,_,B,Q)}function vA(A){for(var B=0,Q=0;Q=55296&&C<=57343?(B+=4,++Q):B+=3}return B}var YB,Z,_,S,m,uA;function iB(A){YB=A,I.HEAP8=Z=new Int8Array(A),I.HEAP16=new Int16Array(A),I.HEAP32=S=new Int32Array(A),I.HEAPU8=_=new Uint8Array(A),I.HEAPU16=new Uint16Array(A),I.HEAPU32=m=new Uint32Array(A),I.HEAPF32=new Float32Array(A),I.HEAPF64=uA=new Float64Array(A)}I.INITIAL_MEMORY;var oB,RB=[],UB=[],JB=[];function oQ(){if(I.preRun)for(typeof I.preRun=="function"&&(I.preRun=[I.preRun]);I.preRun.length;)JQ(I.preRun.shift());_A(RB)}function RQ(){_A(UB)}function UQ(){if(I.postRun)for(typeof I.postRun=="function"&&(I.postRun=[I.postRun]);I.postRun.length;)SQ(I.postRun.shift());_A(JB)}function JQ(A){RB.unshift(A)}function KQ(A){UB.unshift(A)}function SQ(A){JB.unshift(A)}var IA=0,UA=null;function sQ(A){IA++,I.monitorRunDependencies&&I.monitorRunDependencies(IA)}function MQ(A){if(IA--,I.monitorRunDependencies&&I.monitorRunDependencies(IA),IA==0&&UA){var B=UA;UA=null,B()}}function JA(A){I.onAbort&&I.onAbort(A),A="Aborted("+A+")",gA(A),NB=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw q(B),B}var hQ="data:application/octet-stream;base64,";function KB(A){return A.startsWith(hQ)}var r;r="emulator-emscripten.wasm",KB(r)||(r=kQ(r));function SB(A){try{if(A==r&&RA)return new Uint8Array(RA);throw"both async and sync fetching of the wasm failed"}catch(B){JA(B)}}function yQ(){return!RA&&oA&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+r+"'";return A.arrayBuffer()}).catch(function(){return SB(r)}):Promise.resolve().then(function(){return SB(r)})}function aQ(){var A={a:Wg};function B(w,Y){var i=w.exports;I.asm=i,ZA=I.asm.za,iB(ZA.buffer),oB=I.asm.Ga,KQ(I.asm.Aa),MQ()}sQ();function Q(w){B(w.instance)}function C(w){return yQ().then(function(Y){return WebAssembly.instantiate(Y,A)}).then(function(Y){return Y}).then(w,function(Y){gA("failed to asynchronously prepare wasm: "+Y),JA(Y)})}function F(){return!RA&&typeof WebAssembly.instantiateStreaming=="function"&&!KB(r)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(function(w){var Y=WebAssembly.instantiateStreaming(w,A);return Y.then(Q,function(i){return gA("wasm streaming compile failed: "+i),gA("falling back to ArrayBuffer instantiation"),C(Q)})}):C(Q)}if(I.instantiateWasm)try{var D=I.instantiateWasm(A,B);return D}catch(w){return gA("Module.instantiateWasm callback failed with error: "+w),!1}return F().catch(q),{}}var cQ={468400:A=>{throw bA(A)}};function _A(A){for(;A.length>0;)A.shift()(I)}function LQ(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function HQ(A,B){Z.set(A,B)}function qQ(A){return dA(A+24)+24}var pA=[];function ZQ(A){A.add_ref()}var mA=0;function bQ(A){var B=new CA(A);return B.get_caught()||(B.set_caught(!0),mA--),B.set_rethrown(!1),pA.push(B),ZQ(B),B.get_exception_ptr()}var $=0;function CA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){m[this.ptr+4>>2]=B},this.get_type=function(){return m[this.ptr+4>>2]},this.set_destructor=function(B){m[this.ptr+8>>2]=B},this.get_destructor=function(){return m[this.ptr+8>>2]},this.set_refcount=function(B){S[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,Z[this.ptr+12>>0]=B},this.get_caught=function(){return Z[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,Z[this.ptr+13>>0]=B},this.get_rethrown=function(){return Z[this.ptr+13>>0]!=0},this.init=function(B,Q){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(Q),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=S[this.ptr>>2];S[this.ptr>>2]=B+1},this.release_ref=function(){var B=S[this.ptr>>2];return S[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){m[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return m[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=mB(this.get_type());if(B)return m[this.excPtr>>2];var Q=this.get_adjusted_ptr();return Q!==0?Q:this.excPtr}}function sB(A){return bB(new CA(A).ptr)}function H(A){return oB.get(A)}function pQ(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&H(B)(A.excPtr),sB(A.excPtr)}}function mQ(){s(0);var A=pA.pop();pQ(A),$=0}function VQ(A){throw $||($=A),A}function dQ(){var A=$;if(!A)return x(0),0;var B=new CA(A);B.set_adjusted_ptr(A);var Q=B.get_type();if(!Q)return x(0),A;for(var C=Array.prototype.slice.call(arguments),F=0;F>2]+S[A+4>>2]*4294967296}function $Q(A,B){var Q=new Date(MB(A)*1e3);S[B>>2]=Q.getUTCSeconds(),S[B+4>>2]=Q.getUTCMinutes(),S[B+8>>2]=Q.getUTCHours(),S[B+12>>2]=Q.getUTCDate(),S[B+16>>2]=Q.getUTCMonth(),S[B+20>>2]=Q.getUTCFullYear()-1900,S[B+24>>2]=Q.getUTCDay();var C=Date.UTC(Q.getUTCFullYear(),0,1,0,0,0,0),F=(Q.getTime()-C)/(1e3*60*60*24)|0;S[B+28>>2]=F}function Ag(A,B){var Q=new Date(MB(A)*1e3);S[B>>2]=Q.getSeconds(),S[B+4>>2]=Q.getMinutes(),S[B+8>>2]=Q.getHours(),S[B+12>>2]=Q.getDate(),S[B+16>>2]=Q.getMonth(),S[B+20>>2]=Q.getFullYear()-1900,S[B+24>>2]=Q.getDay();var C=new Date(Q.getFullYear(),0,1),F=(Q.getTime()-C.getTime())/(1e3*60*60*24)|0;S[B+28>>2]=F,S[B+36>>2]=-(Q.getTimezoneOffset()*60);var D=new Date(Q.getFullYear(),6,1).getTimezoneOffset(),w=C.getTimezoneOffset(),Y=(D!=w&&Q.getTimezoneOffset()==Math.min(w,D))|0;S[B+32>>2]=Y}function Bg(A,B,Q,C,F,D){}function hB(A){var B=vA(A)+1,Q=dA(B);return Q&&PA(A,Z,Q,B),Q}function Qg(A,B,Q){var C=new Date().getFullYear(),F=new Date(C,0,1),D=new Date(C,6,1),w=F.getTimezoneOffset(),Y=D.getTimezoneOffset(),i=Math.max(w,Y);S[A>>2]=i*60,S[B>>2]=Number(w!=Y);function R(V){var X=V.toTimeString().match(/\(([A-Za-z ]+)\)$/);return X?X[1]:"GMT"}var p=R(F),b=R(D),y=hB(p),L=hB(b);Y>2]=y,m[Q+4>>2]=L):(m[Q>>2]=L,m[Q+4>>2]=y)}function $A(A,B,Q){$A.called||($A.called=!0,Qg(A,B,Q))}function gg(){JA("")}var AB=[];function Ig(A,B){AB.length=0;var Q;for(B>>=2;Q=_[A++];)B+=Q!=105&B,AB.push(Q==105?S[B]:uA[B++>>1]),++B;return AB}function Cg(A,B,Q){var C=Ig(B,Q);return cQ[A].apply(null,C)}var yB;yB=()=>performance.now();function Eg(A){return A<0||A===0&&1/A===-1/0}function Dg(A,B){return(A>>>0)+B*4294967296}function Gg(A,B){return(A>>>0)+(B>>>0)*4294967296}function aB(A,B){if(A<=0)return A;var Q=B<=32?Math.abs(1<=Q&&(B<=32||A>Q)&&(A=-2*Q+A),A}function cB(A,B){return A>=0?A:B<=32?2*Math.abs(1<0?Q:vA(A)+1,F=new Array(C),D=PA(A,F,0,F.length);return B&&(F.length=D),F}function wg(A,B){var Q=A,C=B;function F(v,AA){return(AA==="double"||AA==="i64")&&v&7&&(v+=4),v}function D(v){var AA;return C=F(C,v),v==="double"?(AA=uA[C>>3],C+=8):v=="i64"?(AA=[S[C>>2],S[C+4>>2]],C+=8):(v="i32",AA=S[C>>2],C+=4),AA}for(var w=[],Y,i,R;;){var p=Q;if(Y=Z[Q>>0],Y===0)break;if(i=Z[Q+1>>0],Y==37){var b=!1,y=!1,L=!1,V=!1,X=!1;A:for(;;){switch(i){case 43:b=!0;break;case 45:y=!0;break;case 35:L=!0;break;case 48:if(V)break A;V=!0;break;case 32:X=!0;break;default:break A}Q++,i=Z[Q+1>>0]}var c=0;if(i==42)c=D("i32"),Q++,i=Z[Q+1>>0];else for(;i>=48&&i<=57;)c=c*10+(i-48),Q++,i=Z[Q+1>>0];var l=!1,k=-1;if(i==46){if(k=0,l=!0,Q++,i=Z[Q+1>>0],i==42)k=D("i32"),Q++;else for(;;){var K=Z[Q+1>>0];if(K<48||K>57)break;k=k*10+(K-48),Q++}i=Z[Q+1>>0]}k<0&&(k=6,l=!1);var a;switch(String.fromCharCode(i)){case"h":var d=Z[Q+2>>0];d==104?(Q++,a=1):a=2;break;case"l":var d=Z[Q+2>>0];d==108?(Q++,a=8):a=4;break;case"L":case"q":case"j":a=8;break;case"z":case"t":case"I":a=4;break;default:a=null}switch(a&&Q++,i=Z[Q+1>>0],String.fromCharCode(i)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var FA=i==100||i==105;a=a||4,R=D("i"+a*8);var U;if(a==8&&(R=i==117?Gg(R[0],R[1]):Dg(R[0],R[1])),a<=4){var hI=Math.pow(256,a)-1;R=(FA?aB:cB)(R&hI,a*8)}var sA=Math.abs(R),t="";if(i==100||i==105)U=aB(R,8*a).toString(10);else if(i==117)U=cB(R,8*a).toString(10),R=Math.abs(R);else if(i==111)U=(L?"0":"")+sA.toString(8);else if(i==120||i==88){if(t=L&&R!=0?"0x":"",R<0){R=-R,U=(sA-1).toString(16);for(var PB=[],P=0;P=0&&(b?t="+"+t:X&&(t=" "+t)),U.charAt(0)=="-"&&(t="-"+t,U=U.substr(1));t.length+U.lengthgB&&gB>=-4?(i=(i==103?"f":"F").charCodeAt(0),k-=gB+1):(i=(i==103?"e":"E").charCodeAt(0),k--),MA=Math.min(k,20)}i==101||i==69?(U=R.toExponential(MA),/[eE][-+]\d$/.test(U)&&(U=U.slice(0,-1)+"0"+U.slice(-1))):(i==102||i==70)&&(U=R.toFixed(MA),R===0&&Eg(R)&&(U="-"+U));var e=U.split("e");if(vB&&!L)for(;e[0].length>1&&e[0].includes(".")&&(e[0].slice(-1)=="0"||e[0].slice(-1)==".");)e[0]=e[0].slice(0,-1);else for(L&&U.indexOf(".")==-1&&(e[0]+=".");k>MA++;)e[0]+="0";U=e[0]+(e.length>1?"e"+e[1]:""),i==69&&(U=U.toUpperCase()),R>=0&&(b?U="+"+U:X&&(U=" "+U))}for(;U.length>0]);else w=w.concat(LB("(null)".substr(0,wA),!0));if(y)for(;wA0;)w.push(32);y||w.push(D("i8"));break}case"n":{var yI=D("i32*");S[yI>>2]=w.length;break}case"%":{w.push(Y);break}default:for(var P=p;P>0])}Q+=2}else w.push(Y),Q+=1}return w}function BB(A){if(!A||!A.callee||!A.callee.name)return[null,"",""];A.callee.toString();var B=A.callee.name,Q="(",C=!0;for(var F in A){var D=A[F];C||(Q+=", "),C=!1,typeof D=="number"||typeof D=="string"?Q+=D:Q+="("+typeof D+")"}Q+=")";var w=A.callee.caller;return A=w?w.arguments:[],C&&(Q=""),[A,B,Q]}function GA(A){GA.shown||(GA.shown={}),GA.shown[A]||(GA.shown[A]=1,gA(A))}function Ng(A){var B=LQ(),Q=B.lastIndexOf("_emscripten_log"),C=B.lastIndexOf("_emscripten_get_callstack"),F=B.indexOf(` `,Math.max(Q,C))+1;B=B.slice(F),A&32&&GA("EM_LOG_DEMANGLE is deprecated; ignoring"),A&8&&typeof emscripten_source_map>"u"&&(GA('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),A^=8,A|=16);var D=null;if(A&128)for(D=BB(arguments);D[1].includes("_emscripten_");)D=BB(D[0]);var w=B.split(` `);B="";var Y=new RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),i=new RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),R=new RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)");for(var p in w){var b=w[p],y="",L="",V=0,X=0,c=R.exec(b);if(c&&c.length==5)y=c[1],L=c[2],V=c[3],X=c[4];else if(c=Y.exec(b),c||(c=i.exec(b)),c&&c.length>=4)y=c[1],L=c[2],V=c[3],X=c[4]|0;else{B+=b+` `;continue}var l=!1;if(A&8){var k=emscripten_source_map.originalPositionFor({line:V,column:X});l=k&&k.source,l&&(A&64&&(k.source=k.source.substring(k.source.replace(/\\/g,"/").lastIndexOf("/")+1)),B+=" at "+y+" ("+k.source+":"+k.line+":"+k.column+`) diff --git a/docs/_app/immutable/chunks/singletons.25c14d13.js b/docs/_app/immutable/chunks/singletons.25c14d13.js new file mode 100644 index 0000000..55dc414 --- /dev/null +++ b/docs/_app/immutable/chunks/singletons.25c14d13.js @@ -0,0 +1 @@ +import{w as c}from"./index.1c761ed5.js";const h=globalThis.__sveltekit_12rs9i2?.base??"",b=globalThis.__sveltekit_12rs9i2?.assets??h,g="1701075946441",w="sveltekit:snapshot",A="sveltekit:scroll",R="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1};function T(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function I(){return{x:pageXOffset,y:pageYOffset}}function l(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function _(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function S(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=_(e)}}function y(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!n||!!a||k(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external")||e.hasAttribute("download");return{url:n,external:s,target:a}}function x(e){let t=null,n=null,a=null,s=null,o=e;for(;o&&o!==document.documentElement;)n===null&&(n=l(o,"preload-code")),a===null&&(a=l(o,"preload-data")),t===null&&(t=l(o,"noscroll")),s===null&&(s=l(o,"reload")),o=_(o);return{preload_code:d[n??"off"],preload_data:d[a??"off"],noscroll:t==="off"?!1:t===""?!0:null,reload:s==="off"?!1:s===""?!0:null}}function p(e){const t=c(e);let n=!0;function a(){n=!0,t.update(r=>r)}function s(r){n=!1,t.set(r)}function o(r){let i;return t.subscribe(u=>{(i===void 0||n&&u!==i)&&r(i=u)})}return{notify:a,set:s,subscribe:o}}function v(){const{set:e,subscribe:t}=c(!1);let n;async function a(){clearTimeout(n);const s=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(s.ok){const r=(await s.json()).version!==g;return r&&(e(!0),clearTimeout(n)),r}else throw new Error(`Version check failed: ${s.status}`)}return{subscribe:t,check:a}}function k(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}let E;function O(e){E=e.client}const U={url:p({}),page:p({}),navigating:c(null),updated:v()};export{R as I,f as P,A as S,w as a,y as b,x as c,I as d,h as e,S as f,T as g,O as h,k as i,E as j,U as s}; diff --git a/docs/_app/immutable/chunks/store.d3ab02ad.js b/docs/_app/immutable/chunks/store.476c3091.js similarity index 83% rename from docs/_app/immutable/chunks/store.d3ab02ad.js rename to docs/_app/immutable/chunks/store.476c3091.js index c53f974..39aae6c 100644 --- a/docs/_app/immutable/chunks/store.d3ab02ad.js +++ b/docs/_app/immutable/chunks/store.476c3091.js @@ -1,4 +1,4 @@ -import{aa as Le,a9 as Mt}from"./index.9fe14626.js";import{e as Mi}from"./examples.2096c2f1.js";import{w as rc}from"./index.1c761ed5.js";var ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ii={},$t={};const ic=Symbol.for("nodejs.util.inspect.custom");var fi=ic,hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.crc16=void 0;function nc(f){let w=0;const c=Le.Buffer.alloc(f.length+2);c.set(f);for(let S of c){let n=128;for(;n>0;)w<<=1,S&n&&(w+=1),n>>=1,w>65535&&(w&=65535,w^=4129)}return Le.Buffer.from([Math.floor(w/256),w%256])}hi.crc16=nc;var ac=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},Ju;Object.defineProperty($t,"__esModule",{value:!0});$t.address=$t.Address=void 0;const oc=ac(fi),Qu=hi,Es=17,el=81,Rs=128;function Mf(f){const u=Le.Buffer.isBuffer(f)?f:Le.Buffer.from(f,"base64");if(u.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");const w=u.subarray(0,34),c=u.subarray(34,36),S=(0,Qu.crc16)(w);if(!(S[0]===c[0]&&S[1]===c[1]))throw new Error("Invalid checksum: "+f);let n=w[0],m=!1,y=!1;if(n&Rs&&(m=!0,n=n^Rs),n!==Es&&n!==el)throw"Unknown address tag";y=n===Es;let g=null;w[1]===255?g=-1:g=w[1];const b=w.subarray(2,34);return{isTestOnly:m,isBounceable:y,workchain:g,hashPart:b}}class sr{static isAddress(u){return u instanceof sr}static isFriendly(u){return u.indexOf(":")<0}static normalize(u){return typeof u=="string"?sr.parse(u).toString():u.toString()}static parse(u){return sr.isFriendly(u)?this.parseFriendly(u).address:this.parseRaw(u)}static parseRaw(u){let w=parseInt(u.split(":")[0]),c=Le.Buffer.from(u.split(":")[1],"hex");return new sr(w,c)}static parseFriendly(u){if(Le.Buffer.isBuffer(u)){let w=Mf(u);return{isBounceable:w.isBounceable,isTestOnly:w.isTestOnly,address:new sr(w.workchain,w.hashPart)}}else{let w=u.replace(/\-/g,"+").replace(/_/g,"/"),c=Mf(w);return{isBounceable:c.isBounceable,isTestOnly:c.isTestOnly,address:new sr(c.workchain,c.hashPart)}}}constructor(u,w){this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const c=Le.Buffer.alloc(36);return c.set(this.hash),c.set([this.workChain,this.workChain,this.workChain,this.workChain],32),c},this.toStringBuffer=c=>{let S=c&&c.testOnly!==void 0?c.testOnly:!1,m=(c&&c.bounceable!==void 0?c.bounceable:!0)?Es:el;S&&(m|=Rs);const y=Le.Buffer.alloc(34);y[0]=m,y[1]=this.workChain,y.set(this.hash,2);const g=Le.Buffer.alloc(36);return g.set(y),g.set((0,Qu.crc16)(y),34),g},this.toString=c=>{let S=c&&c.urlSafe!==void 0?c.urlSafe:!0,n=this.toStringBuffer(c);return S?n.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):n.toString("base64")},this[Ju]=()=>this.toString(),this.workChain=u,this.hash=w,Object.freeze(this)}equals(u){return u.workChain!==this.workChain?!1:u.hash.equals(this.hash)}}$t.Address=sr;Ju=oc.default;function sc(f){return sr.parse(f)}$t.address=sc;var ui={},fc=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},tl;Object.defineProperty(ui,"__esModule",{value:!0});ui.ExternalAddress=void 0;const hc=fc(fi);class Ns{static isAddress(u){return u instanceof Ns}constructor(u,w){this[tl]=()=>this.toString(),this.value=u,this.bits=w}toString(){return`External<${this.bits}:${this.value}>`}}ui.ExternalAddress=Ns;tl=hc.default;var xn={},Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.base32Decode=Ir.base32Encode=void 0;const Is="abcdefghijklmnopqrstuvwxyz234567";function uc(f){const u=f.byteLength;let w=0,c=0,S="";for(let n=0;n=5;)S+=Is[c>>>w-5&31],w-=5;return w>0&&(S+=Is[c<<5-w&31]),S}Ir.base32Encode=uc;function lc(f,u){const w=f.indexOf(u);if(w===-1)throw new Error("Invalid character found: "+u);return w}function dc(f){let u;u=f.toLowerCase();const{length:w}=u;let c=0,S=0,n=0;const m=Le.Buffer.alloc(w*5/8|0);for(let y=0;y=8&&(m[n++]=S>>>c-8&255,c-=8);return m}Ir.base32Decode=dc;var cc=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},rl;Object.defineProperty(xn,"__esModule",{value:!0});xn.ADNLAddress=void 0;const pc=cc(fi),xf=Ir,_f=hi;class nn{static parseFriendly(u){if(u.length!==55)throw Error("Invalid address");u="f"+u;let w=(0,xf.base32Decode)(u);if(w[0]!==45)throw Error("Invalid address");let c=w.slice(33);if(!(0,_f.crc16)(w.slice(0,33)).equals(c))throw Error("Invalid address");return new nn(w.slice(1,33))}static parseRaw(u){const w=Le.Buffer.from(u,"base64");return new nn(w)}constructor(u){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let w=Le.Buffer.concat([Le.Buffer.from([45]),this.address]),c=(0,_f.crc16)(w);return w=Le.Buffer.concat([w,c]),(0,xf.base32Encode)(w).slice(1)},this[rl]=()=>this.toString(),u.length!==32)throw Error("Invalid address");this.address=u}equals(u){return this.address.equals(u.address)}}xn.ADNLAddress=nn;rl=pc.default;var _n={},Sr={},xi={},_i={},Si={},Sf;function zs(){if(Sf)return Si;Sf=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.bitsToPaddedBuffer=void 0;const f=Sn();function u(w){let c=new f.BitBuilder(Math.ceil(w.length/8)*8);c.writeBits(w);let S=Math.ceil(w.length/8)*8-w.length;for(let n=0;nthis.toString(),g<0)throw new Error(`Length ${g} is out of bounds`);this._length=g,this._data=m,this._offset=y}get length(){return this._length}at(m){if(m>=this._length)throw new Error(`Index ${m} > ${this._length} is out of bounds`);if(m<0)throw new Error(`Index ${m} < 0 is out of bounds`);let y=this._offset+m>>3,g=7-(this._offset+m)%8;return(this._data[y]&1<=this._length)throw new Error(`Offset(${m}) > ${this._length} is out of bounds`);if(m<0)throw new Error(`Offset(${m}) < 0 is out of bounds`);if(m+y>this._length)throw new Error(`Offset ${m} + Length ${y} > ${this._length} is out of bounds`);return new Ps(this._data,this._offset+m,y)}subbuffer(m,y){if(m>=this._length)throw new Error(`Offset ${m} is out of bounds`);if(m<0)throw new Error(`Offset ${m} is out of bounds`);if(m+y>this._length)throw new Error(`Offset + Lenght = ${m+y} is out of bounds`);if(y%8!==0||(this._offset+m)%8!==0)return null;let g=this._offset+m>>3,b=g+(y>>3);return this._data.subarray(g,b)}equals(m){if(this._length!==m._length)return!1;for(let y=0;ythis._buffer.length*8)throw new Error("BitBuilder overflow");(n===!0||n>0)&&(this._buffer[m/8|0]|=1<<7-m%8),this._length++}writeBits(n){for(let m=0;mthis._buffer.length*8)throw new Error("BitBuilder overflow");n.copy(this._buffer,this._length/8),this._length+=n.length*8}else for(let m=0;m255||!Number.isSafeInteger(v))throw Error(`value is out of range for ${m} bits. Got ${n}`);this._buffer[this._length/8]=Number(n),this._length+=8;return}if(m===16&&this._length%8===0){let v=Number(n);if(v<0||v>65536||!Number.isSafeInteger(v))throw Error(`value is out of range for ${m} bits. Got ${n}`);this._buffer[this._length/8]=v>>8,this._buffer[this._length/8+1]=v&255,this._length+=16;return}let y=BigInt(n);if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);if(m===0){if(n!==0n)throw Error(`value is not zero for ${m} bits. Got ${n}`);return}let g=1n<=g)throw Error(`bitLength is too small for a value ${n}. Got ${m}`);let b=[];for(;y>0;)b.push(y%2n===1n),y/=2n;for(let v=0;v=g)throw Error(`value is out of range for ${m} bits. Got ${n}`);y<0?(this.writeBit(!0),y=(1n<0?y:-y;const b=1+Math.ceil(g.toString(2).length/8),v=b*8;this.writeUint(b,m),this.writeInt(y,v)}writeCoins(n){this.writeVarUint(n,4)}writeAddress(n){if(n==null){this.writeUint(0,2);return}if(f.Address.isAddress(n)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(n.workChain,8),this.writeBuffer(n.hash);return}if(u.ExternalAddress.isAddress(n)){this.writeUint(1,2),this.writeUint(n.bits,9),this.writeUint(n.value,n.bits);return}throw Error(`Invalid address. Got ${n}`)}build(){return new w.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}};return xi.BitBuilder=c,xi}var Bi={},li={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.CellType=void 0,function(u){u[u.Ordinary=-1]="Ordinary",u[u.PrunedBranch=1]="PrunedBranch",u[u.Library=2]="Library",u[u.MerkleProof=3]="MerkleProof",u[u.MerkleUpdate=4]="MerkleUpdate"}(f.CellType||(f.CellType={}))})(li);var Ai={},ki={},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.parseDict=void 0;function vc(f){let u=0;for(;f.loadBit();)u++;return u}function Cs(f,u,w,c,S){let n=u.loadBit()?1:0,m=0,y=f;if(n===0){m=vc(u);for(let g=0;g(0,n.deserializeInternalKey)(F))}values(){return Array.from(this._map.values())}store(F,de,d){if(this._map.size===0)F.storeBit(0);else{let e=this._key;de!=null&&(e=de);let r=this._value;if(d!=null&&(r=d),!e)throw Error("Key serializer is not defined");if(!r)throw Error("Value serializer is not defined");let i=new Map;for(const[s,l]of this._map)i.set(e.serialize((0,n.deserializeInternalKey)(s)),l);F.storeBit(1);let a=(0,u.beginCell)();(0,S.serializeDict)(i,e.bits,r.serialize,a),F.storeRef(a.endCell())}}storeDirect(F,de,d){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let e=this._key;de!=null&&(e=de);let r=this._value;if(d!=null&&(r=d),!e)throw Error("Key serializer is not defined");if(!r)throw Error("Value serializer is not defined");let i=new Map;for(const[a,s]of this._map)i.set(e.serialize((0,n.deserializeInternalKey)(a)),s);(0,S.serializeDict)(i,e.bits,r.serialize,F)}};ki.Dictionary=m,m.Keys={Address:()=>y(),BigInt:Y=>g(Y),Int:Y=>b(Y),BigUint:Y=>v(Y),Uint:Y=>_(Y),Buffer:Y=>M(Y)},m.Values={BigInt:Y=>A(Y),Int:Y=>B(Y),BigVarInt:Y=>k(Y),BigUint:Y=>C(Y),Uint:Y=>P(Y),BigVarUint:Y=>R(Y),Bool:()=>N(),Address:()=>T(),Cell:()=>L(),Buffer:Y=>ee(Y),Dictionary:(Y,F)=>W(Y,F)};function y(){return{bits:267,serialize:Y=>{if(!f.Address.isAddress(Y))throw Error("Key is not an address");return(0,u.beginCell)().storeAddress(Y).endCell().beginParse().preloadUintBig(267)},parse:Y=>(0,u.beginCell)().storeUint(Y,267).endCell().beginParse().loadAddress()}}function g(Y){return{bits:Y,serialize:F=>{if(typeof F!="bigint")throw Error("Key is not a bigint");return(0,u.beginCell)().storeInt(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadIntBig(Y)}}function b(Y){return{bits:Y,serialize:F=>{if(typeof F!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(F))throw Error("Key is not a safe integer: "+F);return(0,u.beginCell)().storeInt(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadInt(Y)}}function v(Y){return{bits:Y,serialize:F=>{if(typeof F!="bigint")throw Error("Key is not a bigint");if(F<0)throw Error("Key is negative: "+F);return(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)}}function _(Y){return{bits:Y,serialize:F=>{if(typeof F!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(F))throw Error("Key is not a safe integer: "+F);if(F<0)throw Error("Key is negative: "+F);return(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>Number((0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUint(Y))}}function M(Y){return{bits:Y*8,serialize:F=>{if(!Le.Buffer.isBuffer(F))throw Error("Key is not a buffer");return(0,u.beginCell)().storeBuffer(F).endCell().beginParse().loadUintBig(Y*8)},parse:F=>(0,u.beginCell)().storeUint(F,Y*8).endCell().beginParse().loadBuffer(Y)}}function B(Y){return{serialize:(F,de)=>{de.storeInt(F,Y)},parse:F=>F.loadInt(Y)}}function A(Y){return{serialize:(F,de)=>{de.storeInt(F,Y)},parse:F=>F.loadIntBig(Y)}}function k(Y){return{serialize:(F,de)=>{de.storeVarInt(F,Y)},parse:F=>F.loadVarIntBig(Y)}}function R(Y){return{serialize:(F,de)=>{de.storeVarUint(F,Y)},parse:F=>F.loadVarUintBig(Y)}}function P(Y){return{serialize:(F,de)=>{de.storeUint(F,Y)},parse:F=>F.loadUint(Y)}}function C(Y){return{serialize:(F,de)=>{de.storeUint(F,Y)},parse:F=>F.loadUintBig(Y)}}function N(){return{serialize:(Y,F)=>{F.storeBit(Y)},parse:Y=>Y.loadBit()}}function T(){return{serialize:(Y,F)=>{F.storeAddress(Y)},parse:Y=>Y.loadAddress()}}function L(){return{serialize:(Y,F)=>{F.storeRef(Y)},parse:Y=>Y.loadRef()}}function W(Y,F){return{serialize:(de,d)=>{de.store(d)},parse:de=>m.load(Y,F,de)}}function ee(Y){return{serialize:(F,de)=>{if(F.length!==Y)throw Error("Invalid buffer size");de.storeBuffer(F)},parse:F=>F.loadBuffer(Y)}}return ki}var ar={},Rf;function nl(){if(Rf)return ar;Rf=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.writeString=ar.stringToCell=ar.readString=void 0;const f=jt();function u(m){if(m.remainingBits%8!==0)throw new Error(`Invalid string length: ${m.remainingBits}`);if(m.remainingRefs!==0&&m.remainingRefs!==1)throw new Error(`invalid number of refs: ${m.remainingRefs}`);if(m.remainingRefs===1&&1023-m.remainingBits>7)throw new Error(`invalid string length: ${m.remainingBits/8}`);let y;return m.remainingBits===0?y=Le.Buffer.alloc(0):y=m.loadBuffer(m.remainingBits/8),m.remainingRefs===1&&(y=Le.Buffer.concat([y,u(m.loadRef().beginParse())])),y}function w(m){return u(m).toString()}ar.readString=w;function c(m,y){if(m.length>0){let g=Math.floor(y.availableBits/8);if(m.length>g){let b=m.subarray(0,g),v=m.subarray(g);y=y.storeBuffer(b);let _=(0,f.beginCell)();c(v,_),y=y.storeRef(_.endCell())}else y=y.storeBuffer(m)}}function S(m){let y=(0,f.beginCell)();return c(Le.Buffer.from(m),y),y.endCell()}ar.stringToCell=S;function n(m,y){c(Le.Buffer.from(m),y)}return ar.writeString=n,ar}var If;function Ds(){if(If)return Ai;If=1;var f=ht&&ht.__importDefault||function(y){return y&&y.__esModule?y:{default:y}},u;Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.Slice=void 0;const w=f(fi),c=Qr(),S=jt(),n=nl();let m=class al{constructor(g,b){this[u]=()=>this.toString(),this._reader=g.clone(),this._refs=[...b]}get remainingBits(){return this._reader.remaining}get remainingRefs(){return this._refs.length}skip(g){return this._reader.skip(g),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(g){return this._reader.loadBits(g)}preloadBits(g){return this._reader.preloadBits(g)}loadUint(g){return this._reader.loadUint(g)}loadUintBig(g){return this._reader.loadUintBig(g)}preloadUint(g){return this._reader.preloadUint(g)}preloadUintBig(g){return this._reader.preloadUintBig(g)}loadMaybeUint(g){return this.loadBit()?this.loadUint(g):null}loadMaybeUintBig(g){return this.loadBit()?this.loadUintBig(g):null}loadInt(g){return this._reader.loadInt(g)}loadIntBig(g){return this._reader.loadIntBig(g)}preloadInt(g){return this._reader.preloadInt(g)}preloadIntBig(g){return this._reader.preloadIntBig(g)}loadMaybeInt(g){return this.loadBit()?this.loadInt(g):null}loadMaybeIntBig(g){return this.loadBit()?this.loadIntBig(g):null}loadVarUint(g){return this._reader.loadVarUint(g)}loadVarUintBig(g){return this._reader.loadVarUintBig(g)}preloadVarUint(g){return this._reader.preloadVarUint(g)}preloadVarUintBig(g){return this._reader.preloadVarUintBig(g)}loadVarInt(g){return this._reader.loadVarInt(g)}loadVarIntBig(g){return this._reader.loadVarIntBig(g)}preloadVarInt(g){return this._reader.preloadVarInt(g)}preloadVarIntBig(g){return this._reader.preloadVarIntBig(g)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refs.length===0)throw new Error("No more references");return this._refs.shift()}preloadRef(){if(this._refs.length===0)throw new Error("No more references");return this._refs[0]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(g){return this._reader.loadBuffer(g)}preloadBuffer(g){return this._reader.preloadBuffer(g)}loadStringTail(){return(0,n.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,n.readString)(this):null}loadStringRefTail(){return(0,n.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const g=this.loadMaybeRef();return g?(0,n.readString)(g.beginParse()):null}loadDict(g,b){return c.Dictionary.load(g,b,this)}loadDictDirect(g,b){return c.Dictionary.loadDirect(g,b,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,S.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,S.beginCell)().storeSlice(this)}clone(){return new al(this._reader,this._refs)}toString(){return this.asCell().toString()}};return Ai.Slice=m,u=w.default,Ai}var kn={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.BitReader=void 0;const Mc=$t,xc=ui;class Ls{constructor(u,w=0){this._checkpoints=[],this._bits=u,this._offset=w}get remaining(){return this._bits.length-this._offset}skip(u){if(u<0||this._offset+u>this._bits.length)throw new Error(`Index ${this._offset+u} is out of bounds`);this._offset+=u}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let u=this._bits.at(this._offset);return this._offset++,u}preloadBit(){return this._bits.at(this._offset)}loadBits(u){let w=this._bits.substring(this._offset,u);return this._offset+=u,w}preloadBits(u){return this._bits.substring(this._offset,u)}loadBuffer(u){let w=this._preloadBuffer(u,this._offset);return this._offset+=u*8,w}preloadBuffer(u){return this._preloadBuffer(u,this._offset)}loadUint(u){return Number(this.loadUintBig(u))}loadUintBig(u){let w=this.preloadUintBig(u);return this._offset+=u,w}preloadUint(u){return Number(this._preloadUint(u,this._offset))}preloadUintBig(u){return this._preloadUint(u,this._offset)}loadInt(u){let w=this._preloadInt(u,this._offset);return this._offset+=u,Number(w)}loadIntBig(u){let w=this._preloadInt(u,this._offset);return this._offset+=u,w}preloadInt(u){return Number(this._preloadInt(u,this._offset))}preloadIntBig(u){return this._preloadInt(u,this._offset)}loadVarUint(u){let w=Number(this.loadUint(u));return Number(this.loadUintBig(w*8))}loadVarUintBig(u){let w=Number(this.loadUint(u));return this.loadUintBig(w*8)}preloadVarUint(u){let w=Number(this._preloadUint(u,this._offset));return Number(this._preloadUint(w*8,this._offset+u))}preloadVarUintBig(u){let w=Number(this._preloadUint(u,this._offset));return this._preloadUint(w*8,this._offset+u)}loadVarInt(u){let w=Number(this.loadUint(u));return Number(this.loadIntBig(w*8))}loadVarIntBig(u){let w=Number(this.loadUint(u));return this.loadIntBig(w*8)}preloadVarInt(u){let w=Number(this._preloadUint(u,this._offset));return Number(this._preloadInt(w*8,this._offset+u))}preloadVarIntBig(u){let w=Number(this._preloadUint(u,this._offset));return this._preloadInt(w*8,this._offset+u)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===2)return this._loadInternalAddress();throw new Error("Invalid address: "+u)}loadMaybeAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===2)return this._loadInternalAddress();if(u===1)return this._loadExternalAddress();throw Error(u===3?"Unsupported":"Unreachable")}loadPaddedBits(u){if(u%8!==0)throw new Error("Invalid number of bits");let w=u;for(;;)if(this._bits.at(this._offset+w-1)){w--;break}else w--;let c=this._bits.substring(this._offset,w);return this._offset+=u,c}clone(){return new Ls(this._bits,this._offset)}_preloadInt(u,w){if(u==0)return 0n;let c=this._bits.at(w),S=0n;for(let n=0;n>u-1)%2!==0}}vi.LevelMask=js;function Rc(f){return f=f-(f>>1&1431655765),f=(f&858993459)+(f>>2&858993459),(f+(f>>4)&252645135)*16843009>>24}Object.defineProperty(pi,"__esModule",{value:!0});pi.exoticPruned=void 0;const Ic=Jt,Pf=vi;function Pc(f,u){let w=new Ic.BitReader(f),c=w.loadUint(8);if(c!==1)throw new Error(`Pruned branch cell must have type 1, got "${c}"`);if(u.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${u.length}"`);let S;if(f.length===280)S=new Pf.LevelMask(1);else{if(S=new Pf.LevelMask(w.loadUint(8)),S.level<1||S.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${S.level}/${S.value}"`);const g=8+8+S.apply(S.level-1).hashCount*(256+16);if(f.length!==g)throw new Error(`Pruned branch cell must have exactly ${g} bits, got "${f.length}"`)}let n=[],m=[],y=[];for(let g=0;g>1);return{type:En.CellType.MerkleProof,depths:w,hashes:c,mask:S}}function Lc(f,u){(0,Oc.exoticMerkleUpdate)(f,u);let w=[],c=[],S=new Rn.LevelMask((u[0].level()|u[1].level())>>1);return{type:En.CellType.MerkleUpdate,depths:w,hashes:c,mask:S}}function jc(f,u){let c=new Cc.BitReader(f).preloadUint(8);if(c===1)return Nc(f,u);if(c===2)return zc(f,u);if(c===3)return Dc(f,u);if(c===4)return Lc(f,u);throw Error("Invalid exotic cell type: "+c)}kn.resolveExotic=jc;var In={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.getRepr=fr.getBitsDescriptor=fr.getRefsDescriptor=void 0;const Pi=li,Fc=zs();function ol(f,u,w){return f.length+(w!==Pi.CellType.Ordinary?1:0)*8+u*32}fr.getRefsDescriptor=ol;function sl(f){let u=f.length;return Math.ceil(u/8)+Math.floor(u/8)}fr.getBitsDescriptor=sl;function Kc(f,u,w,c){const S=Math.ceil(f.length/8),n=Le.Buffer.alloc(2+S+(2+32)*u.length);let m=0;n[m++]=ol(u,w,c),n[m++]=sl(f),(0,Fc.bitsToPaddedBuffer)(f).copy(n,m),m+=S;for(const y of u){let g;c==Pi.CellType.MerkleProof||c==Pi.CellType.MerkleUpdate?g=y.depth(w+1):g=y.depth(w),n[m++]=Math.floor(g/256),n[m++]=g%256}for(const y of u){let g;c==Pi.CellType.MerkleProof||c==Pi.CellType.MerkleUpdate?g=y.hash(w+1):g=y.hash(w),g.copy(n,m),m+=32}return n}fr.getRepr=Kc;var Jn={},pr={},Ni={},Hc={get exports(){return Ni},set exports(f){Ni=f}};(function(f,u){(function(w,c){f.exports=c()})(ht,function(){var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function c(X,G,V,J){var me,$,se,Te=G||[0],ae=(V=V||0)>>>3,ve=J===-1?3:0;for(me=0;me>>2,Te.length<=$&&Te.push(0),Te[$]|=X[me]<<8*(ve+J*(se%4));return{value:Te,binLen:8*X.length+V}}function S(X,G,V){switch(G){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(X){case"HEX":return function(J,me,$){return function(se,Te,ae,ve){var He,ue,ge,Je;if(se.length%2!=0)throw new Error("String of HEX type must be in byte increments");var fe=Te||[0],ke=(ae=ae||0)>>>3,tt=ve===-1?3:0;for(He=0;He>>1)+ke)>>>2;fe.length<=ge;)fe.push(0);fe[ge]|=ue<<8*(tt+ve*(Je%4))}return{value:fe,binLen:4*se.length+ae}}(J,me,$,V)};case"TEXT":return function(J,me,$){return function(se,Te,ae,ve,He){var ue,ge,Je,fe,ke,tt,Me,Ie,dt=0,Se=ae||[0],qe=(ve=ve||0)>>>3;if(Te==="UTF8")for(Me=He===-1?3:0,Je=0;Je(ue=se.charCodeAt(Je))?ge.push(ue):2048>ue?(ge.push(192|ue>>>6),ge.push(128|63&ue)):55296>ue||57344<=ue?ge.push(224|ue>>>12,128|ue>>>6&63,128|63&ue):(Je+=1,ue=65536+((1023&ue)<<10|1023&se.charCodeAt(Je)),ge.push(240|ue>>>18,128|ue>>>12&63,128|ue>>>6&63,128|63&ue)),fe=0;fe>>2;Se.length<=ke;)Se.push(0);Se[ke]|=ge[fe]<<8*(Me+He*(tt%4)),dt+=1}else for(Me=He===-1?2:0,Ie=Te==="UTF16LE"&&He!==1||Te!=="UTF16LE"&&He===1,Je=0;Je>>8),ke=(tt=dt+qe)>>>2;Se.length<=ke;)Se.push(0);Se[ke]|=ue<<8*(Me+He*(tt%4)),dt+=2}return{value:Se,binLen:8*dt+ve}}(J,G,me,$,V)};case"B64":return function(J,me,$){return function(se,Te,ae,ve){var He,ue,ge,Je,fe,ke,tt=0,Me=Te||[0],Ie=(ae=ae||0)>>>3,dt=ve===-1?3:0,Se=se.indexOf("=");if(se.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(se=se.replace(/=/g,""),Se!==-1&&Se */var Of;function Bt(){return Of||(Of=1,function(f,u){var w=Le,c=w.Buffer;function S(m,y){for(var g in m)y[g]=m[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?f.exports=w:(S(w,u),u.Buffer=n);function n(m,y,g){return c(m,y,g)}n.prototype=Object.create(c.prototype),S(c,n),n.from=function(m,y,g){if(typeof m=="number")throw new TypeError("Argument must not be a number");return c(m,y,g)},n.alloc=function(m,y,g){if(typeof m!="number")throw new TypeError("Argument must be a number");var b=c(m);return y!==void 0?typeof g=="string"?b.fill(y,g):b.fill(y):b.fill(0),b},n.allocUnsafe=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return c(m)},n.allocUnsafeSlow=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return w.SlowBuffer(m)}}(Mp,Ti)),Ti}var Uf;function gi(){if(Uf)return on;Uf=1;var f=65536,u=4294967295;function w(){throw new Error(`Secure random number generation is not supported by this browser. +import{aa as Le,a9 as Mt}from"./index.9fe14626.js";import{e as Mi}from"./examples.ec427188.js";import{w as rc}from"./index.1c761ed5.js";var ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nb(f){if(f.__esModule)return f;var u=f.default;if(typeof u=="function"){var w=function c(){if(this instanceof c){var S=[null];S.push.apply(S,arguments);var n=Function.bind.apply(u,S);return new n}return u.apply(this,arguments)};w.prototype=u.prototype}else w={};return Object.defineProperty(w,"__esModule",{value:!0}),Object.keys(f).forEach(function(c){var S=Object.getOwnPropertyDescriptor(f,c);Object.defineProperty(w,c,S.get?S:{enumerable:!0,get:function(){return f[c]}})}),w}var Ii={},$t={};const ic=Symbol.for("nodejs.util.inspect.custom");var fi=ic,hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.crc16=void 0;function nc(f){let w=0;const c=Le.Buffer.alloc(f.length+2);c.set(f);for(let S of c){let n=128;for(;n>0;)w<<=1,S&n&&(w+=1),n>>=1,w>65535&&(w&=65535,w^=4129)}return Le.Buffer.from([Math.floor(w/256),w%256])}hi.crc16=nc;var ac=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},Ju;Object.defineProperty($t,"__esModule",{value:!0});$t.address=$t.Address=void 0;const oc=ac(fi),Qu=hi,Es=17,el=81,Rs=128;function Mf(f){const u=Le.Buffer.isBuffer(f)?f:Le.Buffer.from(f,"base64");if(u.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");const w=u.subarray(0,34),c=u.subarray(34,36),S=(0,Qu.crc16)(w);if(!(S[0]===c[0]&&S[1]===c[1]))throw new Error("Invalid checksum: "+f);let n=w[0],m=!1,y=!1;if(n&Rs&&(m=!0,n=n^Rs),n!==Es&&n!==el)throw"Unknown address tag";y=n===Es;let g=null;w[1]===255?g=-1:g=w[1];const b=w.subarray(2,34);return{isTestOnly:m,isBounceable:y,workchain:g,hashPart:b}}class sr{static isAddress(u){return u instanceof sr}static isFriendly(u){return u.indexOf(":")<0}static normalize(u){return typeof u=="string"?sr.parse(u).toString():u.toString()}static parse(u){return sr.isFriendly(u)?this.parseFriendly(u).address:this.parseRaw(u)}static parseRaw(u){let w=parseInt(u.split(":")[0]),c=Le.Buffer.from(u.split(":")[1],"hex");return new sr(w,c)}static parseFriendly(u){if(Le.Buffer.isBuffer(u)){let w=Mf(u);return{isBounceable:w.isBounceable,isTestOnly:w.isTestOnly,address:new sr(w.workchain,w.hashPart)}}else{let w=u.replace(/\-/g,"+").replace(/_/g,"/"),c=Mf(w);return{isBounceable:c.isBounceable,isTestOnly:c.isTestOnly,address:new sr(c.workchain,c.hashPart)}}}constructor(u,w){this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const c=Le.Buffer.alloc(36);return c.set(this.hash),c.set([this.workChain,this.workChain,this.workChain,this.workChain],32),c},this.toStringBuffer=c=>{let S=c&&c.testOnly!==void 0?c.testOnly:!1,m=(c&&c.bounceable!==void 0?c.bounceable:!0)?Es:el;S&&(m|=Rs);const y=Le.Buffer.alloc(34);y[0]=m,y[1]=this.workChain,y.set(this.hash,2);const g=Le.Buffer.alloc(36);return g.set(y),g.set((0,Qu.crc16)(y),34),g},this.toString=c=>{let S=c&&c.urlSafe!==void 0?c.urlSafe:!0,n=this.toStringBuffer(c);return S?n.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):n.toString("base64")},this[Ju]=()=>this.toString(),this.workChain=u,this.hash=w,Object.freeze(this)}equals(u){return u.workChain!==this.workChain?!1:u.hash.equals(this.hash)}}$t.Address=sr;Ju=oc.default;function sc(f){return sr.parse(f)}$t.address=sc;var ui={},fc=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},tl;Object.defineProperty(ui,"__esModule",{value:!0});ui.ExternalAddress=void 0;const hc=fc(fi);class Ns{static isAddress(u){return u instanceof Ns}constructor(u,w){this[tl]=()=>this.toString(),this.value=u,this.bits=w}toString(){return`External<${this.bits}:${this.value}>`}}ui.ExternalAddress=Ns;tl=hc.default;var xn={},Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.base32Decode=Ir.base32Encode=void 0;const Is="abcdefghijklmnopqrstuvwxyz234567";function uc(f){const u=f.byteLength;let w=0,c=0,S="";for(let n=0;n=5;)S+=Is[c>>>w-5&31],w-=5;return w>0&&(S+=Is[c<<5-w&31]),S}Ir.base32Encode=uc;function lc(f,u){const w=f.indexOf(u);if(w===-1)throw new Error("Invalid character found: "+u);return w}function dc(f){let u;u=f.toLowerCase();const{length:w}=u;let c=0,S=0,n=0;const m=Le.Buffer.alloc(w*5/8|0);for(let y=0;y=8&&(m[n++]=S>>>c-8&255,c-=8);return m}Ir.base32Decode=dc;var cc=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}},rl;Object.defineProperty(xn,"__esModule",{value:!0});xn.ADNLAddress=void 0;const pc=cc(fi),xf=Ir,_f=hi;class nn{static parseFriendly(u){if(u.length!==55)throw Error("Invalid address");u="f"+u;let w=(0,xf.base32Decode)(u);if(w[0]!==45)throw Error("Invalid address");let c=w.slice(33);if(!(0,_f.crc16)(w.slice(0,33)).equals(c))throw Error("Invalid address");return new nn(w.slice(1,33))}static parseRaw(u){const w=Le.Buffer.from(u,"base64");return new nn(w)}constructor(u){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let w=Le.Buffer.concat([Le.Buffer.from([45]),this.address]),c=(0,_f.crc16)(w);return w=Le.Buffer.concat([w,c]),(0,xf.base32Encode)(w).slice(1)},this[rl]=()=>this.toString(),u.length!==32)throw Error("Invalid address");this.address=u}equals(u){return this.address.equals(u.address)}}xn.ADNLAddress=nn;rl=pc.default;var _n={},Sr={},xi={},_i={},Si={},Sf;function zs(){if(Sf)return Si;Sf=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.bitsToPaddedBuffer=void 0;const f=Sn();function u(w){let c=new f.BitBuilder(Math.ceil(w.length/8)*8);c.writeBits(w);let S=Math.ceil(w.length/8)*8-w.length;for(let n=0;nthis.toString(),g<0)throw new Error(`Length ${g} is out of bounds`);this._length=g,this._data=m,this._offset=y}get length(){return this._length}at(m){if(m>=this._length)throw new Error(`Index ${m} > ${this._length} is out of bounds`);if(m<0)throw new Error(`Index ${m} < 0 is out of bounds`);let y=this._offset+m>>3,g=7-(this._offset+m)%8;return(this._data[y]&1<=this._length)throw new Error(`Offset(${m}) > ${this._length} is out of bounds`);if(m<0)throw new Error(`Offset(${m}) < 0 is out of bounds`);if(m+y>this._length)throw new Error(`Offset ${m} + Length ${y} > ${this._length} is out of bounds`);return new Ps(this._data,this._offset+m,y)}subbuffer(m,y){if(m>=this._length)throw new Error(`Offset ${m} is out of bounds`);if(m<0)throw new Error(`Offset ${m} is out of bounds`);if(m+y>this._length)throw new Error(`Offset + Lenght = ${m+y} is out of bounds`);if(y%8!==0||(this._offset+m)%8!==0)return null;let g=this._offset+m>>3,b=g+(y>>3);return this._data.subarray(g,b)}equals(m){if(this._length!==m._length)return!1;for(let y=0;ythis._buffer.length*8)throw new Error("BitBuilder overflow");(n===!0||n>0)&&(this._buffer[m/8|0]|=1<<7-m%8),this._length++}writeBits(n){for(let m=0;mthis._buffer.length*8)throw new Error("BitBuilder overflow");n.copy(this._buffer,this._length/8),this._length+=n.length*8}else for(let m=0;m255||!Number.isSafeInteger(v))throw Error(`value is out of range for ${m} bits. Got ${n}`);this._buffer[this._length/8]=Number(n),this._length+=8;return}if(m===16&&this._length%8===0){let v=Number(n);if(v<0||v>65536||!Number.isSafeInteger(v))throw Error(`value is out of range for ${m} bits. Got ${n}`);this._buffer[this._length/8]=v>>8,this._buffer[this._length/8+1]=v&255,this._length+=16;return}let y=BigInt(n);if(m<0||!Number.isSafeInteger(m))throw Error(`invalid bit length. Got ${m}`);if(m===0){if(n!==0n)throw Error(`value is not zero for ${m} bits. Got ${n}`);return}let g=1n<=g)throw Error(`bitLength is too small for a value ${n}. Got ${m}`);let b=[];for(;y>0;)b.push(y%2n===1n),y/=2n;for(let v=0;v=g)throw Error(`value is out of range for ${m} bits. Got ${n}`);y<0?(this.writeBit(!0),y=(1n<0?y:-y;const b=1+Math.ceil(g.toString(2).length/8),v=b*8;this.writeUint(b,m),this.writeInt(y,v)}writeCoins(n){this.writeVarUint(n,4)}writeAddress(n){if(n==null){this.writeUint(0,2);return}if(f.Address.isAddress(n)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(n.workChain,8),this.writeBuffer(n.hash);return}if(u.ExternalAddress.isAddress(n)){this.writeUint(1,2),this.writeUint(n.bits,9),this.writeUint(n.value,n.bits);return}throw Error(`Invalid address. Got ${n}`)}build(){return new w.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}};return xi.BitBuilder=c,xi}var Bi={},li={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.CellType=void 0,function(u){u[u.Ordinary=-1]="Ordinary",u[u.PrunedBranch=1]="PrunedBranch",u[u.Library=2]="Library",u[u.MerkleProof=3]="MerkleProof",u[u.MerkleUpdate=4]="MerkleUpdate"}(f.CellType||(f.CellType={}))})(li);var Ai={},ki={},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.parseDict=void 0;function vc(f){let u=0;for(;f.loadBit();)u++;return u}function Cs(f,u,w,c,S){let n=u.loadBit()?1:0,m=0,y=f;if(n===0){m=vc(u);for(let g=0;g(0,n.deserializeInternalKey)(F))}values(){return Array.from(this._map.values())}store(F,de,d){if(this._map.size===0)F.storeBit(0);else{let e=this._key;de!=null&&(e=de);let r=this._value;if(d!=null&&(r=d),!e)throw Error("Key serializer is not defined");if(!r)throw Error("Value serializer is not defined");let i=new Map;for(const[s,l]of this._map)i.set(e.serialize((0,n.deserializeInternalKey)(s)),l);F.storeBit(1);let a=(0,u.beginCell)();(0,S.serializeDict)(i,e.bits,r.serialize,a),F.storeRef(a.endCell())}}storeDirect(F,de,d){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let e=this._key;de!=null&&(e=de);let r=this._value;if(d!=null&&(r=d),!e)throw Error("Key serializer is not defined");if(!r)throw Error("Value serializer is not defined");let i=new Map;for(const[a,s]of this._map)i.set(e.serialize((0,n.deserializeInternalKey)(a)),s);(0,S.serializeDict)(i,e.bits,r.serialize,F)}};ki.Dictionary=m,m.Keys={Address:()=>y(),BigInt:Y=>g(Y),Int:Y=>b(Y),BigUint:Y=>v(Y),Uint:Y=>_(Y),Buffer:Y=>M(Y)},m.Values={BigInt:Y=>A(Y),Int:Y=>B(Y),BigVarInt:Y=>k(Y),BigUint:Y=>C(Y),Uint:Y=>P(Y),BigVarUint:Y=>R(Y),Bool:()=>N(),Address:()=>T(),Cell:()=>L(),Buffer:Y=>ee(Y),Dictionary:(Y,F)=>W(Y,F)};function y(){return{bits:267,serialize:Y=>{if(!f.Address.isAddress(Y))throw Error("Key is not an address");return(0,u.beginCell)().storeAddress(Y).endCell().beginParse().preloadUintBig(267)},parse:Y=>(0,u.beginCell)().storeUint(Y,267).endCell().beginParse().loadAddress()}}function g(Y){return{bits:Y,serialize:F=>{if(typeof F!="bigint")throw Error("Key is not a bigint");return(0,u.beginCell)().storeInt(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadIntBig(Y)}}function b(Y){return{bits:Y,serialize:F=>{if(typeof F!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(F))throw Error("Key is not a safe integer: "+F);return(0,u.beginCell)().storeInt(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadInt(Y)}}function v(Y){return{bits:Y,serialize:F=>{if(typeof F!="bigint")throw Error("Key is not a bigint");if(F<0)throw Error("Key is negative: "+F);return(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)}}function _(Y){return{bits:Y,serialize:F=>{if(typeof F!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(F))throw Error("Key is not a safe integer: "+F);if(F<0)throw Error("Key is negative: "+F);return(0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUintBig(Y)},parse:F=>Number((0,u.beginCell)().storeUint(F,Y).endCell().beginParse().loadUint(Y))}}function M(Y){return{bits:Y*8,serialize:F=>{if(!Le.Buffer.isBuffer(F))throw Error("Key is not a buffer");return(0,u.beginCell)().storeBuffer(F).endCell().beginParse().loadUintBig(Y*8)},parse:F=>(0,u.beginCell)().storeUint(F,Y*8).endCell().beginParse().loadBuffer(Y)}}function B(Y){return{serialize:(F,de)=>{de.storeInt(F,Y)},parse:F=>F.loadInt(Y)}}function A(Y){return{serialize:(F,de)=>{de.storeInt(F,Y)},parse:F=>F.loadIntBig(Y)}}function k(Y){return{serialize:(F,de)=>{de.storeVarInt(F,Y)},parse:F=>F.loadVarIntBig(Y)}}function R(Y){return{serialize:(F,de)=>{de.storeVarUint(F,Y)},parse:F=>F.loadVarUintBig(Y)}}function P(Y){return{serialize:(F,de)=>{de.storeUint(F,Y)},parse:F=>F.loadUint(Y)}}function C(Y){return{serialize:(F,de)=>{de.storeUint(F,Y)},parse:F=>F.loadUintBig(Y)}}function N(){return{serialize:(Y,F)=>{F.storeBit(Y)},parse:Y=>Y.loadBit()}}function T(){return{serialize:(Y,F)=>{F.storeAddress(Y)},parse:Y=>Y.loadAddress()}}function L(){return{serialize:(Y,F)=>{F.storeRef(Y)},parse:Y=>Y.loadRef()}}function W(Y,F){return{serialize:(de,d)=>{de.store(d)},parse:de=>m.load(Y,F,de)}}function ee(Y){return{serialize:(F,de)=>{if(F.length!==Y)throw Error("Invalid buffer size");de.storeBuffer(F)},parse:F=>F.loadBuffer(Y)}}return ki}var ar={},Rf;function nl(){if(Rf)return ar;Rf=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.writeString=ar.stringToCell=ar.readString=void 0;const f=jt();function u(m){if(m.remainingBits%8!==0)throw new Error(`Invalid string length: ${m.remainingBits}`);if(m.remainingRefs!==0&&m.remainingRefs!==1)throw new Error(`invalid number of refs: ${m.remainingRefs}`);if(m.remainingRefs===1&&1023-m.remainingBits>7)throw new Error(`invalid string length: ${m.remainingBits/8}`);let y;return m.remainingBits===0?y=Le.Buffer.alloc(0):y=m.loadBuffer(m.remainingBits/8),m.remainingRefs===1&&(y=Le.Buffer.concat([y,u(m.loadRef().beginParse())])),y}function w(m){return u(m).toString()}ar.readString=w;function c(m,y){if(m.length>0){let g=Math.floor(y.availableBits/8);if(m.length>g){let b=m.subarray(0,g),v=m.subarray(g);y=y.storeBuffer(b);let _=(0,f.beginCell)();c(v,_),y=y.storeRef(_.endCell())}else y=y.storeBuffer(m)}}function S(m){let y=(0,f.beginCell)();return c(Le.Buffer.from(m),y),y.endCell()}ar.stringToCell=S;function n(m,y){c(Le.Buffer.from(m),y)}return ar.writeString=n,ar}var If;function Ds(){if(If)return Ai;If=1;var f=ht&&ht.__importDefault||function(y){return y&&y.__esModule?y:{default:y}},u;Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.Slice=void 0;const w=f(fi),c=Qr(),S=jt(),n=nl();let m=class al{constructor(g,b){this[u]=()=>this.toString(),this._reader=g.clone(),this._refs=[...b]}get remainingBits(){return this._reader.remaining}get remainingRefs(){return this._refs.length}skip(g){return this._reader.skip(g),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(g){return this._reader.loadBits(g)}preloadBits(g){return this._reader.preloadBits(g)}loadUint(g){return this._reader.loadUint(g)}loadUintBig(g){return this._reader.loadUintBig(g)}preloadUint(g){return this._reader.preloadUint(g)}preloadUintBig(g){return this._reader.preloadUintBig(g)}loadMaybeUint(g){return this.loadBit()?this.loadUint(g):null}loadMaybeUintBig(g){return this.loadBit()?this.loadUintBig(g):null}loadInt(g){return this._reader.loadInt(g)}loadIntBig(g){return this._reader.loadIntBig(g)}preloadInt(g){return this._reader.preloadInt(g)}preloadIntBig(g){return this._reader.preloadIntBig(g)}loadMaybeInt(g){return this.loadBit()?this.loadInt(g):null}loadMaybeIntBig(g){return this.loadBit()?this.loadIntBig(g):null}loadVarUint(g){return this._reader.loadVarUint(g)}loadVarUintBig(g){return this._reader.loadVarUintBig(g)}preloadVarUint(g){return this._reader.preloadVarUint(g)}preloadVarUintBig(g){return this._reader.preloadVarUintBig(g)}loadVarInt(g){return this._reader.loadVarInt(g)}loadVarIntBig(g){return this._reader.loadVarIntBig(g)}preloadVarInt(g){return this._reader.preloadVarInt(g)}preloadVarIntBig(g){return this._reader.preloadVarIntBig(g)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refs.length===0)throw new Error("No more references");return this._refs.shift()}preloadRef(){if(this._refs.length===0)throw new Error("No more references");return this._refs[0]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(g){return this._reader.loadBuffer(g)}preloadBuffer(g){return this._reader.preloadBuffer(g)}loadStringTail(){return(0,n.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,n.readString)(this):null}loadStringRefTail(){return(0,n.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const g=this.loadMaybeRef();return g?(0,n.readString)(g.beginParse()):null}loadDict(g,b){return c.Dictionary.load(g,b,this)}loadDictDirect(g,b){return c.Dictionary.loadDirect(g,b,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,S.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,S.beginCell)().storeSlice(this)}clone(){return new al(this._reader,this._refs)}toString(){return this.asCell().toString()}};return Ai.Slice=m,u=w.default,Ai}var kn={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.BitReader=void 0;const Mc=$t,xc=ui;class Ls{constructor(u,w=0){this._checkpoints=[],this._bits=u,this._offset=w}get remaining(){return this._bits.length-this._offset}skip(u){if(u<0||this._offset+u>this._bits.length)throw new Error(`Index ${this._offset+u} is out of bounds`);this._offset+=u}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let u=this._bits.at(this._offset);return this._offset++,u}preloadBit(){return this._bits.at(this._offset)}loadBits(u){let w=this._bits.substring(this._offset,u);return this._offset+=u,w}preloadBits(u){return this._bits.substring(this._offset,u)}loadBuffer(u){let w=this._preloadBuffer(u,this._offset);return this._offset+=u*8,w}preloadBuffer(u){return this._preloadBuffer(u,this._offset)}loadUint(u){return Number(this.loadUintBig(u))}loadUintBig(u){let w=this.preloadUintBig(u);return this._offset+=u,w}preloadUint(u){return Number(this._preloadUint(u,this._offset))}preloadUintBig(u){return this._preloadUint(u,this._offset)}loadInt(u){let w=this._preloadInt(u,this._offset);return this._offset+=u,Number(w)}loadIntBig(u){let w=this._preloadInt(u,this._offset);return this._offset+=u,w}preloadInt(u){return Number(this._preloadInt(u,this._offset))}preloadIntBig(u){return this._preloadInt(u,this._offset)}loadVarUint(u){let w=Number(this.loadUint(u));return Number(this.loadUintBig(w*8))}loadVarUintBig(u){let w=Number(this.loadUint(u));return this.loadUintBig(w*8)}preloadVarUint(u){let w=Number(this._preloadUint(u,this._offset));return Number(this._preloadUint(w*8,this._offset+u))}preloadVarUintBig(u){let w=Number(this._preloadUint(u,this._offset));return this._preloadUint(w*8,this._offset+u)}loadVarInt(u){let w=Number(this.loadUint(u));return Number(this.loadIntBig(w*8))}loadVarIntBig(u){let w=Number(this.loadUint(u));return this.loadIntBig(w*8)}preloadVarInt(u){let w=Number(this._preloadUint(u,this._offset));return Number(this._preloadInt(w*8,this._offset+u))}preloadVarIntBig(u){let w=Number(this._preloadUint(u,this._offset));return this._preloadInt(w*8,this._offset+u)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===2)return this._loadInternalAddress();throw new Error("Invalid address: "+u)}loadMaybeAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let u=Number(this._preloadUint(2,this._offset));if(u===0)return this._offset+=2,null;if(u===2)return this._loadInternalAddress();if(u===1)return this._loadExternalAddress();throw Error(u===3?"Unsupported":"Unreachable")}loadPaddedBits(u){if(u%8!==0)throw new Error("Invalid number of bits");let w=u;for(;;)if(this._bits.at(this._offset+w-1)){w--;break}else w--;let c=this._bits.substring(this._offset,w);return this._offset+=u,c}clone(){return new Ls(this._bits,this._offset)}_preloadInt(u,w){if(u==0)return 0n;let c=this._bits.at(w),S=0n;for(let n=0;n>u-1)%2!==0}}vi.LevelMask=js;function Rc(f){return f=f-(f>>1&1431655765),f=(f&858993459)+(f>>2&858993459),(f+(f>>4)&252645135)*16843009>>24}Object.defineProperty(pi,"__esModule",{value:!0});pi.exoticPruned=void 0;const Ic=Jt,Pf=vi;function Pc(f,u){let w=new Ic.BitReader(f),c=w.loadUint(8);if(c!==1)throw new Error(`Pruned branch cell must have type 1, got "${c}"`);if(u.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${u.length}"`);let S;if(f.length===280)S=new Pf.LevelMask(1);else{if(S=new Pf.LevelMask(w.loadUint(8)),S.level<1||S.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${S.level}/${S.value}"`);const g=8+8+S.apply(S.level-1).hashCount*(256+16);if(f.length!==g)throw new Error(`Pruned branch cell must have exactly ${g} bits, got "${f.length}"`)}let n=[],m=[],y=[];for(let g=0;g>1);return{type:En.CellType.MerkleProof,depths:w,hashes:c,mask:S}}function Lc(f,u){(0,Oc.exoticMerkleUpdate)(f,u);let w=[],c=[],S=new Rn.LevelMask((u[0].level()|u[1].level())>>1);return{type:En.CellType.MerkleUpdate,depths:w,hashes:c,mask:S}}function jc(f,u){let c=new Cc.BitReader(f).preloadUint(8);if(c===1)return Nc(f,u);if(c===2)return zc(f,u);if(c===3)return Dc(f,u);if(c===4)return Lc(f,u);throw Error("Invalid exotic cell type: "+c)}kn.resolveExotic=jc;var In={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.getRepr=fr.getBitsDescriptor=fr.getRefsDescriptor=void 0;const Pi=li,Fc=zs();function ol(f,u,w){return f.length+(w!==Pi.CellType.Ordinary?1:0)*8+u*32}fr.getRefsDescriptor=ol;function sl(f){let u=f.length;return Math.ceil(u/8)+Math.floor(u/8)}fr.getBitsDescriptor=sl;function Kc(f,u,w,c){const S=Math.ceil(f.length/8),n=Le.Buffer.alloc(2+S+(2+32)*u.length);let m=0;n[m++]=ol(u,w,c),n[m++]=sl(f),(0,Fc.bitsToPaddedBuffer)(f).copy(n,m),m+=S;for(const y of u){let g;c==Pi.CellType.MerkleProof||c==Pi.CellType.MerkleUpdate?g=y.depth(w+1):g=y.depth(w),n[m++]=Math.floor(g/256),n[m++]=g%256}for(const y of u){let g;c==Pi.CellType.MerkleProof||c==Pi.CellType.MerkleUpdate?g=y.hash(w+1):g=y.hash(w),g.copy(n,m),m+=32}return n}fr.getRepr=Kc;var Jn={},pr={},Ni={},Hc={get exports(){return Ni},set exports(f){Ni=f}};(function(f,u){(function(w,c){f.exports=c()})(ht,function(){var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function c(X,G,V,J){var me,$,se,Te=G||[0],ae=(V=V||0)>>>3,ve=J===-1?3:0;for(me=0;me>>2,Te.length<=$&&Te.push(0),Te[$]|=X[me]<<8*(ve+J*(se%4));return{value:Te,binLen:8*X.length+V}}function S(X,G,V){switch(G){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(X){case"HEX":return function(J,me,$){return function(se,Te,ae,ve){var He,ue,ge,Je;if(se.length%2!=0)throw new Error("String of HEX type must be in byte increments");var fe=Te||[0],ke=(ae=ae||0)>>>3,tt=ve===-1?3:0;for(He=0;He>>1)+ke)>>>2;fe.length<=ge;)fe.push(0);fe[ge]|=ue<<8*(tt+ve*(Je%4))}return{value:fe,binLen:4*se.length+ae}}(J,me,$,V)};case"TEXT":return function(J,me,$){return function(se,Te,ae,ve,He){var ue,ge,Je,fe,ke,tt,Me,Ie,dt=0,Se=ae||[0],qe=(ve=ve||0)>>>3;if(Te==="UTF8")for(Me=He===-1?3:0,Je=0;Je(ue=se.charCodeAt(Je))?ge.push(ue):2048>ue?(ge.push(192|ue>>>6),ge.push(128|63&ue)):55296>ue||57344<=ue?ge.push(224|ue>>>12,128|ue>>>6&63,128|63&ue):(Je+=1,ue=65536+((1023&ue)<<10|1023&se.charCodeAt(Je)),ge.push(240|ue>>>18,128|ue>>>12&63,128|ue>>>6&63,128|63&ue)),fe=0;fe>>2;Se.length<=ke;)Se.push(0);Se[ke]|=ge[fe]<<8*(Me+He*(tt%4)),dt+=1}else for(Me=He===-1?2:0,Ie=Te==="UTF16LE"&&He!==1||Te!=="UTF16LE"&&He===1,Je=0;Je>>8),ke=(tt=dt+qe)>>>2;Se.length<=ke;)Se.push(0);Se[ke]|=ue<<8*(Me+He*(tt%4)),dt+=2}return{value:Se,binLen:8*dt+ve}}(J,G,me,$,V)};case"B64":return function(J,me,$){return function(se,Te,ae,ve){var He,ue,ge,Je,fe,ke,tt=0,Me=Te||[0],Ie=(ae=ae||0)>>>3,dt=ve===-1?3:0,Se=se.indexOf("=");if(se.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(se=se.replace(/=/g,""),Se!==-1&&Se */var Of;function Bt(){return Of||(Of=1,function(f,u){var w=Le,c=w.Buffer;function S(m,y){for(var g in m)y[g]=m[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?f.exports=w:(S(w,u),u.Buffer=n);function n(m,y,g){return c(m,y,g)}n.prototype=Object.create(c.prototype),S(c,n),n.from=function(m,y,g){if(typeof m=="number")throw new TypeError("Argument must not be a number");return c(m,y,g)},n.alloc=function(m,y,g){if(typeof m!="number")throw new TypeError("Argument must be a number");var b=c(m);return y!==void 0?typeof g=="string"?b.fill(y,g):b.fill(y):b.fill(0),b},n.allocUnsafe=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return c(m)},n.allocUnsafeSlow=function(m){if(typeof m!="number")throw new TypeError("Argument must be a number");return w.SlowBuffer(m)}}(Mp,Ti)),Ti}var Uf;function gi(){if(Uf)return on;Uf=1;var f=65536,u=4294967295;function w(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}var c=Bt().Buffer,S=ht.crypto||ht.msCrypto;S&&S.getRandomValues?qf.exports=n:qf.exports=w;function n(m,y){if(m>u)throw new RangeError("requested too many random bytes");var g=c.allocUnsafe(m);if(m>0)if(m>f)for(var b=0;b0&&(de=W[0]),de instanceof Error)throw de;var d=new Error("Unhandled error."+(de?" ("+de.message+")":""));throw d.context=de,d}var e=F[L];if(e===void 0)return!1;if(typeof e=="function")u(e,this,W);else for(var r=e.length,i=A(e,r),ee=0;ee0&&de.length>Y&&!de.warned){de.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+de.length+" "+String(L)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=T,d.type=L,d.count=de.length,c(d)}return T}n.prototype.addListener=function(L,W){return b(this,L,W,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(L,W){return b(this,L,W,!0)};function v(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(T,L,W){var ee={fired:!1,wrapFn:void 0,target:T,type:L,listener:W},Y=v.bind(ee);return Y.listener=W,ee.wrapFn=Y,Y}n.prototype.once=function(L,W){return y(W),this.on(L,_(this,L,W)),this},n.prototype.prependOnceListener=function(L,W){return y(W),this.prependListener(L,_(this,L,W)),this},n.prototype.removeListener=function(L,W){var ee,Y,F,de,d;if(y(W),Y=this._events,Y===void 0)return this;if(ee=Y[L],ee===void 0)return this;if(ee===W||ee.listener===W)--this._eventsCount===0?this._events=Object.create(null):(delete Y[L],Y.removeListener&&this.emit("removeListener",L,ee.listener||W));else if(typeof ee!="function"){for(F=-1,de=ee.length-1;de>=0;de--)if(ee[de]===W||ee[de].listener===W){d=ee[de].listener,F=de;break}if(F<0)return this;F===0?ee.shift():k(ee,F),ee.length===1&&(Y[L]=ee[0]),Y.removeListener!==void 0&&this.emit("removeListener",L,d||W)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(L){var W,ee,Y;if(ee=this._events,ee===void 0)return this;if(ee.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ee[L]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ee[L]),this;if(arguments.length===0){var F=Object.keys(ee),de;for(Y=0;Y=0;Y--)this.removeListener(L,W[Y]);return this};function M(T,L,W){var ee=T._events;if(ee===void 0)return[];var Y=ee[L];return Y===void 0?[]:typeof Y=="function"?W?[Y.listener||Y]:[Y]:W?R(Y):A(Y,Y.length)}n.prototype.listeners=function(L){return M(this,L,!0)},n.prototype.rawListeners=function(L){return M(this,L,!1)},n.listenerCount=function(T,L){return typeof T.listenerCount=="function"?T.listenerCount(L):B.call(T,L)},n.prototype.listenerCount=B;function B(T){var L=this._events;if(L!==void 0){var W=L[T];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?w(this._events):[]};function A(T,L){for(var W=new Array(L),ee=0;ee"u"?f:b(Uint8Array),M={"%AggregateError%":typeof AggregateError>"u"?f:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?f:ArrayBuffer,"%ArrayIteratorPrototype%":g?b([][Symbol.iterator]()):f,"%AsyncFromSyncIteratorPrototype%":f,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":typeof Atomics>"u"?f:Atomics,"%BigInt%":typeof BigInt>"u"?f:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?f:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?f:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?f:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?f:Float32Array,"%Float64Array%":typeof Float64Array>"u"?f:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?f:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":v,"%Int8Array%":typeof Int8Array>"u"?f:Int8Array,"%Int16Array%":typeof Int16Array>"u"?f:Int16Array,"%Int32Array%":typeof Int32Array>"u"?f:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g?b(b([][Symbol.iterator]())):f,"%JSON%":typeof JSON=="object"?JSON:f,"%Map%":typeof Map>"u"?f:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g?f:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?f:Promise,"%Proxy%":typeof Proxy>"u"?f:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?f:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?f:Set,"%SetIteratorPrototype%":typeof Set>"u"||!g?f:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?f:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g?b(""[Symbol.iterator]()):f,"%Symbol%":g?Symbol:f,"%SyntaxError%":u,"%ThrowTypeError%":y,"%TypedArray%":_,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?f:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?f:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?f:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?f:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?f:WeakMap,"%WeakRef%":typeof WeakRef>"u"?f:WeakRef,"%WeakSet%":typeof WeakSet>"u"?f:WeakSet};try{null.error}catch(d){var B=b(b(d));M["%Error.prototype%"]=B}var A=function d(e){var r;if(e==="%AsyncFunction%")r=S("async function () {}");else if(e==="%GeneratorFunction%")r=S("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=S("async function* () {}");else if(e==="%AsyncGenerator%"){var i=d("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=d("%AsyncGenerator%");a&&(r=b(a.prototype))}return M[e]=r,r},k={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=Ks(),P=Ap(),C=R.call(Function.call,Array.prototype.concat),N=R.call(Function.apply,Array.prototype.splice),T=R.call(Function.call,String.prototype.replace),L=R.call(Function.call,String.prototype.slice),W=R.call(Function.call,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,F=function(e){var r=L(e,0,1),i=L(e,-1);if(r==="%"&&i!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var a=[];return T(e,ee,function(s,l,p,o){a[a.length]=p?T(o,Y,"$1"):l||s}),a},de=function(e,r){var i=e,a;if(P(k,i)&&(a=k[i],i="%"+a[0]+"%"),P(M,i)){var s=M[i];if(s===v&&(s=A(i)),typeof s>"u"&&!r)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:i,value:s}}throw new u("intrinsic "+e+" does not exist!")};return fa=function(e,r){if(typeof e!="string"||e.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new c('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,e)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=F(e),a=i.length>0?i[0]:"",s=de("%"+a+"%",r),l=s.name,p=s.value,o=!1,t=s.alias;t&&(a=t[0],N(i,C([0,1],t)));for(var h=1,x=!0;h=i.length){var j=n(p,E);x=!!j,x&&"get"in j&&!("originalValue"in j.get)?p=j.get:p=p[E]}else x=P(p,E),p=p[E];x&&!o&&(M[l]=p)}}return p},fa}var fn={},kp={get exports(){return fn},set exports(f){fn=f}},Wf;function Ep(){return Wf||(Wf=1,function(f){var u=Ks(),w=Hs(),c=w("%Function.prototype.apply%"),S=w("%Function.prototype.call%"),n=w("%Reflect.apply%",!0)||u.call(S,c),m=w("%Object.getOwnPropertyDescriptor%",!0),y=w("%Object.defineProperty%",!0),g=w("%Math.max%");if(y)try{y({},"a",{value:1})}catch{y=null}f.exports=function(_){var M=n(u,S,arguments);if(m&&y){var B=m(M,"length");B.configurable&&y(M,"length",{value:1+g(0,_.length-(arguments.length-1))})}return M};var b=function(){return n(u,c,arguments)};y?y(f.exports,"apply",{value:b}):f.exports.apply=b}(kp)),fn}var ha,Gf;function $s(){if(Gf)return ha;Gf=1;var f=Hs(),u=Ep(),w=u(f("String.prototype.indexOf"));return ha=function(S,n){var m=f(S,!!n);return typeof m=="function"&&w(S,".prototype.")>-1?u(m):m},ha}var ua,Yf;function Rp(){if(Yf)return ua;Yf=1;var f=Nn()(),u=$s(),w=u("Object.prototype.toString"),c=function(y){return f&&y&&typeof y=="object"&&Symbol.toStringTag in y?!1:w(y)==="[object Arguments]"},S=function(y){return c(y)?!0:y!==null&&typeof y=="object"&&typeof y.length=="number"&&y.length>=0&&w(y)!=="[object Array]"&&w(y.callee)==="[object Function]"},n=function(){return c(arguments)}();return c.isLegacyArguments=S,ua=n?c:S,ua}var la,Xf;function Ip(){if(Xf)return la;Xf=1;var f=Object.prototype.toString,u=Function.prototype.toString,w=/^\s*(?:function)?\*/,c=Nn()(),S=Object.getPrototypeOf,n=function(){if(!c)return!1;try{return Function("return function*() {}")()}catch{}},m;return la=function(g){if(typeof g!="function")return!1;if(w.test(u.call(g)))return!0;if(!c){var b=f.call(g);return b==="[object GeneratorFunction]"}if(!S)return!1;if(typeof m>"u"){var v=n();m=v?S(v):!1}return S(g)===m},la}var da,Jf;function Pp(){if(Jf)return da;Jf=1;var f=Function.prototype.toString,u=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,w,c;if(typeof u=="function"&&typeof Object.defineProperty=="function")try{w=Object.defineProperty({},"length",{get:function(){throw c}}),c={},u(function(){throw 42},null,w)}catch(C){C!==c&&(u=null)}else u=null;var S=/^\s*class\b/,n=function(N){try{var T=f.call(N);return S.test(T)}catch{return!1}},m=function(N){try{return n(N)?!1:(f.call(N),!0)}catch{return!1}},y=Object.prototype.toString,g="[object Object]",b="[object Function]",v="[object GeneratorFunction]",_="[object HTMLAllCollection]",M="[object HTML document.all class]",B="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,k=!(0 in[,]),R=function(){return!1};if(typeof document=="object"){var P=document.all;y.call(P)===y.call(document.all)&&(R=function(N){if((k||!N)&&(typeof N>"u"||typeof N=="object"))try{var T=y.call(N);return(T===_||T===M||T===B||T===g)&&N("")==null}catch{}return!1})}return da=u?function(N){if(R(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;try{u(N,null,w)}catch(T){if(T!==c)return!1}return!n(N)&&m(N)}:function(N){if(R(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;if(A)return m(N);if(n(N))return!1;var T=y.call(N);return T!==b&&T!==v&&!/^\[object HTML/.test(T)?!1:m(N)},da}var ca,Qf;function pl(){if(Qf)return ca;Qf=1;var f=Pp(),u=Object.prototype.toString,w=Object.prototype.hasOwnProperty,c=function(g,b,v){for(var _=0,M=g.length;_=3&&(_=v),u.call(g)==="[object Array]"?c(g,b,_):typeof g=="string"?S(g,b,_):n(g,b,_)};return ca=m,ca}var pa,e0;function vl(){if(e0)return pa;e0=1;var f=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],u=typeof globalThis>"u"?ht:globalThis;return pa=function(){for(var c=[],S=0;S"u"?ht:globalThis,y=u(),g=w("Array.prototype.indexOf",!0)||function(A,k){for(var R=0;R-1}return n?M(A):!1},ma}var ga,i0;function Cp(){if(i0)return ga;i0=1;var f=pl(),u=vl(),w=$s(),c=ml(),S=w("Object.prototype.toString"),n=Nn()(),m=typeof globalThis>"u"?ht:globalThis,y=u(),g=w("String.prototype.slice"),b={},v=Object.getPrototypeOf;n&&c&&v&&f(y,function(B){if(typeof m[B]=="function"){var A=new m[B];if(Symbol.toStringTag in A){var k=v(A),R=c(k,Symbol.toStringTag);if(!R){var P=v(k);R=c(P,Symbol.toStringTag)}b[B]=R.get}}});var _=function(A){var k=!1;return f(b,function(R,P){if(!k)try{var C=R.call(A);C===P&&(k=C)}catch{}}),k},M=gl();return ga=function(A){return M(A)?!n||!(Symbol.toStringTag in A)?g(S(A),8,-1):_(A):!1},ga}var n0;function Tp(){return n0||(n0=1,function(f){var u=Rp(),w=Ip(),c=Cp(),S=gl();function n(ne){return ne.call.bind(ne)}var m=typeof BigInt<"u",y=typeof Symbol<"u",g=n(Object.prototype.toString),b=n(Number.prototype.valueOf),v=n(String.prototype.valueOf),_=n(Boolean.prototype.valueOf);if(m)var M=n(BigInt.prototype.valueOf);if(y)var B=n(Symbol.prototype.valueOf);function A(ne,lt){if(typeof ne!="object")return!1;try{return lt(ne),!0}catch{return!1}}f.isArgumentsObject=u,f.isGeneratorFunction=w,f.isTypedArray=S;function k(ne){return typeof Promise<"u"&&ne instanceof Promise||ne!==null&&typeof ne=="object"&&typeof ne.then=="function"&&typeof ne.catch=="function"}f.isPromise=k;function R(ne){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ne):S(ne)||E(ne)}f.isArrayBufferView=R;function P(ne){return c(ne)==="Uint8Array"}f.isUint8Array=P;function C(ne){return c(ne)==="Uint8ClampedArray"}f.isUint8ClampedArray=C;function N(ne){return c(ne)==="Uint16Array"}f.isUint16Array=N;function T(ne){return c(ne)==="Uint32Array"}f.isUint32Array=T;function L(ne){return c(ne)==="Int8Array"}f.isInt8Array=L;function W(ne){return c(ne)==="Int16Array"}f.isInt16Array=W;function ee(ne){return c(ne)==="Int32Array"}f.isInt32Array=ee;function Y(ne){return c(ne)==="Float32Array"}f.isFloat32Array=Y;function F(ne){return c(ne)==="Float64Array"}f.isFloat64Array=F;function de(ne){return c(ne)==="BigInt64Array"}f.isBigInt64Array=de;function d(ne){return c(ne)==="BigUint64Array"}f.isBigUint64Array=d;function e(ne){return g(ne)==="[object Map]"}e.working=typeof Map<"u"&&e(new Map);function r(ne){return typeof Map>"u"?!1:e.working?e(ne):ne instanceof Map}f.isMap=r;function i(ne){return g(ne)==="[object Set]"}i.working=typeof Set<"u"&&i(new Set);function a(ne){return typeof Set>"u"?!1:i.working?i(ne):ne instanceof Set}f.isSet=a;function s(ne){return g(ne)==="[object WeakMap]"}s.working=typeof WeakMap<"u"&&s(new WeakMap);function l(ne){return typeof WeakMap>"u"?!1:s.working?s(ne):ne instanceof WeakMap}f.isWeakMap=l;function p(ne){return g(ne)==="[object WeakSet]"}p.working=typeof WeakSet<"u"&&p(new WeakSet);function o(ne){return p(ne)}f.isWeakSet=o;function t(ne){return g(ne)==="[object ArrayBuffer]"}t.working=typeof ArrayBuffer<"u"&&t(new ArrayBuffer);function h(ne){return typeof ArrayBuffer>"u"?!1:t.working?t(ne):ne instanceof ArrayBuffer}f.isArrayBuffer=h;function x(ne){return g(ne)==="[object DataView]"}x.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&x(new DataView(new ArrayBuffer(1),0,1));function E(ne){return typeof DataView>"u"?!1:x.working?x(ne):ne instanceof DataView}f.isDataView=E;var q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function H(ne){return g(ne)==="[object SharedArrayBuffer]"}function j(ne){return typeof q>"u"?!1:(typeof H.working>"u"&&(H.working=H(new q)),H.working?H(ne):ne instanceof q)}f.isSharedArrayBuffer=j;function Z(ne){return g(ne)==="[object AsyncFunction]"}f.isAsyncFunction=Z;function ce(ne){return g(ne)==="[object Map Iterator]"}f.isMapIterator=ce;function re(ne){return g(ne)==="[object Set Iterator]"}f.isSetIterator=re;function he(ne){return g(ne)==="[object Generator]"}f.isGeneratorObject=he;function Q(ne){return g(ne)==="[object WebAssembly.Module]"}f.isWebAssemblyCompiledModule=Q;function K(ne){return A(ne,b)}f.isNumberObject=K;function oe(ne){return A(ne,v)}f.isStringObject=oe;function Ne(ne){return A(ne,_)}f.isBooleanObject=Ne;function ye(ne){return m&&A(ne,M)}f.isBigIntObject=ye;function we(ne){return y&&A(ne,B)}f.isSymbolObject=we;function et(ne){return K(ne)||oe(ne)||Ne(ne)||ye(ne)||we(ne)}f.isBoxedPrimitive=et;function _e(ne){return typeof Uint8Array<"u"&&(h(ne)||j(ne))}f.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ne){Object.defineProperty(f,ne,{enumerable:!1,value:function(){throw new Error(ne+" is not supported in userland")}})})}(ta)),ta}var ba,a0;function qp(){return a0||(a0=1,ba=function(u){return u&&typeof u=="object"&&typeof u.copy=="function"&&typeof u.fill=="function"&&typeof u.readUInt8=="function"}),ba}var o0;function bl(){return o0||(o0=1,function(f){var u=Object.getOwnPropertyDescriptors||function(E){for(var q=Object.keys(E),H={},j=0;j=j)return re;switch(re){case"%s":return String(H[q++]);case"%d":return Number(H[q++]);case"%j":try{return JSON.stringify(H[q++])}catch{return"[Circular]"}default:return re}}),ce=H[q];q"u")return function(){return f.deprecate(x,E).apply(this,arguments)};var q=!1;function H(){if(!q){if(Mt.throwDeprecation)throw new Error(E);Mt.traceDeprecation?console.trace(E):console.error(E),q=!0}return x.apply(this,arguments)}return H};var c={},S=/^$/;if({}.NODE_DEBUG){var n={}.NODE_DEBUG;n=n.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+n+"$","i")}f.debuglog=function(x){if(x=x.toUpperCase(),!c[x])if(S.test(x)){var E=Mt.pid;c[x]=function(){var q=f.format.apply(f,arguments);console.error("%s %d: %s",x,E,q)}}else c[x]=function(){};return c[x]};function m(x,E){var q={seen:[],stylize:g};return arguments.length>=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),P(E)?q.showHidden=E:E&&f._extend(q,E),ee(q.showHidden)&&(q.showHidden=!1),ee(q.depth)&&(q.depth=2),ee(q.colors)&&(q.colors=!1),ee(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=y),v(q,x,q.depth)}f.inspect=m,m.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},m.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function y(x,E){var q=m.styles[E];return q?"\x1B["+m.colors[q][0]+"m"+x+"\x1B["+m.colors[q][1]+"m":x}function g(x,E){return x}function b(x){var E={};return x.forEach(function(q,H){E[q]=!0}),E}function v(x,E,q){if(x.customInspect&&E&&e(E.inspect)&&E.inspect!==f.inspect&&!(E.constructor&&E.constructor.prototype===E)){var H=E.inspect(q,x);return L(H)||(H=v(x,H,q)),H}var j=_(x,E);if(j)return j;var Z=Object.keys(E),ce=b(Z);if(x.showHidden&&(Z=Object.getOwnPropertyNames(E)),d(E)&&(Z.indexOf("message")>=0||Z.indexOf("description")>=0))return M(E);if(Z.length===0){if(e(E)){var re=E.name?": "+E.name:"";return x.stylize("[Function"+re+"]","special")}if(Y(E))return x.stylize(RegExp.prototype.toString.call(E),"regexp");if(de(E))return x.stylize(Date.prototype.toString.call(E),"date");if(d(E))return M(E)}var he="",Q=!1,K=["{","}"];if(R(E)&&(Q=!0,K=["[","]"]),e(E)){var oe=E.name?": "+E.name:"";he=" [Function"+oe+"]"}if(Y(E)&&(he=" "+RegExp.prototype.toString.call(E)),de(E)&&(he=" "+Date.prototype.toUTCString.call(E)),d(E)&&(he=" "+M(E)),Z.length===0&&(!Q||E.length==0))return K[0]+he+K[1];if(q<0)return Y(E)?x.stylize(RegExp.prototype.toString.call(E),"regexp"):x.stylize("[Object]","special");x.seen.push(E);var Ne;return Q?Ne=B(x,E,q,ce,Z):Ne=Z.map(function(ye){return A(x,E,q,ce,ye,Q)}),x.seen.pop(),k(Ne,he,K)}function _(x,E){if(ee(E))return x.stylize("undefined","undefined");if(L(E)){var q="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(q,"string")}if(T(E))return x.stylize(""+E,"number");if(P(E))return x.stylize(""+E,"boolean");if(C(E))return x.stylize("null","null")}function M(x){return"["+Error.prototype.toString.call(x)+"]"}function B(x,E,q,H,j){for(var Z=[],ce=0,re=E.length;ce-1&&(Z?re=re.split(` `).map(function(Q){return" "+Q}).join(` @@ -12,4 +12,4 @@ Use Chrome, Firefox or Internet Explorer 11`)}var c=Bt().Buffer,S=ht.crypto||ht. `)},os}var vu;function Xl(){return vu||(vu=1,function(f){const u=f;u.der=Yl(),u.pem=Mv()}(es)),es}var ss={},fs,mu;function Jl(){if(mu)return fs;mu=1;const f=_t(),u=Gl(),w=zi().DecoderBuffer,c=uf(),S=lf();function n(b){this.enc="der",this.name=b.name,this.entity=b,this.tree=new m,this.tree._init(b.body)}fs=n,n.prototype.decode=function(v,_){return w.isDecoderBuffer(v)||(v=new w(v,_)),this.tree._decode(v,_)};function m(b){c.call(this,"der",b)}f(m,c),m.prototype._peekTag=function(v,_,M){if(v.isEmpty())return!1;const B=v.save(),A=y(v,'Failed to peek tag: "'+_+'"');return v.isError(A)?A:(v.restore(B),A.tag===_||A.tagStr===_||A.tagStr+"of"===_||M)},m.prototype._decodeTag=function(v,_,M){const B=y(v,'Failed to decode tag of "'+_+'"');if(v.isError(B))return B;let A=g(v,B.primitive,'Failed to get length of "'+_+'"');if(v.isError(A))return A;if(!M&&B.tag!==_&&B.tagStr!==_&&B.tagStr+"of"!==_)return v.error('Failed to match tag: "'+_+'"');if(B.primitive||A!==null)return v.skip(A,'Failed to match body of: "'+_+'"');const k=v.save(),R=this._skipUntilEnd(v,'Failed to skip indefinite length body: "'+this.tag+'"');return v.isError(R)?R:(A=v.offset-k.offset,v.restore(k),v.skip(A,'Failed to match body of: "'+_+'"'))},m.prototype._skipUntilEnd=function(v,_){for(;;){const M=y(v,_);if(v.isError(M))return M;const B=g(v,M.primitive,_);if(v.isError(B))return B;let A;if(M.primitive||B!==null?A=v.skip(B):A=this._skipUntilEnd(v,_),v.isError(A))return A;if(M.tagStr==="end")break}},m.prototype._decodeList=function(v,_,M,B){const A=[];for(;!v.isEmpty();){const k=this._peekTag(v,"end");if(v.isError(k))return k;const R=M.decode(v,"der",B);if(v.isError(R)&&k)break;A.push(R)}return A},m.prototype._decodeStr=function(v,_){if(_==="bitstr"){const M=v.readUInt8();return v.isError(M)?M:{unused:M,data:v.raw()}}else if(_==="bmpstr"){const M=v.raw();if(M.length%2===1)return v.error("Decoding of string type: bmpstr length mismatch");let B="";for(let A=0;A>6],B=(_&32)===0;if((_&31)===31){let k=_;for(_=0;(k&128)===128;){if(k=b.readUInt8(v),b.isError(k))return k;_<<=7,_|=k&127}}else _&=31;const A=S.tag[_];return{cls:M,primitive:B,tag:_,tagStr:A}}function g(b,v,_){let M=b.readUInt8(_);if(b.isError(M))return M;if(!v&&M===128)return null;if(!(M&128))return M;const B=M&127;if(B>4)return b.error("length octect is too long");M=0;for(let A=0;A0&&C.ishrn(N),C}function B(R,P){R=M(R,P),R=R.mod(P);var C=f.from(R.toArray());if(C.length=v)throw new Error("invalid sig")}return vs=n,vs}var ms,Ru;function Cv(){if(Ru)return ms;Ru=1;var f=Bt().Buffer,u=Ki(),w=_l(),c=_t(),S=Iv(),n=Pv(),m=Rl;Object.keys(m).forEach(function(_){m[_].id=f.from(m[_].id,"hex"),m[_.toLowerCase()]=m[_]});function y(_){w.Writable.call(this);var M=m[_];if(!M)throw new Error("Unknown message digest");this._hashType=M.hash,this._hash=u(M.hash),this._tag=M.id,this._signType=M.sign}c(y,w.Writable),y.prototype._write=function(M,B,A){this._hash.update(M),A()},y.prototype.update=function(M,B){return typeof M=="string"&&(M=f.from(M,B)),this._hash.update(M),this},y.prototype.sign=function(M,B){this.end();var A=this._hash.digest(),k=S(A,M,this._hashType,this._signType,this._tag);return B?k.toString(B):k};function g(_){w.Writable.call(this);var M=m[_];if(!M)throw new Error("Unknown message digest");this._hash=u(M.hash),this._tag=M.id,this._signType=M.sign}c(g,w.Writable),g.prototype._write=function(M,B,A){this._hash.update(M),A()},g.prototype.update=function(M,B){return typeof M=="string"&&(M=f.from(M,B)),this._hash.update(M),this},g.prototype.verify=function(M,B,A){typeof B=="string"&&(B=f.from(B,A)),this.end();var k=this._hash.digest();return n(B,k,M,this._signType,this._tag)};function b(_){return new y(_)}function v(_){return new g(_)}return ms={Sign:b,Verify:v,createSign:b,createVerify:v},ms}var mn={},Tv={get exports(){return mn},set exports(f){mn=f}},Iu;function qv(){return Iu||(Iu=1,function(f){(function(u,w){function c(d,e){if(!d)throw new Error(e||"Assertion failed")}function S(d,e){d.super_=e;var r=function(){};r.prototype=e.prototype,d.prototype=new r,d.prototype.constructor=d}function n(d,e,r){if(n.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((e==="le"||e==="be")&&(r=e,e=10),this._init(d||0,e||10,r||"be"))}typeof u=="object"?u.exports=n:w.BN=n,n.BN=n,n.wordSize=26;var m;try{typeof window<"u"&&typeof window.Buffer<"u"?m=window.Buffer:m=Le.Buffer}catch{}n.isBN=function(e){return e instanceof n?!0:e!==null&&typeof e=="object"&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,r){return e.cmp(r)>0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),c(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var a=0;e[0]==="-"&&(a++,this.negative=1),a=0;a-=3)l=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[s]|=l<>>26-p&67108863,p+=24,p>=26&&(p-=26,s++);else if(i==="le")for(a=0,s=0;a>>26-p&67108863,p+=24,p>=26&&(p-=26,s++);return this.strip()};function y(d,e){var r=d.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function g(d,e,r){var i=y(d,r);return r-1>=e&&(i|=y(d,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var a=0;a=r;a-=2)p=g(e,r,a)<=18?(s-=18,l+=1,this.words[l]|=p>>>26):s+=8;else{var o=e.length-r;for(a=o%2===0?r+1:r;a=18?(s-=18,l+=1,this.words[l]|=p>>>26):s+=8}this.strip()};function b(d,e,r,i){for(var a=0,s=Math.min(d.length,r),l=e;l=49?a+=p-49+10:p>=17?a+=p-17+10:a+=p}return a}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var a=0,s=1;s<=67108863;s*=r)a++;a--,s=s/r|0;for(var l=e.length-i,p=l%a,o=Math.min(l,l-p)+i,t=0,h=i;h1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var a=0,s=0,l=0;l>>24-a&16777215,s!==0||l!==this.length-1?i=v[6-o.length]+o+i:i=o+i,a+=2,a>=26&&(a-=26,l--)}for(s!==0&&(i=s.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=_[e],h=M[e];i="";var x=this.clone();for(x.negative=0;!x.isZero();){var E=x.modn(h).toString(e);x=x.idivn(h),x.isZero()?i=E+i:i=v[t-E.length]+E+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}c(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return c(typeof m<"u"),this.toArrayLike(m,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var a=this.byteLength(),s=i||Math.max(1,a);c(a<=s,"byte array longer than desired length"),c(s>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(s),o,t,h=this.clone();if(l){for(t=0;!h.isZero();t++)o=h.andln(255),h.iushrn(8),p[t]=o;for(;t=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function B(d){for(var e=new Array(d.bitLength()),r=0;r>>a}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;re.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var a=0;ae.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){c(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){c(typeof e=="number"&&e>=0);var i=e/26|0,a=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<e.length?(i=this,a=e):(i=e,a=this);for(var s=0,l=0;l>>26;for(;s!==0&&l>>26;if(this.length=i.length,s!==0)this.words[this.length]=s,this.length++;else if(i!==this)for(;le.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,s;i>0?(a=this,s=e):(a=e,s=this);for(var l=0,p=0;p>26,this.words[p]=r&67108863;for(;l!==0&&p>26,this.words[p]=r&67108863;if(l===0&&p>>26,x=o&67108863,E=Math.min(t,e.length-1),q=Math.max(0,t-d.length+1);q<=E;q++){var H=t-q|0;a=d.words[H]|0,s=e.words[q]|0,l=a*s+x,h+=l/67108864|0,x=l&67108863}r.words[t]=x|0,o=h|0}return o!==0?r.words[t]=o|0:r.length--,r.strip()}var k=function(e,r,i){var a=e.words,s=r.words,l=i.words,p=0,o,t,h,x=a[0]|0,E=x&8191,q=x>>>13,H=a[1]|0,j=H&8191,Z=H>>>13,ce=a[2]|0,re=ce&8191,he=ce>>>13,Q=a[3]|0,K=Q&8191,oe=Q>>>13,Ne=a[4]|0,ye=Ne&8191,we=Ne>>>13,et=a[5]|0,_e=et&8191,ne=et>>>13,lt=a[6]|0,xe=lt&8191,Ce=lt>>>13,ct=a[7]|0,Ee=ct&8191,X=ct>>>13,G=a[8]|0,V=G&8191,J=G>>>13,me=a[9]|0,$=me&8191,se=me>>>13,Te=s[0]|0,ae=Te&8191,ve=Te>>>13,He=s[1]|0,ue=He&8191,ge=He>>>13,Je=s[2]|0,fe=Je&8191,ke=Je>>>13,tt=s[3]|0,Me=tt&8191,Ie=tt>>>13,dt=s[4]|0,Se=dt&8191,qe=dt>>>13,vt=s[5]|0,Pe=vt&8191,Oe=vt>>>13,mt=s[6]|0,Re=mt&8191,Ue=mt>>>13,O=s[7]|0,U=O&8191,z=O>>>13,I=s[8]|0,D=I&8191,te=I>>>13,be=s[9]|0,ie=be&8191,pe=be>>>13;i.negative=e.negative^r.negative,i.length=19,o=Math.imul(E,ae),t=Math.imul(E,ve),t=t+Math.imul(q,ae)|0,h=Math.imul(q,ve);var Fe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,o=Math.imul(j,ae),t=Math.imul(j,ve),t=t+Math.imul(Z,ae)|0,h=Math.imul(Z,ve),o=o+Math.imul(E,ue)|0,t=t+Math.imul(E,ge)|0,t=t+Math.imul(q,ue)|0,h=h+Math.imul(q,ge)|0;var ze=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ze>>>26)|0,ze&=67108863,o=Math.imul(re,ae),t=Math.imul(re,ve),t=t+Math.imul(he,ae)|0,h=Math.imul(he,ve),o=o+Math.imul(j,ue)|0,t=t+Math.imul(j,ge)|0,t=t+Math.imul(Z,ue)|0,h=h+Math.imul(Z,ge)|0,o=o+Math.imul(E,fe)|0,t=t+Math.imul(E,ke)|0,t=t+Math.imul(q,fe)|0,h=h+Math.imul(q,ke)|0;var ut=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ut>>>26)|0,ut&=67108863,o=Math.imul(K,ae),t=Math.imul(K,ve),t=t+Math.imul(oe,ae)|0,h=Math.imul(oe,ve),o=o+Math.imul(re,ue)|0,t=t+Math.imul(re,ge)|0,t=t+Math.imul(he,ue)|0,h=h+Math.imul(he,ge)|0,o=o+Math.imul(j,fe)|0,t=t+Math.imul(j,ke)|0,t=t+Math.imul(Z,fe)|0,h=h+Math.imul(Z,ke)|0,o=o+Math.imul(E,Me)|0,t=t+Math.imul(E,Ie)|0,t=t+Math.imul(q,Me)|0,h=h+Math.imul(q,Ie)|0;var Ze=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,o=Math.imul(ye,ae),t=Math.imul(ye,ve),t=t+Math.imul(we,ae)|0,h=Math.imul(we,ve),o=o+Math.imul(K,ue)|0,t=t+Math.imul(K,ge)|0,t=t+Math.imul(oe,ue)|0,h=h+Math.imul(oe,ge)|0,o=o+Math.imul(re,fe)|0,t=t+Math.imul(re,ke)|0,t=t+Math.imul(he,fe)|0,h=h+Math.imul(he,ke)|0,o=o+Math.imul(j,Me)|0,t=t+Math.imul(j,Ie)|0,t=t+Math.imul(Z,Me)|0,h=h+Math.imul(Z,Ie)|0,o=o+Math.imul(E,Se)|0,t=t+Math.imul(E,qe)|0,t=t+Math.imul(q,Se)|0,h=h+Math.imul(q,qe)|0;var rt=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(rt>>>26)|0,rt&=67108863,o=Math.imul(_e,ae),t=Math.imul(_e,ve),t=t+Math.imul(ne,ae)|0,h=Math.imul(ne,ve),o=o+Math.imul(ye,ue)|0,t=t+Math.imul(ye,ge)|0,t=t+Math.imul(we,ue)|0,h=h+Math.imul(we,ge)|0,o=o+Math.imul(K,fe)|0,t=t+Math.imul(K,ke)|0,t=t+Math.imul(oe,fe)|0,h=h+Math.imul(oe,ke)|0,o=o+Math.imul(re,Me)|0,t=t+Math.imul(re,Ie)|0,t=t+Math.imul(he,Me)|0,h=h+Math.imul(he,Ie)|0,o=o+Math.imul(j,Se)|0,t=t+Math.imul(j,qe)|0,t=t+Math.imul(Z,Se)|0,h=h+Math.imul(Z,qe)|0,o=o+Math.imul(E,Pe)|0,t=t+Math.imul(E,Oe)|0,t=t+Math.imul(q,Pe)|0,h=h+Math.imul(q,Oe)|0;var it=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(it>>>26)|0,it&=67108863,o=Math.imul(xe,ae),t=Math.imul(xe,ve),t=t+Math.imul(Ce,ae)|0,h=Math.imul(Ce,ve),o=o+Math.imul(_e,ue)|0,t=t+Math.imul(_e,ge)|0,t=t+Math.imul(ne,ue)|0,h=h+Math.imul(ne,ge)|0,o=o+Math.imul(ye,fe)|0,t=t+Math.imul(ye,ke)|0,t=t+Math.imul(we,fe)|0,h=h+Math.imul(we,ke)|0,o=o+Math.imul(K,Me)|0,t=t+Math.imul(K,Ie)|0,t=t+Math.imul(oe,Me)|0,h=h+Math.imul(oe,Ie)|0,o=o+Math.imul(re,Se)|0,t=t+Math.imul(re,qe)|0,t=t+Math.imul(he,Se)|0,h=h+Math.imul(he,qe)|0,o=o+Math.imul(j,Pe)|0,t=t+Math.imul(j,Oe)|0,t=t+Math.imul(Z,Pe)|0,h=h+Math.imul(Z,Oe)|0,o=o+Math.imul(E,Re)|0,t=t+Math.imul(E,Ue)|0,t=t+Math.imul(q,Re)|0,h=h+Math.imul(q,Ue)|0;var ft=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ft>>>26)|0,ft&=67108863,o=Math.imul(Ee,ae),t=Math.imul(Ee,ve),t=t+Math.imul(X,ae)|0,h=Math.imul(X,ve),o=o+Math.imul(xe,ue)|0,t=t+Math.imul(xe,ge)|0,t=t+Math.imul(Ce,ue)|0,h=h+Math.imul(Ce,ge)|0,o=o+Math.imul(_e,fe)|0,t=t+Math.imul(_e,ke)|0,t=t+Math.imul(ne,fe)|0,h=h+Math.imul(ne,ke)|0,o=o+Math.imul(ye,Me)|0,t=t+Math.imul(ye,Ie)|0,t=t+Math.imul(we,Me)|0,h=h+Math.imul(we,Ie)|0,o=o+Math.imul(K,Se)|0,t=t+Math.imul(K,qe)|0,t=t+Math.imul(oe,Se)|0,h=h+Math.imul(oe,qe)|0,o=o+Math.imul(re,Pe)|0,t=t+Math.imul(re,Oe)|0,t=t+Math.imul(he,Pe)|0,h=h+Math.imul(he,Oe)|0,o=o+Math.imul(j,Re)|0,t=t+Math.imul(j,Ue)|0,t=t+Math.imul(Z,Re)|0,h=h+Math.imul(Z,Ue)|0,o=o+Math.imul(E,U)|0,t=t+Math.imul(E,z)|0,t=t+Math.imul(q,U)|0,h=h+Math.imul(q,z)|0;var st=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(st>>>26)|0,st&=67108863,o=Math.imul(V,ae),t=Math.imul(V,ve),t=t+Math.imul(J,ae)|0,h=Math.imul(J,ve),o=o+Math.imul(Ee,ue)|0,t=t+Math.imul(Ee,ge)|0,t=t+Math.imul(X,ue)|0,h=h+Math.imul(X,ge)|0,o=o+Math.imul(xe,fe)|0,t=t+Math.imul(xe,ke)|0,t=t+Math.imul(Ce,fe)|0,h=h+Math.imul(Ce,ke)|0,o=o+Math.imul(_e,Me)|0,t=t+Math.imul(_e,Ie)|0,t=t+Math.imul(ne,Me)|0,h=h+Math.imul(ne,Ie)|0,o=o+Math.imul(ye,Se)|0,t=t+Math.imul(ye,qe)|0,t=t+Math.imul(we,Se)|0,h=h+Math.imul(we,qe)|0,o=o+Math.imul(K,Pe)|0,t=t+Math.imul(K,Oe)|0,t=t+Math.imul(oe,Pe)|0,h=h+Math.imul(oe,Oe)|0,o=o+Math.imul(re,Re)|0,t=t+Math.imul(re,Ue)|0,t=t+Math.imul(he,Re)|0,h=h+Math.imul(he,Ue)|0,o=o+Math.imul(j,U)|0,t=t+Math.imul(j,z)|0,t=t+Math.imul(Z,U)|0,h=h+Math.imul(Z,z)|0,o=o+Math.imul(E,D)|0,t=t+Math.imul(E,te)|0,t=t+Math.imul(q,D)|0,h=h+Math.imul(q,te)|0;var nt=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(nt>>>26)|0,nt&=67108863,o=Math.imul($,ae),t=Math.imul($,ve),t=t+Math.imul(se,ae)|0,h=Math.imul(se,ve),o=o+Math.imul(V,ue)|0,t=t+Math.imul(V,ge)|0,t=t+Math.imul(J,ue)|0,h=h+Math.imul(J,ge)|0,o=o+Math.imul(Ee,fe)|0,t=t+Math.imul(Ee,ke)|0,t=t+Math.imul(X,fe)|0,h=h+Math.imul(X,ke)|0,o=o+Math.imul(xe,Me)|0,t=t+Math.imul(xe,Ie)|0,t=t+Math.imul(Ce,Me)|0,h=h+Math.imul(Ce,Ie)|0,o=o+Math.imul(_e,Se)|0,t=t+Math.imul(_e,qe)|0,t=t+Math.imul(ne,Se)|0,h=h+Math.imul(ne,qe)|0,o=o+Math.imul(ye,Pe)|0,t=t+Math.imul(ye,Oe)|0,t=t+Math.imul(we,Pe)|0,h=h+Math.imul(we,Oe)|0,o=o+Math.imul(K,Re)|0,t=t+Math.imul(K,Ue)|0,t=t+Math.imul(oe,Re)|0,h=h+Math.imul(oe,Ue)|0,o=o+Math.imul(re,U)|0,t=t+Math.imul(re,z)|0,t=t+Math.imul(he,U)|0,h=h+Math.imul(he,z)|0,o=o+Math.imul(j,D)|0,t=t+Math.imul(j,te)|0,t=t+Math.imul(Z,D)|0,h=h+Math.imul(Z,te)|0,o=o+Math.imul(E,ie)|0,t=t+Math.imul(E,pe)|0,t=t+Math.imul(q,ie)|0,h=h+Math.imul(q,pe)|0;var ot=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ot>>>26)|0,ot&=67108863,o=Math.imul($,ue),t=Math.imul($,ge),t=t+Math.imul(se,ue)|0,h=Math.imul(se,ge),o=o+Math.imul(V,fe)|0,t=t+Math.imul(V,ke)|0,t=t+Math.imul(J,fe)|0,h=h+Math.imul(J,ke)|0,o=o+Math.imul(Ee,Me)|0,t=t+Math.imul(Ee,Ie)|0,t=t+Math.imul(X,Me)|0,h=h+Math.imul(X,Ie)|0,o=o+Math.imul(xe,Se)|0,t=t+Math.imul(xe,qe)|0,t=t+Math.imul(Ce,Se)|0,h=h+Math.imul(Ce,qe)|0,o=o+Math.imul(_e,Pe)|0,t=t+Math.imul(_e,Oe)|0,t=t+Math.imul(ne,Pe)|0,h=h+Math.imul(ne,Oe)|0,o=o+Math.imul(ye,Re)|0,t=t+Math.imul(ye,Ue)|0,t=t+Math.imul(we,Re)|0,h=h+Math.imul(we,Ue)|0,o=o+Math.imul(K,U)|0,t=t+Math.imul(K,z)|0,t=t+Math.imul(oe,U)|0,h=h+Math.imul(oe,z)|0,o=o+Math.imul(re,D)|0,t=t+Math.imul(re,te)|0,t=t+Math.imul(he,D)|0,h=h+Math.imul(he,te)|0,o=o+Math.imul(j,ie)|0,t=t+Math.imul(j,pe)|0,t=t+Math.imul(Z,ie)|0,h=h+Math.imul(Z,pe)|0;var at=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(at>>>26)|0,at&=67108863,o=Math.imul($,fe),t=Math.imul($,ke),t=t+Math.imul(se,fe)|0,h=Math.imul(se,ke),o=o+Math.imul(V,Me)|0,t=t+Math.imul(V,Ie)|0,t=t+Math.imul(J,Me)|0,h=h+Math.imul(J,Ie)|0,o=o+Math.imul(Ee,Se)|0,t=t+Math.imul(Ee,qe)|0,t=t+Math.imul(X,Se)|0,h=h+Math.imul(X,qe)|0,o=o+Math.imul(xe,Pe)|0,t=t+Math.imul(xe,Oe)|0,t=t+Math.imul(Ce,Pe)|0,h=h+Math.imul(Ce,Oe)|0,o=o+Math.imul(_e,Re)|0,t=t+Math.imul(_e,Ue)|0,t=t+Math.imul(ne,Re)|0,h=h+Math.imul(ne,Ue)|0,o=o+Math.imul(ye,U)|0,t=t+Math.imul(ye,z)|0,t=t+Math.imul(we,U)|0,h=h+Math.imul(we,z)|0,o=o+Math.imul(K,D)|0,t=t+Math.imul(K,te)|0,t=t+Math.imul(oe,D)|0,h=h+Math.imul(oe,te)|0,o=o+Math.imul(re,ie)|0,t=t+Math.imul(re,pe)|0,t=t+Math.imul(he,ie)|0,h=h+Math.imul(he,pe)|0;var Ge=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,o=Math.imul($,Me),t=Math.imul($,Ie),t=t+Math.imul(se,Me)|0,h=Math.imul(se,Ie),o=o+Math.imul(V,Se)|0,t=t+Math.imul(V,qe)|0,t=t+Math.imul(J,Se)|0,h=h+Math.imul(J,qe)|0,o=o+Math.imul(Ee,Pe)|0,t=t+Math.imul(Ee,Oe)|0,t=t+Math.imul(X,Pe)|0,h=h+Math.imul(X,Oe)|0,o=o+Math.imul(xe,Re)|0,t=t+Math.imul(xe,Ue)|0,t=t+Math.imul(Ce,Re)|0,h=h+Math.imul(Ce,Ue)|0,o=o+Math.imul(_e,U)|0,t=t+Math.imul(_e,z)|0,t=t+Math.imul(ne,U)|0,h=h+Math.imul(ne,z)|0,o=o+Math.imul(ye,D)|0,t=t+Math.imul(ye,te)|0,t=t+Math.imul(we,D)|0,h=h+Math.imul(we,te)|0,o=o+Math.imul(K,ie)|0,t=t+Math.imul(K,pe)|0,t=t+Math.imul(oe,ie)|0,h=h+Math.imul(oe,pe)|0;var Qe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,o=Math.imul($,Se),t=Math.imul($,qe),t=t+Math.imul(se,Se)|0,h=Math.imul(se,qe),o=o+Math.imul(V,Pe)|0,t=t+Math.imul(V,Oe)|0,t=t+Math.imul(J,Pe)|0,h=h+Math.imul(J,Oe)|0,o=o+Math.imul(Ee,Re)|0,t=t+Math.imul(Ee,Ue)|0,t=t+Math.imul(X,Re)|0,h=h+Math.imul(X,Ue)|0,o=o+Math.imul(xe,U)|0,t=t+Math.imul(xe,z)|0,t=t+Math.imul(Ce,U)|0,h=h+Math.imul(Ce,z)|0,o=o+Math.imul(_e,D)|0,t=t+Math.imul(_e,te)|0,t=t+Math.imul(ne,D)|0,h=h+Math.imul(ne,te)|0,o=o+Math.imul(ye,ie)|0,t=t+Math.imul(ye,pe)|0,t=t+Math.imul(we,ie)|0,h=h+Math.imul(we,pe)|0;var Ve=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,o=Math.imul($,Pe),t=Math.imul($,Oe),t=t+Math.imul(se,Pe)|0,h=Math.imul(se,Oe),o=o+Math.imul(V,Re)|0,t=t+Math.imul(V,Ue)|0,t=t+Math.imul(J,Re)|0,h=h+Math.imul(J,Ue)|0,o=o+Math.imul(Ee,U)|0,t=t+Math.imul(Ee,z)|0,t=t+Math.imul(X,U)|0,h=h+Math.imul(X,z)|0,o=o+Math.imul(xe,D)|0,t=t+Math.imul(xe,te)|0,t=t+Math.imul(Ce,D)|0,h=h+Math.imul(Ce,te)|0,o=o+Math.imul(_e,ie)|0,t=t+Math.imul(_e,pe)|0,t=t+Math.imul(ne,ie)|0,h=h+Math.imul(ne,pe)|0;var Ye=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,o=Math.imul($,Re),t=Math.imul($,Ue),t=t+Math.imul(se,Re)|0,h=Math.imul(se,Ue),o=o+Math.imul(V,U)|0,t=t+Math.imul(V,z)|0,t=t+Math.imul(J,U)|0,h=h+Math.imul(J,z)|0,o=o+Math.imul(Ee,D)|0,t=t+Math.imul(Ee,te)|0,t=t+Math.imul(X,D)|0,h=h+Math.imul(X,te)|0,o=o+Math.imul(xe,ie)|0,t=t+Math.imul(xe,pe)|0,t=t+Math.imul(Ce,ie)|0,h=h+Math.imul(Ce,pe)|0;var Xe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,o=Math.imul($,U),t=Math.imul($,z),t=t+Math.imul(se,U)|0,h=Math.imul(se,z),o=o+Math.imul(V,D)|0,t=t+Math.imul(V,te)|0,t=t+Math.imul(J,D)|0,h=h+Math.imul(J,te)|0,o=o+Math.imul(Ee,ie)|0,t=t+Math.imul(Ee,pe)|0,t=t+Math.imul(X,ie)|0,h=h+Math.imul(X,pe)|0;var $e=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+($e>>>26)|0,$e&=67108863,o=Math.imul($,D),t=Math.imul($,te),t=t+Math.imul(se,D)|0,h=Math.imul(se,te),o=o+Math.imul(V,ie)|0,t=t+Math.imul(V,pe)|0,t=t+Math.imul(J,ie)|0,h=h+Math.imul(J,pe)|0;var Be=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Be>>>26)|0,Be&=67108863,o=Math.imul($,ie),t=Math.imul($,pe),t=t+Math.imul(se,ie)|0,h=Math.imul(se,pe);var Ae=(p+o|0)+((t&8191)<<13)|0;return p=(h+(t>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,l[0]=Fe,l[1]=ze,l[2]=ut,l[3]=Ze,l[4]=rt,l[5]=it,l[6]=ft,l[7]=st,l[8]=nt,l[9]=ot,l[10]=at,l[11]=Ge,l[12]=Qe,l[13]=Ve,l[14]=Ye,l[15]=Xe,l[16]=$e,l[17]=Be,l[18]=Ae,p!==0&&(l[19]=p,i.length++),i};Math.imul||(k=A);function R(d,e,r){r.negative=e.negative^d.negative,r.length=d.length+e.length;for(var i=0,a=0,s=0;s>>26)|0,a+=l>>>26,l&=67108863}r.words[s]=p,i=l,l=a}return i!==0?r.words[s]=i:r.length--,r.strip()}function P(d,e,r){var i=new C;return i.mulp(d,e,r)}n.prototype.mulTo=function(e,r){var i,a=this.length+e.length;return this.length===10&&e.length===10?i=k(this,e,r):a<63?i=A(this,e,r):a<1024?i=R(this,e,r):i=P(this,e,r),i};function C(d,e){this.x=d,this.y=e}C.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,a=0;a>=1;return a},C.prototype.permute=function(e,r,i,a,s,l){for(var p=0;p>>1)s++;return 1<>>13,i[2*l+1]=s&8191,s=s>>>13;for(l=2*r;l>=26,r+=a/67108864|0,r+=s>>>26,this.words[i]=s&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=B(e);if(r.length===0)return new n(1);for(var i=this,a=0;a=0);var r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r,s;if(r!==0){var l=0;for(s=0;s>>26-r}l&&(this.words[s]=l,this.length++)}if(i!==0){for(s=this.length-1;s>=0;s--)this.words[s+i]=this.words[s];for(s=0;s=0);var a;r?a=(r-r%26)/26:a=0;var s=e%26,l=Math.min((e-s)/26,this.length),p=67108863^67108863>>>s<l)for(this.length-=l,t=0;t=0&&(h!==0||t>=a);t--){var x=this.words[t]|0;this.words[t]=h<<26-s|x>>>s,h=x&p}return o&&h!==0&&(o.words[o.length++]=h),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return c(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){c(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,a=1<=0);var r=e%26,i=(e-r)/26;if(c(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(c(typeof e=="number"),c(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(o/67108864|0),this.words[s+i]=l&67108863}for(;s>26,this.words[s+i]=l&67108863;if(p===0)return this.strip();for(c(p===-1),p=0,s=0;s>26,this.words[s]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,a=this.clone(),s=e,l=s.words[s.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(s=s.ushln(i),a.iushln(i),l=s.words[s.length-1]|0);var o=a.length-s.length,t;if(r!=="mod"){t=new n(null),t.length=o+1,t.words=new Array(t.length);for(var h=0;h=0;E--){var q=(a.words[s.length+E]|0)*67108864+(a.words[s.length+E-1]|0);for(q=Math.min(q/l|0,67108863),a._ishlnsubmul(s,q,E);a.negative!==0;)q--,a.negative=0,a._ishlnsubmul(s,1,E),a.isZero()||(a.negative^=1);t&&(t.words[E]=q)}return t&&t.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:t||null,mod:a}},n.prototype.divmod=function(e,r,i){if(c(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var a,s,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(a=l.div.neg()),r!=="div"&&(s=l.mod.neg(),i&&s.negative!==0&&s.iadd(e)),{div:a,mod:s}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(a=l.div.neg()),{div:a,mod:l.mod}):this.negative&e.negative?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(s=l.mod.neg(),i&&s.negative!==0&&s.isub(e)),{div:l.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,a=e.ushrn(1),s=e.andln(1),l=i.cmp(a);return l<0||s===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){c(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%e;return i},n.prototype.idivn=function(e){c(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/e|0,r=a%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){c(e.negative===0),c(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var a=new n(1),s=new n(0),l=new n(0),p=new n(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var t=i.clone(),h=r.clone();!r.isZero();){for(var x=0,E=1;!(r.words[0]&E)&&x<26;++x,E<<=1);if(x>0)for(r.iushrn(x);x-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(t),s.isub(h)),a.iushrn(1),s.iushrn(1);for(var q=0,H=1;!(i.words[0]&H)&&q<26;++q,H<<=1);if(q>0)for(i.iushrn(q);q-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(h)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(l),s.isub(p)):(i.isub(r),l.isub(a),p.isub(s))}return{a:l,b:p,gcd:i.iushln(o)}},n.prototype._invmp=function(e){c(e.negative===0),c(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var a=new n(1),s=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,o=1;!(r.words[0]&o)&&p<26;++p,o<<=1);if(p>0)for(r.iushrn(p);p-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var t=0,h=1;!(i.words[0]&h)&&t<26;++t,h<<=1);if(t>0)for(i.iushrn(t);t-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(s)):(i.isub(r),s.isub(a))}var x;return r.cmpn(1)===0?x=a:x=s,x.cmpn(0)<0&&x.iadd(e),x},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var s=r.cmp(i);if(s<0){var l=r;r=i,i=l}else if(s===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){c(typeof e=="number");var r=e%26,i=(e-r)/26,a=1<>>26,p&=67108863,this.words[l]=p}return s!==0&&(this.words[l]=s,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),c(e<=67108863,"Number is too big");var a=this.words[0]|0;i=a===e?0:ae.length)return 1;if(this.length=0;i--){var a=this.words[i]|0,s=e.words[i]|0;if(a!==s){as&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new F(e)},n.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var N={k256:null,p224:null,p192:null,p25519:null};function T(d,e){this.name=d,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},T.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},T.prototype.split=function(e,r){e.iushrn(this.n,0,r)},T.prototype.imulK=function(e){return e.imul(this.k)};function L(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}S(L,T),L.prototype.split=function(e,r){for(var i=4194303,a=Math.min(e.length,9),s=0;s>>22,l=p}l>>>=22,e.words[s-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[i]=s,r=a}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(N[e])return N[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new W;else if(e==="p192")r=new ee;else if(e==="p25519")r=new Y;else throw new Error("Unknown prime "+e);return N[e]=r,r};function F(d){if(typeof d=="string"){var e=n._prime(d);this.m=e.p,this.prime=e}else c(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}F.prototype._verify1=function(e){c(e.negative===0,"red works only with positives"),c(e.red,"red works only with red numbers")},F.prototype._verify2=function(e,r){c((e.negative|r.negative)===0,"red works only with positives"),c(e.red&&e.red===r.red,"red works only with red numbers")},F.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},F.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},F.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},F.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},F.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},F.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},F.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},F.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},F.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},F.prototype.isqr=function(e){return this.imul(e,e.clone())},F.prototype.sqr=function(e){return this.mul(e,e)},F.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(c(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&a.andln(1)===0;)s++,a.iushrn(1);c(!a.isZero());var l=new n(1).toRed(this),p=l.redNeg(),o=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,o).cmp(p)!==0;)t.redIAdd(p);for(var h=this.pow(t,a),x=this.pow(e,a.addn(1).iushrn(1)),E=this.pow(e,a),q=s;E.cmp(l)!==0;){for(var H=E,j=0;H.cmp(l)!==0;j++)H=H.redSqr();c(j=0;s--){for(var h=r.words[s],x=t-1;x>=0;x--){var E=h>>x&1;if(l!==a[0]&&(l=this.sqr(l)),E===0&&p===0){o=0;continue}p<<=1,p|=E,o++,!(o!==i&&(s!==0||x!==0))&&(l=this.mul(l,a[p]),o=0,p=0)}t=26}return l},F.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},F.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new de(e)};function de(d){F.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S(de,F),de.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},de.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},de.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(a).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},de.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(a).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},de.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(f,ht)}(Tv)),mn}var gs,Pu;function Ov(){if(Pu)return gs;Pu=1;var f=sf(),u=qv();gs=function(m){return new c(m)};var w={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};w.p224=w.secp224r1,w.p256=w.secp256r1=w.prime256v1,w.p192=w.secp192r1=w.prime192v1,w.p384=w.secp384r1,w.p521=w.secp521r1;function c(n){this.curveType=w[n],this.curveType||(this.curveType={name:n}),this.curve=new f.ec(this.curveType.name),this.keys=void 0}c.prototype.generateKeys=function(n,m){return this.keys=this.curve.genKeyPair(),this.getPublicKey(n,m)},c.prototype.computeSecret=function(n,m,y){m=m||"utf8",Le.Buffer.isBuffer(n)||(n=new Le.Buffer(n,m));var g=this.curve.keyFromPublic(n).getPublic(),b=g.mul(this.keys.getPrivate()).getX();return S(b,y,this.curveType.byteLength)},c.prototype.getPublicKey=function(n,m){var y=this.keys.getPublic(m==="compressed",!0);return m==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),S(y,n)},c.prototype.getPrivateKey=function(n){return S(this.keys.getPrivate(),n)},c.prototype.setPublicKey=function(n,m){return m=m||"utf8",Le.Buffer.isBuffer(n)||(n=new Le.Buffer(n,m)),this.keys._importPublic(n),this},c.prototype.setPrivateKey=function(n,m){m=m||"utf8",Le.Buffer.isBuffer(n)||(n=new Le.Buffer(n,m));var y=new u(n);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function S(n,m,y){Array.isArray(n)||(n=n.toArray());var g=new Le.Buffer(n);if(y&&g.length0?e:r},n.min=function(e,r){return e.cmp(r)<0?e:r},n.prototype._init=function(e,r,i){if(typeof e=="number")return this._initNumber(e,r,i);if(typeof e=="object")return this._initArray(e,r,i);r==="hex"&&(r=16),c(r===(r|0)&&r>=2&&r<=36),e=e.toString().replace(/\s+/g,"");var a=0;e[0]==="-"&&(a++,this.negative=1),a=0;a-=3)l=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[s]|=l<>>26-p&67108863,p+=24,p>=26&&(p-=26,s++);else if(i==="le")for(a=0,s=0;a>>26-p&67108863,p+=24,p>=26&&(p-=26,s++);return this.strip()};function y(d,e){var r=d.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function g(d,e,r){var i=y(d,r);return r-1>=e&&(i|=y(d,r-1)<<4),i}n.prototype._parseHex=function(e,r,i){this.length=Math.ceil((e.length-r)/6),this.words=new Array(this.length);for(var a=0;a=r;a-=2)p=g(e,r,a)<=18?(s-=18,l+=1,this.words[l]|=p>>>26):s+=8;else{var o=e.length-r;for(a=o%2===0?r+1:r;a=18?(s-=18,l+=1,this.words[l]|=p>>>26):s+=8}this.strip()};function b(d,e,r,i){for(var a=0,s=Math.min(d.length,r),l=e;l=49?a+=p-49+10:p>=17?a+=p-17+10:a+=p}return a}n.prototype._parseBase=function(e,r,i){this.words=[0],this.length=1;for(var a=0,s=1;s<=67108863;s*=r)a++;a--,s=s/r|0;for(var l=e.length-i,p=l%a,o=Math.min(l,l-p)+i,t=0,h=i;h1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var v=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(e,r){e=e||10,r=r|0||1;var i;if(e===16||e==="hex"){i="";for(var a=0,s=0,l=0;l>>24-a&16777215,s!==0||l!==this.length-1?i=v[6-o.length]+o+i:i=o+i,a+=2,a>=26&&(a-=26,l--)}for(s!==0&&(i=s.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(e===(e|0)&&e>=2&&e<=36){var t=_[e],h=M[e];i="";var x=this.clone();for(x.negative=0;!x.isZero();){var E=x.modn(h).toString(e);x=x.idivn(h),x.isZero()?i=E+i:i=v[t-E.length]+E+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}c(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return this.length===2?e+=this.words[1]*67108864:this.length===3&&this.words[2]===1?e+=4503599627370496+this.words[1]*67108864:this.length>2&&c(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,r){return c(typeof m<"u"),this.toArrayLike(m,e,r)},n.prototype.toArray=function(e,r){return this.toArrayLike(Array,e,r)},n.prototype.toArrayLike=function(e,r,i){var a=this.byteLength(),s=i||Math.max(1,a);c(a<=s,"byte array longer than desired length"),c(s>0,"Requested array length <= 0"),this.strip();var l=r==="le",p=new e(s),o,t,h=this.clone();if(l){for(t=0;!h.isZero();t++)o=h.andln(255),h.iushrn(8),p[t]=o;for(;t=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(e){if(e===0)return 26;var r=e,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],r=this._countBits(e);return(this.length-1)*26+r};function B(d){for(var e=new Array(d.bitLength()),r=0;r>>a}return e}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,r=0;re.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var r;this.length>e.length?r=e:r=this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var r,i;this.length>e.length?(r=this,i=e):(r=e,i=this);for(var a=0;ae.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){c(typeof e=="number"&&e>=0);var r=Math.ceil(e/26)|0,i=e%26;this._expand(r),i>0&&r--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,r){c(typeof e=="number"&&e>=0);var i=e/26|0,a=e%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<e.length?(i=this,a=e):(i=e,a=this);for(var s=0,l=0;l>>26;for(;s!==0&&l>>26;if(this.length=i.length,s!==0)this.words[this.length]=s,this.length++;else if(i!==this)for(;le.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(e.negative!==0){e.negative=0;var r=this.iadd(e);return e.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,s;i>0?(a=this,s=e):(a=e,s=this);for(var l=0,p=0;p>26,this.words[p]=r&67108863;for(;l!==0&&p>26,this.words[p]=r&67108863;if(l===0&&p>>26,x=o&67108863,E=Math.min(t,e.length-1),q=Math.max(0,t-d.length+1);q<=E;q++){var H=t-q|0;a=d.words[H]|0,s=e.words[q]|0,l=a*s+x,h+=l/67108864|0,x=l&67108863}r.words[t]=x|0,o=h|0}return o!==0?r.words[t]=o|0:r.length--,r.strip()}var k=function(e,r,i){var a=e.words,s=r.words,l=i.words,p=0,o,t,h,x=a[0]|0,E=x&8191,q=x>>>13,H=a[1]|0,j=H&8191,Z=H>>>13,ce=a[2]|0,re=ce&8191,he=ce>>>13,Q=a[3]|0,K=Q&8191,oe=Q>>>13,Ne=a[4]|0,ye=Ne&8191,we=Ne>>>13,et=a[5]|0,_e=et&8191,ne=et>>>13,lt=a[6]|0,xe=lt&8191,Ce=lt>>>13,ct=a[7]|0,Ee=ct&8191,X=ct>>>13,G=a[8]|0,V=G&8191,J=G>>>13,me=a[9]|0,$=me&8191,se=me>>>13,Te=s[0]|0,ae=Te&8191,ve=Te>>>13,He=s[1]|0,ue=He&8191,ge=He>>>13,Je=s[2]|0,fe=Je&8191,ke=Je>>>13,tt=s[3]|0,Me=tt&8191,Ie=tt>>>13,dt=s[4]|0,Se=dt&8191,qe=dt>>>13,vt=s[5]|0,Pe=vt&8191,Oe=vt>>>13,mt=s[6]|0,Re=mt&8191,Ue=mt>>>13,O=s[7]|0,U=O&8191,z=O>>>13,I=s[8]|0,D=I&8191,te=I>>>13,be=s[9]|0,ie=be&8191,pe=be>>>13;i.negative=e.negative^r.negative,i.length=19,o=Math.imul(E,ae),t=Math.imul(E,ve),t=t+Math.imul(q,ae)|0,h=Math.imul(q,ve);var Fe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,o=Math.imul(j,ae),t=Math.imul(j,ve),t=t+Math.imul(Z,ae)|0,h=Math.imul(Z,ve),o=o+Math.imul(E,ue)|0,t=t+Math.imul(E,ge)|0,t=t+Math.imul(q,ue)|0,h=h+Math.imul(q,ge)|0;var ze=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ze>>>26)|0,ze&=67108863,o=Math.imul(re,ae),t=Math.imul(re,ve),t=t+Math.imul(he,ae)|0,h=Math.imul(he,ve),o=o+Math.imul(j,ue)|0,t=t+Math.imul(j,ge)|0,t=t+Math.imul(Z,ue)|0,h=h+Math.imul(Z,ge)|0,o=o+Math.imul(E,fe)|0,t=t+Math.imul(E,ke)|0,t=t+Math.imul(q,fe)|0,h=h+Math.imul(q,ke)|0;var ut=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ut>>>26)|0,ut&=67108863,o=Math.imul(K,ae),t=Math.imul(K,ve),t=t+Math.imul(oe,ae)|0,h=Math.imul(oe,ve),o=o+Math.imul(re,ue)|0,t=t+Math.imul(re,ge)|0,t=t+Math.imul(he,ue)|0,h=h+Math.imul(he,ge)|0,o=o+Math.imul(j,fe)|0,t=t+Math.imul(j,ke)|0,t=t+Math.imul(Z,fe)|0,h=h+Math.imul(Z,ke)|0,o=o+Math.imul(E,Me)|0,t=t+Math.imul(E,Ie)|0,t=t+Math.imul(q,Me)|0,h=h+Math.imul(q,Ie)|0;var Ze=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,o=Math.imul(ye,ae),t=Math.imul(ye,ve),t=t+Math.imul(we,ae)|0,h=Math.imul(we,ve),o=o+Math.imul(K,ue)|0,t=t+Math.imul(K,ge)|0,t=t+Math.imul(oe,ue)|0,h=h+Math.imul(oe,ge)|0,o=o+Math.imul(re,fe)|0,t=t+Math.imul(re,ke)|0,t=t+Math.imul(he,fe)|0,h=h+Math.imul(he,ke)|0,o=o+Math.imul(j,Me)|0,t=t+Math.imul(j,Ie)|0,t=t+Math.imul(Z,Me)|0,h=h+Math.imul(Z,Ie)|0,o=o+Math.imul(E,Se)|0,t=t+Math.imul(E,qe)|0,t=t+Math.imul(q,Se)|0,h=h+Math.imul(q,qe)|0;var rt=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(rt>>>26)|0,rt&=67108863,o=Math.imul(_e,ae),t=Math.imul(_e,ve),t=t+Math.imul(ne,ae)|0,h=Math.imul(ne,ve),o=o+Math.imul(ye,ue)|0,t=t+Math.imul(ye,ge)|0,t=t+Math.imul(we,ue)|0,h=h+Math.imul(we,ge)|0,o=o+Math.imul(K,fe)|0,t=t+Math.imul(K,ke)|0,t=t+Math.imul(oe,fe)|0,h=h+Math.imul(oe,ke)|0,o=o+Math.imul(re,Me)|0,t=t+Math.imul(re,Ie)|0,t=t+Math.imul(he,Me)|0,h=h+Math.imul(he,Ie)|0,o=o+Math.imul(j,Se)|0,t=t+Math.imul(j,qe)|0,t=t+Math.imul(Z,Se)|0,h=h+Math.imul(Z,qe)|0,o=o+Math.imul(E,Pe)|0,t=t+Math.imul(E,Oe)|0,t=t+Math.imul(q,Pe)|0,h=h+Math.imul(q,Oe)|0;var it=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(it>>>26)|0,it&=67108863,o=Math.imul(xe,ae),t=Math.imul(xe,ve),t=t+Math.imul(Ce,ae)|0,h=Math.imul(Ce,ve),o=o+Math.imul(_e,ue)|0,t=t+Math.imul(_e,ge)|0,t=t+Math.imul(ne,ue)|0,h=h+Math.imul(ne,ge)|0,o=o+Math.imul(ye,fe)|0,t=t+Math.imul(ye,ke)|0,t=t+Math.imul(we,fe)|0,h=h+Math.imul(we,ke)|0,o=o+Math.imul(K,Me)|0,t=t+Math.imul(K,Ie)|0,t=t+Math.imul(oe,Me)|0,h=h+Math.imul(oe,Ie)|0,o=o+Math.imul(re,Se)|0,t=t+Math.imul(re,qe)|0,t=t+Math.imul(he,Se)|0,h=h+Math.imul(he,qe)|0,o=o+Math.imul(j,Pe)|0,t=t+Math.imul(j,Oe)|0,t=t+Math.imul(Z,Pe)|0,h=h+Math.imul(Z,Oe)|0,o=o+Math.imul(E,Re)|0,t=t+Math.imul(E,Ue)|0,t=t+Math.imul(q,Re)|0,h=h+Math.imul(q,Ue)|0;var ft=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ft>>>26)|0,ft&=67108863,o=Math.imul(Ee,ae),t=Math.imul(Ee,ve),t=t+Math.imul(X,ae)|0,h=Math.imul(X,ve),o=o+Math.imul(xe,ue)|0,t=t+Math.imul(xe,ge)|0,t=t+Math.imul(Ce,ue)|0,h=h+Math.imul(Ce,ge)|0,o=o+Math.imul(_e,fe)|0,t=t+Math.imul(_e,ke)|0,t=t+Math.imul(ne,fe)|0,h=h+Math.imul(ne,ke)|0,o=o+Math.imul(ye,Me)|0,t=t+Math.imul(ye,Ie)|0,t=t+Math.imul(we,Me)|0,h=h+Math.imul(we,Ie)|0,o=o+Math.imul(K,Se)|0,t=t+Math.imul(K,qe)|0,t=t+Math.imul(oe,Se)|0,h=h+Math.imul(oe,qe)|0,o=o+Math.imul(re,Pe)|0,t=t+Math.imul(re,Oe)|0,t=t+Math.imul(he,Pe)|0,h=h+Math.imul(he,Oe)|0,o=o+Math.imul(j,Re)|0,t=t+Math.imul(j,Ue)|0,t=t+Math.imul(Z,Re)|0,h=h+Math.imul(Z,Ue)|0,o=o+Math.imul(E,U)|0,t=t+Math.imul(E,z)|0,t=t+Math.imul(q,U)|0,h=h+Math.imul(q,z)|0;var st=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(st>>>26)|0,st&=67108863,o=Math.imul(V,ae),t=Math.imul(V,ve),t=t+Math.imul(J,ae)|0,h=Math.imul(J,ve),o=o+Math.imul(Ee,ue)|0,t=t+Math.imul(Ee,ge)|0,t=t+Math.imul(X,ue)|0,h=h+Math.imul(X,ge)|0,o=o+Math.imul(xe,fe)|0,t=t+Math.imul(xe,ke)|0,t=t+Math.imul(Ce,fe)|0,h=h+Math.imul(Ce,ke)|0,o=o+Math.imul(_e,Me)|0,t=t+Math.imul(_e,Ie)|0,t=t+Math.imul(ne,Me)|0,h=h+Math.imul(ne,Ie)|0,o=o+Math.imul(ye,Se)|0,t=t+Math.imul(ye,qe)|0,t=t+Math.imul(we,Se)|0,h=h+Math.imul(we,qe)|0,o=o+Math.imul(K,Pe)|0,t=t+Math.imul(K,Oe)|0,t=t+Math.imul(oe,Pe)|0,h=h+Math.imul(oe,Oe)|0,o=o+Math.imul(re,Re)|0,t=t+Math.imul(re,Ue)|0,t=t+Math.imul(he,Re)|0,h=h+Math.imul(he,Ue)|0,o=o+Math.imul(j,U)|0,t=t+Math.imul(j,z)|0,t=t+Math.imul(Z,U)|0,h=h+Math.imul(Z,z)|0,o=o+Math.imul(E,D)|0,t=t+Math.imul(E,te)|0,t=t+Math.imul(q,D)|0,h=h+Math.imul(q,te)|0;var nt=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(nt>>>26)|0,nt&=67108863,o=Math.imul($,ae),t=Math.imul($,ve),t=t+Math.imul(se,ae)|0,h=Math.imul(se,ve),o=o+Math.imul(V,ue)|0,t=t+Math.imul(V,ge)|0,t=t+Math.imul(J,ue)|0,h=h+Math.imul(J,ge)|0,o=o+Math.imul(Ee,fe)|0,t=t+Math.imul(Ee,ke)|0,t=t+Math.imul(X,fe)|0,h=h+Math.imul(X,ke)|0,o=o+Math.imul(xe,Me)|0,t=t+Math.imul(xe,Ie)|0,t=t+Math.imul(Ce,Me)|0,h=h+Math.imul(Ce,Ie)|0,o=o+Math.imul(_e,Se)|0,t=t+Math.imul(_e,qe)|0,t=t+Math.imul(ne,Se)|0,h=h+Math.imul(ne,qe)|0,o=o+Math.imul(ye,Pe)|0,t=t+Math.imul(ye,Oe)|0,t=t+Math.imul(we,Pe)|0,h=h+Math.imul(we,Oe)|0,o=o+Math.imul(K,Re)|0,t=t+Math.imul(K,Ue)|0,t=t+Math.imul(oe,Re)|0,h=h+Math.imul(oe,Ue)|0,o=o+Math.imul(re,U)|0,t=t+Math.imul(re,z)|0,t=t+Math.imul(he,U)|0,h=h+Math.imul(he,z)|0,o=o+Math.imul(j,D)|0,t=t+Math.imul(j,te)|0,t=t+Math.imul(Z,D)|0,h=h+Math.imul(Z,te)|0,o=o+Math.imul(E,ie)|0,t=t+Math.imul(E,pe)|0,t=t+Math.imul(q,ie)|0,h=h+Math.imul(q,pe)|0;var ot=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(ot>>>26)|0,ot&=67108863,o=Math.imul($,ue),t=Math.imul($,ge),t=t+Math.imul(se,ue)|0,h=Math.imul(se,ge),o=o+Math.imul(V,fe)|0,t=t+Math.imul(V,ke)|0,t=t+Math.imul(J,fe)|0,h=h+Math.imul(J,ke)|0,o=o+Math.imul(Ee,Me)|0,t=t+Math.imul(Ee,Ie)|0,t=t+Math.imul(X,Me)|0,h=h+Math.imul(X,Ie)|0,o=o+Math.imul(xe,Se)|0,t=t+Math.imul(xe,qe)|0,t=t+Math.imul(Ce,Se)|0,h=h+Math.imul(Ce,qe)|0,o=o+Math.imul(_e,Pe)|0,t=t+Math.imul(_e,Oe)|0,t=t+Math.imul(ne,Pe)|0,h=h+Math.imul(ne,Oe)|0,o=o+Math.imul(ye,Re)|0,t=t+Math.imul(ye,Ue)|0,t=t+Math.imul(we,Re)|0,h=h+Math.imul(we,Ue)|0,o=o+Math.imul(K,U)|0,t=t+Math.imul(K,z)|0,t=t+Math.imul(oe,U)|0,h=h+Math.imul(oe,z)|0,o=o+Math.imul(re,D)|0,t=t+Math.imul(re,te)|0,t=t+Math.imul(he,D)|0,h=h+Math.imul(he,te)|0,o=o+Math.imul(j,ie)|0,t=t+Math.imul(j,pe)|0,t=t+Math.imul(Z,ie)|0,h=h+Math.imul(Z,pe)|0;var at=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(at>>>26)|0,at&=67108863,o=Math.imul($,fe),t=Math.imul($,ke),t=t+Math.imul(se,fe)|0,h=Math.imul(se,ke),o=o+Math.imul(V,Me)|0,t=t+Math.imul(V,Ie)|0,t=t+Math.imul(J,Me)|0,h=h+Math.imul(J,Ie)|0,o=o+Math.imul(Ee,Se)|0,t=t+Math.imul(Ee,qe)|0,t=t+Math.imul(X,Se)|0,h=h+Math.imul(X,qe)|0,o=o+Math.imul(xe,Pe)|0,t=t+Math.imul(xe,Oe)|0,t=t+Math.imul(Ce,Pe)|0,h=h+Math.imul(Ce,Oe)|0,o=o+Math.imul(_e,Re)|0,t=t+Math.imul(_e,Ue)|0,t=t+Math.imul(ne,Re)|0,h=h+Math.imul(ne,Ue)|0,o=o+Math.imul(ye,U)|0,t=t+Math.imul(ye,z)|0,t=t+Math.imul(we,U)|0,h=h+Math.imul(we,z)|0,o=o+Math.imul(K,D)|0,t=t+Math.imul(K,te)|0,t=t+Math.imul(oe,D)|0,h=h+Math.imul(oe,te)|0,o=o+Math.imul(re,ie)|0,t=t+Math.imul(re,pe)|0,t=t+Math.imul(he,ie)|0,h=h+Math.imul(he,pe)|0;var Ge=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,o=Math.imul($,Me),t=Math.imul($,Ie),t=t+Math.imul(se,Me)|0,h=Math.imul(se,Ie),o=o+Math.imul(V,Se)|0,t=t+Math.imul(V,qe)|0,t=t+Math.imul(J,Se)|0,h=h+Math.imul(J,qe)|0,o=o+Math.imul(Ee,Pe)|0,t=t+Math.imul(Ee,Oe)|0,t=t+Math.imul(X,Pe)|0,h=h+Math.imul(X,Oe)|0,o=o+Math.imul(xe,Re)|0,t=t+Math.imul(xe,Ue)|0,t=t+Math.imul(Ce,Re)|0,h=h+Math.imul(Ce,Ue)|0,o=o+Math.imul(_e,U)|0,t=t+Math.imul(_e,z)|0,t=t+Math.imul(ne,U)|0,h=h+Math.imul(ne,z)|0,o=o+Math.imul(ye,D)|0,t=t+Math.imul(ye,te)|0,t=t+Math.imul(we,D)|0,h=h+Math.imul(we,te)|0,o=o+Math.imul(K,ie)|0,t=t+Math.imul(K,pe)|0,t=t+Math.imul(oe,ie)|0,h=h+Math.imul(oe,pe)|0;var Qe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,o=Math.imul($,Se),t=Math.imul($,qe),t=t+Math.imul(se,Se)|0,h=Math.imul(se,qe),o=o+Math.imul(V,Pe)|0,t=t+Math.imul(V,Oe)|0,t=t+Math.imul(J,Pe)|0,h=h+Math.imul(J,Oe)|0,o=o+Math.imul(Ee,Re)|0,t=t+Math.imul(Ee,Ue)|0,t=t+Math.imul(X,Re)|0,h=h+Math.imul(X,Ue)|0,o=o+Math.imul(xe,U)|0,t=t+Math.imul(xe,z)|0,t=t+Math.imul(Ce,U)|0,h=h+Math.imul(Ce,z)|0,o=o+Math.imul(_e,D)|0,t=t+Math.imul(_e,te)|0,t=t+Math.imul(ne,D)|0,h=h+Math.imul(ne,te)|0,o=o+Math.imul(ye,ie)|0,t=t+Math.imul(ye,pe)|0,t=t+Math.imul(we,ie)|0,h=h+Math.imul(we,pe)|0;var Ve=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,o=Math.imul($,Pe),t=Math.imul($,Oe),t=t+Math.imul(se,Pe)|0,h=Math.imul(se,Oe),o=o+Math.imul(V,Re)|0,t=t+Math.imul(V,Ue)|0,t=t+Math.imul(J,Re)|0,h=h+Math.imul(J,Ue)|0,o=o+Math.imul(Ee,U)|0,t=t+Math.imul(Ee,z)|0,t=t+Math.imul(X,U)|0,h=h+Math.imul(X,z)|0,o=o+Math.imul(xe,D)|0,t=t+Math.imul(xe,te)|0,t=t+Math.imul(Ce,D)|0,h=h+Math.imul(Ce,te)|0,o=o+Math.imul(_e,ie)|0,t=t+Math.imul(_e,pe)|0,t=t+Math.imul(ne,ie)|0,h=h+Math.imul(ne,pe)|0;var Ye=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,o=Math.imul($,Re),t=Math.imul($,Ue),t=t+Math.imul(se,Re)|0,h=Math.imul(se,Ue),o=o+Math.imul(V,U)|0,t=t+Math.imul(V,z)|0,t=t+Math.imul(J,U)|0,h=h+Math.imul(J,z)|0,o=o+Math.imul(Ee,D)|0,t=t+Math.imul(Ee,te)|0,t=t+Math.imul(X,D)|0,h=h+Math.imul(X,te)|0,o=o+Math.imul(xe,ie)|0,t=t+Math.imul(xe,pe)|0,t=t+Math.imul(Ce,ie)|0,h=h+Math.imul(Ce,pe)|0;var Xe=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,o=Math.imul($,U),t=Math.imul($,z),t=t+Math.imul(se,U)|0,h=Math.imul(se,z),o=o+Math.imul(V,D)|0,t=t+Math.imul(V,te)|0,t=t+Math.imul(J,D)|0,h=h+Math.imul(J,te)|0,o=o+Math.imul(Ee,ie)|0,t=t+Math.imul(Ee,pe)|0,t=t+Math.imul(X,ie)|0,h=h+Math.imul(X,pe)|0;var $e=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+($e>>>26)|0,$e&=67108863,o=Math.imul($,D),t=Math.imul($,te),t=t+Math.imul(se,D)|0,h=Math.imul(se,te),o=o+Math.imul(V,ie)|0,t=t+Math.imul(V,pe)|0,t=t+Math.imul(J,ie)|0,h=h+Math.imul(J,pe)|0;var Be=(p+o|0)+((t&8191)<<13)|0;p=(h+(t>>>13)|0)+(Be>>>26)|0,Be&=67108863,o=Math.imul($,ie),t=Math.imul($,pe),t=t+Math.imul(se,ie)|0,h=Math.imul(se,pe);var Ae=(p+o|0)+((t&8191)<<13)|0;return p=(h+(t>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,l[0]=Fe,l[1]=ze,l[2]=ut,l[3]=Ze,l[4]=rt,l[5]=it,l[6]=ft,l[7]=st,l[8]=nt,l[9]=ot,l[10]=at,l[11]=Ge,l[12]=Qe,l[13]=Ve,l[14]=Ye,l[15]=Xe,l[16]=$e,l[17]=Be,l[18]=Ae,p!==0&&(l[19]=p,i.length++),i};Math.imul||(k=A);function R(d,e,r){r.negative=e.negative^d.negative,r.length=d.length+e.length;for(var i=0,a=0,s=0;s>>26)|0,a+=l>>>26,l&=67108863}r.words[s]=p,i=l,l=a}return i!==0?r.words[s]=i:r.length--,r.strip()}function P(d,e,r){var i=new C;return i.mulp(d,e,r)}n.prototype.mulTo=function(e,r){var i,a=this.length+e.length;return this.length===10&&e.length===10?i=k(this,e,r):a<63?i=A(this,e,r):a<1024?i=R(this,e,r):i=P(this,e,r),i};function C(d,e){this.x=d,this.y=e}C.prototype.makeRBT=function(e){for(var r=new Array(e),i=n.prototype._countBits(e)-1,a=0;a>=1;return a},C.prototype.permute=function(e,r,i,a,s,l){for(var p=0;p>>1)s++;return 1<>>13,i[2*l+1]=s&8191,s=s>>>13;for(l=2*r;l>=26,r+=a/67108864|0,r+=s>>>26,this.words[i]=s&67108863}return r!==0&&(this.words[i]=r,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var r=B(e);if(r.length===0)return new n(1);for(var i=this,a=0;a=0);var r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r,s;if(r!==0){var l=0;for(s=0;s>>26-r}l&&(this.words[s]=l,this.length++)}if(i!==0){for(s=this.length-1;s>=0;s--)this.words[s+i]=this.words[s];for(s=0;s=0);var a;r?a=(r-r%26)/26:a=0;var s=e%26,l=Math.min((e-s)/26,this.length),p=67108863^67108863>>>s<l)for(this.length-=l,t=0;t=0&&(h!==0||t>=a);t--){var x=this.words[t]|0;this.words[t]=h<<26-s|x>>>s,h=x&p}return o&&h!==0&&(o.words[o.length++]=h),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,r,i){return c(this.negative===0),this.iushrn(e,r,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){c(typeof e=="number"&&e>=0);var r=e%26,i=(e-r)/26,a=1<=0);var r=e%26,i=(e-r)/26;if(c(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(e){if(c(typeof e=="number"),c(e<67108864),e<0)return this.iaddn(-e);if(this.negative!==0)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(o/67108864|0),this.words[s+i]=l&67108863}for(;s>26,this.words[s+i]=l&67108863;if(p===0)return this.strip();for(c(p===-1),p=0,s=0;s>26,this.words[s]=l&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,r){var i=this.length-e.length,a=this.clone(),s=e,l=s.words[s.length-1]|0,p=this._countBits(l);i=26-p,i!==0&&(s=s.ushln(i),a.iushln(i),l=s.words[s.length-1]|0);var o=a.length-s.length,t;if(r!=="mod"){t=new n(null),t.length=o+1,t.words=new Array(t.length);for(var h=0;h=0;E--){var q=(a.words[s.length+E]|0)*67108864+(a.words[s.length+E-1]|0);for(q=Math.min(q/l|0,67108863),a._ishlnsubmul(s,q,E);a.negative!==0;)q--,a.negative=0,a._ishlnsubmul(s,1,E),a.isZero()||(a.negative^=1);t&&(t.words[E]=q)}return t&&t.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:t||null,mod:a}},n.prototype.divmod=function(e,r,i){if(c(!e.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var a,s,l;return this.negative!==0&&e.negative===0?(l=this.neg().divmod(e,r),r!=="mod"&&(a=l.div.neg()),r!=="div"&&(s=l.mod.neg(),i&&s.negative!==0&&s.iadd(e)),{div:a,mod:s}):this.negative===0&&e.negative!==0?(l=this.divmod(e.neg(),r),r!=="mod"&&(a=l.div.neg()),{div:a,mod:l.mod}):this.negative&e.negative?(l=this.neg().divmod(e.neg(),r),r!=="div"&&(s=l.mod.neg(),i&&s.negative!==0&&s.isub(e)),{div:l.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:e.length===1?r==="div"?{div:this.divn(e.words[0]),mod:null}:r==="mod"?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,r)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var r=this.divmod(e);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(e):r.mod,a=e.ushrn(1),s=e.andln(1),l=i.cmp(a);return l<0||s===1&&l===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modn=function(e){c(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%e;return i},n.prototype.idivn=function(e){c(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/e|0,r=a%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){c(e.negative===0),c(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var a=new n(1),s=new n(0),l=new n(0),p=new n(1),o=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++o;for(var t=i.clone(),h=r.clone();!r.isZero();){for(var x=0,E=1;!(r.words[0]&E)&&x<26;++x,E<<=1);if(x>0)for(r.iushrn(x);x-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(t),s.isub(h)),a.iushrn(1),s.iushrn(1);for(var q=0,H=1;!(i.words[0]&H)&&q<26;++q,H<<=1);if(q>0)for(i.iushrn(q);q-- >0;)(l.isOdd()||p.isOdd())&&(l.iadd(t),p.isub(h)),l.iushrn(1),p.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(l),s.isub(p)):(i.isub(r),l.isub(a),p.isub(s))}return{a:l,b:p,gcd:i.iushln(o)}},n.prototype._invmp=function(e){c(e.negative===0),c(!e.isZero());var r=this,i=e.clone();r.negative!==0?r=r.umod(e):r=r.clone();for(var a=new n(1),s=new n(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var p=0,o=1;!(r.words[0]&o)&&p<26;++p,o<<=1);if(p>0)for(r.iushrn(p);p-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var t=0,h=1;!(i.words[0]&h)&&t<26;++t,h<<=1);if(t>0)for(i.iushrn(t);t-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(s)):(i.isub(r),s.isub(a))}var x;return r.cmpn(1)===0?x=a:x=s,x.cmpn(0)<0&&x.iadd(e),x},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var r=this.clone(),i=e.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var s=r.cmp(i);if(s<0){var l=r;r=i,i=l}else if(s===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){c(typeof e=="number");var r=e%26,i=(e-r)/26,a=1<>>26,p&=67108863,this.words[l]=p}return s!==0&&(this.words[l]=s,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(e){var r=e<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(e=-e),c(e<=67108863,"Number is too big");var a=this.words[0]|0;i=a===e?0:ae.length)return 1;if(this.length=0;i--){var a=this.words[i]|0,s=e.words[i]|0;if(a!==s){as&&(r=1);break}}return r},n.prototype.gtn=function(e){return this.cmpn(e)===1},n.prototype.gt=function(e){return this.cmp(e)===1},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return this.cmpn(e)===-1},n.prototype.lt=function(e){return this.cmp(e)===-1},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return this.cmpn(e)===0},n.prototype.eq=function(e){return this.cmp(e)===0},n.red=function(e){return new F(e)},n.prototype.toRed=function(e){return c(!this.red,"Already a number in reduction context"),c(this.negative===0,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return c(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return c(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return c(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return c(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return c(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return c(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return c(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return c(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return c(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return c(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return c(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return c(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return c(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return c(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var N={k256:null,p224:null,p192:null,p25519:null};function T(d,e){this.name=d,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},T.prototype.ireduce=function(e){var r=e,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},T.prototype.split=function(e,r){e.iushrn(this.n,0,r)},T.prototype.imulK=function(e){return e.imul(this.k)};function L(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}S(L,T),L.prototype.split=function(e,r){for(var i=4194303,a=Math.min(e.length,9),s=0;s>>22,l=p}l>>>=22,e.words[s-10]=l,l===0&&e.length>10?e.length-=10:e.length-=9},L.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var r=0,i=0;i>>=26,e.words[i]=s,r=a}return r!==0&&(e.words[e.length++]=r),e},n._prime=function(e){if(N[e])return N[e];var r;if(e==="k256")r=new L;else if(e==="p224")r=new W;else if(e==="p192")r=new ee;else if(e==="p25519")r=new Y;else throw new Error("Unknown prime "+e);return N[e]=r,r};function F(d){if(typeof d=="string"){var e=n._prime(d);this.m=e.p,this.prime=e}else c(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}F.prototype._verify1=function(e){c(e.negative===0,"red works only with positives"),c(e.red,"red works only with red numbers")},F.prototype._verify2=function(e,r){c((e.negative|r.negative)===0,"red works only with positives"),c(e.red&&e.red===r.red,"red works only with red numbers")},F.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},F.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},F.prototype.add=function(e,r){this._verify2(e,r);var i=e.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},F.prototype.iadd=function(e,r){this._verify2(e,r);var i=e.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},F.prototype.sub=function(e,r){this._verify2(e,r);var i=e.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},F.prototype.isub=function(e,r){this._verify2(e,r);var i=e.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},F.prototype.shl=function(e,r){return this._verify1(e),this.imod(e.ushln(r))},F.prototype.imul=function(e,r){return this._verify2(e,r),this.imod(e.imul(r))},F.prototype.mul=function(e,r){return this._verify2(e,r),this.imod(e.mul(r))},F.prototype.isqr=function(e){return this.imul(e,e.clone())},F.prototype.sqr=function(e){return this.mul(e,e)},F.prototype.sqrt=function(e){if(e.isZero())return e.clone();var r=this.m.andln(3);if(c(r%2===1),r===3){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&a.andln(1)===0;)s++,a.iushrn(1);c(!a.isZero());var l=new n(1).toRed(this),p=l.redNeg(),o=this.m.subn(1).iushrn(1),t=this.m.bitLength();for(t=new n(2*t*t).toRed(this);this.pow(t,o).cmp(p)!==0;)t.redIAdd(p);for(var h=this.pow(t,a),x=this.pow(e,a.addn(1).iushrn(1)),E=this.pow(e,a),q=s;E.cmp(l)!==0;){for(var H=E,j=0;H.cmp(l)!==0;j++)H=H.redSqr();c(j=0;s--){for(var h=r.words[s],x=t-1;x>=0;x--){var E=h>>x&1;if(l!==a[0]&&(l=this.sqr(l)),E===0&&p===0){o=0;continue}p<<=1,p|=E,o++,!(o!==i&&(s!==0||x!==0))&&(l=this.mul(l,a[p]),o=0,p=0)}t=26}return l},F.prototype.convertTo=function(e){var r=e.umod(this.m);return r===e?r.clone():r},F.prototype.convertFrom=function(e){var r=e.clone();return r.red=null,r},n.mont=function(e){return new de(e)};function de(d){F.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S(de,F),de.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},de.prototype.convertFrom=function(e){var r=this.imod(e.mul(this.rinv));return r.red=null,r},de.prototype.imul=function(e,r){if(e.isZero()||r.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(a).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},de.prototype.mul=function(e,r){if(e.isZero()||r.isZero())return new n(0)._forceRed(this);var i=e.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=i.isub(a).iushrn(this.shift),l=s;return s.cmp(this.m)>=0?l=s.isub(this.m):s.cmpn(0)<0&&(l=s.iadd(this.m)),l._forceRed(this)},de.prototype.invm=function(e){var r=this.imod(e._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(f,ht)}(Uv)),gn}var Ms,Ou;function nd(){if(Ou)return Ms;Ou=1;var f=df(),u=Bt().Buffer;function w(c,S){return u.from(c.toRed(f.mont(S.modulus)).redPow(new f(S.publicExponent)).fromRed().toArray())}return Ms=w,Ms}var xs,Uu;function Nv(){if(Uu)return xs;Uu=1;var f=Fn(),u=gi(),w=Ki(),c=rd(),S=id(),n=df(),m=nd(),y=nf(),g=Bt().Buffer;xs=function(B,A,k){var R;B.padding?R=B.padding:k?R=1:R=4;var P=f(B),C;if(R===4)C=b(P,A);else if(R===1)C=v(P,A,k);else if(R===3){if(C=new n(A),C.cmp(P.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return k?y(C,P):m(C,P)};function b(M,B){var A=M.modulus.byteLength(),k=B.length,R=w("sha1").update(g.alloc(0)).digest(),P=R.length,C=2*P;if(k>A-C-2)throw new Error("message too long");var N=g.alloc(A-k-C-2),T=A-P-1,L=u(P),W=S(g.concat([R,N,g.alloc(1,1),B],T),c(L,T)),ee=S(L,c(W,P));return new n(g.concat([g.alloc(1),ee,W],A))}function v(M,B,A){var k=B.length,R=M.modulus.byteLength();if(k>R-11)throw new Error("message too long");var P;return A?P=g.alloc(R-k-3,255):P=_(R-k-3),new n(g.concat([g.from([0,A?1:2]),P,g.alloc(1),B],R))}function _(M){for(var B=g.allocUnsafe(M),A=0,k=u(M*2),R=0,P;AP||new c(B).cmp(R.modulus)>=0)throw new Error("decryption error");var C;A?C=m(new c(B),R):C=S(B,R);var N=y.alloc(P-C.length);if(C=y.concat([N,C],P),k===4)return g(R,C);if(k===1)return b(R,C,A);if(k===3)return C;throw new Error("unknown padding")};function g(_,M){var B=_.modulus.byteLength(),A=n("sha1").update(y.alloc(0)).digest(),k=A.length;if(M[0]!==0)throw new Error("decryption error");var R=M.slice(1,k+1),P=M.slice(k+1),C=w(R,u(P,k)),N=w(P,u(C,B-k-1));if(v(A,N.slice(0,k)))throw new Error("decryption error");for(var T=k;N[T]===0;)T++;if(N[T++]!==1)throw new Error("decryption error");return N.slice(T)}function b(_,M,B){for(var A=M.slice(0,2),k=2,R=0;M[k++]!==0;)if(k>=M.length){R++;break}var P=M.slice(2,k-1);if((A.toString("hex")!=="0002"&&!B||A.toString("hex")!=="0001"&&B)&&R++,P.length<8&&R++,R)throw new Error("decryption error");return M.slice(k)}function v(_,M){_=y.from(_),M=y.from(M);var B=0,A=_.length;_.length!==M.length&&(B++,A=Math.min(_.length,M.length));for(var k=-1;++km||M<0)throw new TypeError("offset must be a uint32");if(M>S||M>B)throw new RangeError("offset out of range")}function g(M,B,A){if(typeof M!="number"||M!==M)throw new TypeError("size must be a number");if(M>m||M<0)throw new TypeError("size must be a uint32");if(M+B>A||M>S)throw new RangeError("buffer too small")}n&&n.getRandomValues||!Mt.browser?(ti.randomFill=b,ti.randomFillSync=_):(ti.randomFill=f,ti.randomFillSync=f);function b(M,B,A,k){if(!c.isBuffer(M)&&!(M instanceof ht.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof B=="function")k=B,B=0,A=M.length;else if(typeof A=="function")k=A,A=M.length-B;else if(typeof k!="function")throw new TypeError('"cb" argument must be a function');return y(B,M.length),g(A,B,M.length),v(M,B,A,k)}function v(M,B,A,k){if(Mt.browser){var R=M.buffer,P=new Uint8Array(R,B,A);if(n.getRandomValues(P),k){Mt.nextTick(function(){k(null,M)});return}return M}if(k){w(A,function(N,T){if(N)return k(N);T.copy(M,B),k(null,M)});return}var C=w(A);return C.copy(M,B),M}function _(M,B,A){if(typeof B>"u"&&(B=0),!c.isBuffer(M)&&!(M instanceof ht.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return y(B,M.length),A===void 0&&(A=M.length-B),g(A,B,M.length),v(M,B,A)}return ti}var Lu;function ad(){if(Lu)return wt;Lu=1,wt.randomBytes=wt.rng=wt.pseudoRandomBytes=wt.prng=gi(),wt.createHash=wt.Hash=Ki(),wt.createHmac=wt.Hmac=El();var f=n1(),u=Object.keys(f),w=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(u);wt.getHashes=function(){return w};var c=ql();wt.pbkdf2=c.pbkdf2,wt.pbkdf2Sync=c.pbkdf2Sync;var S=_1();wt.Cipher=S.Cipher,wt.createCipher=S.createCipher,wt.Cipheriv=S.Cipheriv,wt.createCipheriv=S.createCipheriv,wt.Decipher=S.Decipher,wt.createDecipher=S.createDecipher,wt.Decipheriv=S.Decipheriv,wt.createDecipheriv=S.createDecipheriv,wt.getCiphers=S.getCiphers,wt.listCiphers=S.listCiphers;var n=z1();wt.DiffieHellmanGroup=n.DiffieHellmanGroup,wt.createDiffieHellmanGroup=n.createDiffieHellmanGroup,wt.getDiffieHellman=n.getDiffieHellman,wt.createDiffieHellman=n.createDiffieHellman,wt.DiffieHellman=n.DiffieHellman;var m=Cv();wt.createSign=m.createSign,wt.Sign=m.Sign,wt.createVerify=m.createVerify,wt.Verify=m.Verify,wt.createECDH=Ov();var y=Dv();wt.publicEncrypt=y.publicEncrypt,wt.privateEncrypt=y.privateEncrypt,wt.publicDecrypt=y.publicDecrypt,wt.privateDecrypt=y.privateDecrypt;var g=Lv();return wt.randomFill=g.randomFill,wt.randomFillSync=g.randomFillSync,wt.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` `))},wt.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},wt}(function(f){(function(u){var w=function(O){var U,z=new Float64Array(16);if(O)for(U=0;U>24&255,O[U+1]=z>>16&255,O[U+2]=z>>8&255,O[U+3]=z&255,O[U+4]=I>>24&255,O[U+5]=I>>16&255,O[U+6]=I>>8&255,O[U+7]=I&255}function k(O,U,z,I,D){var te,be=0;for(te=0;te>>8)-1}function R(O,U,z,I){return k(O,U,z,I,16)}function P(O,U,z,I){return k(O,U,z,I,32)}function C(O,U,z,I){for(var D=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,te=z[0]&255|(z[1]&255)<<8|(z[2]&255)<<16|(z[3]&255)<<24,be=z[4]&255|(z[5]&255)<<8|(z[6]&255)<<16|(z[7]&255)<<24,ie=z[8]&255|(z[9]&255)<<8|(z[10]&255)<<16|(z[11]&255)<<24,pe=z[12]&255|(z[13]&255)<<8|(z[14]&255)<<16|(z[15]&255)<<24,Fe=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,ze=U[0]&255|(U[1]&255)<<8|(U[2]&255)<<16|(U[3]&255)<<24,ut=U[4]&255|(U[5]&255)<<8|(U[6]&255)<<16|(U[7]&255)<<24,Ze=U[8]&255|(U[9]&255)<<8|(U[10]&255)<<16|(U[11]&255)<<24,rt=U[12]&255|(U[13]&255)<<8|(U[14]&255)<<16|(U[15]&255)<<24,it=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=z[16]&255|(z[17]&255)<<8|(z[18]&255)<<16|(z[19]&255)<<24,st=z[20]&255|(z[21]&255)<<8|(z[22]&255)<<16|(z[23]&255)<<24,nt=z[24]&255|(z[25]&255)<<8|(z[26]&255)<<16|(z[27]&255)<<24,ot=z[28]&255|(z[29]&255)<<8|(z[30]&255)<<16|(z[31]&255)<<24,at=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,Ge=D,Qe=te,Ve=be,Ye=ie,Xe=pe,$e=Fe,Be=ze,Ae=ut,Ke=Ze,De=rt,je=it,We=ft,pt=st,gt=nt,yt=ot,bt=at,le,St=0;St<20;St+=2)le=Ge+pt|0,Xe^=le<<7|le>>>32-7,le=Xe+Ge|0,Ke^=le<<9|le>>>32-9,le=Ke+Xe|0,pt^=le<<13|le>>>32-13,le=pt+Ke|0,Ge^=le<<18|le>>>32-18,le=$e+Qe|0,De^=le<<7|le>>>32-7,le=De+$e|0,gt^=le<<9|le>>>32-9,le=gt+De|0,Qe^=le<<13|le>>>32-13,le=Qe+gt|0,$e^=le<<18|le>>>32-18,le=je+Be|0,yt^=le<<7|le>>>32-7,le=yt+je|0,Ve^=le<<9|le>>>32-9,le=Ve+yt|0,Be^=le<<13|le>>>32-13,le=Be+Ve|0,je^=le<<18|le>>>32-18,le=bt+We|0,Ye^=le<<7|le>>>32-7,le=Ye+bt|0,Ae^=le<<9|le>>>32-9,le=Ae+Ye|0,We^=le<<13|le>>>32-13,le=We+Ae|0,bt^=le<<18|le>>>32-18,le=Ge+Ye|0,Qe^=le<<7|le>>>32-7,le=Qe+Ge|0,Ve^=le<<9|le>>>32-9,le=Ve+Qe|0,Ye^=le<<13|le>>>32-13,le=Ye+Ve|0,Ge^=le<<18|le>>>32-18,le=$e+Xe|0,Be^=le<<7|le>>>32-7,le=Be+$e|0,Ae^=le<<9|le>>>32-9,le=Ae+Be|0,Xe^=le<<13|le>>>32-13,le=Xe+Ae|0,$e^=le<<18|le>>>32-18,le=je+De|0,We^=le<<7|le>>>32-7,le=We+je|0,Ke^=le<<9|le>>>32-9,le=Ke+We|0,De^=le<<13|le>>>32-13,le=De+Ke|0,je^=le<<18|le>>>32-18,le=bt+yt|0,pt^=le<<7|le>>>32-7,le=pt+bt|0,gt^=le<<9|le>>>32-9,le=gt+pt|0,yt^=le<<13|le>>>32-13,le=yt+gt|0,bt^=le<<18|le>>>32-18;Ge=Ge+D|0,Qe=Qe+te|0,Ve=Ve+be|0,Ye=Ye+ie|0,Xe=Xe+pe|0,$e=$e+Fe|0,Be=Be+ze|0,Ae=Ae+ut|0,Ke=Ke+Ze|0,De=De+rt|0,je=je+it|0,We=We+ft|0,pt=pt+st|0,gt=gt+nt|0,yt=yt+ot|0,bt=bt+at|0,O[0]=Ge>>>0&255,O[1]=Ge>>>8&255,O[2]=Ge>>>16&255,O[3]=Ge>>>24&255,O[4]=Qe>>>0&255,O[5]=Qe>>>8&255,O[6]=Qe>>>16&255,O[7]=Qe>>>24&255,O[8]=Ve>>>0&255,O[9]=Ve>>>8&255,O[10]=Ve>>>16&255,O[11]=Ve>>>24&255,O[12]=Ye>>>0&255,O[13]=Ye>>>8&255,O[14]=Ye>>>16&255,O[15]=Ye>>>24&255,O[16]=Xe>>>0&255,O[17]=Xe>>>8&255,O[18]=Xe>>>16&255,O[19]=Xe>>>24&255,O[20]=$e>>>0&255,O[21]=$e>>>8&255,O[22]=$e>>>16&255,O[23]=$e>>>24&255,O[24]=Be>>>0&255,O[25]=Be>>>8&255,O[26]=Be>>>16&255,O[27]=Be>>>24&255,O[28]=Ae>>>0&255,O[29]=Ae>>>8&255,O[30]=Ae>>>16&255,O[31]=Ae>>>24&255,O[32]=Ke>>>0&255,O[33]=Ke>>>8&255,O[34]=Ke>>>16&255,O[35]=Ke>>>24&255,O[36]=De>>>0&255,O[37]=De>>>8&255,O[38]=De>>>16&255,O[39]=De>>>24&255,O[40]=je>>>0&255,O[41]=je>>>8&255,O[42]=je>>>16&255,O[43]=je>>>24&255,O[44]=We>>>0&255,O[45]=We>>>8&255,O[46]=We>>>16&255,O[47]=We>>>24&255,O[48]=pt>>>0&255,O[49]=pt>>>8&255,O[50]=pt>>>16&255,O[51]=pt>>>24&255,O[52]=gt>>>0&255,O[53]=gt>>>8&255,O[54]=gt>>>16&255,O[55]=gt>>>24&255,O[56]=yt>>>0&255,O[57]=yt>>>8&255,O[58]=yt>>>16&255,O[59]=yt>>>24&255,O[60]=bt>>>0&255,O[61]=bt>>>8&255,O[62]=bt>>>16&255,O[63]=bt>>>24&255}function N(O,U,z,I){for(var D=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,te=z[0]&255|(z[1]&255)<<8|(z[2]&255)<<16|(z[3]&255)<<24,be=z[4]&255|(z[5]&255)<<8|(z[6]&255)<<16|(z[7]&255)<<24,ie=z[8]&255|(z[9]&255)<<8|(z[10]&255)<<16|(z[11]&255)<<24,pe=z[12]&255|(z[13]&255)<<8|(z[14]&255)<<16|(z[15]&255)<<24,Fe=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,ze=U[0]&255|(U[1]&255)<<8|(U[2]&255)<<16|(U[3]&255)<<24,ut=U[4]&255|(U[5]&255)<<8|(U[6]&255)<<16|(U[7]&255)<<24,Ze=U[8]&255|(U[9]&255)<<8|(U[10]&255)<<16|(U[11]&255)<<24,rt=U[12]&255|(U[13]&255)<<8|(U[14]&255)<<16|(U[15]&255)<<24,it=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=z[16]&255|(z[17]&255)<<8|(z[18]&255)<<16|(z[19]&255)<<24,st=z[20]&255|(z[21]&255)<<8|(z[22]&255)<<16|(z[23]&255)<<24,nt=z[24]&255|(z[25]&255)<<8|(z[26]&255)<<16|(z[27]&255)<<24,ot=z[28]&255|(z[29]&255)<<8|(z[30]&255)<<16|(z[31]&255)<<24,at=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,Ge=D,Qe=te,Ve=be,Ye=ie,Xe=pe,$e=Fe,Be=ze,Ae=ut,Ke=Ze,De=rt,je=it,We=ft,pt=st,gt=nt,yt=ot,bt=at,le,St=0;St<20;St+=2)le=Ge+pt|0,Xe^=le<<7|le>>>32-7,le=Xe+Ge|0,Ke^=le<<9|le>>>32-9,le=Ke+Xe|0,pt^=le<<13|le>>>32-13,le=pt+Ke|0,Ge^=le<<18|le>>>32-18,le=$e+Qe|0,De^=le<<7|le>>>32-7,le=De+$e|0,gt^=le<<9|le>>>32-9,le=gt+De|0,Qe^=le<<13|le>>>32-13,le=Qe+gt|0,$e^=le<<18|le>>>32-18,le=je+Be|0,yt^=le<<7|le>>>32-7,le=yt+je|0,Ve^=le<<9|le>>>32-9,le=Ve+yt|0,Be^=le<<13|le>>>32-13,le=Be+Ve|0,je^=le<<18|le>>>32-18,le=bt+We|0,Ye^=le<<7|le>>>32-7,le=Ye+bt|0,Ae^=le<<9|le>>>32-9,le=Ae+Ye|0,We^=le<<13|le>>>32-13,le=We+Ae|0,bt^=le<<18|le>>>32-18,le=Ge+Ye|0,Qe^=le<<7|le>>>32-7,le=Qe+Ge|0,Ve^=le<<9|le>>>32-9,le=Ve+Qe|0,Ye^=le<<13|le>>>32-13,le=Ye+Ve|0,Ge^=le<<18|le>>>32-18,le=$e+Xe|0,Be^=le<<7|le>>>32-7,le=Be+$e|0,Ae^=le<<9|le>>>32-9,le=Ae+Be|0,Xe^=le<<13|le>>>32-13,le=Xe+Ae|0,$e^=le<<18|le>>>32-18,le=je+De|0,We^=le<<7|le>>>32-7,le=We+je|0,Ke^=le<<9|le>>>32-9,le=Ke+We|0,De^=le<<13|le>>>32-13,le=De+Ke|0,je^=le<<18|le>>>32-18,le=bt+yt|0,pt^=le<<7|le>>>32-7,le=pt+bt|0,gt^=le<<9|le>>>32-9,le=gt+pt|0,yt^=le<<13|le>>>32-13,le=yt+gt|0,bt^=le<<18|le>>>32-18;O[0]=Ge>>>0&255,O[1]=Ge>>>8&255,O[2]=Ge>>>16&255,O[3]=Ge>>>24&255,O[4]=$e>>>0&255,O[5]=$e>>>8&255,O[6]=$e>>>16&255,O[7]=$e>>>24&255,O[8]=je>>>0&255,O[9]=je>>>8&255,O[10]=je>>>16&255,O[11]=je>>>24&255,O[12]=bt>>>0&255,O[13]=bt>>>8&255,O[14]=bt>>>16&255,O[15]=bt>>>24&255,O[16]=Be>>>0&255,O[17]=Be>>>8&255,O[18]=Be>>>16&255,O[19]=Be>>>24&255,O[20]=Ae>>>0&255,O[21]=Ae>>>8&255,O[22]=Ae>>>16&255,O[23]=Ae>>>24&255,O[24]=Ke>>>0&255,O[25]=Ke>>>8&255,O[26]=Ke>>>16&255,O[27]=Ke>>>24&255,O[28]=De>>>0&255,O[29]=De>>>8&255,O[30]=De>>>16&255,O[31]=De>>>24&255}function T(O,U,z,I){C(O,U,z,I)}function L(O,U,z,I){N(O,U,z,I)}var W=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function ee(O,U,z,I,D,te,be){var ie=new Uint8Array(16),pe=new Uint8Array(64),Fe,ze;for(ze=0;ze<16;ze++)ie[ze]=0;for(ze=0;ze<8;ze++)ie[ze]=te[ze];for(;D>=64;){for(T(pe,ie,be,W),ze=0;ze<64;ze++)O[U+ze]=z[I+ze]^pe[ze];for(Fe=1,ze=8;ze<16;ze++)Fe=Fe+(ie[ze]&255)|0,ie[ze]=Fe&255,Fe>>>=8;D-=64,U+=64,I+=64}if(D>0)for(T(pe,ie,be,W),ze=0;ze=64;){for(T(be,te,D,W),pe=0;pe<64;pe++)O[U+pe]=be[pe];for(ie=1,pe=8;pe<16;pe++)ie=ie+(te[pe]&255)|0,te[pe]=ie&255,ie>>>=8;z-=64,U+=64}if(z>0)for(T(be,te,D,W),pe=0;pe>>13|z<<3)&8191,I=O[4]&255|(O[5]&255)<<8,this.r[2]=(z>>>10|I<<6)&7939,D=O[6]&255|(O[7]&255)<<8,this.r[3]=(I>>>7|D<<9)&8191,te=O[8]&255|(O[9]&255)<<8,this.r[4]=(D>>>4|te<<12)&255,this.r[5]=te>>>1&8190,be=O[10]&255|(O[11]&255)<<8,this.r[6]=(te>>>14|be<<2)&8191,ie=O[12]&255|(O[13]&255)<<8,this.r[7]=(be>>>11|ie<<5)&8065,pe=O[14]&255|(O[15]&255)<<8,this.r[8]=(ie>>>8|pe<<8)&8191,this.r[9]=pe>>>5&127,this.pad[0]=O[16]&255|(O[17]&255)<<8,this.pad[1]=O[18]&255|(O[19]&255)<<8,this.pad[2]=O[20]&255|(O[21]&255)<<8,this.pad[3]=O[22]&255|(O[23]&255)<<8,this.pad[4]=O[24]&255|(O[25]&255)<<8,this.pad[5]=O[26]&255|(O[27]&255)<<8,this.pad[6]=O[28]&255|(O[29]&255)<<8,this.pad[7]=O[30]&255|(O[31]&255)<<8};d.prototype.blocks=function(O,U,z){for(var I=this.fin?0:2048,D,te,be,ie,pe,Fe,ze,ut,Ze,rt,it,ft,st,nt,ot,at,Ge,Qe,Ve,Ye=this.h[0],Xe=this.h[1],$e=this.h[2],Be=this.h[3],Ae=this.h[4],Ke=this.h[5],De=this.h[6],je=this.h[7],We=this.h[8],pt=this.h[9],gt=this.r[0],yt=this.r[1],bt=this.r[2],le=this.r[3],St=this.r[4],Et=this.r[5],Rt=this.r[6],xt=this.r[7],At=this.r[8],kt=this.r[9];z>=16;)D=O[U+0]&255|(O[U+1]&255)<<8,Ye+=D&8191,te=O[U+2]&255|(O[U+3]&255)<<8,Xe+=(D>>>13|te<<3)&8191,be=O[U+4]&255|(O[U+5]&255)<<8,$e+=(te>>>10|be<<6)&8191,ie=O[U+6]&255|(O[U+7]&255)<<8,Be+=(be>>>7|ie<<9)&8191,pe=O[U+8]&255|(O[U+9]&255)<<8,Ae+=(ie>>>4|pe<<12)&8191,Ke+=pe>>>1&8191,Fe=O[U+10]&255|(O[U+11]&255)<<8,De+=(pe>>>14|Fe<<2)&8191,ze=O[U+12]&255|(O[U+13]&255)<<8,je+=(Fe>>>11|ze<<5)&8191,ut=O[U+14]&255|(O[U+15]&255)<<8,We+=(ze>>>8|ut<<8)&8191,pt+=ut>>>5|I,Ze=0,rt=Ze,rt+=Ye*gt,rt+=Xe*(5*kt),rt+=$e*(5*At),rt+=Be*(5*xt),rt+=Ae*(5*Rt),Ze=rt>>>13,rt&=8191,rt+=Ke*(5*Et),rt+=De*(5*St),rt+=je*(5*le),rt+=We*(5*bt),rt+=pt*(5*yt),Ze+=rt>>>13,rt&=8191,it=Ze,it+=Ye*yt,it+=Xe*gt,it+=$e*(5*kt),it+=Be*(5*At),it+=Ae*(5*xt),Ze=it>>>13,it&=8191,it+=Ke*(5*Rt),it+=De*(5*Et),it+=je*(5*St),it+=We*(5*le),it+=pt*(5*bt),Ze+=it>>>13,it&=8191,ft=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,Qe+=je*yt,Qe+=We*gt,Qe+=pt*(5*kt),Ze+=Qe>>>13,Qe&=8191,Ve=Ze,Ve+=Ye*kt,Ve+=Xe*At,Ve+=$e*xt,Ve+=Be*Rt,Ve+=Ae*Et,Ze=Ve>>>13,Ve&=8191,Ve+=Ke*St,Ve+=De*le,Ve+=je*bt,Ve+=We*yt,Ve+=pt*gt,Ze+=Ve>>>13,Ve&=8191,Ze=(Ze<<2)+Ze|0,Ze=Ze+rt|0,rt=Ze&8191,Ze=Ze>>>13,it+=Ze,Ye=rt,Xe=it,$e=ft,Be=st,Ae=nt,Ke=ot,De=at,je=Ge,We=Qe,pt=Ve,U+=16,z-=16;this.h[0]=Ye,this.h[1]=Xe,this.h[2]=$e,this.h[3]=Be,this.h[4]=Ae,this.h[5]=Ke,this.h[6]=De,this.h[7]=je,this.h[8]=We,this.h[9]=pt},d.prototype.finish=function(O,U){var z=new Uint16Array(10),I,D,te,be;if(this.leftover){for(be=this.leftover,this.buffer[be++]=1;be<16;be++)this.buffer[be]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(I=this.h[1]>>>13,this.h[1]&=8191,be=2;be<10;be++)this.h[be]+=I,I=this.h[be]>>>13,this.h[be]&=8191;for(this.h[0]+=I*5,I=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=I,I=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=I,z[0]=this.h[0]+5,I=z[0]>>>13,z[0]&=8191,be=1;be<10;be++)z[be]=this.h[be]+I,I=z[be]>>>13,z[be]&=8191;for(z[9]-=1<<13,D=(I^1)-1,be=0;be<10;be++)z[be]&=D;for(D=~D,be=0;be<10;be++)this.h[be]=this.h[be]&D|z[be];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,te=this.h[0]+this.pad[0],this.h[0]=te&65535,be=1;be<8;be++)te=(this.h[be]+this.pad[be]|0)+(te>>>16)|0,this.h[be]=te&65535;O[U+0]=this.h[0]>>>0&255,O[U+1]=this.h[0]>>>8&255,O[U+2]=this.h[1]>>>0&255,O[U+3]=this.h[1]>>>8&255,O[U+4]=this.h[2]>>>0&255,O[U+5]=this.h[2]>>>8&255,O[U+6]=this.h[3]>>>0&255,O[U+7]=this.h[3]>>>8&255,O[U+8]=this.h[4]>>>0&255,O[U+9]=this.h[4]>>>8&255,O[U+10]=this.h[5]>>>0&255,O[U+11]=this.h[5]>>>8&255,O[U+12]=this.h[6]>>>0&255,O[U+13]=this.h[6]>>>8&255,O[U+14]=this.h[7]>>>0&255,O[U+15]=this.h[7]>>>8&255},d.prototype.update=function(O,U,z){var I,D;if(this.leftover){for(D=16-this.leftover,D>z&&(D=z),I=0;I=16&&(D=z-z%16,this.blocks(O,U,D),U+=D,z-=D),z){for(I=0;I>16&1),te[z-1]&=65535;te[15]=be[15]-32767-(te[14]>>16&1),D=te[15]>>16&1,te[14]&=65535,p(be,te,1-D)}for(z=0;z<16;z++)O[2*z]=be[z]&255,O[2*z+1]=be[z]>>8}function t(O,U){var z=new Uint8Array(32),I=new Uint8Array(32);return o(z,O),o(I,U),P(z,0,I,0)}function h(O){var U=new Uint8Array(32);return o(U,O),U[0]&1}function x(O,U){var z;for(z=0;z<16;z++)O[z]=U[2*z]+(U[2*z+1]<<8);O[15]&=32767}function E(O,U,z){for(var I=0;I<16;I++)O[I]=U[I]+z[I]}function q(O,U,z){for(var I=0;I<16;I++)O[I]=U[I]-z[I]}function H(O,U,z){var I,D,te=0,be=0,ie=0,pe=0,Fe=0,ze=0,ut=0,Ze=0,rt=0,it=0,ft=0,st=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I*Nt,De+=I*zt,je+=I*Dt,We+=I*Lt,I=U[12],nt+=I*le,ot+=I*St,at+=I*Et,Ge+=I*Rt,Qe+=I*xt,Ve+=I*At,Ye+=I*kt,Xe+=I*Ut,$e+=I*It,Be+=I*Tt,Ae+=I*qt,Ke+=I*Ot,De+=I*Nt,je+=I*zt,We+=I*Dt,pt+=I*Lt,I=U[13],ot+=I*le,at+=I*St,Ge+=I*Et,Qe+=I*Rt,Ve+=I*xt,Ye+=I*At,Xe+=I*kt,$e+=I*Ut,Be+=I*It,Ae+=I*Tt,Ke+=I*qt,De+=I*Ot,je+=I*Nt,We+=I*zt,pt+=I*Dt,gt+=I*Lt,I=U[14],at+=I*le,Ge+=I*St,Qe+=I*Et,Ve+=I*Rt,Ye+=I*xt,Xe+=I*At,$e+=I*kt,Be+=I*Ut,Ae+=I*It,Ke+=I*Tt,De+=I*qt,je+=I*Ot,We+=I*Nt,pt+=I*zt,gt+=I*Dt,yt+=I*Lt,I=U[15],Ge+=I*le,Qe+=I*St,Ve+=I*Et,Ye+=I*Rt,Xe+=I*xt,$e+=I*At,Be+=I*kt,Ae+=I*Ut,Ke+=I*It,De+=I*Tt,je+=I*qt,We+=I*Ot,pt+=I*Nt,gt+=I*zt,yt+=I*Dt,bt+=I*Lt,te+=38*Qe,be+=38*Ve,ie+=38*Ye,pe+=38*Xe,Fe+=38*$e,ze+=38*Be,ut+=38*Ae,Ze+=38*Ke,rt+=38*De,it+=38*je,ft+=38*We,st+=38*pt,nt+=38*gt,ot+=38*yt,at+=38*bt,D=1,I=te+D+65535,D=Math.floor(I/65536),te=I-D*65536,I=be+D+65535,D=Math.floor(I/65536),be=I-D*65536,I=ie+D+65535,D=Math.floor(I/65536),ie=I-D*65536,I=pe+D+65535,D=Math.floor(I/65536),pe=I-D*65536,I=Fe+D+65535,D=Math.floor(I/65536),Fe=I-D*65536,I=ze+D+65535,D=Math.floor(I/65536),ze=I-D*65536,I=ut+D+65535,D=Math.floor(I/65536),ut=I-D*65536,I=Ze+D+65535,D=Math.floor(I/65536),Ze=I-D*65536,I=rt+D+65535,D=Math.floor(I/65536),rt=I-D*65536,I=it+D+65535,D=Math.floor(I/65536),it=I-D*65536,I=ft+D+65535,D=Math.floor(I/65536),ft=I-D*65536,I=st+D+65535,D=Math.floor(I/65536),st=I-D*65536,I=nt+D+65535,D=Math.floor(I/65536),nt=I-D*65536,I=ot+D+65535,D=Math.floor(I/65536),ot=I-D*65536,I=at+D+65535,D=Math.floor(I/65536),at=I-D*65536,I=Ge+D+65535,D=Math.floor(I/65536),Ge=I-D*65536,te+=D-1+37*(D-1),D=1,I=te+D+65535,D=Math.floor(I/65536),te=I-D*65536,I=be+D+65535,D=Math.floor(I/65536),be=I-D*65536,I=ie+D+65535,D=Math.floor(I/65536),ie=I-D*65536,I=pe+D+65535,D=Math.floor(I/65536),pe=I-D*65536,I=Fe+D+65535,D=Math.floor(I/65536),Fe=I-D*65536,I=ze+D+65535,D=Math.floor(I/65536),ze=I-D*65536,I=ut+D+65535,D=Math.floor(I/65536),ut=I-D*65536,I=Ze+D+65535,D=Math.floor(I/65536),Ze=I-D*65536,I=rt+D+65535,D=Math.floor(I/65536),rt=I-D*65536,I=it+D+65535,D=Math.floor(I/65536),it=I-D*65536,I=ft+D+65535,D=Math.floor(I/65536),ft=I-D*65536,I=st+D+65535,D=Math.floor(I/65536),st=I-D*65536,I=nt+D+65535,D=Math.floor(I/65536),nt=I-D*65536,I=ot+D+65535,D=Math.floor(I/65536),ot=I-D*65536,I=at+D+65535,D=Math.floor(I/65536),at=I-D*65536,I=Ge+D+65535,D=Math.floor(I/65536),Ge=I-D*65536,te+=D-1+37*(D-1),O[0]=te,O[1]=be,O[2]=ie,O[3]=pe,O[4]=Fe,O[5]=ze,O[6]=ut,O[7]=Ze,O[8]=rt,O[9]=it,O[10]=ft,O[11]=st,O[12]=nt,O[13]=ot,O[14]=at,O[15]=Ge}function j(O,U){H(O,U,U)}function Z(O,U){var z=w(),I;for(I=0;I<16;I++)z[I]=U[I];for(I=253;I>=0;I--)j(z,z),I!==2&&I!==4&&H(z,z,U);for(I=0;I<16;I++)O[I]=z[I]}function ce(O,U){var z=w(),I;for(I=0;I<16;I++)z[I]=U[I];for(I=250;I>=0;I--)j(z,z),I!==1&&H(z,z,U);for(I=0;I<16;I++)O[I]=z[I]}function re(O,U,z){var I=new Uint8Array(32),D=new Float64Array(80),te,be,ie=w(),pe=w(),Fe=w(),ze=w(),ut=w(),Ze=w();for(be=0;be<31;be++)I[be]=U[be];for(I[31]=U[31]&127|64,I[0]&=248,x(D,z),be=0;be<16;be++)pe[be]=D[be],ze[be]=ie[be]=Fe[be]=0;for(ie[0]=ze[0]=1,be=254;be>=0;--be)te=I[be>>>3]>>>(be&7)&1,p(ie,pe,te),p(Fe,ze,te),E(ut,ie,Fe),q(ie,ie,Fe),E(Fe,pe,ze),q(pe,pe,ze),j(ze,ut),j(Ze,ie),H(ie,Fe,ie),H(Fe,pe,ut),E(ut,ie,Fe),q(ie,ie,Fe),j(pe,ie),q(Fe,ze,Ze),H(ie,Fe,g),E(ie,ie,ze),H(Fe,Fe,ie),H(ie,ze,Ze),H(ze,pe,D),j(pe,ut),p(ie,pe,te),p(Fe,ze,te);for(be=0;be<16;be++)D[be+16]=ie[be],D[be+32]=Fe[be],D[be+48]=pe[be],D[be+64]=ze[be];var rt=D.subarray(32),it=D.subarray(16);return Z(rt,rt),H(it,it,rt),o(O,it),0}function he(O,U){return re(O,U,n)}function Q(O,U){return c(U,32),he(O,U)}function K(O,U,z){var I=new Uint8Array(32);return re(I,z,U),L(O,S,I,W)}var oe=i,Ne=a;function ye(O,U,z,I,D,te){var be=new Uint8Array(32);return K(be,D,te),oe(O,U,z,I,be)}function we(O,U,z,I,D,te){var be=new Uint8Array(32);return K(be,D,te),Ne(O,U,z,I,be)}var et=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _e(O,U,z,I){for(var D=new Int32Array(16),te=new Int32Array(16),be,ie,pe,Fe,ze,ut,Ze,rt,it,ft,st,nt,ot,at,Ge,Qe,Ve,Ye,Xe,$e,Be,Ae,Ke,De,je,We,pt=O[0],gt=O[1],yt=O[2],bt=O[3],le=O[4],St=O[5],Et=O[6],Rt=O[7],xt=U[0],At=U[1],kt=U[2],Ut=U[3],It=U[4],Tt=U[5],qt=U[6],Ot=U[7],Nt=0;I>=128;){for(Xe=0;Xe<16;Xe++)$e=8*Xe+Nt,D[Xe]=z[$e+0]<<24|z[$e+1]<<16|z[$e+2]<<8|z[$e+3],te[Xe]=z[$e+4]<<24|z[$e+5]<<16|z[$e+6]<<8|z[$e+7];for(Xe=0;Xe<80;Xe++)if(be=pt,ie=gt,pe=yt,Fe=bt,ze=le,ut=St,Ze=Et,rt=Rt,it=xt,ft=At,st=kt,nt=Ut,ot=It,at=Tt,Ge=qt,Qe=Ot,Be=Rt,Ae=Ot,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=(le>>>14|It<<32-14)^(le>>>18|It<<32-18)^(It>>>41-32|le<<32-(41-32)),Ae=(It>>>14|le<<32-14)^(It>>>18|le<<32-18)^(le>>>41-32|It<<32-(41-32)),Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Be=le&St^~le&Et,Ae=It&Tt^~It&qt,Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Be=et[Xe*2],Ae=et[Xe*2+1],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Be=D[Xe%16],Ae=te[Xe%16],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,Ve=je&65535|We<<16,Ye=Ke&65535|De<<16,Be=Ve,Ae=Ye,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=(pt>>>28|xt<<32-28)^(xt>>>34-32|pt<<32-(34-32))^(xt>>>39-32|pt<<32-(39-32)),Ae=(xt>>>28|pt<<32-28)^(pt>>>34-32|xt<<32-(34-32))^(pt>>>39-32|xt<<32-(39-32)),Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Be=pt>^pt&yt^gt&yt,Ae=xt&At^xt&kt^At&kt,Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,rt=je&65535|We<<16,Qe=Ke&65535|De<<16,Be=Fe,Ae=nt,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=Ve,Ae=Ye,Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,Fe=je&65535|We<<16,nt=Ke&65535|De<<16,gt=be,yt=ie,bt=pe,le=Fe,St=ze,Et=ut,Rt=Ze,pt=rt,At=it,kt=ft,Ut=st,It=nt,Tt=ot,qt=at,Ot=Ge,xt=Qe,Xe%16===15)for($e=0;$e<16;$e++)Be=D[$e],Ae=te[$e],Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=D[($e+9)%16],Ae=te[($e+9)%16],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Ve=D[($e+1)%16],Ye=te[($e+1)%16],Be=(Ve>>>1|Ye<<32-1)^(Ve>>>8|Ye<<32-8)^Ve>>>7,Ae=(Ye>>>1|Ve<<32-1)^(Ye>>>8|Ve<<32-8)^(Ye>>>7|Ve<<32-7),Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,Ve=D[($e+14)%16],Ye=te[($e+14)%16],Be=(Ve>>>19|Ye<<32-19)^(Ye>>>61-32|Ve<<32-(61-32))^Ve>>>6,Ae=(Ye>>>19|Ve<<32-19)^(Ve>>>61-32|Ye<<32-(61-32))^(Ye>>>6|Ve<<32-6),Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,D[$e]=je&65535|We<<16,te[$e]=Ke&65535|De<<16;Be=pt,Ae=xt,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[0],Ae=U[0],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[0]=pt=je&65535|We<<16,U[0]=xt=Ke&65535|De<<16,Be=gt,Ae=At,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[1],Ae=U[1],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[1]=gt=je&65535|We<<16,U[1]=At=Ke&65535|De<<16,Be=yt,Ae=kt,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[2],Ae=U[2],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[2]=yt=je&65535|We<<16,U[2]=kt=Ke&65535|De<<16,Be=bt,Ae=Ut,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[3],Ae=U[3],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[3]=bt=je&65535|We<<16,U[3]=Ut=Ke&65535|De<<16,Be=le,Ae=It,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[4],Ae=U[4],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[4]=le=je&65535|We<<16,U[4]=It=Ke&65535|De<<16,Be=St,Ae=Tt,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[5],Ae=U[5],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[5]=St=je&65535|We<<16,U[5]=Tt=Ke&65535|De<<16,Be=Et,Ae=qt,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[6],Ae=U[6],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[6]=Et=je&65535|We<<16,U[6]=qt=Ke&65535|De<<16,Be=Rt,Ae=Ot,Ke=Ae&65535,De=Ae>>>16,je=Be&65535,We=Be>>>16,Be=O[7],Ae=U[7],Ke+=Ae&65535,De+=Ae>>>16,je+=Be&65535,We+=Be>>>16,De+=Ke>>>16,je+=De>>>16,We+=je>>>16,O[7]=Rt=je&65535|We<<16,U[7]=Ot=Ke&65535|De<<16,Nt+=128,I-=128}return I}function ne(O,U,z){var I=new Int32Array(8),D=new Int32Array(8),te=new Uint8Array(256),be,ie=z;for(I[0]=1779033703,I[1]=3144134277,I[2]=1013904242,I[3]=2773480762,I[4]=1359893119,I[5]=2600822924,I[6]=528734635,I[7]=1541459225,D[0]=4089235720,D[1]=2227873595,D[2]=4271175723,D[3]=1595750129,D[4]=2917565137,D[5]=725511199,D[6]=4215389547,D[7]=327033209,_e(I,D,U,z),z%=128,be=0;be=0;--D)I=z[D/8|0]>>(D&7)&1,xe(O,U,I),lt(U,O),lt(O,O),xe(O,U,I)}function Ee(O,U){var z=[w(),w(),w(),w()];s(z[0],_),s(z[1],M),s(z[2],y),H(z[3],_,M),ct(O,z,U)}function X(O,U,z){var I=new Uint8Array(64),D=[w(),w(),w(),w()],te;for(z||c(U,32),ne(I,U,32),I[0]&=248,I[31]&=127,I[31]|=64,Ee(D,I),Ce(O,D),te=0;te<32;te++)U[te+32]=O[te];return 0}var G=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function V(O,U){var z,I,D,te;for(I=63;I>=32;--I){for(z=0,D=I-32,te=I-12;D>4)*G[D],z=U[D]>>8,U[D]&=255;for(D=0;D<32;D++)U[D]-=z*G[D];for(I=0;I<32;I++)U[I+1]+=U[I]>>8,O[I]=U[I]&255}function J(O){var U=new Float64Array(64),z;for(z=0;z<64;z++)U[z]=O[z];for(z=0;z<64;z++)O[z]=0;V(O,U)}function me(O,U,z,I){var D=new Uint8Array(64),te=new Uint8Array(64),be=new Uint8Array(64),ie,pe,Fe=new Float64Array(64),ze=[w(),w(),w(),w()];ne(D,I,32),D[0]&=248,D[31]&=127,D[31]|=64;var ut=z+64;for(ie=0;ie>7&&q(O[0],m,O[0]),H(O[3],O[0],O[1]),0)}function se(O,U,z,I){var D,te=new Uint8Array(32),be=new Uint8Array(64),ie=[w(),w(),w(),w()],pe=[w(),w(),w(),w()];if(z<64||$(pe,I))return-1;for(D=0;D=0},u.sign.keyPair=function(){var O=new Uint8Array(Se),U=new Uint8Array(qe);return X(O,U),{publicKey:O,secretKey:U}},u.sign.keyPair.fromSecretKey=function(O){if(Re(O),O.length!==qe)throw new Error("bad secret key size");for(var U=new Uint8Array(Se),z=0;z0;)u.push(parseInt(f.slice(0,8),2)),f=f.slice(8);return Le.Buffer.from(u)}mr.bitsToBytes=Fv;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.wordlist=void 0;const Kv=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];Vi.wordlist=Kv;var Hv=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.mnemonicFromRandomSeed=Ct.mnemonicIndexesToBytes=Ct.bytesToMnemonics=Ct.bytesToMnemonicIndexes=Ct.mnemonicNew=Ct.mnemonicValidate=Ct.mnemonicToHDSeed=Ct.mnemonicToWalletKey=Ct.mnemonicToPrivateKey=Ct.mnemonicToSeed=Ct.mnemonicToEntropy=void 0;const sd=Hv(an),$v=tr,Vv=rr,Kn=Fi,qs=mr,bn=Vi,cf=1e5;async function fd(f){const u=await Zi(f);return await Zv(u)&&!await vf(u)}function pf(f){return f.map(u=>u.toLowerCase().trim())}async function vf(f){return(await(0,Kn.pbkdf2_sha512)(f,"TON seed version",Math.max(1,Math.floor(cf/256)),64))[0]==0}async function Zv(f){return(await(0,Kn.pbkdf2_sha512)(f,"TON fast seed version",1,64))[0]==1}async function Zi(f,u){return await(0,Vv.hmac_sha512)(f.join(" "),u&&u.length>0?u:"")}Ct.mnemonicToEntropy=Zi;async function mf(f,u,w){const c=await Zi(f,w);return await(0,Kn.pbkdf2_sha512)(c,u,cf,64)}Ct.mnemonicToSeed=mf;async function hd(f,u){f=pf(f);const w=await mf(f,"TON default seed",u);let c=sd.default.sign.keyPair.fromSeed(w.slice(0,32));return{publicKey:Le.Buffer.from(c.publicKey),secretKey:Le.Buffer.from(c.secretKey)}}Ct.mnemonicToPrivateKey=hd;async function Wv(f,u){let c=(await hd(f,u)).secretKey.slice(0,32);const S=sd.default.sign.keyPair.fromSeed(c);return{publicKey:Le.Buffer.from(S.publicKey),secretKey:Le.Buffer.from(S.secretKey)}}Ct.mnemonicToWalletKey=Wv;async function Gv(f,u){return f=pf(f),await mf(f,"TON HD Keys seed",u)}Ct.mnemonicToHDSeed=Gv;async function ud(f,u){f=pf(f);for(let w of f)if(bn.wordlist.indexOf(w)<0)return!1;return u&&u.length>0&&!await fd(f)?!1:await vf(await Zi(f,u))}Ct.mnemonicValidate=ud;async function Yv(f=24,u){let w=[];for(;;){w=[];for(let c=0;c0&&!await fd(w))&&await vf(await Zi(w,u)))break}return w}Ct.mnemonicNew=Yv;function ld(f,u){let w=(0,qs.bytesToBits)(f),c=[];for(let S=0;S=2028)throw Error("Invalid input");u+=(0,qs.lpad)(w.toString(2),"0",11)}for(;u.length%8!==0;)u=u+"0";return(0,qs.bitsToBytes)(u)}Ct.mnemonicIndexesToBytes=Xv;async function Jv(f,u=24,w){const c=Math.ceil(u*11/8);let S=f;for(;;){let n=await(0,Kn.pbkdf2_sha512)(S,"TON mnemonic seed",Math.max(1,Math.floor(cf/256)),c),m=dd(n,u);if(await ud(m,w))return m;S=n}}Ct.mnemonicFromRandomSeed=Jv;var Kt={},Qv=ht&&ht.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.openBox=Kt.sealBox=Kt.signVerify=Kt.sign=Kt.keyPairFromSeed=Kt.keyPairFromSecretKey=void 0;const wi=Qv(an);function em(f){let u=wi.default.sign.keyPair.fromSecretKey(new Uint8Array(f));return{publicKey:Le.Buffer.from(u.publicKey),secretKey:Le.Buffer.from(u.secretKey)}}Kt.keyPairFromSecretKey=em;function tm(f){let u=wi.default.sign.keyPair.fromSeed(new Uint8Array(f));return{publicKey:Le.Buffer.from(u.publicKey),secretKey:Le.Buffer.from(u.secretKey)}}Kt.keyPairFromSeed=tm;function rm(f,u){return Le.Buffer.from(wi.default.sign.detached(new Uint8Array(f),new Uint8Array(u)))}Kt.sign=rm;function im(f,u,w){return wi.default.sign.detached.verify(new Uint8Array(f),new Uint8Array(u),new Uint8Array(w))}Kt.signVerify=im;function nm(f,u,w){return Le.Buffer.from(wi.default.secretbox(f,u,w))}Kt.sealBox=nm;function am(f,u,w){let c=wi.default.secretbox.open(f,u,w);return c?Le.Buffer.from(c):null}Kt.openBox=am;var gr={};Object.defineProperty(gr,"__esModule",{value:!0});gr.deriveEd25519Path=gr.deriveED25519HardenedKey=gr.getED25519MasterKeyFromSeed=void 0;const cd=rr,om="ed25519 seed",ju=2147483648;async function pd(f){const u=await(0,cd.hmac_sha512)(om,f),w=u.slice(0,32),c=u.slice(32);return{key:w,chainCode:c}}gr.getED25519MasterKeyFromSeed=pd;async function vd(f,u){if(u>=ju)throw Error("Key index must be less than offset");const w=Le.Buffer.alloc(4);w.writeUInt32BE(u+ju,0);const c=Le.Buffer.concat([Le.Buffer.alloc(1,0),f.key,w]),S=await(0,cd.hmac_sha512)(f.chainCode,c),n=S.slice(0,32),m=S.slice(32);return{key:n,chainCode:m}}gr.deriveED25519HardenedKey=vd;async function sm(f,u){let w=await pd(f),c=[...u];for(;c.length>0;){let S=c[0];c=c.slice(1),w=await vd(w,S)}return w.key}gr.deriveEd25519Path=sm;var br={};Object.defineProperty(br,"__esModule",{value:!0});br.deriveSymmetricPath=br.deriveSymmetricHardenedKey=br.getSymmetricMasterKeyFromSeed=void 0;const md=rr,fm="Symmetric key seed";async function gd(f){const u=await(0,md.hmac_sha512)(fm,f),w=u.slice(32),c=u.slice(0,32);return{key:w,chainCode:c}}br.getSymmetricMasterKeyFromSeed=gd;async function bd(f,u){const w=Le.Buffer.concat([Le.Buffer.alloc(1,0),Le.Buffer.from(u)]),c=await(0,md.hmac_sha512)(f.chainCode,w),S=c.slice(32),n=c.slice(0,32);return{key:S,chainCode:n}}br.deriveSymmetricHardenedKey=bd;async function hm(f,u){let w=await gd(f),c=[...u];for(;c.length>0;){let S=c[0];c=c.slice(1),w=await bd(w,S)}return w.key}br.deriveSymmetricPath=hm;var yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.deriveMnemonicsPath=yr.deriveMnemonicHardenedKey=yr.getMnemonicsMasterKeyFromSeed=void 0;const um=Ct,yd=rr,Fu=2147483648,lm="TON Mnemonics HD seed";async function wd(f){const u=await(0,yd.hmac_sha512)(lm,f),w=u.slice(0,32),c=u.slice(32);return{key:w,chainCode:c}}yr.getMnemonicsMasterKeyFromSeed=wd;async function Md(f,u){if(u>=Fu)throw Error("Key index must be less than offset");const w=Le.Buffer.alloc(4);w.writeUInt32BE(u+Fu,0);const c=Le.Buffer.concat([Le.Buffer.alloc(1,0),f.key,w]),S=await(0,yd.hmac_sha512)(f.chainCode,c),n=S.slice(0,32),m=S.slice(32);return{key:n,chainCode:m}}yr.deriveMnemonicHardenedKey=Md;async function dm(f,u,w=24,c){let S=await wd(f),n=[...u];for(;n.length>0;){let m=n[0];n=n.slice(1),S=await Md(S,m)}return await(0,um.mnemonicFromRandomSeed)(S.key,w,c)}yr.deriveMnemonicsPath=dm;var Ku;function gf(){return Ku||(Ku=1,function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.getMnemonicsMasterKeyFromSeed=f.deriveMnemonicHardenedKey=f.deriveMnemonicsPath=f.deriveSymmetricPath=f.deriveSymmetricHardenedKey=f.getSymmetricMasterKeyFromSeed=f.deriveEd25519Path=f.deriveED25519HardenedKey=f.getED25519MasterKeyFromSeed=f.signVerify=f.sign=f.keyPairFromSecretKey=f.keyPairFromSeed=f.openBox=f.sealBox=f.mnemonicWordList=f.mnemonicToHDSeed=f.mnemonicToSeed=f.mnemonicToWalletKey=f.mnemonicToPrivateKey=f.mnemonicValidate=f.mnemonicNew=f.newSecurePassphrase=f.newSecureWords=f.getSecureRandomNumber=f.getSecureRandomWords=f.getSecureRandomBytes=f.hmac_sha512=f.pbkdf2_sha512=f.sha512_sync=f.sha512=f.sha256_sync=f.sha256=void 0;var u=pr;Object.defineProperty(f,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(f,"sha256_sync",{enumerable:!0,get:function(){return u.sha256_sync}});var w=vr;Object.defineProperty(f,"sha512",{enumerable:!0,get:function(){return w.sha512}}),Object.defineProperty(f,"sha512_sync",{enumerable:!0,get:function(){return w.sha512_sync}});var c=Fi;Object.defineProperty(f,"pbkdf2_sha512",{enumerable:!0,get:function(){return c.pbkdf2_sha512}});var S=rr;Object.defineProperty(f,"hmac_sha512",{enumerable:!0,get:function(){return S.hmac_sha512}});var n=tr;Object.defineProperty(f,"getSecureRandomBytes",{enumerable:!0,get:function(){return n.getSecureRandomBytes}}),Object.defineProperty(f,"getSecureRandomWords",{enumerable:!0,get:function(){return n.getSecureRandomWords}}),Object.defineProperty(f,"getSecureRandomNumber",{enumerable:!0,get:function(){return n.getSecureRandomNumber}});var m=On;Object.defineProperty(f,"newSecureWords",{enumerable:!0,get:function(){return m.newSecureWords}});var y=bp();Object.defineProperty(f,"newSecurePassphrase",{enumerable:!0,get:function(){return y.newSecurePassphrase}});var g=Ct;Object.defineProperty(f,"mnemonicNew",{enumerable:!0,get:function(){return g.mnemonicNew}}),Object.defineProperty(f,"mnemonicValidate",{enumerable:!0,get:function(){return g.mnemonicValidate}}),Object.defineProperty(f,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return g.mnemonicToPrivateKey}}),Object.defineProperty(f,"mnemonicToWalletKey",{enumerable:!0,get:function(){return g.mnemonicToWalletKey}}),Object.defineProperty(f,"mnemonicToSeed",{enumerable:!0,get:function(){return g.mnemonicToSeed}}),Object.defineProperty(f,"mnemonicToHDSeed",{enumerable:!0,get:function(){return g.mnemonicToHDSeed}});var b=Vi;Object.defineProperty(f,"mnemonicWordList",{enumerable:!0,get:function(){return b.wordlist}});var v=Kt;Object.defineProperty(f,"sealBox",{enumerable:!0,get:function(){return v.sealBox}}),Object.defineProperty(f,"openBox",{enumerable:!0,get:function(){return v.openBox}});var _=Kt;Object.defineProperty(f,"keyPairFromSeed",{enumerable:!0,get:function(){return _.keyPairFromSeed}}),Object.defineProperty(f,"keyPairFromSecretKey",{enumerable:!0,get:function(){return _.keyPairFromSecretKey}}),Object.defineProperty(f,"sign",{enumerable:!0,get:function(){return _.sign}}),Object.defineProperty(f,"signVerify",{enumerable:!0,get:function(){return _.signVerify}});var M=gr;Object.defineProperty(f,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return M.getED25519MasterKeyFromSeed}}),Object.defineProperty(f,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return M.deriveED25519HardenedKey}}),Object.defineProperty(f,"deriveEd25519Path",{enumerable:!0,get:function(){return M.deriveEd25519Path}});var B=br;Object.defineProperty(f,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return B.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(f,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return B.deriveSymmetricHardenedKey}}),Object.defineProperty(f,"deriveSymmetricPath",{enumerable:!0,get:function(){return B.deriveSymmetricPath}});var A=yr;Object.defineProperty(f,"deriveMnemonicsPath",{enumerable:!0,get:function(){return A.deriveMnemonicsPath}}),Object.defineProperty(f,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return A.deriveMnemonicHardenedKey}}),Object.defineProperty(f,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return A.getMnemonicsMasterKeyFromSeed}})}(Jn)),Jn}Object.defineProperty(In,"__esModule",{value:!0});In.wonderCalculator=void 0;const cm=Li(),er=li,Ri=vi,pm=pi,vm=di,mm=fr,gm=gf(),bm=ci,ym=ji;function wm(f,u,w){let c,S=null;if(f===er.CellType.Ordinary){let M=0;for(let B of w)M=M|B.mask.value;c=new Ri.LevelMask(M)}else if(f===er.CellType.PrunedBranch)S=(0,pm.exoticPruned)(u,w),c=new Ri.LevelMask(S.mask);else if(f===er.CellType.MerkleProof)(0,vm.exoticMerkleProof)(u,w),c=new Ri.LevelMask(w[0].mask.value>>1);else if(f===er.CellType.MerkleUpdate)(0,bm.exoticMerkleUpdate)(u,w),c=new Ri.LevelMask((w[0].mask.value|w[1].mask.value)>>1);else if(f===er.CellType.Library)(0,ym.exoticLibrary)(u,w),c=new Ri.LevelMask;else throw new Error("Unsupported exotic type");let n=[],m=[],y=f===er.CellType.PrunedBranch?1:c.hashCount,b=c.hashCount-y;for(let M=0,B=0;M<=c.level;M++){if(!c.isSignificant(M))continue;if(B0&&k++;let R=(0,mm.getRepr)(A,w,M,f),P=(0,gm.sha256_sync)(R),C=B-b;n[C]=k,m[C]=P,B++}let v=[],_=[];if(S)for(let M=0;M<4;M++){const{hashIndex:B}=c.apply(M),{hashIndex:A}=c;B!==A?(v.push(S.pruned[B].hash),_.push(S.pruned[B].depth)):(v.push(m[0]),_.push(n[0]))}else for(let M=0;M<4;M++)v.push(m[c.apply(M).hashIndex]),_.push(n[c.apply(M).hashIndex]);return{mask:c,hashes:v,depths:_}}In.wonderCalculator=wm;var or={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.topologicalSort=void 0;function Mm(f){let u=[f],w=new Map,c=new Set,S=[];for(;u.length>0;){const b=[...u];u=[];for(let v of b){const _=v.hash().toString("hex");if(!w.has(_)){c.add(_),w.set(_,{cell:v,refs:v.refs.map(M=>M.hash().toString("hex"))});for(let M of v.refs)u.push(M)}}}let n=new Set;function m(b){if(c.has(b)){if(n.has(b))throw Error("Not a DAG");n.add(b);for(let v of w.get(b).refs)m(v);S.unshift(b),n.delete(b),c.delete(b)}}for(;c.size>0;){const b=Array.from(c)[0];m(b)}let y=new Map;for(let b=0;by.get(_))})}return g}Hn.topologicalSort=Mm;var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.bitsForNumber=void 0;function xm(f,u){let w=BigInt(f);if(u==="int")return w===0n||w===-1n?1:(w>0?w:-w).toString(2).length+1;if(u==="uint"){if(w<0)throw Error(`value is negative. Got ${f}`);return w.toString(2).length}else throw Error(`invalid mode. Got ${u}`)}$n.bitsForNumber=xm;var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.crc32c=void 0;const dr=2197175160;function _m(f){let u=-1;for(let c=0;c>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1,u=u&1?u>>>1^dr:u>>>1;u=u^4294967295;let w=Le.Buffer.alloc(4);return w.writeInt32LE(u),w}Wi.crc32c=_m;var Hu;function Sm(){if(Hu)return or;Hu=1,Object.defineProperty(or,"__esModule",{value:!0}),or.serializeBoc=or.deserializeBoc=or.parseBoc=void 0;const f=Jt,u=Li(),w=ei(),c=Hn,S=$n,n=Sn(),m=fr,y=zs(),g=Wi;function b(k,R){const P=k.loadUint(8),C=P%8,N=!!(P&8),T=k.loadUint(8),L=Math.ceil(T/2),W=!!(T%2);let ee=u.BitString.EMPTY;L>0&&(W?ee=k.loadPaddedBits(L*8):ee=k.loadBits(L*8));let Y=[];for(let F=0;F=0;T--){if(C[T].result)throw Error("Impossible");let L=[];for(let W of C[T].refs){if(!C[W].result)throw Error("Invalid BOC file");L.push(C[W].result)}C[T].result=new w.Cell({bits:C[T].bits,refs:L,exotic:C[T].exotic})}let N=[];for(let T=0;T{if(this.isExotic&&!T)throw new Error("Exotic cells cannot be parsed");return new n.Slice(new b.BitReader(this.bits),this.refs)},this.hash=(T=3)=>this._hashes[Math.min(this._hashes.length-1,T)],this.depth=(T=3)=>this._depths[Math.min(this._depths.length-1,T)],this.level=()=>this.mask.level,this.equals=T=>this.hash().equals(T.hash()),this[u]=()=>this.toString();let A=c.BitString.EMPTY;B&&B.bits&&(A=B.bits);let k=[];B&&B.refs&&(k=[...B.refs]);let R,P,C,N=S.CellType.Ordinary;if(B&&B.exotic){let T=(0,m.resolveExotic)(A,k),L=(0,y.wonderCalculator)(T.type,A,k);C=L.mask,P=L.depths,R=L.hashes,N=T.type}else{if(k.length>4)throw new Error("Invalid number of references");if(A.length>1023)throw new Error(`Bits overflow: ${A.length} > 1023`);let T=(0,y.wonderCalculator)(S.CellType.Ordinary,A,k);C=T.mask,P=T.depths,R=T.hashes,N=S.CellType.Ordinary}this.type=N,this.bits=A,this.refs=k,this.mask=C,this._depths=P,this._hashes=R,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==S.CellType.Ordinary}toBoc(B){let A=B&&B.idx!==null&&B.idx!==void 0?B.idx:!1,k=B&&B.crc32!==null&&B.crc32!==void 0?B.crc32:!0;return(0,g.serializeBoc)(this,{idx:A,crc32:k})}toString(B){let A=B||"",k="x";this.isExotic&&(this.type===S.CellType.MerkleProof?k="p":this.type===S.CellType.MerkleUpdate?k="u":this.type===S.CellType.PrunedBranch&&(k="p"));let R=A+(this.isExotic?k:"x")+"{"+this.bits.toString()+"}";for(let P in this.refs){const C=this.refs[P];R+=` -`+C.toString(A+" ")}return R}asSlice(){return this.beginParse()}asBuilder(){return(0,v.beginCell)().storeSlice(this.asSlice())}};return Bi.Cell=_,u=w.default,_.EMPTY=new _,Bi}var Vu;function jt(){if(Vu)return Sr;Vu=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Builder=Sr.beginCell=void 0;const f=Sn(),u=ei(),w=nl();function c(){return new S}Sr.beginCell=c;let S=class _d{constructor(){this._bits=new f.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(m){return this._bits.writeBit(m),this}storeBits(m){return this._bits.writeBits(m),this}storeBuffer(m,y){if(y!=null&&m.length!==y)throw Error(`Buffer length ${m.length} is not equal to ${y}`);return this._bits.writeBuffer(m),this}storeMaybeBuffer(m,y){return m!==null?(this.storeBit(1),this.storeBuffer(m,y)):this.storeBit(0),this}storeUint(m,y){return this._bits.writeUint(m,y),this}storeMaybeUint(m,y){return m!=null?(this.storeBit(1),this.storeUint(m,y)):this.storeBit(0),this}storeInt(m,y){return this._bits.writeInt(m,y),this}storeMaybeInt(m,y){return m!=null?(this.storeBit(1),this.storeInt(m,y)):this.storeBit(0),this}storeVarUint(m,y){return this._bits.writeVarUint(m,y),this}storeMaybeVarUint(m,y){return m!=null?(this.storeBit(1),this.storeVarUint(m,y)):this.storeBit(0),this}storeVarInt(m,y){return this._bits.writeVarInt(m,y),this}storeMaybeVarInt(m,y){return m!=null?(this.storeBit(1),this.storeVarInt(m,y)):this.storeBit(0),this}storeCoins(m){return this._bits.writeCoins(m),this}storeMaybeCoins(m){return m!=null?(this.storeBit(1),this.storeCoins(m)):this.storeBit(0),this}storeAddress(m){return this._bits.writeAddress(m),this}storeRef(m){if(this._refs.length>=4)throw new Error("Too many references");if(m instanceof u.Cell)this._refs.push(m);else if(m instanceof _d)this._refs.push(m.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(m){return m?(this.storeBit(1),this.storeRef(m)):this.storeBit(0),this}storeSlice(m){let y=m.clone();for(y.remainingBits>0&&this.storeBits(y.loadBits(y.remainingBits));y.remainingRefs>0;)this.storeRef(y.loadRef());return this}storeMaybeSlice(m){return m?(this.storeBit(1),this.storeSlice(m)):this.storeBit(0),this}storeBuilder(m){return this.storeSlice(m.endCell().beginParse())}storeMaybeBuilder(m){return m?(this.storeBit(1),this.storeBuilder(m)):this.storeBit(0),this}storeWritable(m){return typeof m=="object"?m.writeTo(this):m(this),this}storeMaybeWritable(m){return m?(this.storeBit(1),this.storeWritable(m)):this.storeBit(0),this}store(m){return this.storeWritable(m),this}storeStringTail(m){return(0,w.writeString)(m,this),this}storeMaybeStringTail(m){return m!=null?(this.storeBit(1),(0,w.writeString)(m,this)):this.storeBit(0),this}storeStringRefTail(m){return this.storeRef(c().storeStringTail(m)),this}storeMaybeStringRefTail(m){return m!=null?(this.storeBit(1),this.storeStringRefTail(m)):this.storeBit(0),this}storeDict(m,y,g){return m?m.store(this,y,g):this.storeBit(0),this}storeDictDirect(m,y,g){return m.storeDirect(this,y,g),this}endCell(){return new u.Cell({bits:this._bits.build(),refs:this._refs})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}};return Sr.Builder=S,Sr}var ir={},hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.SimpleLibraryValue=hr.storeSimpleLibrary=hr.loadSimpleLibrary=void 0;function Sd(f){return{public:f.loadBit(),root:f.loadRef()}}hr.loadSimpleLibrary=Sd;function Bd(f){return u=>{u.storeBit(f.public),u.storeRef(f.root)}}hr.storeSimpleLibrary=Bd;hr.SimpleLibraryValue={serialize(f,u){Bd(f)(u)},parse(f){return Sd(f)}};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.storeTickTock=Cr.loadTickTock=void 0;function Bm(f){return{tick:f.loadBit(),tock:f.loadBit()}}Cr.loadTickTock=Bm;function Am(f){return u=>{u.storeBit(f.tick),u.storeBit(f.tock)}}Cr.storeTickTock=Am;Object.defineProperty(ir,"__esModule",{value:!0});ir.storeStateInit=ir.loadStateInit=void 0;const km=Qr(),Em=hr,Ad=Cr;function Rm(f){let u;f.loadBit()&&(u=f.loadUint(5));let w;f.loadBit()&&(w=(0,Ad.loadTickTock)(f));let c=f.loadMaybeRef(),S=f.loadMaybeRef(),n=f.loadDict(km.Dictionary.Keys.BigUint(256),Em.SimpleLibraryValue);return n.size===0&&(n=void 0),{splitDepth:u,special:w,code:c,data:S,libraries:n}}ir.loadStateInit=Rm;function Im(f){return u=>{f.splitDepth!==null&&f.splitDepth!==void 0?(u.storeBit(!0),u.storeUint(f.splitDepth,5)):u.storeBit(!1),f.special!==null&&f.special!==void 0?(u.storeBit(!0),u.store((0,Ad.storeTickTock)(f.special))):u.storeBit(!1),u.storeMaybeRef(f.code),u.storeMaybeRef(f.data),u.storeDict(f.libraries)}}ir.storeStateInit=Im;Object.defineProperty(_n,"__esModule",{value:!0});_n.contractAddress=void 0;const Pm=jt(),Cm=ir,Tm=$t;function qm(f,u){let w=(0,Pm.beginCell)().store((0,Cm.storeStateInit)(u)).endCell().hash();return new Tm.Address(f,w)}_n.contractAddress=qm;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.parseTuple=ai.serializeTuple=void 0;const Di=jt(),Om=BigInt("-9223372036854775808"),Um=BigInt("9223372036854775807");function kd(f,u){if(f.type==="null")u.storeUint(0,8);else if(f.type==="int")f.value<=Um&&f.value>=Om?(u.storeUint(1,8),u.storeInt(f.value,64)):(u.storeUint(256,15),u.storeInt(f.value,257));else if(f.type==="nan")u.storeInt(767,16);else if(f.type==="cell")u.storeUint(3,8),u.storeRef(f.cell);else if(f.type==="slice")u.storeUint(4,8),u.storeUint(0,10),u.storeUint(f.cell.bits.length,10),u.storeUint(0,3),u.storeUint(f.cell.refs.length,3),u.storeRef(f.cell);else if(f.type==="builder")u.storeUint(5,8),u.storeRef(f.cell);else if(f.type==="tuple"){let w=null,c=null;for(let S=0;S1&&(w=(0,Di.beginCell)().storeRef(c).storeRef(w).endCell());let m=(0,Di.beginCell)();kd(f.items[S],m),c=m.endCell()}u.storeUint(7,8),u.storeUint(f.items.length,16),w&&u.storeRef(w),c&&u.storeRef(c)}else throw Error("Invalid value")}function Ci(f){let u=f.loadUint(8);if(u===0)return{type:"null"};if(u===1)return{type:"int",value:f.loadIntBig(64)};if(u===2)return f.loadUint(7)===0?{type:"int",value:f.loadIntBig(257)}:(f.loadBit(),{type:"nan"});if(u===3)return{type:"cell",cell:f.loadRef()};if(u===4){let w=f.loadUint(10),c=f.loadUint(10),S=f.loadUint(3),n=f.loadUint(3),m=f.loadRef().beginParse();m.skip(w);let y=m.loadBits(c-w),g=(0,Di.beginCell)().storeBits(y);if(S1){let S=f.loadRef().beginParse(),n=f.loadRef().beginParse();c.unshift(Ci(n));for(let m=0;m0){let w=(0,Di.beginCell)();Ed(f.slice(0,f.length-1),w),u.storeRef(w.endCell()),kd(f[f.length-1],u)}}function Nm(f){let u=(0,Di.beginCell)();u.storeUint(f.length,24);let w=[...f];return Ed(w,u),u.endCell()}ai.serializeTuple=Nm;function zm(f){let u=[],w=f.beginParse(),c=w.loadUint(24);for(let S=0;S2)throw Error("Invalid number");let c=w[0],S=w[1];if(c||(c="0"),S||(S="0"),S.length>9)throw Error("Invalid number");for(;S.length<9;)S+="0";let n=BigInt(c)*1000000000n+BigInt(S);return u&&(n=-n),n}}Tr.toNano=Lm;function jm(f){let u=BigInt(f),w=!1;u<0&&(w=!0,u=-u);let S=(u%1000000000n).toString();for(;S.length<9;)S="0"+S;S=S.match(/^([0-9]*[1-9]|0)(0*)/)[1];let y=`${(u/1000000000n).toString()}${S==="0"?"":`.${S}`}`;return w&&(y="-"+y),y}Tr.fromNano=jm;Object.defineProperty(wr,"__esModule",{value:!0});wr.comment=wr.external=wr.internal=void 0;const wn=$t,Id=ei(),Pd=jt(),Fm=Tr;function Km(f){let u=!0;f.bounce!==null&&f.bounce!==void 0&&(u=f.bounce);let w;if(typeof f.to=="string")w=wn.Address.parse(f.to);else if(wn.Address.isAddress(f.to))w=f.to;else throw new Error(`Invalid address ${f.to}`);let c;typeof f.value=="string"?c=(0,Fm.toNano)(f.value):c=f.value;let S=Id.Cell.EMPTY;return typeof f.body=="string"?S=(0,Pd.beginCell)().storeUint(0,32).storeStringTail(f.body).endCell():f.body&&(S=f.body),{info:{type:"internal",dest:w,value:{coins:c},bounce:u,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:f.init?{code:f.init.code,data:f.init.data}:void 0,body:S}}wr.internal=Km;function Hm(f){let u;if(typeof f.to=="string")u=wn.Address.parse(f.to);else if(wn.Address.isAddress(f.to))u=f.to;else throw new Error(`Invalid address ${f.to}`);return{info:{type:"external-in",dest:u,importFee:0n},init:f.init?{code:f.init.code,data:f.init.data}:void 0,body:f.body||Id.Cell.EMPTY}}wr.external=Hm;function $m(f){return(0,Pd.beginCell)().storeUint(0,32).storeStringTail(f).endCell()}wr.comment=$m;var qr={},Or={},Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.storeAccountState=Ur.loadAccountState=void 0;const Cd=ir;function Vm(f){return f.loadBit()?{type:"active",state:(0,Cd.loadStateInit)(f)}:f.loadBit()?{type:"frozen",stateHash:f.loadUintBig(256)}:{type:"uninit"}}Ur.loadAccountState=Vm;function Zm(f){return u=>{f.type==="active"?(u.storeBit(!0),u.store((0,Cd.storeStateInit)(f.state))):f.type==="frozen"?(u.storeBit(!1),u.storeBit(!0),u.storeUint(f.stateHash,256)):f.type==="uninit"&&(u.storeBit(!1),u.storeBit(!1))}}Ur.storeAccountState=Zm;var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.storeCurrencyCollection=Vt.loadCurrencyCollection=void 0;const Zu=Qr();function Wm(f){const u=f.loadCoins(),w=f.loadDict(Zu.Dictionary.Keys.Uint(32),Zu.Dictionary.Values.BigVarUint(5));return w.size===0?{coins:u}:{other:w,coins:u}}Vt.loadCurrencyCollection=Wm;function Gm(f){return u=>{u.storeCoins(f.coins),f.other?u.storeDict(f.other):u.storeBit(0)}}Vt.storeCurrencyCollection=Gm;Object.defineProperty(Or,"__esModule",{value:!0});Or.storeAccountStorage=Or.loadAccountStorage=void 0;const Td=Ur,qd=Vt;function Ym(f){return{lastTransLt:f.loadUintBig(64),balance:(0,qd.loadCurrencyCollection)(f),state:(0,Td.loadAccountState)(f)}}Or.loadAccountStorage=Ym;function Xm(f){return u=>{u.storeUint(f.lastTransLt,64),u.store((0,qd.storeCurrencyCollection)(f.balance)),u.store((0,Td.storeAccountState)(f.state))}}Or.storeAccountStorage=Xm;var Nr={},zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.storeStorageUsed=zr.loadStorageUsed=void 0;function Jm(f){return{cells:f.loadVarUintBig(3),bits:f.loadVarUintBig(3),publicCells:f.loadVarUintBig(3)}}zr.loadStorageUsed=Jm;function Qm(f){return u=>{u.storeVarUint(f.cells,3),u.storeVarUint(f.bits,3),u.storeVarUint(f.publicCells,3)}}zr.storeStorageUsed=Qm;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.storeStorageInfo=Nr.loadStorageInfo=void 0;const Od=zr;function eg(f){return{used:(0,Od.loadStorageUsed)(f),lastPaid:f.loadUint(32),duePayment:f.loadMaybeCoins()}}Nr.loadStorageInfo=eg;function tg(f){return u=>{u.store((0,Od.storeStorageUsed)(f.used)),u.storeUint(f.lastPaid,32),u.storeMaybeCoins(f.duePayment)}}Nr.storeStorageInfo=tg;Object.defineProperty(qr,"__esModule",{value:!0});qr.storeAccount=qr.loadAccount=void 0;const Ud=Or,Nd=Nr;function rg(f){return{addr:f.loadAddress(),storageStats:(0,Nd.loadStorageInfo)(f),storage:(0,Ud.loadAccountStorage)(f)}}qr.loadAccount=rg;function ig(f){return u=>{u.storeAddress(f.addr),u.store((0,Nd.storeStorageInfo)(f.storageStats)),u.store((0,Ud.storeAccountStorage)(f.storage))}}qr.storeAccount=ig;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.storeAccountStatus=Dr.loadAccountStatus=void 0;function ng(f){const u=f.loadUint(2);if(u===0)return"uninitialized";if(u===1)return"frozen";if(u===2)return"active";if(u===3)return"non-existing";throw Error("Invalid data")}Dr.loadAccountStatus=ng;function ag(f){return u=>{if(f==="uninitialized")u.storeUint(0,2);else if(f==="frozen")u.storeUint(1,2);else if(f==="active")u.storeUint(2,2);else if(f==="non-existing")u.storeUint(3,2);else throw Error("Invalid data");return u}}Dr.storeAccountStatus=ag;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.storeAccountStatusChange=Mr.loadAccountStatusChange=void 0;function og(f){return f.loadBit()?f.loadBit()?"frozen":"deleted":"unchanged"}Mr.loadAccountStatusChange=og;function sg(f){return u=>{if(f=="unchanged")u.storeBit(0);else if(f==="frozen")u.storeBit(1),u.storeBit(0);else if(f==="deleted")u.storeBit(1),u.storeBit(1);else throw Error("Invalid account status change")}}Mr.storeAccountStatusChange=sg;var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.storeCommonMessageInfo=Lr.loadCommonMessageInfo=void 0;const zd=Vt;function fg(f){if(!f.loadBit()){const n=f.loadBit(),m=f.loadBit(),y=f.loadBit(),g=f.loadAddress(),b=f.loadAddress(),v=(0,zd.loadCurrencyCollection)(f),_=f.loadCoins(),M=f.loadCoins(),B=f.loadUintBig(64),A=f.loadUint(32);return{type:"internal",ihrDisabled:n,bounce:m,bounced:y,src:g,dest:b,value:v,ihrFee:_,forwardFee:M,createdLt:B,createdAt:A}}if(!f.loadBit()){const n=f.loadMaybeExternalAddress(),m=f.loadAddress(),y=f.loadCoins();return{type:"external-in",src:n,dest:m,importFee:y}}const u=f.loadAddress(),w=f.loadMaybeExternalAddress(),c=f.loadUintBig(64),S=f.loadUint(32);return{type:"external-out",src:u,dest:w,createdLt:c,createdAt:S}}Lr.loadCommonMessageInfo=fg;function hg(f){return u=>{if(f.type==="internal")u.storeBit(0),u.storeBit(f.ihrDisabled),u.storeBit(f.bounce),u.storeBit(f.bounced),u.storeAddress(f.src),u.storeAddress(f.dest),u.store((0,zd.storeCurrencyCollection)(f.value)),u.storeCoins(f.ihrFee),u.storeCoins(f.forwardFee),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else if(f.type==="external-in")u.storeBit(1),u.storeBit(0),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeCoins(f.importFee);else if(f.type==="external-out")u.storeBit(1),u.storeBit(1),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}Lr.storeCommonMessageInfo=hg;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.storeCommonMessageInfoRelaxed=jr.loadCommonMessageInfoRelaxed=void 0;const Dd=Vt;function ug(f){if(!f.loadBit()){const n=f.loadBit(),m=f.loadBit(),y=f.loadBit(),g=f.loadMaybeAddress(),b=f.loadAddress(),v=(0,Dd.loadCurrencyCollection)(f),_=f.loadCoins(),M=f.loadCoins(),B=f.loadUintBig(64),A=f.loadUint(32);return{type:"internal",ihrDisabled:n,bounce:m,bounced:y,src:g,dest:b,value:v,ihrFee:_,forwardFee:M,createdLt:B,createdAt:A}}if(!f.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");const u=f.loadMaybeAddress(),w=f.loadMaybeExternalAddress(),c=f.loadUintBig(64),S=f.loadUint(32);return{type:"external-out",src:u,dest:w,createdLt:c,createdAt:S}}jr.loadCommonMessageInfoRelaxed=ug;function lg(f){return u=>{if(f.type==="internal")u.storeBit(0),u.storeBit(f.ihrDisabled),u.storeBit(f.bounce),u.storeBit(f.bounced),u.storeAddress(f.src),u.storeAddress(f.dest),u.store((0,Dd.storeCurrencyCollection)(f.value)),u.storeCoins(f.ihrFee),u.storeCoins(f.forwardFee),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else if(f.type==="external-out")u.storeBit(1),u.storeBit(1),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}jr.storeCommonMessageInfoRelaxed=lg;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.storeComputeSkipReason=Fr.loadComputeSkipReason=void 0;function dg(f){let u=f.loadUint(2);if(u===0)return"no-state";if(u===1)return"bad-state";if(u===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${u}`)}Fr.loadComputeSkipReason=dg;function cg(f){return u=>{if(f==="no-state")u.storeUint(0,2);else if(f==="bad-state")u.storeUint(1,2);else if(f==="no-gas")u.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${f}`)}}Fr.storeComputeSkipReason=cg;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.storeDepthBalanceInfo=Kr.loadDepthBalanceInfo=void 0;const Ld=Vt;function pg(f){return{splitDepth:f.loadUint(5),balance:(0,Ld.loadCurrencyCollection)(f)}}Kr.loadDepthBalanceInfo=pg;function vg(f){return u=>{u.storeUint(f.splitDepth,5),u.store((0,Ld.storeCurrencyCollection)(f.balance))}}Kr.storeDepthBalanceInfo=vg;var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.storeHashUpdate=Hr.loadHashUpdate=void 0;function mg(f){if(f.loadUint(8)!==114)throw Error("Invalid data");const u=f.loadBuffer(32),w=f.loadBuffer(32);return{oldHash:u,newHash:w}}Hr.loadHashUpdate=mg;function gg(f){return u=>{u.storeUint(114,8),u.storeBuffer(f.oldHash),u.storeBuffer(f.newHash)}}Hr.storeHashUpdate=gg;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.loadMasterchainStateExtra=void 0;const ks=Qr(),bg=Vt;function yg(f){if(f.loadUint(16)!==52262)throw Error("Invalid data");f.loadBit()&&f.loadRef();let u=f.loadUintBig(256),w=ks.Dictionary.load(ks.Dictionary.Keys.Int(32),ks.Dictionary.Values.Cell(),f);const c=(0,bg.loadCurrencyCollection)(f);return{config:w,configAddress:u,globalBalance:c}}Gi.loadMasterchainStateExtra=yg;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.MessageValue=ur.storeMessage=ur.loadMessage=void 0;const jd=jt(),Fd=Lr,Os=ir;function Kd(f){const u=(0,Fd.loadCommonMessageInfo)(f);let w=null;f.loadBit()&&(f.loadBit()?w=(0,Os.loadStateInit)(f.loadRef().beginParse()):w=(0,Os.loadStateInit)(f));const c=f.loadBit()?f.loadRef():f.asCell();return{info:u,init:w,body:c}}ur.loadMessage=Kd;function Hd(f,u){return w=>{if(w.store((0,Fd.storeCommonMessageInfo)(f.info)),f.init){w.storeBit(!0);let S=(0,jd.beginCell)().store((0,Os.storeStateInit)(f.init)),n=!1;u&&u.forceRef?n=!0:w.availableBits-2>=S.bits?n=!1:n=!0,n?(w.storeBit(!0),w.storeRef(S)):(w.storeBit(!1),w.storeBuilder(S))}else w.storeBit(!1);let c=!1;u&&u.forceRef?c=!0:w.availableBits-1>=f.body.bits.length&&w.refs+f.body.refs.length<=4?c=!1:c=!0,c?(w.storeBit(!0),w.storeRef(f.body)):(w.storeBit(!1),w.storeBuilder(f.body.asBuilder()))}}ur.storeMessage=Hd;ur.MessageValue={serialize(f,u){u.storeRef((0,jd.beginCell)().store(Hd(f)))},parse(f){return Kd(f.loadRef().beginParse())}};var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.storeMessageRelaxed=oi.loadMessageRelaxed=void 0;const wg=jt(),$d=jr,Us=ir;function Mg(f){const u=(0,$d.loadCommonMessageInfoRelaxed)(f);let w=null;f.loadBit()&&(f.loadBit()?w=(0,Us.loadStateInit)(f.loadRef().beginParse()):w=(0,Us.loadStateInit)(f));const c=f.loadBit()?f.loadRef():f.asCell();return{info:u,init:w,body:c}}oi.loadMessageRelaxed=Mg;function xg(f,u){return w=>{if(w.store((0,$d.storeCommonMessageInfoRelaxed)(f.info)),f.init){w.storeBit(!0);let S=(0,wg.beginCell)().store((0,Us.storeStateInit)(f.init)),n=!1;u&&u.forceRef?n=!0:w.availableBits-2>=S.bits?n=!1:n=!0,n?(w.storeBit(!0),w.storeRef(S)):(w.storeBit(!1),w.storeBuilder(S))}else w.storeBit(!1);let c=!1;u&&u.forceRef?c=!0:w.availableBits-1>=f.body.bits.length&&w.refs+f.body.refs.length<=4?c=!1:c=!0,c?(w.storeBit(!0),w.storeRef(f.body)):(w.storeBit(!1),w.storeBuilder(f.body.asBuilder()))}}oi.storeMessageRelaxed=xg;var Vd={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.SendMode=void 0,function(u){u[u.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",u[u.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",u[u.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",u[u.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",u[u.IGNORE_ERRORS=2]="IGNORE_ERRORS",u[u.NONE=0]="NONE"}(f.SendMode||(f.SendMode={}))})(Vd);var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.storeShardAccount=$r.loadShardAccount=void 0;const Wu=jt(),Zd=qr;function _g(f){let u=f.loadRef(),w;if(!u.isExotic){let c=u.beginParse();c.loadBit()&&(w=(0,Zd.loadAccount)(c))}return{account:w,lastTransactionHash:f.loadUintBig(256),lastTransactionLt:f.loadUintBig(64)}}$r.loadShardAccount=_g;function Sg(f){return u=>{f.account?u.storeRef((0,Wu.beginCell)().storeBit(!0).store((0,Zd.storeAccount)(f.account))):u.storeRef((0,Wu.beginCell)().storeBit(!1)),u.storeUint(f.lastTransactionHash,256),u.storeUint(f.lastTransactionLt,64)}}$r.storeShardAccount=Sg;var bf={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=void 0;const u=Qr(),w=Kr,c=$r;f.ShardAccountRefValue={parse:m=>{let y=(0,w.loadDepthBalanceInfo)(m),g=(0,c.loadShardAccount)(m);return{depthBalanceInfo:y,shardAccount:g}},serialize(m,y){y.store((0,w.storeDepthBalanceInfo)(m.depthBalanceInfo)),y.store((0,c.storeShardAccount)(m.shardAccount))}};function S(m){return u.Dictionary.load(u.Dictionary.Keys.BigUint(256),f.ShardAccountRefValue,m)}f.loadShardAccounts=S;function n(m){return y=>{y.storeDict(m)}}f.storeShardAccounts=n})(bf);var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.storeShardIdent=Vr.loadShardIdent=void 0;function Bg(f){if(f.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:f.loadUint(6),workchainId:f.loadInt(32),shardPrefix:f.loadUintBig(64)}}Vr.loadShardIdent=Bg;function Ag(f){return u=>{u.storeUint(0,2),u.storeUint(f.shardPrefixBits,6),u.storeInt(f.workchainId,32),u.storeUint(f.shardPrefix,64)}}Vr.storeShardIdent=Ag;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.loadShardStateUnsplit=void 0;const kg=Gi,Eg=bf,Rg=Vr;function Ig(f){if(f.loadUint(32)!==2418257890)throw Error("Invalid data");let u=f.loadInt(32),w=(0,Rg.loadShardIdent)(f),c=f.loadUint(32),S=f.loadUint(32),n=f.loadUint(32),m=f.loadUintBig(64),y=f.loadUint(32);f.loadRef();let g=f.loadBit(),b=f.loadRef(),v;b.isExotic||(v=(0,Eg.loadShardAccounts)(b.beginParse())),f.loadRef();let _=f.loadBit(),M=null;if(_){let B=f.loadRef();B.isExotic||(M=(0,kg.loadMasterchainStateExtra)(B.beginParse()))}return{globalId:u,shardId:w,seqno:c,vertSeqNo:S,genUtime:n,genLt:m,minRefMcSeqno:y,beforeSplit:g,accounts:v,extras:M}}Wn.loadShardStateUnsplit=Ig;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.storeSplitMergeInfo=Zr.loadSplitMergeInfo=void 0;function Pg(f){let u=f.loadUint(6),w=f.loadUint(6),c=f.loadUintBig(256),S=f.loadUintBig(256);return{currentShardPrefixLength:u,accountSplitDepth:w,thisAddress:c,siblingAddress:S}}Zr.loadSplitMergeInfo=Pg;function Cg(f){return u=>{u.storeUint(f.currentShardPrefixLength,6),u.storeUint(f.accountSplitDepth,6),u.storeUint(f.thisAddress,256),u.storeUint(f.siblingAddress,256)}}Zr.storeSplitMergeInfo=Cg;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.storeStorageUsedShort=xr.loadStorageUsedShort=void 0;function Tg(f){let u=f.loadVarUintBig(3),w=f.loadVarUintBig(3);return{cells:u,bits:w}}xr.loadStorageUsedShort=Tg;function qg(f){return u=>{u.storeVarUint(f.cells,3),u.storeVarUint(f.bits,3)}}xr.storeStorageUsedShort=qg;var Er={},Rr={},Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.storeTransactionActionPhase=Wr.loadTransactionActionPhase=void 0;const Wd=Mr,Gd=xr;function Og(f){let u=f.loadBit(),w=f.loadBit(),c=f.loadBit(),S=(0,Wd.loadAccountStatusChange)(f),n=f.loadBit()?f.loadCoins():void 0,m=f.loadBit()?f.loadCoins():void 0,y=f.loadInt(32),g=f.loadBit()?f.loadInt(32):void 0,b=f.loadUint(16),v=f.loadUint(16),_=f.loadUint(16),M=f.loadUint(16),B=f.loadUintBig(256),A=(0,Gd.loadStorageUsedShort)(f);return{success:u,valid:w,noFunds:c,statusChange:S,totalFwdFees:n,totalActionFees:m,resultCode:y,resultArg:g,totalActions:b,specActions:v,skippedActions:_,messagesCreated:M,actionListHash:B,totalMessageSize:A}}Wr.loadTransactionActionPhase=Og;function Ug(f){return u=>{u.storeBit(f.success),u.storeBit(f.valid),u.storeBit(f.noFunds),u.store((0,Wd.storeAccountStatusChange)(f.statusChange)),u.storeMaybeCoins(f.totalFwdFees),u.storeMaybeCoins(f.totalActionFees),u.storeInt(f.resultCode,32),u.storeMaybeInt(f.resultArg,32),u.storeUint(f.totalActions,16),u.storeUint(f.specActions,16),u.storeUint(f.skippedActions,16),u.storeUint(f.messagesCreated,16),u.storeUint(f.actionListHash,256),u.store((0,Gd.storeStorageUsedShort)(f.totalMessageSize))}}Wr.storeTransactionActionPhase=Ug;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.storeTransactionBouncePhase=Gr.loadTransactionBouncePhase=void 0;const Mn=xr;function Ng(f){if(f.loadBit()){let u=(0,Mn.loadStorageUsedShort)(f),w=f.loadCoins(),c=f.loadCoins();return{type:"ok",messageSize:u,messageFees:w,forwardFees:c}}if(f.loadBit()){let u=(0,Mn.loadStorageUsedShort)(f),w=f.loadCoins();return{type:"no-funds",messageSize:u,requiredForwardFees:w}}return{type:"negative-funds"}}Gr.loadTransactionBouncePhase=Ng;function zg(f){return u=>{if(f.type==="ok")u.storeBit(!0),u.store((0,Mn.storeStorageUsedShort)(f.messageSize)),u.storeCoins(f.messageFees),u.storeCoins(f.forwardFees);else if(f.type==="negative-funds")u.storeBit(!1),u.storeBit(!1);else if(f.type==="no-funds")u.storeBit(!1),u.storeBit(!0),u.store((0,Mn.storeStorageUsedShort)(f.messageSize)),u.storeCoins(f.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}Gr.storeTransactionBouncePhase=zg;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.storeTransactionComputePhase=Yr.loadTransactionComputePhase=void 0;const Dg=jt(),Yd=Fr;function Lg(f){if(!f.loadBit())return{type:"skipped",reason:(0,Yd.loadComputeSkipReason)(f)};let u=f.loadBit(),w=f.loadBit(),c=f.loadBit(),S=f.loadCoins();const n=f.loadRef().beginParse();let m=n.loadVarUintBig(3),y=n.loadVarUintBig(3),g=n.loadBit()?n.loadVarUintBig(2):void 0,b=n.loadUint(8),v=n.loadUint(32),_=n.loadBit()?n.loadInt(32):void 0,M=n.loadUint(32),B=n.loadUintBig(256),A=n.loadUintBig(256);return{type:"vm",success:u,messageStateUsed:w,accountActivated:c,gasFees:S,gasUsed:m,gasLimit:y,gasCredit:g,mode:b,exitCode:v,exitArg:_,vmSteps:M,vmInitStateHash:B,vmFinalStateHash:A}}Yr.loadTransactionComputePhase=Lg;function jg(f){return u=>{if(f.type==="skipped"){u.storeBit(0),u.store((0,Yd.storeComputeSkipReason)(f.reason));return}u.storeBit(1),u.storeBit(f.success),u.storeBit(f.messageStateUsed),u.storeBit(f.accountActivated),u.storeCoins(f.gasFees),u.storeRef((0,Dg.beginCell)().storeVarUint(f.gasUsed,3).storeVarUint(f.gasLimit,3).store(w=>f.gasCredit!==void 0&&f.gasCredit!==null?w.storeBit(1).storeVarUint(f.gasCredit,2):w.storeBit(0)).storeUint(f.mode,8).storeUint(f.exitCode,32).store(w=>f.exitArg!==void 0&&f.exitArg!==null?w.storeBit(1).storeInt(f.exitArg,32):w.storeBit(0)).storeUint(f.vmSteps,32).storeUint(f.vmInitStateHash,256).storeUint(f.vmFinalStateHash,256).endCell())}}Yr.storeTransactionComputePhase=jg;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.storeTransactionCreditPhase=Xr.loadTransactionCreditPhase=void 0;const Xd=Vt;function Fg(f){const u=f.loadBit()?f.loadCoins():void 0,w=(0,Xd.loadCurrencyCollection)(f);return{dueFeesColelcted:u,credit:w}}Xr.loadTransactionCreditPhase=Fg;function Kg(f){return u=>{f.dueFeesColelcted===null||f.dueFeesColelcted===void 0?u.storeBit(!1):(u.storeBit(!0),u.storeCoins(f.dueFeesColelcted)),u.store((0,Xd.storeCurrencyCollection)(f.credit))}}Xr.storeTransactionCreditPhase=Kg;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.storeTransactionsStoragePhase=Jr.loadTransactionStoragePhase=void 0;const Jd=Mr;function Hg(f){const u=f.loadCoins();let w;f.loadBit()&&(w=f.loadCoins());const c=(0,Jd.loadAccountStatusChange)(f);return{storageFeesCollected:u,storageFeesDue:w,statusChange:c}}Jr.loadTransactionStoragePhase=Hg;function $g(f){return u=>{u.storeCoins(f.storageFeesCollected),f.storageFeesDue===null||f.storageFeesDue===void 0?u.storeBit(!1):(u.storeBit(!0),u.storeCoins(f.storageFeesDue)),u.store((0,Jd.storeAccountStatusChange)(f.statusChange))}}Jr.storeTransactionsStoragePhase=$g;var Gu;function Qd(){if(Gu)return Rr;Gu=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.storeTransactionDescription=Rr.loadTransactionDescription=void 0;const f=jt(),u=Zr,w=ec(),c=Wr,S=Gr,n=Yr,m=Xr,y=Jr;function g(v){let _=v.loadUint(4);if(_===0){const M=v.loadBit();let B;v.loadBit()&&(B=(0,y.loadTransactionStoragePhase)(v));let A;v.loadBit()&&(A=(0,m.loadTransactionCreditPhase)(v));let k=(0,n.loadTransactionComputePhase)(v),R;v.loadBit()&&(R=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));let P=v.loadBit(),C;v.loadBit()&&(C=(0,S.loadTransactionBouncePhase)(v));const N=v.loadBit();return{type:"generic",creditFirst:M,storagePhase:B,creditPhase:A,computePhase:k,actionPhase:R,bouncePhase:C,aborted:P,destroyed:N}}if(_===1)return{type:"storage",storagePhase:(0,y.loadTransactionStoragePhase)(v)};if(_===2||_===3){const M=_===3;let B=(0,y.loadTransactionStoragePhase)(v),A=(0,n.loadTransactionComputePhase)(v),k;v.loadBit()&&(k=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));const R=v.loadBit(),P=v.loadBit();return{type:"tick-tock",isTock:M,storagePhase:B,computePhase:A,actionPhase:k,aborted:R,destroyed:P}}if(_===4){let M=(0,u.loadSplitMergeInfo)(v),B;v.loadBit()&&(B=(0,y.loadTransactionStoragePhase)(v));let A=(0,n.loadTransactionComputePhase)(v),k;v.loadBit()&&(k=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));const R=v.loadBit(),P=v.loadBit();return{type:"split-prepare",splitInfo:M,storagePhase:B,computePhase:A,actionPhase:k,aborted:R,destroyed:P}}if(_===5){let M=(0,u.loadSplitMergeInfo)(v),B=(0,w.loadTransaction)(v.loadRef().beginParse());const A=v.loadBit();return{type:"split-install",splitInfo:M,prepareTransaction:B,installed:A}}throw Error(`Unsupported transaction description type ${_}`)}Rr.loadTransactionDescription=g;function b(v){return _=>{if(v.type==="generic")_.storeUint(0,4),_.storeBit(v.creditFirst),v.storagePhase?(_.storeBit(!0),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase))):_.storeBit(!1),v.creditPhase?(_.storeBit(!0),_.store((0,m.storeTransactionCreditPhase)(v.creditPhase))):_.storeBit(!1),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,c.storeTransactionActionPhase)(v.actionPhase)))):_.storeBit(!1),_.storeBit(v.aborted),v.bouncePhase?(_.storeBit(!0),_.store((0,S.storeTransactionBouncePhase)(v.bouncePhase))):_.storeBit(!1),_.storeBit(v.destroyed);else if(v.type==="storage")_.storeUint(1,4),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase));else if(v.type==="tick-tock")_.storeUint(v.isTock?3:2,4),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase)),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,c.storeTransactionActionPhase)(v.actionPhase)))):_.storeBit(!1),_.storeBit(v.aborted),_.storeBit(v.destroyed);else if(v.type==="split-prepare")_.storeUint(4,4),_.store((0,u.storeSplitMergeInfo)(v.splitInfo)),v.storagePhase?(_.storeBit(!0),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase))):_.storeBit(!1),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.store((0,c.storeTransactionActionPhase)(v.actionPhase))):_.storeBit(!1),_.storeBit(v.aborted),_.storeBit(v.destroyed);else if(v.type==="split-install")_.storeUint(5,4),_.store((0,u.storeSplitMergeInfo)(v.splitInfo)),_.storeRef((0,f.beginCell)().store((0,w.storeTransaction)(v.prepareTransaction))),_.storeBit(v.installed);else throw Error(`Unsupported transaction description type ${v.type}`)}}return Rr.storeTransactionDescription=b,Rr}var Yu;function ec(){if(Yu)return Er;Yu=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.storeTransaction=Er.loadTransaction=void 0;const f=jt(),u=Qr(),w=Dr,c=Vt,S=Hr,n=ur,m=Qd();function y(b){if(b.loadUint(4)!==7)throw Error("Invalid data");let v=b.loadUintBig(256),_=b.loadUintBig(64),M=b.loadUintBig(256),B=b.loadUintBig(64),A=b.loadUint(32),k=b.loadUint(15),R=(0,w.loadAccountStatus)(b),P=(0,w.loadAccountStatus)(b),N=b.loadRef().beginParse(),T=N.loadBit()?(0,n.loadMessage)(N.loadRef().beginParse()):void 0,L=N.loadDict(u.Dictionary.Keys.Uint(15),n.MessageValue);N.endParse();let W=(0,c.loadCurrencyCollection)(b),ee=(0,S.loadHashUpdate)(b.loadRef().beginParse()),Y=(0,m.loadTransactionDescription)(b.loadRef().beginParse());return{address:v,lt:_,prevTransactionHash:M,prevTransactionLt:B,now:A,outMessagesCount:k,oldStatus:R,endStatus:P,inMessage:T,outMessages:L,totalFees:W,stateUpdate:ee,description:Y}}Er.loadTransaction=y;function g(b){return v=>{v.storeUint(7,4),v.storeUint(b.address,256),v.storeUint(b.lt,64),v.storeUint(b.prevTransactionHash,256),v.storeUint(b.prevTransactionLt,64),v.storeUint(b.now,32),v.storeUint(b.outMessagesCount,15),v.store((0,w.storeAccountStatus)(b.oldStatus)),v.store((0,w.storeAccountStatus)(b.endStatus));let _=(0,f.beginCell)();b.inMessage?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,n.storeMessage)(b.inMessage)))):_.storeBit(!1),_.storeDict(b.outMessages),v.storeRef(_),v.store((0,c.storeCurrencyCollection)(b.totalFees)),v.storeRef((0,f.beginCell)().store((0,S.storeHashUpdate)(b.stateUpdate))),v.storeRef((0,f.beginCell)().store((0,m.storeTransactionDescription)(b.description)))}}return Er.storeTransaction=g,Er}(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.loadStorageUsedShort=f.storeStorageUsed=f.loadStorageUsed=f.storeStorageInfo=f.loadStorageInfo=f.storeStateInit=f.loadStateInit=f.storeSplitMergeInfo=f.loadSplitMergeInfo=f.storeSimpleLibrary=f.loadSimpleLibrary=f.loadShardStateUnsplit=f.storeShardIdent=f.loadShardIdent=f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=f.storeShardAccount=f.loadShardAccount=f.SendMode=f.storeMessageRelaxed=f.loadMessageRelaxed=f.storeMessage=f.loadMessage=f.loadMasterchainStateExtra=f.storeHashUpdate=f.loadHashUpdate=f.storeDepthBalanceInfo=f.loadDepthBalanceInfo=f.storeCurrencyCollection=f.loadCurrencyCollection=f.storeComputeSkipReason=f.loadComputeSkipReason=f.storeCommonMessageInfoRelaxed=f.loadCommonMessageInfoRelaxed=f.storeCommonMessageInfo=f.loadCommonMessageInfo=f.storeAccountStorage=f.loadAccountStorage=f.storeAccountStatusChange=f.loadAccountStatusChange=f.storeAccountStatus=f.loadAccountStatus=f.storeAccountState=f.loadAccountState=f.storeAccount=f.loadAccount=f.comment=f.external=f.internal=void 0,f.storeTransactionsStoragePhase=f.loadTransactionStoragePhase=f.storeTransactionDescription=f.loadTransactionDescription=f.storeTransactionCreditPhase=f.loadTransactionCreditPhase=f.storeTransactionComputePhase=f.loadTransactionComputePhase=f.storeTransactionBouncePhase=f.loadTransactionBouncePhase=f.storeTransactionActionPhase=f.loadTransactionActionPhase=f.storeTransaction=f.loadTransaction=f.storeTickTock=f.loadTickTock=f.storeStorageUsedShort=void 0;var u=wr;Object.defineProperty(f,"internal",{enumerable:!0,get:function(){return u.internal}}),Object.defineProperty(f,"external",{enumerable:!0,get:function(){return u.external}}),Object.defineProperty(f,"comment",{enumerable:!0,get:function(){return u.comment}});var w=qr;Object.defineProperty(f,"loadAccount",{enumerable:!0,get:function(){return w.loadAccount}}),Object.defineProperty(f,"storeAccount",{enumerable:!0,get:function(){return w.storeAccount}});var c=Ur;Object.defineProperty(f,"loadAccountState",{enumerable:!0,get:function(){return c.loadAccountState}}),Object.defineProperty(f,"storeAccountState",{enumerable:!0,get:function(){return c.storeAccountState}});var S=Dr;Object.defineProperty(f,"loadAccountStatus",{enumerable:!0,get:function(){return S.loadAccountStatus}}),Object.defineProperty(f,"storeAccountStatus",{enumerable:!0,get:function(){return S.storeAccountStatus}});var n=Mr;Object.defineProperty(f,"loadAccountStatusChange",{enumerable:!0,get:function(){return n.loadAccountStatusChange}}),Object.defineProperty(f,"storeAccountStatusChange",{enumerable:!0,get:function(){return n.storeAccountStatusChange}});var m=Or;Object.defineProperty(f,"loadAccountStorage",{enumerable:!0,get:function(){return m.loadAccountStorage}}),Object.defineProperty(f,"storeAccountStorage",{enumerable:!0,get:function(){return m.storeAccountStorage}});var y=Lr;Object.defineProperty(f,"loadCommonMessageInfo",{enumerable:!0,get:function(){return y.loadCommonMessageInfo}}),Object.defineProperty(f,"storeCommonMessageInfo",{enumerable:!0,get:function(){return y.storeCommonMessageInfo}});var g=jr;Object.defineProperty(f,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return g.loadCommonMessageInfoRelaxed}}),Object.defineProperty(f,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return g.storeCommonMessageInfoRelaxed}});var b=Fr;Object.defineProperty(f,"loadComputeSkipReason",{enumerable:!0,get:function(){return b.loadComputeSkipReason}}),Object.defineProperty(f,"storeComputeSkipReason",{enumerable:!0,get:function(){return b.storeComputeSkipReason}});var v=Vt;Object.defineProperty(f,"loadCurrencyCollection",{enumerable:!0,get:function(){return v.loadCurrencyCollection}}),Object.defineProperty(f,"storeCurrencyCollection",{enumerable:!0,get:function(){return v.storeCurrencyCollection}});var _=Kr;Object.defineProperty(f,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return _.loadDepthBalanceInfo}}),Object.defineProperty(f,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return _.storeDepthBalanceInfo}});var M=Hr;Object.defineProperty(f,"loadHashUpdate",{enumerable:!0,get:function(){return M.loadHashUpdate}}),Object.defineProperty(f,"storeHashUpdate",{enumerable:!0,get:function(){return M.storeHashUpdate}});var B=Gi;Object.defineProperty(f,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return B.loadMasterchainStateExtra}});var A=ur;Object.defineProperty(f,"loadMessage",{enumerable:!0,get:function(){return A.loadMessage}}),Object.defineProperty(f,"storeMessage",{enumerable:!0,get:function(){return A.storeMessage}});var k=oi;Object.defineProperty(f,"loadMessageRelaxed",{enumerable:!0,get:function(){return k.loadMessageRelaxed}}),Object.defineProperty(f,"storeMessageRelaxed",{enumerable:!0,get:function(){return k.storeMessageRelaxed}});var R=Vd;Object.defineProperty(f,"SendMode",{enumerable:!0,get:function(){return R.SendMode}});var P=$r;Object.defineProperty(f,"loadShardAccount",{enumerable:!0,get:function(){return P.loadShardAccount}}),Object.defineProperty(f,"storeShardAccount",{enumerable:!0,get:function(){return P.storeShardAccount}});var C=bf;Object.defineProperty(f,"ShardAccountRefValue",{enumerable:!0,get:function(){return C.ShardAccountRefValue}}),Object.defineProperty(f,"loadShardAccounts",{enumerable:!0,get:function(){return C.loadShardAccounts}}),Object.defineProperty(f,"storeShardAccounts",{enumerable:!0,get:function(){return C.storeShardAccounts}});var N=Vr;Object.defineProperty(f,"loadShardIdent",{enumerable:!0,get:function(){return N.loadShardIdent}}),Object.defineProperty(f,"storeShardIdent",{enumerable:!0,get:function(){return N.storeShardIdent}});var T=Wn;Object.defineProperty(f,"loadShardStateUnsplit",{enumerable:!0,get:function(){return T.loadShardStateUnsplit}});var L=hr;Object.defineProperty(f,"loadSimpleLibrary",{enumerable:!0,get:function(){return L.loadSimpleLibrary}}),Object.defineProperty(f,"storeSimpleLibrary",{enumerable:!0,get:function(){return L.storeSimpleLibrary}});var W=Zr;Object.defineProperty(f,"loadSplitMergeInfo",{enumerable:!0,get:function(){return W.loadSplitMergeInfo}}),Object.defineProperty(f,"storeSplitMergeInfo",{enumerable:!0,get:function(){return W.storeSplitMergeInfo}});var ee=ir;Object.defineProperty(f,"loadStateInit",{enumerable:!0,get:function(){return ee.loadStateInit}}),Object.defineProperty(f,"storeStateInit",{enumerable:!0,get:function(){return ee.storeStateInit}});var Y=Nr;Object.defineProperty(f,"loadStorageInfo",{enumerable:!0,get:function(){return Y.loadStorageInfo}}),Object.defineProperty(f,"storeStorageInfo",{enumerable:!0,get:function(){return Y.storeStorageInfo}});var F=zr;Object.defineProperty(f,"loadStorageUsed",{enumerable:!0,get:function(){return F.loadStorageUsed}}),Object.defineProperty(f,"storeStorageUsed",{enumerable:!0,get:function(){return F.storeStorageUsed}});var de=xr;Object.defineProperty(f,"loadStorageUsedShort",{enumerable:!0,get:function(){return de.loadStorageUsedShort}}),Object.defineProperty(f,"storeStorageUsedShort",{enumerable:!0,get:function(){return de.storeStorageUsedShort}});var d=Cr;Object.defineProperty(f,"loadTickTock",{enumerable:!0,get:function(){return d.loadTickTock}}),Object.defineProperty(f,"storeTickTock",{enumerable:!0,get:function(){return d.storeTickTock}});var e=ec();Object.defineProperty(f,"loadTransaction",{enumerable:!0,get:function(){return e.loadTransaction}}),Object.defineProperty(f,"storeTransaction",{enumerable:!0,get:function(){return e.storeTransaction}});var r=Wr;Object.defineProperty(f,"loadTransactionActionPhase",{enumerable:!0,get:function(){return r.loadTransactionActionPhase}}),Object.defineProperty(f,"storeTransactionActionPhase",{enumerable:!0,get:function(){return r.storeTransactionActionPhase}});var i=Gr;Object.defineProperty(f,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return i.loadTransactionBouncePhase}}),Object.defineProperty(f,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return i.storeTransactionBouncePhase}});var a=Yr;Object.defineProperty(f,"loadTransactionComputePhase",{enumerable:!0,get:function(){return a.loadTransactionComputePhase}}),Object.defineProperty(f,"storeTransactionComputePhase",{enumerable:!0,get:function(){return a.storeTransactionComputePhase}});var s=Xr;Object.defineProperty(f,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return s.loadTransactionCreditPhase}}),Object.defineProperty(f,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return s.storeTransactionCreditPhase}});var l=Qd();Object.defineProperty(f,"loadTransactionDescription",{enumerable:!0,get:function(){return l.loadTransactionDescription}}),Object.defineProperty(f,"storeTransactionDescription",{enumerable:!0,get:function(){return l.storeTransactionDescription}});var p=Jr;Object.defineProperty(f,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return p.loadTransactionStoragePhase}}),Object.defineProperty(f,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return p.storeTransactionsStoragePhase}})})(Rd);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.openContract=void 0;const Vg=$t,Xu=ei();function Zg(f,u){let w,c=null;if(!Vg.Address.isAddress(f.address))throw Error("Invalid address");if(w=f.address,f.init){if(!(f.init.code instanceof Xu.Cell))throw Error("Invalid init.code");if(!(f.init.data instanceof Xu.Cell))throw Error("Invalid init.data");c=f.init}let S=u({address:w,init:c});return new Proxy(f,{get(n,m){const y=n[m];return typeof m=="string"&&(m.startsWith("get")||m.startsWith("send"))&&typeof y=="function"?(...g)=>y.apply(n,[S,...g]):y}})}Gn.openContract=Zg;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ComputeError=void 0;class yf extends Error{constructor(u,w,c){super(u),this.exitCode=w,this.debugLogs=c&&c.debugLogs?c.debugLogs:null,this.logs=c&&c.logs?c.logs:null,Object.setPrototypeOf(this,yf.prototype)}}Yn.ComputeError=yf;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMethodId=void 0;const Wg=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function Gg(f){f instanceof Le.Buffer||(f=Le.Buffer.from(f));let u=0;for(let w=0;w>8^c)&255]^u<<8)&65535}return u}function Yg(f){return Gg(f)&65535|65536}Xn.getMethodId=Yg;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.safeSignVerify=si.safeSign=void 0;const wf=gf(),Xg=8,Jg=64;function tc(f,u){let w=Le.Buffer.from(u);if(w.length>Jg)throw Error("Seed can be longer than 64 bytes");if(w.length{},messages:{},getters:{}});export{rn as a,ht as c,Ii as d,ab as g,gf as r,ob as s}; +`+C.toString(A+" ")}return R}asSlice(){return this.beginParse()}asBuilder(){return(0,v.beginCell)().storeSlice(this.asSlice())}};return Bi.Cell=_,u=w.default,_.EMPTY=new _,Bi}var Vu;function jt(){if(Vu)return Sr;Vu=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Builder=Sr.beginCell=void 0;const f=Sn(),u=ei(),w=nl();function c(){return new S}Sr.beginCell=c;let S=class _d{constructor(){this._bits=new f.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(m){return this._bits.writeBit(m),this}storeBits(m){return this._bits.writeBits(m),this}storeBuffer(m,y){if(y!=null&&m.length!==y)throw Error(`Buffer length ${m.length} is not equal to ${y}`);return this._bits.writeBuffer(m),this}storeMaybeBuffer(m,y){return m!==null?(this.storeBit(1),this.storeBuffer(m,y)):this.storeBit(0),this}storeUint(m,y){return this._bits.writeUint(m,y),this}storeMaybeUint(m,y){return m!=null?(this.storeBit(1),this.storeUint(m,y)):this.storeBit(0),this}storeInt(m,y){return this._bits.writeInt(m,y),this}storeMaybeInt(m,y){return m!=null?(this.storeBit(1),this.storeInt(m,y)):this.storeBit(0),this}storeVarUint(m,y){return this._bits.writeVarUint(m,y),this}storeMaybeVarUint(m,y){return m!=null?(this.storeBit(1),this.storeVarUint(m,y)):this.storeBit(0),this}storeVarInt(m,y){return this._bits.writeVarInt(m,y),this}storeMaybeVarInt(m,y){return m!=null?(this.storeBit(1),this.storeVarInt(m,y)):this.storeBit(0),this}storeCoins(m){return this._bits.writeCoins(m),this}storeMaybeCoins(m){return m!=null?(this.storeBit(1),this.storeCoins(m)):this.storeBit(0),this}storeAddress(m){return this._bits.writeAddress(m),this}storeRef(m){if(this._refs.length>=4)throw new Error("Too many references");if(m instanceof u.Cell)this._refs.push(m);else if(m instanceof _d)this._refs.push(m.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(m){return m?(this.storeBit(1),this.storeRef(m)):this.storeBit(0),this}storeSlice(m){let y=m.clone();for(y.remainingBits>0&&this.storeBits(y.loadBits(y.remainingBits));y.remainingRefs>0;)this.storeRef(y.loadRef());return this}storeMaybeSlice(m){return m?(this.storeBit(1),this.storeSlice(m)):this.storeBit(0),this}storeBuilder(m){return this.storeSlice(m.endCell().beginParse())}storeMaybeBuilder(m){return m?(this.storeBit(1),this.storeBuilder(m)):this.storeBit(0),this}storeWritable(m){return typeof m=="object"?m.writeTo(this):m(this),this}storeMaybeWritable(m){return m?(this.storeBit(1),this.storeWritable(m)):this.storeBit(0),this}store(m){return this.storeWritable(m),this}storeStringTail(m){return(0,w.writeString)(m,this),this}storeMaybeStringTail(m){return m!=null?(this.storeBit(1),(0,w.writeString)(m,this)):this.storeBit(0),this}storeStringRefTail(m){return this.storeRef(c().storeStringTail(m)),this}storeMaybeStringRefTail(m){return m!=null?(this.storeBit(1),this.storeStringRefTail(m)):this.storeBit(0),this}storeDict(m,y,g){return m?m.store(this,y,g):this.storeBit(0),this}storeDictDirect(m,y,g){return m.storeDirect(this,y,g),this}endCell(){return new u.Cell({bits:this._bits.build(),refs:this._refs})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}};return Sr.Builder=S,Sr}var ir={},hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.SimpleLibraryValue=hr.storeSimpleLibrary=hr.loadSimpleLibrary=void 0;function Sd(f){return{public:f.loadBit(),root:f.loadRef()}}hr.loadSimpleLibrary=Sd;function Bd(f){return u=>{u.storeBit(f.public),u.storeRef(f.root)}}hr.storeSimpleLibrary=Bd;hr.SimpleLibraryValue={serialize(f,u){Bd(f)(u)},parse(f){return Sd(f)}};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.storeTickTock=Cr.loadTickTock=void 0;function Bm(f){return{tick:f.loadBit(),tock:f.loadBit()}}Cr.loadTickTock=Bm;function Am(f){return u=>{u.storeBit(f.tick),u.storeBit(f.tock)}}Cr.storeTickTock=Am;Object.defineProperty(ir,"__esModule",{value:!0});ir.storeStateInit=ir.loadStateInit=void 0;const km=Qr(),Em=hr,Ad=Cr;function Rm(f){let u;f.loadBit()&&(u=f.loadUint(5));let w;f.loadBit()&&(w=(0,Ad.loadTickTock)(f));let c=f.loadMaybeRef(),S=f.loadMaybeRef(),n=f.loadDict(km.Dictionary.Keys.BigUint(256),Em.SimpleLibraryValue);return n.size===0&&(n=void 0),{splitDepth:u,special:w,code:c,data:S,libraries:n}}ir.loadStateInit=Rm;function Im(f){return u=>{f.splitDepth!==null&&f.splitDepth!==void 0?(u.storeBit(!0),u.storeUint(f.splitDepth,5)):u.storeBit(!1),f.special!==null&&f.special!==void 0?(u.storeBit(!0),u.store((0,Ad.storeTickTock)(f.special))):u.storeBit(!1),u.storeMaybeRef(f.code),u.storeMaybeRef(f.data),u.storeDict(f.libraries)}}ir.storeStateInit=Im;Object.defineProperty(_n,"__esModule",{value:!0});_n.contractAddress=void 0;const Pm=jt(),Cm=ir,Tm=$t;function qm(f,u){let w=(0,Pm.beginCell)().store((0,Cm.storeStateInit)(u)).endCell().hash();return new Tm.Address(f,w)}_n.contractAddress=qm;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.parseTuple=ai.serializeTuple=void 0;const Di=jt(),Om=BigInt("-9223372036854775808"),Um=BigInt("9223372036854775807");function kd(f,u){if(f.type==="null")u.storeUint(0,8);else if(f.type==="int")f.value<=Um&&f.value>=Om?(u.storeUint(1,8),u.storeInt(f.value,64)):(u.storeUint(256,15),u.storeInt(f.value,257));else if(f.type==="nan")u.storeInt(767,16);else if(f.type==="cell")u.storeUint(3,8),u.storeRef(f.cell);else if(f.type==="slice")u.storeUint(4,8),u.storeUint(0,10),u.storeUint(f.cell.bits.length,10),u.storeUint(0,3),u.storeUint(f.cell.refs.length,3),u.storeRef(f.cell);else if(f.type==="builder")u.storeUint(5,8),u.storeRef(f.cell);else if(f.type==="tuple"){let w=null,c=null;for(let S=0;S1&&(w=(0,Di.beginCell)().storeRef(c).storeRef(w).endCell());let m=(0,Di.beginCell)();kd(f.items[S],m),c=m.endCell()}u.storeUint(7,8),u.storeUint(f.items.length,16),w&&u.storeRef(w),c&&u.storeRef(c)}else throw Error("Invalid value")}function Ci(f){let u=f.loadUint(8);if(u===0)return{type:"null"};if(u===1)return{type:"int",value:f.loadIntBig(64)};if(u===2)return f.loadUint(7)===0?{type:"int",value:f.loadIntBig(257)}:(f.loadBit(),{type:"nan"});if(u===3)return{type:"cell",cell:f.loadRef()};if(u===4){let w=f.loadUint(10),c=f.loadUint(10),S=f.loadUint(3),n=f.loadUint(3),m=f.loadRef().beginParse();m.skip(w);let y=m.loadBits(c-w),g=(0,Di.beginCell)().storeBits(y);if(S1){let S=f.loadRef().beginParse(),n=f.loadRef().beginParse();c.unshift(Ci(n));for(let m=0;m0){let w=(0,Di.beginCell)();Ed(f.slice(0,f.length-1),w),u.storeRef(w.endCell()),kd(f[f.length-1],u)}}function Nm(f){let u=(0,Di.beginCell)();u.storeUint(f.length,24);let w=[...f];return Ed(w,u),u.endCell()}ai.serializeTuple=Nm;function zm(f){let u=[],w=f.beginParse(),c=w.loadUint(24);for(let S=0;S2)throw Error("Invalid number");let c=w[0],S=w[1];if(c||(c="0"),S||(S="0"),S.length>9)throw Error("Invalid number");for(;S.length<9;)S+="0";let n=BigInt(c)*1000000000n+BigInt(S);return u&&(n=-n),n}}Tr.toNano=Lm;function jm(f){let u=BigInt(f),w=!1;u<0&&(w=!0,u=-u);let S=(u%1000000000n).toString();for(;S.length<9;)S="0"+S;S=S.match(/^([0-9]*[1-9]|0)(0*)/)[1];let y=`${(u/1000000000n).toString()}${S==="0"?"":`.${S}`}`;return w&&(y="-"+y),y}Tr.fromNano=jm;Object.defineProperty(wr,"__esModule",{value:!0});wr.comment=wr.external=wr.internal=void 0;const wn=$t,Id=ei(),Pd=jt(),Fm=Tr;function Km(f){let u=!0;f.bounce!==null&&f.bounce!==void 0&&(u=f.bounce);let w;if(typeof f.to=="string")w=wn.Address.parse(f.to);else if(wn.Address.isAddress(f.to))w=f.to;else throw new Error(`Invalid address ${f.to}`);let c;typeof f.value=="string"?c=(0,Fm.toNano)(f.value):c=f.value;let S=Id.Cell.EMPTY;return typeof f.body=="string"?S=(0,Pd.beginCell)().storeUint(0,32).storeStringTail(f.body).endCell():f.body&&(S=f.body),{info:{type:"internal",dest:w,value:{coins:c},bounce:u,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:f.init?{code:f.init.code,data:f.init.data}:void 0,body:S}}wr.internal=Km;function Hm(f){let u;if(typeof f.to=="string")u=wn.Address.parse(f.to);else if(wn.Address.isAddress(f.to))u=f.to;else throw new Error(`Invalid address ${f.to}`);return{info:{type:"external-in",dest:u,importFee:0n},init:f.init?{code:f.init.code,data:f.init.data}:void 0,body:f.body||Id.Cell.EMPTY}}wr.external=Hm;function $m(f){return(0,Pd.beginCell)().storeUint(0,32).storeStringTail(f).endCell()}wr.comment=$m;var qr={},Or={},Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.storeAccountState=Ur.loadAccountState=void 0;const Cd=ir;function Vm(f){return f.loadBit()?{type:"active",state:(0,Cd.loadStateInit)(f)}:f.loadBit()?{type:"frozen",stateHash:f.loadUintBig(256)}:{type:"uninit"}}Ur.loadAccountState=Vm;function Zm(f){return u=>{f.type==="active"?(u.storeBit(!0),u.store((0,Cd.storeStateInit)(f.state))):f.type==="frozen"?(u.storeBit(!1),u.storeBit(!0),u.storeUint(f.stateHash,256)):f.type==="uninit"&&(u.storeBit(!1),u.storeBit(!1))}}Ur.storeAccountState=Zm;var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.storeCurrencyCollection=Vt.loadCurrencyCollection=void 0;const Zu=Qr();function Wm(f){const u=f.loadCoins(),w=f.loadDict(Zu.Dictionary.Keys.Uint(32),Zu.Dictionary.Values.BigVarUint(5));return w.size===0?{coins:u}:{other:w,coins:u}}Vt.loadCurrencyCollection=Wm;function Gm(f){return u=>{u.storeCoins(f.coins),f.other?u.storeDict(f.other):u.storeBit(0)}}Vt.storeCurrencyCollection=Gm;Object.defineProperty(Or,"__esModule",{value:!0});Or.storeAccountStorage=Or.loadAccountStorage=void 0;const Td=Ur,qd=Vt;function Ym(f){return{lastTransLt:f.loadUintBig(64),balance:(0,qd.loadCurrencyCollection)(f),state:(0,Td.loadAccountState)(f)}}Or.loadAccountStorage=Ym;function Xm(f){return u=>{u.storeUint(f.lastTransLt,64),u.store((0,qd.storeCurrencyCollection)(f.balance)),u.store((0,Td.storeAccountState)(f.state))}}Or.storeAccountStorage=Xm;var Nr={},zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.storeStorageUsed=zr.loadStorageUsed=void 0;function Jm(f){return{cells:f.loadVarUintBig(3),bits:f.loadVarUintBig(3),publicCells:f.loadVarUintBig(3)}}zr.loadStorageUsed=Jm;function Qm(f){return u=>{u.storeVarUint(f.cells,3),u.storeVarUint(f.bits,3),u.storeVarUint(f.publicCells,3)}}zr.storeStorageUsed=Qm;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.storeStorageInfo=Nr.loadStorageInfo=void 0;const Od=zr;function eg(f){return{used:(0,Od.loadStorageUsed)(f),lastPaid:f.loadUint(32),duePayment:f.loadMaybeCoins()}}Nr.loadStorageInfo=eg;function tg(f){return u=>{u.store((0,Od.storeStorageUsed)(f.used)),u.storeUint(f.lastPaid,32),u.storeMaybeCoins(f.duePayment)}}Nr.storeStorageInfo=tg;Object.defineProperty(qr,"__esModule",{value:!0});qr.storeAccount=qr.loadAccount=void 0;const Ud=Or,Nd=Nr;function rg(f){return{addr:f.loadAddress(),storageStats:(0,Nd.loadStorageInfo)(f),storage:(0,Ud.loadAccountStorage)(f)}}qr.loadAccount=rg;function ig(f){return u=>{u.storeAddress(f.addr),u.store((0,Nd.storeStorageInfo)(f.storageStats)),u.store((0,Ud.storeAccountStorage)(f.storage))}}qr.storeAccount=ig;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.storeAccountStatus=Dr.loadAccountStatus=void 0;function ng(f){const u=f.loadUint(2);if(u===0)return"uninitialized";if(u===1)return"frozen";if(u===2)return"active";if(u===3)return"non-existing";throw Error("Invalid data")}Dr.loadAccountStatus=ng;function ag(f){return u=>{if(f==="uninitialized")u.storeUint(0,2);else if(f==="frozen")u.storeUint(1,2);else if(f==="active")u.storeUint(2,2);else if(f==="non-existing")u.storeUint(3,2);else throw Error("Invalid data");return u}}Dr.storeAccountStatus=ag;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.storeAccountStatusChange=Mr.loadAccountStatusChange=void 0;function og(f){return f.loadBit()?f.loadBit()?"frozen":"deleted":"unchanged"}Mr.loadAccountStatusChange=og;function sg(f){return u=>{if(f=="unchanged")u.storeBit(0);else if(f==="frozen")u.storeBit(1),u.storeBit(0);else if(f==="deleted")u.storeBit(1),u.storeBit(1);else throw Error("Invalid account status change")}}Mr.storeAccountStatusChange=sg;var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.storeCommonMessageInfo=Lr.loadCommonMessageInfo=void 0;const zd=Vt;function fg(f){if(!f.loadBit()){const n=f.loadBit(),m=f.loadBit(),y=f.loadBit(),g=f.loadAddress(),b=f.loadAddress(),v=(0,zd.loadCurrencyCollection)(f),_=f.loadCoins(),M=f.loadCoins(),B=f.loadUintBig(64),A=f.loadUint(32);return{type:"internal",ihrDisabled:n,bounce:m,bounced:y,src:g,dest:b,value:v,ihrFee:_,forwardFee:M,createdLt:B,createdAt:A}}if(!f.loadBit()){const n=f.loadMaybeExternalAddress(),m=f.loadAddress(),y=f.loadCoins();return{type:"external-in",src:n,dest:m,importFee:y}}const u=f.loadAddress(),w=f.loadMaybeExternalAddress(),c=f.loadUintBig(64),S=f.loadUint(32);return{type:"external-out",src:u,dest:w,createdLt:c,createdAt:S}}Lr.loadCommonMessageInfo=fg;function hg(f){return u=>{if(f.type==="internal")u.storeBit(0),u.storeBit(f.ihrDisabled),u.storeBit(f.bounce),u.storeBit(f.bounced),u.storeAddress(f.src),u.storeAddress(f.dest),u.store((0,zd.storeCurrencyCollection)(f.value)),u.storeCoins(f.ihrFee),u.storeCoins(f.forwardFee),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else if(f.type==="external-in")u.storeBit(1),u.storeBit(0),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeCoins(f.importFee);else if(f.type==="external-out")u.storeBit(1),u.storeBit(1),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}Lr.storeCommonMessageInfo=hg;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.storeCommonMessageInfoRelaxed=jr.loadCommonMessageInfoRelaxed=void 0;const Dd=Vt;function ug(f){if(!f.loadBit()){const n=f.loadBit(),m=f.loadBit(),y=f.loadBit(),g=f.loadMaybeAddress(),b=f.loadAddress(),v=(0,Dd.loadCurrencyCollection)(f),_=f.loadCoins(),M=f.loadCoins(),B=f.loadUintBig(64),A=f.loadUint(32);return{type:"internal",ihrDisabled:n,bounce:m,bounced:y,src:g,dest:b,value:v,ihrFee:_,forwardFee:M,createdLt:B,createdAt:A}}if(!f.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");const u=f.loadMaybeAddress(),w=f.loadMaybeExternalAddress(),c=f.loadUintBig(64),S=f.loadUint(32);return{type:"external-out",src:u,dest:w,createdLt:c,createdAt:S}}jr.loadCommonMessageInfoRelaxed=ug;function lg(f){return u=>{if(f.type==="internal")u.storeBit(0),u.storeBit(f.ihrDisabled),u.storeBit(f.bounce),u.storeBit(f.bounced),u.storeAddress(f.src),u.storeAddress(f.dest),u.store((0,Dd.storeCurrencyCollection)(f.value)),u.storeCoins(f.ihrFee),u.storeCoins(f.forwardFee),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else if(f.type==="external-out")u.storeBit(1),u.storeBit(1),u.storeAddress(f.src),u.storeAddress(f.dest),u.storeUint(f.createdLt,64),u.storeUint(f.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}jr.storeCommonMessageInfoRelaxed=lg;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.storeComputeSkipReason=Fr.loadComputeSkipReason=void 0;function dg(f){let u=f.loadUint(2);if(u===0)return"no-state";if(u===1)return"bad-state";if(u===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${u}`)}Fr.loadComputeSkipReason=dg;function cg(f){return u=>{if(f==="no-state")u.storeUint(0,2);else if(f==="bad-state")u.storeUint(1,2);else if(f==="no-gas")u.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${f}`)}}Fr.storeComputeSkipReason=cg;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.storeDepthBalanceInfo=Kr.loadDepthBalanceInfo=void 0;const Ld=Vt;function pg(f){return{splitDepth:f.loadUint(5),balance:(0,Ld.loadCurrencyCollection)(f)}}Kr.loadDepthBalanceInfo=pg;function vg(f){return u=>{u.storeUint(f.splitDepth,5),u.store((0,Ld.storeCurrencyCollection)(f.balance))}}Kr.storeDepthBalanceInfo=vg;var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.storeHashUpdate=Hr.loadHashUpdate=void 0;function mg(f){if(f.loadUint(8)!==114)throw Error("Invalid data");const u=f.loadBuffer(32),w=f.loadBuffer(32);return{oldHash:u,newHash:w}}Hr.loadHashUpdate=mg;function gg(f){return u=>{u.storeUint(114,8),u.storeBuffer(f.oldHash),u.storeBuffer(f.newHash)}}Hr.storeHashUpdate=gg;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.loadMasterchainStateExtra=void 0;const ks=Qr(),bg=Vt;function yg(f){if(f.loadUint(16)!==52262)throw Error("Invalid data");f.loadBit()&&f.loadRef();let u=f.loadUintBig(256),w=ks.Dictionary.load(ks.Dictionary.Keys.Int(32),ks.Dictionary.Values.Cell(),f);const c=(0,bg.loadCurrencyCollection)(f);return{config:w,configAddress:u,globalBalance:c}}Gi.loadMasterchainStateExtra=yg;var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.MessageValue=ur.storeMessage=ur.loadMessage=void 0;const jd=jt(),Fd=Lr,Os=ir;function Kd(f){const u=(0,Fd.loadCommonMessageInfo)(f);let w=null;f.loadBit()&&(f.loadBit()?w=(0,Os.loadStateInit)(f.loadRef().beginParse()):w=(0,Os.loadStateInit)(f));const c=f.loadBit()?f.loadRef():f.asCell();return{info:u,init:w,body:c}}ur.loadMessage=Kd;function Hd(f,u){return w=>{if(w.store((0,Fd.storeCommonMessageInfo)(f.info)),f.init){w.storeBit(!0);let S=(0,jd.beginCell)().store((0,Os.storeStateInit)(f.init)),n=!1;u&&u.forceRef?n=!0:w.availableBits-2>=S.bits?n=!1:n=!0,n?(w.storeBit(!0),w.storeRef(S)):(w.storeBit(!1),w.storeBuilder(S))}else w.storeBit(!1);let c=!1;u&&u.forceRef?c=!0:w.availableBits-1>=f.body.bits.length&&w.refs+f.body.refs.length<=4?c=!1:c=!0,c?(w.storeBit(!0),w.storeRef(f.body)):(w.storeBit(!1),w.storeBuilder(f.body.asBuilder()))}}ur.storeMessage=Hd;ur.MessageValue={serialize(f,u){u.storeRef((0,jd.beginCell)().store(Hd(f)))},parse(f){return Kd(f.loadRef().beginParse())}};var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.storeMessageRelaxed=oi.loadMessageRelaxed=void 0;const wg=jt(),$d=jr,Us=ir;function Mg(f){const u=(0,$d.loadCommonMessageInfoRelaxed)(f);let w=null;f.loadBit()&&(f.loadBit()?w=(0,Us.loadStateInit)(f.loadRef().beginParse()):w=(0,Us.loadStateInit)(f));const c=f.loadBit()?f.loadRef():f.asCell();return{info:u,init:w,body:c}}oi.loadMessageRelaxed=Mg;function xg(f,u){return w=>{if(w.store((0,$d.storeCommonMessageInfoRelaxed)(f.info)),f.init){w.storeBit(!0);let S=(0,wg.beginCell)().store((0,Us.storeStateInit)(f.init)),n=!1;u&&u.forceRef?n=!0:w.availableBits-2>=S.bits?n=!1:n=!0,n?(w.storeBit(!0),w.storeRef(S)):(w.storeBit(!1),w.storeBuilder(S))}else w.storeBit(!1);let c=!1;u&&u.forceRef?c=!0:w.availableBits-1>=f.body.bits.length&&w.refs+f.body.refs.length<=4?c=!1:c=!0,c?(w.storeBit(!0),w.storeRef(f.body)):(w.storeBit(!1),w.storeBuilder(f.body.asBuilder()))}}oi.storeMessageRelaxed=xg;var Vd={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.SendMode=void 0,function(u){u[u.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",u[u.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",u[u.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",u[u.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",u[u.IGNORE_ERRORS=2]="IGNORE_ERRORS",u[u.NONE=0]="NONE"}(f.SendMode||(f.SendMode={}))})(Vd);var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.storeShardAccount=$r.loadShardAccount=void 0;const Wu=jt(),Zd=qr;function _g(f){let u=f.loadRef(),w;if(!u.isExotic){let c=u.beginParse();c.loadBit()&&(w=(0,Zd.loadAccount)(c))}return{account:w,lastTransactionHash:f.loadUintBig(256),lastTransactionLt:f.loadUintBig(64)}}$r.loadShardAccount=_g;function Sg(f){return u=>{f.account?u.storeRef((0,Wu.beginCell)().storeBit(!0).store((0,Zd.storeAccount)(f.account))):u.storeRef((0,Wu.beginCell)().storeBit(!1)),u.storeUint(f.lastTransactionHash,256),u.storeUint(f.lastTransactionLt,64)}}$r.storeShardAccount=Sg;var bf={};(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=void 0;const u=Qr(),w=Kr,c=$r;f.ShardAccountRefValue={parse:m=>{let y=(0,w.loadDepthBalanceInfo)(m),g=(0,c.loadShardAccount)(m);return{depthBalanceInfo:y,shardAccount:g}},serialize(m,y){y.store((0,w.storeDepthBalanceInfo)(m.depthBalanceInfo)),y.store((0,c.storeShardAccount)(m.shardAccount))}};function S(m){return u.Dictionary.load(u.Dictionary.Keys.BigUint(256),f.ShardAccountRefValue,m)}f.loadShardAccounts=S;function n(m){return y=>{y.storeDict(m)}}f.storeShardAccounts=n})(bf);var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.storeShardIdent=Vr.loadShardIdent=void 0;function Bg(f){if(f.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:f.loadUint(6),workchainId:f.loadInt(32),shardPrefix:f.loadUintBig(64)}}Vr.loadShardIdent=Bg;function Ag(f){return u=>{u.storeUint(0,2),u.storeUint(f.shardPrefixBits,6),u.storeInt(f.workchainId,32),u.storeUint(f.shardPrefix,64)}}Vr.storeShardIdent=Ag;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.loadShardStateUnsplit=void 0;const kg=Gi,Eg=bf,Rg=Vr;function Ig(f){if(f.loadUint(32)!==2418257890)throw Error("Invalid data");let u=f.loadInt(32),w=(0,Rg.loadShardIdent)(f),c=f.loadUint(32),S=f.loadUint(32),n=f.loadUint(32),m=f.loadUintBig(64),y=f.loadUint(32);f.loadRef();let g=f.loadBit(),b=f.loadRef(),v;b.isExotic||(v=(0,Eg.loadShardAccounts)(b.beginParse())),f.loadRef();let _=f.loadBit(),M=null;if(_){let B=f.loadRef();B.isExotic||(M=(0,kg.loadMasterchainStateExtra)(B.beginParse()))}return{globalId:u,shardId:w,seqno:c,vertSeqNo:S,genUtime:n,genLt:m,minRefMcSeqno:y,beforeSplit:g,accounts:v,extras:M}}Wn.loadShardStateUnsplit=Ig;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.storeSplitMergeInfo=Zr.loadSplitMergeInfo=void 0;function Pg(f){let u=f.loadUint(6),w=f.loadUint(6),c=f.loadUintBig(256),S=f.loadUintBig(256);return{currentShardPrefixLength:u,accountSplitDepth:w,thisAddress:c,siblingAddress:S}}Zr.loadSplitMergeInfo=Pg;function Cg(f){return u=>{u.storeUint(f.currentShardPrefixLength,6),u.storeUint(f.accountSplitDepth,6),u.storeUint(f.thisAddress,256),u.storeUint(f.siblingAddress,256)}}Zr.storeSplitMergeInfo=Cg;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.storeStorageUsedShort=xr.loadStorageUsedShort=void 0;function Tg(f){let u=f.loadVarUintBig(3),w=f.loadVarUintBig(3);return{cells:u,bits:w}}xr.loadStorageUsedShort=Tg;function qg(f){return u=>{u.storeVarUint(f.cells,3),u.storeVarUint(f.bits,3)}}xr.storeStorageUsedShort=qg;var Er={},Rr={},Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.storeTransactionActionPhase=Wr.loadTransactionActionPhase=void 0;const Wd=Mr,Gd=xr;function Og(f){let u=f.loadBit(),w=f.loadBit(),c=f.loadBit(),S=(0,Wd.loadAccountStatusChange)(f),n=f.loadBit()?f.loadCoins():void 0,m=f.loadBit()?f.loadCoins():void 0,y=f.loadInt(32),g=f.loadBit()?f.loadInt(32):void 0,b=f.loadUint(16),v=f.loadUint(16),_=f.loadUint(16),M=f.loadUint(16),B=f.loadUintBig(256),A=(0,Gd.loadStorageUsedShort)(f);return{success:u,valid:w,noFunds:c,statusChange:S,totalFwdFees:n,totalActionFees:m,resultCode:y,resultArg:g,totalActions:b,specActions:v,skippedActions:_,messagesCreated:M,actionListHash:B,totalMessageSize:A}}Wr.loadTransactionActionPhase=Og;function Ug(f){return u=>{u.storeBit(f.success),u.storeBit(f.valid),u.storeBit(f.noFunds),u.store((0,Wd.storeAccountStatusChange)(f.statusChange)),u.storeMaybeCoins(f.totalFwdFees),u.storeMaybeCoins(f.totalActionFees),u.storeInt(f.resultCode,32),u.storeMaybeInt(f.resultArg,32),u.storeUint(f.totalActions,16),u.storeUint(f.specActions,16),u.storeUint(f.skippedActions,16),u.storeUint(f.messagesCreated,16),u.storeUint(f.actionListHash,256),u.store((0,Gd.storeStorageUsedShort)(f.totalMessageSize))}}Wr.storeTransactionActionPhase=Ug;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.storeTransactionBouncePhase=Gr.loadTransactionBouncePhase=void 0;const Mn=xr;function Ng(f){if(f.loadBit()){let u=(0,Mn.loadStorageUsedShort)(f),w=f.loadCoins(),c=f.loadCoins();return{type:"ok",messageSize:u,messageFees:w,forwardFees:c}}if(f.loadBit()){let u=(0,Mn.loadStorageUsedShort)(f),w=f.loadCoins();return{type:"no-funds",messageSize:u,requiredForwardFees:w}}return{type:"negative-funds"}}Gr.loadTransactionBouncePhase=Ng;function zg(f){return u=>{if(f.type==="ok")u.storeBit(!0),u.store((0,Mn.storeStorageUsedShort)(f.messageSize)),u.storeCoins(f.messageFees),u.storeCoins(f.forwardFees);else if(f.type==="negative-funds")u.storeBit(!1),u.storeBit(!1);else if(f.type==="no-funds")u.storeBit(!1),u.storeBit(!0),u.store((0,Mn.storeStorageUsedShort)(f.messageSize)),u.storeCoins(f.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}Gr.storeTransactionBouncePhase=zg;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.storeTransactionComputePhase=Yr.loadTransactionComputePhase=void 0;const Dg=jt(),Yd=Fr;function Lg(f){if(!f.loadBit())return{type:"skipped",reason:(0,Yd.loadComputeSkipReason)(f)};let u=f.loadBit(),w=f.loadBit(),c=f.loadBit(),S=f.loadCoins();const n=f.loadRef().beginParse();let m=n.loadVarUintBig(3),y=n.loadVarUintBig(3),g=n.loadBit()?n.loadVarUintBig(2):void 0,b=n.loadUint(8),v=n.loadUint(32),_=n.loadBit()?n.loadInt(32):void 0,M=n.loadUint(32),B=n.loadUintBig(256),A=n.loadUintBig(256);return{type:"vm",success:u,messageStateUsed:w,accountActivated:c,gasFees:S,gasUsed:m,gasLimit:y,gasCredit:g,mode:b,exitCode:v,exitArg:_,vmSteps:M,vmInitStateHash:B,vmFinalStateHash:A}}Yr.loadTransactionComputePhase=Lg;function jg(f){return u=>{if(f.type==="skipped"){u.storeBit(0),u.store((0,Yd.storeComputeSkipReason)(f.reason));return}u.storeBit(1),u.storeBit(f.success),u.storeBit(f.messageStateUsed),u.storeBit(f.accountActivated),u.storeCoins(f.gasFees),u.storeRef((0,Dg.beginCell)().storeVarUint(f.gasUsed,3).storeVarUint(f.gasLimit,3).store(w=>f.gasCredit!==void 0&&f.gasCredit!==null?w.storeBit(1).storeVarUint(f.gasCredit,2):w.storeBit(0)).storeUint(f.mode,8).storeUint(f.exitCode,32).store(w=>f.exitArg!==void 0&&f.exitArg!==null?w.storeBit(1).storeInt(f.exitArg,32):w.storeBit(0)).storeUint(f.vmSteps,32).storeUint(f.vmInitStateHash,256).storeUint(f.vmFinalStateHash,256).endCell())}}Yr.storeTransactionComputePhase=jg;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.storeTransactionCreditPhase=Xr.loadTransactionCreditPhase=void 0;const Xd=Vt;function Fg(f){const u=f.loadBit()?f.loadCoins():void 0,w=(0,Xd.loadCurrencyCollection)(f);return{dueFeesColelcted:u,credit:w}}Xr.loadTransactionCreditPhase=Fg;function Kg(f){return u=>{f.dueFeesColelcted===null||f.dueFeesColelcted===void 0?u.storeBit(!1):(u.storeBit(!0),u.storeCoins(f.dueFeesColelcted)),u.store((0,Xd.storeCurrencyCollection)(f.credit))}}Xr.storeTransactionCreditPhase=Kg;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.storeTransactionsStoragePhase=Jr.loadTransactionStoragePhase=void 0;const Jd=Mr;function Hg(f){const u=f.loadCoins();let w;f.loadBit()&&(w=f.loadCoins());const c=(0,Jd.loadAccountStatusChange)(f);return{storageFeesCollected:u,storageFeesDue:w,statusChange:c}}Jr.loadTransactionStoragePhase=Hg;function $g(f){return u=>{u.storeCoins(f.storageFeesCollected),f.storageFeesDue===null||f.storageFeesDue===void 0?u.storeBit(!1):(u.storeBit(!0),u.storeCoins(f.storageFeesDue)),u.store((0,Jd.storeAccountStatusChange)(f.statusChange))}}Jr.storeTransactionsStoragePhase=$g;var Gu;function Qd(){if(Gu)return Rr;Gu=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.storeTransactionDescription=Rr.loadTransactionDescription=void 0;const f=jt(),u=Zr,w=ec(),c=Wr,S=Gr,n=Yr,m=Xr,y=Jr;function g(v){let _=v.loadUint(4);if(_===0){const M=v.loadBit();let B;v.loadBit()&&(B=(0,y.loadTransactionStoragePhase)(v));let A;v.loadBit()&&(A=(0,m.loadTransactionCreditPhase)(v));let k=(0,n.loadTransactionComputePhase)(v),R;v.loadBit()&&(R=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));let P=v.loadBit(),C;v.loadBit()&&(C=(0,S.loadTransactionBouncePhase)(v));const N=v.loadBit();return{type:"generic",creditFirst:M,storagePhase:B,creditPhase:A,computePhase:k,actionPhase:R,bouncePhase:C,aborted:P,destroyed:N}}if(_===1)return{type:"storage",storagePhase:(0,y.loadTransactionStoragePhase)(v)};if(_===2||_===3){const M=_===3;let B=(0,y.loadTransactionStoragePhase)(v),A=(0,n.loadTransactionComputePhase)(v),k;v.loadBit()&&(k=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));const R=v.loadBit(),P=v.loadBit();return{type:"tick-tock",isTock:M,storagePhase:B,computePhase:A,actionPhase:k,aborted:R,destroyed:P}}if(_===4){let M=(0,u.loadSplitMergeInfo)(v),B;v.loadBit()&&(B=(0,y.loadTransactionStoragePhase)(v));let A=(0,n.loadTransactionComputePhase)(v),k;v.loadBit()&&(k=(0,c.loadTransactionActionPhase)(v.loadRef().beginParse()));const R=v.loadBit(),P=v.loadBit();return{type:"split-prepare",splitInfo:M,storagePhase:B,computePhase:A,actionPhase:k,aborted:R,destroyed:P}}if(_===5){let M=(0,u.loadSplitMergeInfo)(v),B=(0,w.loadTransaction)(v.loadRef().beginParse());const A=v.loadBit();return{type:"split-install",splitInfo:M,prepareTransaction:B,installed:A}}throw Error(`Unsupported transaction description type ${_}`)}Rr.loadTransactionDescription=g;function b(v){return _=>{if(v.type==="generic")_.storeUint(0,4),_.storeBit(v.creditFirst),v.storagePhase?(_.storeBit(!0),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase))):_.storeBit(!1),v.creditPhase?(_.storeBit(!0),_.store((0,m.storeTransactionCreditPhase)(v.creditPhase))):_.storeBit(!1),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,c.storeTransactionActionPhase)(v.actionPhase)))):_.storeBit(!1),_.storeBit(v.aborted),v.bouncePhase?(_.storeBit(!0),_.store((0,S.storeTransactionBouncePhase)(v.bouncePhase))):_.storeBit(!1),_.storeBit(v.destroyed);else if(v.type==="storage")_.storeUint(1,4),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase));else if(v.type==="tick-tock")_.storeUint(v.isTock?3:2,4),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase)),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,c.storeTransactionActionPhase)(v.actionPhase)))):_.storeBit(!1),_.storeBit(v.aborted),_.storeBit(v.destroyed);else if(v.type==="split-prepare")_.storeUint(4,4),_.store((0,u.storeSplitMergeInfo)(v.splitInfo)),v.storagePhase?(_.storeBit(!0),_.store((0,y.storeTransactionsStoragePhase)(v.storagePhase))):_.storeBit(!1),_.store((0,n.storeTransactionComputePhase)(v.computePhase)),v.actionPhase?(_.storeBit(!0),_.store((0,c.storeTransactionActionPhase)(v.actionPhase))):_.storeBit(!1),_.storeBit(v.aborted),_.storeBit(v.destroyed);else if(v.type==="split-install")_.storeUint(5,4),_.store((0,u.storeSplitMergeInfo)(v.splitInfo)),_.storeRef((0,f.beginCell)().store((0,w.storeTransaction)(v.prepareTransaction))),_.storeBit(v.installed);else throw Error(`Unsupported transaction description type ${v.type}`)}}return Rr.storeTransactionDescription=b,Rr}var Yu;function ec(){if(Yu)return Er;Yu=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.storeTransaction=Er.loadTransaction=void 0;const f=jt(),u=Qr(),w=Dr,c=Vt,S=Hr,n=ur,m=Qd();function y(b){if(b.loadUint(4)!==7)throw Error("Invalid data");let v=b.loadUintBig(256),_=b.loadUintBig(64),M=b.loadUintBig(256),B=b.loadUintBig(64),A=b.loadUint(32),k=b.loadUint(15),R=(0,w.loadAccountStatus)(b),P=(0,w.loadAccountStatus)(b),N=b.loadRef().beginParse(),T=N.loadBit()?(0,n.loadMessage)(N.loadRef().beginParse()):void 0,L=N.loadDict(u.Dictionary.Keys.Uint(15),n.MessageValue);N.endParse();let W=(0,c.loadCurrencyCollection)(b),ee=(0,S.loadHashUpdate)(b.loadRef().beginParse()),Y=(0,m.loadTransactionDescription)(b.loadRef().beginParse());return{address:v,lt:_,prevTransactionHash:M,prevTransactionLt:B,now:A,outMessagesCount:k,oldStatus:R,endStatus:P,inMessage:T,outMessages:L,totalFees:W,stateUpdate:ee,description:Y}}Er.loadTransaction=y;function g(b){return v=>{v.storeUint(7,4),v.storeUint(b.address,256),v.storeUint(b.lt,64),v.storeUint(b.prevTransactionHash,256),v.storeUint(b.prevTransactionLt,64),v.storeUint(b.now,32),v.storeUint(b.outMessagesCount,15),v.store((0,w.storeAccountStatus)(b.oldStatus)),v.store((0,w.storeAccountStatus)(b.endStatus));let _=(0,f.beginCell)();b.inMessage?(_.storeBit(!0),_.storeRef((0,f.beginCell)().store((0,n.storeMessage)(b.inMessage)))):_.storeBit(!1),_.storeDict(b.outMessages),v.storeRef(_),v.store((0,c.storeCurrencyCollection)(b.totalFees)),v.storeRef((0,f.beginCell)().store((0,S.storeHashUpdate)(b.stateUpdate))),v.storeRef((0,f.beginCell)().store((0,m.storeTransactionDescription)(b.description)))}}return Er.storeTransaction=g,Er}(function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.loadStorageUsedShort=f.storeStorageUsed=f.loadStorageUsed=f.storeStorageInfo=f.loadStorageInfo=f.storeStateInit=f.loadStateInit=f.storeSplitMergeInfo=f.loadSplitMergeInfo=f.storeSimpleLibrary=f.loadSimpleLibrary=f.loadShardStateUnsplit=f.storeShardIdent=f.loadShardIdent=f.storeShardAccounts=f.loadShardAccounts=f.ShardAccountRefValue=f.storeShardAccount=f.loadShardAccount=f.SendMode=f.storeMessageRelaxed=f.loadMessageRelaxed=f.storeMessage=f.loadMessage=f.loadMasterchainStateExtra=f.storeHashUpdate=f.loadHashUpdate=f.storeDepthBalanceInfo=f.loadDepthBalanceInfo=f.storeCurrencyCollection=f.loadCurrencyCollection=f.storeComputeSkipReason=f.loadComputeSkipReason=f.storeCommonMessageInfoRelaxed=f.loadCommonMessageInfoRelaxed=f.storeCommonMessageInfo=f.loadCommonMessageInfo=f.storeAccountStorage=f.loadAccountStorage=f.storeAccountStatusChange=f.loadAccountStatusChange=f.storeAccountStatus=f.loadAccountStatus=f.storeAccountState=f.loadAccountState=f.storeAccount=f.loadAccount=f.comment=f.external=f.internal=void 0,f.storeTransactionsStoragePhase=f.loadTransactionStoragePhase=f.storeTransactionDescription=f.loadTransactionDescription=f.storeTransactionCreditPhase=f.loadTransactionCreditPhase=f.storeTransactionComputePhase=f.loadTransactionComputePhase=f.storeTransactionBouncePhase=f.loadTransactionBouncePhase=f.storeTransactionActionPhase=f.loadTransactionActionPhase=f.storeTransaction=f.loadTransaction=f.storeTickTock=f.loadTickTock=f.storeStorageUsedShort=void 0;var u=wr;Object.defineProperty(f,"internal",{enumerable:!0,get:function(){return u.internal}}),Object.defineProperty(f,"external",{enumerable:!0,get:function(){return u.external}}),Object.defineProperty(f,"comment",{enumerable:!0,get:function(){return u.comment}});var w=qr;Object.defineProperty(f,"loadAccount",{enumerable:!0,get:function(){return w.loadAccount}}),Object.defineProperty(f,"storeAccount",{enumerable:!0,get:function(){return w.storeAccount}});var c=Ur;Object.defineProperty(f,"loadAccountState",{enumerable:!0,get:function(){return c.loadAccountState}}),Object.defineProperty(f,"storeAccountState",{enumerable:!0,get:function(){return c.storeAccountState}});var S=Dr;Object.defineProperty(f,"loadAccountStatus",{enumerable:!0,get:function(){return S.loadAccountStatus}}),Object.defineProperty(f,"storeAccountStatus",{enumerable:!0,get:function(){return S.storeAccountStatus}});var n=Mr;Object.defineProperty(f,"loadAccountStatusChange",{enumerable:!0,get:function(){return n.loadAccountStatusChange}}),Object.defineProperty(f,"storeAccountStatusChange",{enumerable:!0,get:function(){return n.storeAccountStatusChange}});var m=Or;Object.defineProperty(f,"loadAccountStorage",{enumerable:!0,get:function(){return m.loadAccountStorage}}),Object.defineProperty(f,"storeAccountStorage",{enumerable:!0,get:function(){return m.storeAccountStorage}});var y=Lr;Object.defineProperty(f,"loadCommonMessageInfo",{enumerable:!0,get:function(){return y.loadCommonMessageInfo}}),Object.defineProperty(f,"storeCommonMessageInfo",{enumerable:!0,get:function(){return y.storeCommonMessageInfo}});var g=jr;Object.defineProperty(f,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return g.loadCommonMessageInfoRelaxed}}),Object.defineProperty(f,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return g.storeCommonMessageInfoRelaxed}});var b=Fr;Object.defineProperty(f,"loadComputeSkipReason",{enumerable:!0,get:function(){return b.loadComputeSkipReason}}),Object.defineProperty(f,"storeComputeSkipReason",{enumerable:!0,get:function(){return b.storeComputeSkipReason}});var v=Vt;Object.defineProperty(f,"loadCurrencyCollection",{enumerable:!0,get:function(){return v.loadCurrencyCollection}}),Object.defineProperty(f,"storeCurrencyCollection",{enumerable:!0,get:function(){return v.storeCurrencyCollection}});var _=Kr;Object.defineProperty(f,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return _.loadDepthBalanceInfo}}),Object.defineProperty(f,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return _.storeDepthBalanceInfo}});var M=Hr;Object.defineProperty(f,"loadHashUpdate",{enumerable:!0,get:function(){return M.loadHashUpdate}}),Object.defineProperty(f,"storeHashUpdate",{enumerable:!0,get:function(){return M.storeHashUpdate}});var B=Gi;Object.defineProperty(f,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return B.loadMasterchainStateExtra}});var A=ur;Object.defineProperty(f,"loadMessage",{enumerable:!0,get:function(){return A.loadMessage}}),Object.defineProperty(f,"storeMessage",{enumerable:!0,get:function(){return A.storeMessage}});var k=oi;Object.defineProperty(f,"loadMessageRelaxed",{enumerable:!0,get:function(){return k.loadMessageRelaxed}}),Object.defineProperty(f,"storeMessageRelaxed",{enumerable:!0,get:function(){return k.storeMessageRelaxed}});var R=Vd;Object.defineProperty(f,"SendMode",{enumerable:!0,get:function(){return R.SendMode}});var P=$r;Object.defineProperty(f,"loadShardAccount",{enumerable:!0,get:function(){return P.loadShardAccount}}),Object.defineProperty(f,"storeShardAccount",{enumerable:!0,get:function(){return P.storeShardAccount}});var C=bf;Object.defineProperty(f,"ShardAccountRefValue",{enumerable:!0,get:function(){return C.ShardAccountRefValue}}),Object.defineProperty(f,"loadShardAccounts",{enumerable:!0,get:function(){return C.loadShardAccounts}}),Object.defineProperty(f,"storeShardAccounts",{enumerable:!0,get:function(){return C.storeShardAccounts}});var N=Vr;Object.defineProperty(f,"loadShardIdent",{enumerable:!0,get:function(){return N.loadShardIdent}}),Object.defineProperty(f,"storeShardIdent",{enumerable:!0,get:function(){return N.storeShardIdent}});var T=Wn;Object.defineProperty(f,"loadShardStateUnsplit",{enumerable:!0,get:function(){return T.loadShardStateUnsplit}});var L=hr;Object.defineProperty(f,"loadSimpleLibrary",{enumerable:!0,get:function(){return L.loadSimpleLibrary}}),Object.defineProperty(f,"storeSimpleLibrary",{enumerable:!0,get:function(){return L.storeSimpleLibrary}});var W=Zr;Object.defineProperty(f,"loadSplitMergeInfo",{enumerable:!0,get:function(){return W.loadSplitMergeInfo}}),Object.defineProperty(f,"storeSplitMergeInfo",{enumerable:!0,get:function(){return W.storeSplitMergeInfo}});var ee=ir;Object.defineProperty(f,"loadStateInit",{enumerable:!0,get:function(){return ee.loadStateInit}}),Object.defineProperty(f,"storeStateInit",{enumerable:!0,get:function(){return ee.storeStateInit}});var Y=Nr;Object.defineProperty(f,"loadStorageInfo",{enumerable:!0,get:function(){return Y.loadStorageInfo}}),Object.defineProperty(f,"storeStorageInfo",{enumerable:!0,get:function(){return Y.storeStorageInfo}});var F=zr;Object.defineProperty(f,"loadStorageUsed",{enumerable:!0,get:function(){return F.loadStorageUsed}}),Object.defineProperty(f,"storeStorageUsed",{enumerable:!0,get:function(){return F.storeStorageUsed}});var de=xr;Object.defineProperty(f,"loadStorageUsedShort",{enumerable:!0,get:function(){return de.loadStorageUsedShort}}),Object.defineProperty(f,"storeStorageUsedShort",{enumerable:!0,get:function(){return de.storeStorageUsedShort}});var d=Cr;Object.defineProperty(f,"loadTickTock",{enumerable:!0,get:function(){return d.loadTickTock}}),Object.defineProperty(f,"storeTickTock",{enumerable:!0,get:function(){return d.storeTickTock}});var e=ec();Object.defineProperty(f,"loadTransaction",{enumerable:!0,get:function(){return e.loadTransaction}}),Object.defineProperty(f,"storeTransaction",{enumerable:!0,get:function(){return e.storeTransaction}});var r=Wr;Object.defineProperty(f,"loadTransactionActionPhase",{enumerable:!0,get:function(){return r.loadTransactionActionPhase}}),Object.defineProperty(f,"storeTransactionActionPhase",{enumerable:!0,get:function(){return r.storeTransactionActionPhase}});var i=Gr;Object.defineProperty(f,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return i.loadTransactionBouncePhase}}),Object.defineProperty(f,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return i.storeTransactionBouncePhase}});var a=Yr;Object.defineProperty(f,"loadTransactionComputePhase",{enumerable:!0,get:function(){return a.loadTransactionComputePhase}}),Object.defineProperty(f,"storeTransactionComputePhase",{enumerable:!0,get:function(){return a.storeTransactionComputePhase}});var s=Xr;Object.defineProperty(f,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return s.loadTransactionCreditPhase}}),Object.defineProperty(f,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return s.storeTransactionCreditPhase}});var l=Qd();Object.defineProperty(f,"loadTransactionDescription",{enumerable:!0,get:function(){return l.loadTransactionDescription}}),Object.defineProperty(f,"storeTransactionDescription",{enumerable:!0,get:function(){return l.storeTransactionDescription}});var p=Jr;Object.defineProperty(f,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return p.loadTransactionStoragePhase}}),Object.defineProperty(f,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return p.storeTransactionsStoragePhase}})})(Rd);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.openContract=void 0;const Vg=$t,Xu=ei();function Zg(f,u){let w,c=null;if(!Vg.Address.isAddress(f.address))throw Error("Invalid address");if(w=f.address,f.init){if(!(f.init.code instanceof Xu.Cell))throw Error("Invalid init.code");if(!(f.init.data instanceof Xu.Cell))throw Error("Invalid init.data");c=f.init}let S=u({address:w,init:c});return new Proxy(f,{get(n,m){const y=n[m];return typeof m=="string"&&(m.startsWith("get")||m.startsWith("send"))&&typeof y=="function"?(...g)=>y.apply(n,[S,...g]):y}})}Gn.openContract=Zg;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ComputeError=void 0;class yf extends Error{constructor(u,w,c){super(u),this.exitCode=w,this.debugLogs=c&&c.debugLogs?c.debugLogs:null,this.logs=c&&c.logs?c.logs:null,Object.setPrototypeOf(this,yf.prototype)}}Yn.ComputeError=yf;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMethodId=void 0;const Wg=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function Gg(f){f instanceof Le.Buffer||(f=Le.Buffer.from(f));let u=0;for(let w=0;w>8^c)&255]^u<<8)&65535}return u}function Yg(f){return Gg(f)&65535|65536}Xn.getMethodId=Yg;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.safeSignVerify=si.safeSign=void 0;const wf=gf(),Xg=8,Jg=64;function tc(f,u){let w=Le.Buffer.from(u);if(w.length>Jg)throw Error("Seed can be longer than 64 bytes");if(w.length{},messages:{},getters:{}});export{rn as a,nb as b,ht as c,Ii as d,ob as g,gf as r,sb as s}; diff --git a/docs/_app/immutable/entry/(examples)-00-hello-world-page.svelte.16f8154b.js b/docs/_app/immutable/entry/(examples)-00-hello-world-page.svelte.16f8154b.js new file mode 100644 index 0000000..894f890 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-00-hello-world-page.svelte.16f8154b.js @@ -0,0 +1,21 @@ +var u=Object.defineProperty;var y=(n,e,t)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(y(n,typeof e!="symbol"?e+"":e,t),t);import{S as A,i as w,s as f,I as h,ac as b}from"../chunks/index.9fe14626.js";import{d as r,g as c,s as p}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const I=`# Hello World + +This is probably the simplest possible Tact program. It will provide callers with the classic output "hello world". + +Tact lets you write smart contracts. This code defines a single contract named \`HelloWorld\`. Smart contracts must be deployed to the blockchain network to be usable, try to deploy this contract by pressing the Deploy button. + +Contract deployments usually cost gas. This website deploys to an [emulator](https://github.com/tact-lang/tact-emulator) of TON blockchain, so gas is emulated TON coin (which is free). + +If you're unfamilar with terms like *contract*, *deployment* and *gas*, please [read this post](https://blog.ton.org/what_is_blockchain) first. It's a great introduction to all blockchain terminology you will need to learn Tact. + +## A simple interaction + +Contracts can have *getters* like \`greeting()\`. Getters are special external interface functions that allow users to query information from the contract. Try to call the getter by pressing the Get greeting button. Calling getters is free and does not cost gas. + +Don't worry if some things aren't clear now, we will dive into getters in more detail later.`,v=`contract HelloWorld { + + get fun greeting(): String { + return "hello world"; + } + +}`;async function g(){const n=r.Cell.fromBase64("te6ccgECDgEAAXAAART/APSkE/S88sgLAQIBYgIDApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4IIwyPhDAcx/AcoAye1UBwQCASAFBgA8AZIwf+BwIddJwh+VMCDXCx/ewAAB10nBIbCRf+BwAg+9jVbZ5tnhjAcIAgEgCgsBNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8CQAai7aGVsbG8gd29ybGSAACbQC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAgFIDA0AEbCvu1E0NIAAYAB1sm7jQ1aXBmczovL1FtVXE0N2RKY2tqWG90UFRDZHZoRjZHQ3hGb3BwQTQxNEJ0Y0tGeUdwNEhDYkeCA="),e=r.Cell.fromBase64("te6cckECEAEAAXoAAQHAAQEFoPYVAgEU/wD0pBP0vPLICwMCAWIMBAIBIAoFAgEgCQYCAUgIBwB1sm7jQ1aXBmczovL1FtVXE0N2RKY2tqWG90UFRDZHZoRjZHQ3hGb3BwQTQxNEJ0Y0tGeUdwNEhDYkeCAAEbCvu1E0NIAAYAC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAg+9jVbZ5tnhjA4LABqLtoZWxsbyB3b3JsZIApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4IIwyPhDAcx/AcoAye1UDg0APAGSMH/gcCHXScIflTAg1wsf3sAAAddJwSGwkX/gcAE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwPAAJtiiFvWw==");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const s=t.endCell();return{code:n,data:s}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},B=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]}],S=[{name:"greeting",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}}],D=[{receiver:"internal",message:{kind:"empty"}}];class i{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]}],types:B,getters:S,receivers:D,errors:k});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=r.contractAddress(0,e);return new i(t,e)}static fromAddress(e){return new i(e)}async send(e,t,s,a){let o=null;if(a===null&&(o=new r.Cell),o===null)throw new Error("Invalid message type");await e.internal(t,{...s,body:o})}async getGreeting(e){let t=new r.TupleBuilder;return(await e.get("greeting",t.build())).stack.readString()}}function E(n,e,t){let s;h(n,p,o=>t(2,s=o));let a;return b(p,s={markdown:I,tactCode:v,deploy:async()=>{const o=await C.Blockchain.create(),d=await o.treasury("deployer");d.getSender(),a=o.openContract(await i.fromInit());const m={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],m,[await a.send(d.getSender(),{value:r.toNano(1)},null)]]},messages:{},getters:{greeting:async()=>await a.getGreeting()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},s),[]}class T extends A{constructor(e){super(),w(this,e,E,null,f,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.60e4d560.js b/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.60e4d560.js deleted file mode 100644 index d8747ff..0000000 --- a/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.60e4d560.js +++ /dev/null @@ -1,33 +0,0 @@ -var w=Object.defineProperty;var p=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var c=(s,e,t)=>(p(s,typeof e!="symbol"?e+"":e,t),t);import{S as h,i as v,s as f,I as C,ac as b}from"../chunks/index.9fe14626.js";import{d as a,g as u,s as g}from"../chunks/store.d3ab02ad.js";import{d as y}from"../chunks/index.78404594.js";const I=`# A Simple Counter - -This is a simple counter contract that allows users to increment its value. - -This contract has a state variable \`val\` that persists between contract calls - the counter value. When persisted, this variable is encoded \`as uint32\` - a 32-bit unsigned integer. Contracts pay rent in proportion to the amount of persistent space they consume, so compact representations are encouraged. - -State variables should be initialized in \`init()\` that runs on deployment of the contract. - -## Receiving messages - -This contract can receive *messages* from users. Unlike getters that are just read-only, messages can do write operations and change the contract's persistent state. Incoming messages are processed in \`receive()\` methods as transactions and cost gas for the sender. - -After deploying the contract, send the \`increment\` message by pressing the Send increment button in order to increase the counter value by one. Afterwards, call the getter \`value()\` to see that the value indeed changed. -`,B=`contract Counter { - - // persistent state variable of type Int to hold the counter value - val: Int as uint32; - - // initialize the state variable when contract is deployed - init() { - self.val = 0; - } - - // handler for incoming increment messages that change the state - receive("increment") { - self.val = self.val + 1; - } - - // read-only getter for querying the counter value - get fun value(): Int { - return self.val; - } -}`;async function A(){const s=a.Cell.fromBase64("te6ccgECDgEAAaAAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLH8ntVAsEAgFYBQYAru2i7ftwIddJwh+VMCDXCx/eApJbf+AhwAAh10nBIbCSW3/gAcAAjiv5AYLwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66lKR/2zHgkTDicAC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAgFIBwgAEbCvu1E0NIAAYAIBagkKAHOndxoatLgzOZ0Xl6i2qz0yPSkppZisqLcZILclOrOwtKisrCGxmiipvJwluaaqvBi7tBw8qKQ6ubjBAg2lgbZ5tnhjCwwBPO1E0NQB+GPSAAGU0x8BMeAw+CjXCwqDCbry4InbPA0AAiAAAnA="),e=a.Cell.fromBase64("te6cckECEAEAAaoAAQHAAQEFoendAgEU/wD0pBP0vPLICwMCAWIMBAIBWAsFAgFICgYCAWoJBwINpYG2ebZ4Yw4IAAIgAHOndxoatLgzOZ0Xl6i2qz0yPSkppZisqLcZILclOrOwtKisrCGxmiipvJwluaaqvBi7tBw8qKQ6ubjBABGwr7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKU0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEByx/J7VQODQCu7aLt+3Ah10nCH5UwINcLH94Cklt/4CHAACHXScEhsJJbf+ABwACOK/kBgvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqUpH/bMeCRMOJwATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwPAAJwfPvBUA==");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]}],errors:S});this.address=e,this.init=t}static async init(){return await A()}static async fromInit(){const e=await A(),t=a.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,r,o){let n=null;if(o===null&&(n=new a.Cell),o==="increment"&&(n=a.beginCell().storeUint(0,32).storeStringTail(o).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:n})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function x(s,e,t){let r;C(s,g,i=>t(2,r=i));let o,n;return b(g,r={markdown:I,tactCode:B,deploy:async()=>{const i=await y.Blockchain.create(),d=await i.treasury("deployer");o=d.getSender(),n=i.openContract(await l.fromInit());const m={[d.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],m,[await n.send(d.getSender(),{value:a.toNano(1)},null)]]},messages:{increment:async()=>[await n.send(o,{value:a.toNano(1)},"increment")]},getters:{value:async()=>await n.getValue()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},r),[]}class L extends h{constructor(e){super(),v(this,e,x,null,f,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.d7d63907.js b/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.d7d63907.js new file mode 100644 index 0000000..336d05d --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-01-a-simple-counter-page.svelte.d7d63907.js @@ -0,0 +1,40 @@ +var A=Object.defineProperty;var f=(s,e,t)=>e in s?A(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(f(s,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as w,s as v,I as h,ac as C}from"../chunks/index.9fe14626.js";import{d as a,g as m,s as p}from"../chunks/store.476c3091.js";import{d as I}from"../chunks/index.c056099e.js";const b=`# A Simple Counter + +This is a simple counter contract that allows users to increment its value. + +This contract has a state variable \`val\` that persists between contract calls - the counter value. When persisted, this variable is encoded \`as uint32\` - a 32-bit unsigned integer. Contracts pay rent in proportion to the amount of persistent space they consume, so compact representations are encouraged. + +State variables should be initialized in \`init()\` that runs on deployment of the contract. + +## Receiving messages + +This contract can receive **_messages_** from users. + +Unlike getters that are just read-only, messages can do write operations and change the contract's persistent state. Incoming messages are processed in \`receive()\` methods as transactions and cost gas for the sender. + +After deploying the contract, send the \`increment\` message by pressing the Send increment button in order to increase the counter value by one. Afterwards, call the getter \`value()\` to see that the value indeed changed. + +
+
+ Info: We will learn more in details about "getter" functions in the next example. +
+`,k=`contract Counter { + + // persistent state variable of type Int to hold the counter value + val: Int as uint32; + + // initialize the state variable when contract is deployed + init() { + self.val = 0; + } + + // handler for incoming increment messages that change the state + receive("increment") { + self.val = self.val + 1; + } + + // read-only getter for querying the counter value + get fun value(): Int { + return self.val; + } +}`;async function u(){const s=a.Cell.fromBase64("te6ccgECDgEAAaEAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcsfye1UCwQCAVgFBgCs7aLt+wGSMH/gcCHXScIflTAg1wsf3iDAACLXScEhsJJbf+DAAI4r+QGC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuupSkf9sx4JEw4nAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAIBSAcIABGwr7tRNDSAAGACAWoJCgBzp3caGrS4MzmdF5eotqs9Mj0pKaWYrKi3GSC3JTqzsLSorKwhsZooqbycJbmmqrwYu7QcPKikOrm4wQINpYG2ebZ4YwsMATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwNAAIgAAJw"),e=a.Cell.fromBase64("te6cckECEAEAAasAAQHAAQEFoendAgEU/wD0pBP0vPLICwMCAWIMBAIBWAsFAgFICgYCAWoJBwINpYG2ebZ4Yw4IAAIgAHOndxoatLgzOZ0Xl6i2qz0yPSkppZisqLcZILclOrOwtKisrCGxmiipvJwluaaqvBi7tBw8qKQ6ubjBABGwr7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLH8ntVA4NAKztou37AZIwf+BwIddJwh+VMCDXCx/eIMAAItdJwSGwklt/4MAAjiv5AYLwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66lKR/2zHgkTDicAE87UTQ1AH4Y9IAAZTTHwEx4DD4KNcLCoMJuvLgids8DwACcBH28eA=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},B=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]}],x=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],T=[{receiver:"internal",message:{kind:"empty"}},{receiver:"internal",message:{kind:"text",text:"increment"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]}],types:B,getters:x,receivers:T,errors:S});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,r,o){let n=null;if(o===null&&(n=new a.Cell),o==="increment"&&(n=a.beginCell().storeUint(0,32).storeStringTail(o).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:n})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function z(s,e,t){let r;h(s,p,i=>t(2,r=i));let o,n;return C(p,r={markdown:b,tactCode:k,deploy:async()=>{const i=await I.Blockchain.create(),d=await i.treasury("deployer");o=d.getSender(),n=i.openContract(await c.fromInit());const g={[d.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],g,[await n.send(d.getSender(),{value:a.toNano(1)},null)]]},messages:{increment:async()=>[await n.send(o,{value:a.toNano(1)},"increment")]},getters:{value:async()=>await n.getValue()},prev:m(import.meta.url).prev,next:m(import.meta.url).next},r),[]}class J extends y{constructor(e){super(),w(this,e,z,null,v,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-01-hello-world-page.svelte.bd09d3c0.js b/docs/_app/immutable/entry/(examples)-01-hello-world-page.svelte.bd09d3c0.js deleted file mode 100644 index 346b69e..0000000 --- a/docs/_app/immutable/entry/(examples)-01-hello-world-page.svelte.bd09d3c0.js +++ /dev/null @@ -1,21 +0,0 @@ -var A=Object.defineProperty;var w=(s,e,t)=>e in s?A(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(w(s,typeof e!="symbol"?e+"":e,t),t);import{S as p,i as h,s as f,I as b,ac as y}from"../chunks/index.9fe14626.js";import{d as r,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as C}from"../chunks/index.78404594.js";const I=`# Hello World - -This is probably the simplest possible Tact program. It will provide callers with the classic output "hello world". - -Tact lets you write smart contracts. This code defines a single contract named \`HelloWorld\`. Smart contracts must be deployed to the blockchain network to be usable, try to deploy this contract by pressing the Deploy button. - -Contract deployments usually cost gas. This website deploys to an [emulator](https://github.com/tact-lang/tact-emulator) of TON blockchain, so gas is emulated TON coin (which is free). - -If you're unfamilar with terms like *contract*, *deployment* and *gas*, please [read this post](https://blog.ton.org/what_is_blockchain) first. It's a great introduction to all blockchain terminology you will need to learn Tact. - -## A simple interaction - -Contracts can have *getters* like \`greeting()\`. Getters are special external interface functions that allow users to query information from the contract. Try to call the getter by pressing the Get greeting button. Calling getters is free and does not cost gas. - -Don't worry if some things aren't clear now, we will dive into getters in more detail later.`,v=`contract HelloWorld { - - get fun greeting(): String { - return "hello world"; - } - -}`;async function u(){const s=r.Cell.fromBase64("te6ccgECDgEAAW8AART/APSkE/S88sgLAQIBYgIDAo7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwMMj4QwHMfwHKAMntVAcEAgEgBQYAPnAh10nCH5UwINcLH94Cklt/4AHAAAHXScEhsJF/4HACD72NVtnm2eGMBwgCASAKCwE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwJABqLtoZWxsbyB3b3JsZIAAJtALm7vRgnBc7D1dLK57HoTsOdZKhRtmgnCd1jUtK2R8syLTry398WI5gnAgVcAbgGdjlM5YOq5HJbLDgnAb1J3vlUWW8cdT094FWcMmgnCdl05as07LczoOlm2UZuikgCAUgMDQARsK+7UTQ0gABgAHWybuNDVpcGZzOi8vUW1VcTQ3ZEpja2pYb3RQVENkdmhGNkdDeEZvcHBBNDE0QnRjS0Z5R3A0SENiR4IA=="),e=r.Cell.fromBase64("te6cckECEAEAAXkAAQHAAQEFoPYVAgEU/wD0pBP0vPLICwMCAWIMBAIBIAoFAgEgCQYCAUgIBwB1sm7jQ1aXBmczovL1FtVXE0N2RKY2tqWG90UFRDZHZoRjZHQ3hGb3BwQTQxNEJ0Y0tGeUdwNEhDYkeCAAEbCvu1E0NIAAYAC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAg+9jVbZ5tnhjA4LABqLtoZWxsbyB3b3JsZIAo7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwMMj4QwHMfwHKAMntVA4NAD5wIddJwh+VMCDXCx/eApJbf+ABwAAB10nBIbCRf+BwATTtRNDUAfhj0gAwkW3g+CjXCwqDCbry4InbPA8AAm17HG9k");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const n=t.endCell();return{code:s,data:n}}const B={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class i{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]}],errors:B});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=r.contractAddress(0,e);return new i(t,e)}static fromAddress(e){return new i(e)}async send(e,t,n,a){let o=null;if(a===null&&(o=new r.Cell),o===null)throw new Error("Invalid message type");await e.internal(t,{...n,body:o})}async getGreeting(e){let t=new r.TupleBuilder;return(await e.get("greeting",t.build())).stack.readString()}}function D(s,e,t){let n;b(s,d,o=>t(2,n=o));let a;return y(d,n={markdown:I,tactCode:v,deploy:async()=>{const o=await C.Blockchain.create(),c=await o.treasury("deployer");c.getSender(),a=o.openContract(await i.fromInit());const m={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],m,[await a.send(c.getSender(),{value:r.toNano(1)},null)]]},messages:{},getters:{greeting:async()=>await a.getGreeting()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},n),[]}class N extends p{constructor(e){super(),h(this,e,D,null,f,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.7ca70ba6.js b/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.7ca70ba6.js deleted file mode 100644 index e5c19b2..0000000 --- a/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.7ca70ba6.js +++ /dev/null @@ -1,20 +0,0 @@ -var m=Object.defineProperty;var y=(s,e,t)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(y(s,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as C,s as h,I as f,ac as I}from"../chunks/index.9fe14626.js";import{d as r,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as B}from"../chunks/index.78404594.js";const b="# The Deployable Trait\n\nTact doesn't support classical class inheritance, but contracts can implement *traits*. One of the commonly used traits is `Deployable`. It implements a simple receiver for the `Deploy` message which helps deploy contracts in a standard way.\n\nAll contracts are deployed by sending them a message. This can be any message, but best practice is to designate the special `Deploy` message for this purpose.\n\nThis message has a single field, `queryId`, which is provided by the deployer (normally zero). If the deploy succeeds, the contract will reply with the message `DeployOk` and echo the same `queryId` in the response.\n\nIf you're using Tact's [auto-generated](https://docs.tact-lang.org/tools/typescript#tact-contract-in-typescript) TypeScript classes to deploy, sending the deploy message should look like:\n\n```ts\nconst msg = { $$type: \"Deploy\", queryId: 0n };\n await contract.send(sender, { value: toNano(1) }, msg);\n```\n\nYou can see the implementation of the trait [here](https://github.com/tact-lang/tact/blob/main/stdlib/libs/deploy.tact). Notice that the file *deploy.tact* needs to be imported from the standard library using the `import` keyword.",v=`// this trait has to be imported -import "@stdlib/deploy"; - -// the Deployable trait adds a default receiver for the "Deploy" message -contract Counter with Deployable { - - val: Int as uint32; - - init() { - self.val = 0; - } - - receive("increment") { - self.val = self.val + 1; - } - - get fun value(): Int { - return self.val; - } -}`;function D(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function u(){const s=r.Cell.fromBase64("te6ccgECEQEAAoUAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLH8ntVA4EAgFYCAkCru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAUGAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAcAVvkBgvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqUpH/bMeAAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAIBSAoLABGwr7tRNDSAAGACAWoMDQBzp3caGrS4MzmdF5eotrKsJiuZGzIaKSqjJSiYq6MjtzO0qr0nPLI5qqaZITWbnLOtNzC3Ozw4MLw6QQINpYG2ebZ4Yw4PATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwQAAIgAAJw"),e=r.Cell.fromBase64("te6cckECEwEAAo8AAQHAAQEFoendAgEU/wD0pBP0vPLICwMCAWIMBAIBWAsFAgFICgYCAWoJBwINpYG2ebZ4YxEIAAIgAHOndxoatLgzOZ0Xl6i2sqwmK5kbMhopKqMlKJiroyO3M7SqvSc8sjmqppkhNZucs603MLc7PDgwvDpBABGwr7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKU0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEByx/J7VQRDQKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wDw4AVvkBgvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqUpH/bMeAByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTTHwEx4DD4KNcLCoMJuvLgids8EgACcIhq0BU=");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:s,data:o}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:M});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=r.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,o,n){let a=null;if(n==="increment"&&(a=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof r.Slice)&&n.$$type==="Deploy"&&(a=r.beginCell().store(D(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getValue(e){let t=new r.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function H(s,e,t){let o;f(s,g,i=>t(2,o=i));let n,a;return I(g,o={markdown:b,tactCode:v,deploy:async()=>{const i=await B.Blockchain.create(),A=await i.treasury("deployer");n=A.getSender(),a=i.openContract(await c.fromInit());const p={[A.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],p,[await a.send(A.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await a.send(n,{value:r.toNano(1)},"increment")]},getters:{value:async()=>await a.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class N extends w{constructor(e){super(),C(this,e,H,null,h,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.cab4baf4.js b/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.cab4baf4.js new file mode 100644 index 0000000..118ab51 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-01-the-deployable-trait-page.svelte.cab4baf4.js @@ -0,0 +1,40 @@ +var g=Object.defineProperty;var u=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(u(n,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as C,s as h,I as w,ac as I}from"../chunks/index.9fe14626.js";import{d as o,g as p,s as A}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const b=`# The Deployable Trait + +Tact doesn't support classical class inheritance, but contracts can implement **_traits_**. + +One commonly used trait is \`Deployable\`, which implements a simple receiver for the \`Deploy\` message. This helps deploy contracts in a standardized manner. + +All contracts are deployed by sending them a message. While any message can be used for this purpose, best practice is to use the special \`Deploy\` message. + +This message has a single field, \`queryId\`, provided by the deployer (usually set to zero). If the deployment succeeds, the contract will reply with a \`DeployOk\` message and echo the same \`queryId\` in the response. + +--- + +If you're using Tact's [auto-generated](https://docs.tact-lang.org/tools/typescript#tact-contract-in-typescript) TypeScript classes to deploy, sending the deploy message should look like: + +\`\`\`ts +const msg = { $$type: "Deploy", queryId: 0n }; +await contract.send(sender, { value: toNano(1) }, msg); +\`\`\` + +You can see the implementation of the trait [here](https://github.com/tact-lang/tact/blob/main/stdlib/libs/deploy.tact). Notice that the file **_deploy.tact_** needs to be imported from the standard library using the \`import\` keyword. +`,v=`// this trait has to be imported +import "@stdlib/deploy"; + +// the Deployable trait adds a default receiver for the "Deploy" message +contract Counter with Deployable { + + val: Int as uint32; + + init() { + self.val = 0; + } + + receive("increment") { + self.val = self.val + 1; + } + + get fun value(): Int { + return self.val; + } +}`;function D(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function m(){const n=o.Cell.fromBase64("te6ccgECEQEAAp4AART/APSkE/S88sgLAQIBYgIDApjQAdD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NS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLH8ntVBENAvbtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACOK/kBgvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqUpH/bMeCRMOIOEgE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwPAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABAAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBPO1E0NQB+GPSAAGU0x8BMeAw+CjXCwqDCbry4InbPBIAAnDmcEqT");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:n,data:r}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},E=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],M=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],L=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:E,getters:M,receivers:L,errors:k});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=o.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,r,s){let a=null;if(s==="increment"&&(a=o.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof o.Slice)&&s.$$type==="Deploy"&&(a=o.beginCell().store(D(s)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getValue(e){let t=new o.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function Q(n,e,t){let r;w(n,A,i=>t(2,r=i));let s,a;return I(A,r={markdown:b,tactCode:v,deploy:async()=>{const i=await B.Blockchain.create(),d=await i.treasury("deployer");s=d.getSender(),a=i.openContract(await c.fromInit());const y={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],y,[await a.send(d.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await a.send(s,{value:o.toNano(1)},"increment")]},getters:{value:async()=>await a.getValue()},prev:p(import.meta.url).prev,next:p(import.meta.url).next},r),[]}class z extends f{constructor(e){super(),C(this,e,Q,null,h,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.774753f6.js b/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.774753f6.js deleted file mode 100644 index 218c639..0000000 --- a/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.774753f6.js +++ /dev/null @@ -1,60 +0,0 @@ -var I=Object.defineProperty;var w=(r,e,s)=>e in r?I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var g=(r,e,s)=>(w(r,typeof e!="symbol"?e+"":e,s),s);import{S as B,i as y,s as m,I as Q,ac as L}from"../chunks/index.9fe14626.js";import{d as a,g as l,s as c}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const f=`# Addresses - -\`Address\` is another primitive data type. It represents standard addresses on the TON blockchain. Every smart contract on TON is identifiable by its address. Think of this as a unique id. - -TON is divided into multiple chains called *workchains*. This allows to balance the load more effectively. One of the internal fields of the address is the workchain id: - -* \`0\` - The standard workchain, for regular users. Your contracts will be here. - -* \`-1\` - The masterchain, usually for validators. Gas on this chain is significantly more expensive, but you'll probably never use it. - -There are multiple ways on TON to [represent](https://docs.ton.org/learn/overviews/addresses#bounceable-vs-non-bounceable-addresses) the same address. Notice in the contract that the bouncable and non-bouncable representations of the same address actually generate the exact same value. Inside the contract, it doesn't matter which representation you use. - -## State costs - -Most addresses take 264-bit to store (8-bit for the workchain id and 256-bit for the account id). This means that storing 1000 addresses [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about 0.189 TON per year.`,v=`import "@stdlib/deploy"; - -contract Addresses with Deployable { - - // contract persistent state variables - // we have three representations of the same address - a1: Address = address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"); // bouncable (same foundation wallet) - a2: Address = address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"); // non-bounceable (same foundation wallet) - a3: Address; - - a4: Address; - a5: Address; - a6: Address; - - init() { - // this is the third representation of the same address - self.a3 = newAddress(0, 0x83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8); // raw (same foundation wallet) - - // here are a few other important addresses - self.a4 = newAddress(0, 0); // the zero address (nobody) - self.a5 = myAddress(); // address of this contract - self.a6 = sender(); // address of the deployer (the sender during init()) - } - - receive("show all") { - /// addresses cannot currently be dumped - /// TODO: https://github.com/tact-lang/tact/issues/16 - /// dump(self.a1); - } - - receive("show ops") { - // temporary variable - let a: Address = address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"); // bouncable (same foundation wallet) - - dump(a == self.a1); - dump(a == self.a2); - dump(a == self.a3); - - dump(a == self.a4); - dump(a != self.a5); - } - - get fun result(): Address { - return self.a1; - } -}`;function h(r){return e=>{let s=e;s.storeUint(2490013878,32),s.storeUint(r.queryId,64)}}async function u(){const r=a.Cell.fromBase64("te6ccgECGQEABX0AART/APSkE/S88sgLAQIBYgIDA5bQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFds8MMj4QwHMfwHKAFVQ2zzJ7VQPBAUCASANDgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wBgcBwlBlINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAMg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYBINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WyFgMAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAgBrvkBIILwMkLMZZUvBdmwfSssqtkWOKNByOHyU8I41N5guQv9c0q6lDB/2zHggvCumxXw1Q6VFk72d/68V6X5rjebOs9yG2lKSCx322XD1bqOhds8f9sx4AkAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwEdI0IYAQe/qqXMblNo5fl5kYi9eYzSLgSrFtHY6k/DdIB0HmNRFNgxwXbPFNQxwXbPFNAxwXbPFMwxwULCwsKAhLbPFIgxwWz2zwLCwAsmYtHRydWWP4UMJqLVmYWxzZY/hQw4gDAINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAMg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYBINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WyQHMAhG/cpbZ5tnjYwwPEAIBIBUWAj7tRNDUAfhj0gABjoT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J2zwZFwHWjQhgBB7+qpcxuU2jl+XmRiL15jNIuBKsW0djqT8N0gHQeY1EjQhgBB7+qpcxuU2jl+XmRiL15jNIuBKsW0djqT8N0gHQeY1EcILwg9/VUuY3KbRy/LzIxF68xmkXAlWLaOx1J+G6QDoPMagYALzIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiHAgyHIBywFwAcsAEsoHy//J0CDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4Ij4KPhCAcb6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHUAdAaAMz6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDEQNhA1EDQWSBrO");let s=a.beginCell();s.storeRef(e),s.storeUint(0,1);const o=s.endCell();return{code:r,data:o}}const p={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class d{constructor(e,s){g(this,"address");g(this,"init");g(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:p});this.address=e,this.init=s}static async init(){return await u()}static async fromInit(){const e=await u(),s=a.contractAddress(0,e);return new d(s,e)}static fromAddress(e){return new d(e)}async send(e,s,o,t){let n=null;if(t==="show all"&&(n=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="show ops"&&(n=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(n=a.beginCell().store(h(t)).endCell()),n===null)throw new Error("Invalid message type");await e.internal(s,{...o,body:n})}async getResult(e){let s=new a.TupleBuilder;return(await e.get("result",s.build())).stack.readAddress()}}function D(r,e,s){let o;Q(r,c,i=>s(2,o=i));let t,n;return L(c,o={markdown:f,tactCode:v,deploy:async()=>{const i=await b.Blockchain.create(),A=await i.treasury("deployer");t=A.getSender(),n=i.openContract(await d.fromInit());const C={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],C,[await n.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await n.send(t,{value:a.toNano(1)},"show all")],"show ops":async()=>[await n.send(t,{value:a.toNano(1)},"show ops")]},getters:{result:async()=>await n.getResult()},prev:l(import.meta.url).prev,next:l(import.meta.url).next},o),[]}class Y extends B{constructor(e){super(),y(this,e,D,null,m,{})}}export{Y as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.e721ceab.js b/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.e721ceab.js new file mode 100644 index 0000000..acbd9ad --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-addresses-page.svelte.e721ceab.js @@ -0,0 +1,61 @@ +var m=Object.defineProperty;var p=(a,e,s)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[e]=s;var d=(a,e,s)=>(p(a,typeof e!="symbol"?e+"":e,s),s);import{S as I,i as w,s as C,I as B,ac as f}from"../chunks/index.9fe14626.js";import{d as r,g,s as c}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const Q=`# Addresses + +\`Address\` is another primitive data type. It represents standard addresses on the TON blockchain. Every smart contract on TON is identifiable by its address. Think of this as a unique id. + +TON is divided into multiple chains called _workchains_. This allows to balance the load more effectively. One of the internal fields of the address is the workchain id: + +- \`0\` - The standard workchain, for regular users. Your contracts will be here. + +- \`-1\` - The masterchain, usually for validators. Gas on this chain is significantly more expensive, but you'll probably never use it. + +There are multiple ways on TON to [represent](https://docs.ton.org/learn/overviews/addresses#bounceable-vs-non-bounceable-addresses) the same address. Notice in the contract that the bouncable and non-bouncable representations of the same address actually generate the exact same value. Inside the contract, it doesn't matter which representation you use. + +## State costs + +Most addresses take 264-bit to store (8-bit for the workchain id and 256-bit for the account id). **This means that storing 1000 addresses [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about 0.189 TON per year.** +`,h=`import "@stdlib/deploy"; + +contract Addresses with Deployable { + + // contract persistent state variables + // we have three representations of the same address + a1: Address = address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"); // bouncable (same foundation wallet) + a2: Address = address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"); // non-bounceable (same foundation wallet) + a3: Address; + + a4: Address; + a5: Address; + a6: Address; + + init() { + // this is the third representation of the same address + self.a3 = newAddress(0, 0x83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8); // raw (same foundation wallet) + + // here are a few other important addresses + self.a4 = newAddress(0, 0); // the zero address (nobody) + self.a5 = myAddress(); // address of this contract + self.a6 = sender(); // address of the deployer (the sender during init()) + } + + receive("show all") { + /// addresses cannot currently be dumped + /// TODO: https://github.com/tact-lang/tact/issues/16 + /// dump(self.a1); + } + + receive("show ops") { + // temporary variable + let a: Address = address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"); // bouncable (same foundation wallet) + + dump(a == self.a1); + dump(a == self.a2); + dump(a == self.a3); + + dump(a == self.a4); + dump(a != self.a5); + } + + get fun result(): Address { + return self.a1; + } +}`;function L(a){return e=>{let s=e;s.storeUint(2490013878,32),s.storeUint(a.queryId,64)}}async function u(){const a=r.Cell.fromBase64("te6ccgECGgEABZgAART/APSkE/S88sgLAQIBYgIDA5rQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFds88uCCyPhDAcx/AcoAVVDbPMntVBAEBQIBIA4PAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAYHAcJQZSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlADINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFshYDQE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwIAa75ASCC8DJCzGWVLwXZsH0rLKrZFjijQcjh8lPCONTeYLkL/XNKupQwf9sx4ILwrpsV8NUOlRZO9nf+vFel+a43mzrPchtpSkgsd9tlw9W6joXbPH/bMeAKAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAkAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwEdI0IYAQe/qqXMblNo5fl5kYi9eYzSLgSrFtHY6k/DdIB0HmNRFNgxwXbPFNQxwXbPFNAxwXbPFMwxwUMDAwLAhLbPFIg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CDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABYAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCPu1E0NQB+GPSAAGOhNs8bBbgMPgo1wsKgwm68uCJ2zwaGAHWjQhgBB7+qpcxuU2jl+XmRiL15jNIuBKsW0djqT8N0gHQeY1EjQhgBB7+qpcxuU2jl+XmRiL15jNIuBKsW0djqT8N0gHQeY1EcILwg9/VUuY3KbRy/LzIxF68xmkXAlWLaOx1J+G6QDoPMagZALzIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiHAgyHIBywFwAcsAEsoHy//J0CDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4Ij4KPhCAcb6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHUAdAbAMz6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDEQNhA1EDSvQDBA");let s=r.beginCell();s.storeRef(e),s.storeUint(0,1);const o=s.endCell();return{code:a,data:o}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},D=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],E=[{name:"result",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],M=[{receiver:"internal",message:{kind:"text",text:"show all"}},{receiver:"internal",message:{kind:"text",text:"show ops"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class l{constructor(e,s){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:D,getters:E,receivers:M,errors:v});this.address=e,this.init=s}static async init(){return await u()}static async fromInit(){const e=await u(),s=r.contractAddress(0,e);return new l(s,e)}static fromAddress(e){return new l(e)}async send(e,s,o,t){let n=null;if(t==="show all"&&(n=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="show ops"&&(n=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="Deploy"&&(n=r.beginCell().store(L(t)).endCell()),n===null)throw new Error("Invalid message type");await e.internal(s,{...o,body:n})}async getResult(e){let s=new r.TupleBuilder;return(await e.get("result",s.build())).stack.readAddress()}}function N(a,e,s){let o;B(a,c,i=>s(2,o=i));let t,n;return f(c,o={markdown:Q,tactCode:h,deploy:async()=>{const i=await b.Blockchain.create(),A=await i.treasury("deployer");t=A.getSender(),n=i.openContract(await l.fromInit());const y={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],y,[await n.send(A.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await n.send(t,{value:r.toNano(1)},"show all")],"show ops":async()=>[await n.send(t,{value:r.toNano(1)},"show ops")]},getters:{result:async()=>await n.getResult()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class S extends I{constructor(e){super(),w(this,e,N,null,C,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.06b72b09.js b/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.06b72b09.js new file mode 100644 index 0000000..b090dd5 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.06b72b09.js @@ -0,0 +1,35 @@ +var m=Object.defineProperty;var u=(o,e,t)=>e in o?m(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>(u(o,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as w,s as b,I,ac as C}from"../chunks/index.9fe14626.js";import{d as a,g as p,s as c}from"../chunks/store.476c3091.js";import{d as h}from"../chunks/index.c056099e.js";const B="# Bools\n\nThis primitive data type can hold the values `true` or `false`.\n\n`Bool` is convenient for boolean and logical operations. It is also useful for storing flags.\n\nThe only supported operations with booleans are `&&` `||` `!` - if you try to add them, for example, the code will not compile.\n\n## State costs\n\nPersisting bools to state is very space-efficient, they only take 1-bit. **Storing 1000 bools in state [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about 0.00072 TON per year.**\n",D=`import "@stdlib/deploy"; + +contract Bools with Deployable { + + // contract persistent state variables + b1: Bool = true; + b2: Bool = false; + b3: Bool; + + init() { + self.b3 = !self.b2; + } + + receive("show all") { + dump(self.b1); + dump(self.b2); + dump(self.b3); + } + + receive("show ops") { + let b: Bool = true; // temporary variable + dump(b); + + b = self.b1 && self.b2 || !self.b3; + dump(b); + + dump(self.b1 == true); + dump(self.b1 == self.b2); + dump(self.b1 != self.b2); + } + + get fun result(): Bool { + return self.b1; + } +}`;function v(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}async function g(){const o=a.Cell.fromBase64("te6ccgECFgEAAzEAART/APSkE/S88sgLAQIBYgIDAqbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBQI8oAygDKAMntVA8EAgEgDQ4CoO2i7fsBkjB/4HAh10nCH5UwINcLH94gghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wBQYBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8BwSy+QEggvAyQsxllS8F2bB9Kyyq2RY4o0HI4fJTwjjU3mC5C/1zSrqPjTAi2zwh2zwg2zx/2zHggvCumxXw1Q6VFk72d/68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QL4Yts8VRLbPPLggsj4QwHMfwHKAFUgUCPKAMoAygDJ7VQWDQKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXATDgSy+QEggvAyQsxllS8F2bB9Kyyq2RY4o0HI4fJTwjjU3mC5C/1zSrqPjTAi2zwh2zwg2zx/2zHggvCumxXw1Q6VFk72d/68V6X5rjebOs9yG2lKSCx322XD1boSEhIPARCOhds8f9sx4BAEMn/bPCKRIZFw4pF/kiCz4ts8IsD/2zxTIboSEhIRAg7bPFMhvds8EhIALJmLR0cnVlj+FDCai1ZmFsc2WP4UMOIBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8FAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAVAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAUjtRNDUAfhj0gABmtIA0gDSAFUgbBPgMPgo1wsKgwm68uCJ2zwXAAZ/cH9su+Lo");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const l=t.endCell();return{code:o,data:l}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},k=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],Q=[{name:"result",arguments:[],returnType:{kind:"simple",type:"bool",optional:!1}}],S=[{receiver:"internal",message:{kind:"text",text:"show all"}},{receiver:"internal",message:{kind:"text",text:"show ops"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class d{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:k,getters:Q,receivers:S,errors:E});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=a.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,l,s){let n=null;if(s==="show all"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s==="show ops"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(n=a.beginCell().store(v(s)).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...l,body:n})}async getResult(e){let t=new a.TupleBuilder;return(await e.get("result",t.build())).stack.readBoolean()}}function M(o,e,t){let l;I(o,c,r=>t(2,l=r));let s,n;return C(c,l={markdown:B,tactCode:D,deploy:async()=>{const r=await h.Blockchain.create(),A=await r.treasury("deployer");s=A.getSender(),n=r.openContract(await d.fromInit());const y={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],y,[await n.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await n.send(s,{value:a.toNano(1)},"show all")],"show ops":async()=>[await n.send(s,{value:a.toNano(1)},"show ops")]},getters:{result:async()=>await n.getResult()},prev:p(import.meta.url).prev,next:p(import.meta.url).next},l),[]}class J extends f{constructor(e){super(),w(this,e,M,null,b,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.4def9755.js b/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.4def9755.js deleted file mode 100644 index f4c20fd..0000000 --- a/docs/_app/immutable/entry/(examples)-02-bools-page.svelte.4def9755.js +++ /dev/null @@ -1,35 +0,0 @@ -var p=Object.defineProperty;var y=(n,e,t)=>e in n?p(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>(y(n,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as b,s as C,I,ac as m}from"../chunks/index.9fe14626.js";import{d as r,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as B}from"../chunks/index.78404594.js";const h="# Bools\n\nThis primitive data type can hold the values `true` or `false`.\n\n`Bool` is convenient for boolean and logical operations. It is also useful for storing flags.\n\nThe only supported operations with booleans are `&&` `||` `!` - if you try to add them, for example, the code will not compile.\n\n## State costs\n\nPersisting bools to state is very space-efficient, they only take 1-bit. Storing 1000 bools in state [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about 0.00072 TON per year.",D=`import "@stdlib/deploy"; - -contract Bools with Deployable { - - // contract persistent state variables - b1: Bool = true; - b2: Bool = false; - b3: Bool; - - init() { - self.b3 = !self.b2; - } - - receive("show all") { - dump(self.b1); - dump(self.b2); - dump(self.b3); - } - - receive("show ops") { - let b: Bool = true; // temporary variable - dump(b); - - b = self.b1 && self.b2 || !self.b3; - dump(b); - - dump(self.b1 == true); - dump(self.b1 == self.b2); - dump(self.b1 != self.b2); - } - - get fun result(): Bool { - return self.b1; - } -}`;function E(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function u(){const n=r.Cell.fromBase64("te6ccgECFQEAAxYAART/APSkE/S88sgLAQIBYgIDAqLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgUCPKAMoAygDJ7VQOBAIBIAwNAq7tou37cCHXScIflTAg1wsf3gKSW3/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAkTDjDXAFBgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAHBLL5ASCC8DJCzGWVLwXZsH0rLKrZFjijQcjh8l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Jbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcBMOBLL5ASCC8DJCzGWVLwXZsH0rLKrZFjijQcjh8lPCONTeYLkL/XNKuo+NMCLbPCHbPCDbPH/bMeCC8K6bFfDVDpUWTvZ3/rxXpfmuN5s6z3IbaUpILHfbZcPVuhISEg8BEI6F2zx/2zHgEAQyf9s8IpEhkXDikX+SILPi2zwiwP/bPFMhuhISEhECDts8UyG92zwSEgAsmYtHRydWWP4UMJqLVmYWxzZY/hQw4gHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAUAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAUjtRNDUAfhj0gABmtIA0gDSAFUgbBPgMPgo1wsKgwm68uCJ2zwWAAZ/cH8Mqc0Y");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const a=t.endCell();return{code:n,data:a}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class A{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:H});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=r.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,a,s){let o=null;if(s==="show all"&&(o=r.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s==="show ops"&&(o=r.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof r.Slice)&&s.$$type==="Deploy"&&(o=r.beginCell().store(E(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:o})}async getResult(e){let t=new r.TupleBuilder;return(await e.get("result",t.build())).stack.readBoolean()}}function M(n,e,t){let a;I(n,d,l=>t(2,a=l));let s,o;return m(d,a={markdown:h,tactCode:D,deploy:async()=>{const l=await B.Blockchain.create(),c=await l.treasury("deployer");s=c.getSender(),o=l.openContract(await A.fromInit());const w={[c.address.toString()]:"deployer",[o.address.toString()]:"contract"};return[[o],w,[await o.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await o.send(s,{value:r.toNano(1)},"show all")],"show ops":async()=>[await o.send(s,{value:r.toNano(1)},"show ops")]},getters:{result:async()=>await o.getResult()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},a),[]}class S extends f{constructor(e){super(),b(this,e,M,null,C,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.60a3c886.js b/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.60a3c886.js new file mode 100644 index 0000000..309f433 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.60a3c886.js @@ -0,0 +1,34 @@ +var g=Object.defineProperty;var u=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(u(n,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as f,s as C,I as h,ac as w}from"../chunks/index.9fe14626.js";import{d as i,g as d,s as A}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const I=`# Constants + +Unlike variables, constants cannot change. Their values are calculated in _compile-time_ and cannot change during execution. + +Constant initializations must be relatively simple and only rely on values known during compilation. If you add two numbers for example, the compiler will calculate the result during build and put the result in your compiled code. + +You can read constants both in **_receivers_** and in **_getters_**. + +Unlike contract variables, **constants don't consume space in persistent state. Their values are stored directly in the code cell.** + +There isn't much difference between constants defined outside of a contract and inside the contract. Those defined outside can be used by other contracts in your project. +`,b=`import "@stdlib/deploy"; + +// global constants are calculated in compile-time and can't change +const GlobalConst1: Int = 1000 + ton("1.24") + pow(10, 9); + +contract Constants with Deployable { + + // contract constants are calculated in compile-time and can't change + const ContractConst1: Int = 2000 + ton("1.25") + pow(10, 9); + + // if your contract can be in multiple states, constants are an easy alternative to enums + const StateUnpaid: Int = 0; + const StatePaid: Int = 1; + const StateDelivered: Int = 2; + const StateDisputed: Int = 3; + + init() {} + + get fun sum(): Int { + // you can read the constants anywhere + return GlobalConst1 + self.ContractConst1 + self.StatePaid; + } +}`;function D(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function p(){const n=i.Cell.fromBase64("te6ccgECEQEAAmcAART/APSkE/S88sgLAQIBYgIDApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4IIwyPhDAcx/AcoAye1UDgQCAVgICQGKAZIwf+BwIddJwh+VMCDXCx/eghCUapi2uo6n0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4DBwBQE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwGAcrIcQHKAVAHAcoAcAHKAlAFINdJ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2zwPAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABAAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8EgACbZA3iYc=");let t=i.beginCell();t.storeRef(e),t.storeUint(0,1);const s=t.endCell();return{code:n,data:s}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},k=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],L=[{name:"sum",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],Q=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class l{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:k,getters:L,receivers:Q,errors:v});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=i.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,s,a){let o=null;if(a&&typeof a=="object"&&!(a instanceof i.Slice)&&a.$$type==="Deploy"&&(o=i.beginCell().store(D(a)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...s,body:o})}async getSum(e){let t=new i.TupleBuilder;return(await e.get("sum",t.build())).stack.readBigNumber()}}function S(n,e,t){let s;h(n,A,o=>t(2,s=o));let a;return w(A,s={markdown:I,tactCode:b,deploy:async()=>{const o=await B.Blockchain.create(),c=await o.treasury("deployer");c.getSender(),a=o.openContract(await l.fromInit());const m={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],m,[await a.send(c.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{sum:async()=>await a.getSum()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},s),[]}class z extends y{constructor(e){super(),f(this,e,S,null,C,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.e3182455.js b/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.e3182455.js deleted file mode 100644 index e4c077e..0000000 --- a/docs/_app/immutable/entry/(examples)-02-constants-page.svelte.e3182455.js +++ /dev/null @@ -1,33 +0,0 @@ -var m=Object.defineProperty;var C=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var c=(n,e,t)=>(C(n,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as p,s as w,I as B,ac as f}from"../chunks/index.9fe14626.js";import{d as r,g as A,s as d}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const I=`# Constants - -Unlike variables, constants cannot change. Their values are calculated in *compile-time* and cannot change during execution. - -Constant initializations must be relatively simple and only rely on values known during compilation. If you add two numbers for example, the compiler will calculate the result during build and put the result in your compiled code. - -You can read constants both in *receivers* and in *getters*. - -Unlike contract variables, constants don't consume space in persistent state. Their values are stored directly in the code cell. - -There isn't much difference between constants defined outside of a contract and inside the contract. Those defined outside can be used by other contracts in your project.`,h=`import "@stdlib/deploy"; - -// global constants are calculated in compile-time and can't change -const GlobalConst1: Int = 1000 + ton("1.24") + pow(10, 9); - -contract Constants with Deployable { - - // contract constants are calculated in compile-time and can't change - const ContractConst1: Int = 2000 + ton("1.25") + pow(10, 9); - - // if your contract can be in multiple states, constants are an easy alternative to enums - const StateUnpaid: Int = 0; - const StatePaid: Int = 1; - const StateDelivered: Int = 2; - const StateDisputed: Int = 3; - - init() {} - - get fun sum(): Int { - // you can read the constants anywhere - return GlobalConst1 + self.ContractConst1 + self.StatePaid; - } -}`;function v(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function g(){const n=r.Cell.fromBase64("te6ccg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1J3vlUWW8cdT094FWcMmgnCdl05as07LczoOlm2UZuikgCjtAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFnbPDAwyPhDAcx/AcoAye1UEA0BmHAh10nCH5UwINcLH94Cklt/4AGCEJRqmLa6jq3THwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gMHAOAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AA8AmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8EQACbWPJ5iA=");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const a=t.endCell();return{code:n,data:a}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class i{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:D});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=r.contractAddress(0,e);return new i(t,e)}static fromAddress(e){return new i(e)}async send(e,t,a,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof r.Slice)&&s.$$type==="Deploy"&&(o=r.beginCell().store(v(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:o})}async getSum(e){let t=new r.TupleBuilder;return(await e.get("sum",t.build())).stack.readBigNumber()}}function L(n,e,t){let a;B(n,d,o=>t(2,a=o));let s;return f(d,a={markdown:I,tactCode:h,deploy:async()=>{const o=await b.Blockchain.create(),l=await o.treasury("deployer");l.getSender(),s=o.openContract(await i.fromInit());const u={[l.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],u,[await s.send(l.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{sum:async()=>await s.getSum()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},a),[]}class S extends y{constructor(e){super(),p(this,e,L,null,w,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.37fc378a.js b/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.37fc378a.js deleted file mode 100644 index 7a89112..0000000 --- a/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.37fc378a.js +++ /dev/null @@ -1,56 +0,0 @@ -var u=Object.defineProperty;var p=(n,e,t)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var A=(n,e,t)=>(p(n,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as C,s as h,I as f,ac as B}from"../chunks/index.9fe14626.js";import{d as a,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as I}from"../chunks/index.78404594.js";const b=`# Integer Operations - -Since all runtime calculations with integers are done at 257-bit, overflows are quite rare. An overflow can happen if the result of a math operation is too big to fit. For example, multiplying 2^256 by 2^256 will not fit within 257-bit. - -Nevertheless, if any math operation overflows, an exception will be thrown and the transaction will fail. You can say that Tact's math is safe by default. - -There's no problem with mixing variables of different state sizes in the same calculation. In runtime, they are all the same type - always 257-bit signed. This is the largest supported integer type, so they all fit. - -## Decimal point with integers - -Arithmetics with dollars, for example, requires 2 decimal places. How can we represent the number \`1.25\` if we can only work with integers? The answer is to work with *cents*. So \`1.25\` becomes \`125\`. We just remember that the two lowest digits are coming after the decimal point. - -In the same way, working with TON coins has 9 decimal places instead of 2. So the amount 1.25 TON which can be coded in Tact as \`ton("1.25")\` is actually the number \`1250000000\` - we call these *nano-tons* instead of cents.`,D=`import "@stdlib/deploy"; - -contract Integers with Deployable { - - // contract persistent state variables - i1: Int as uint128 = 3001; - i2: Int as int32 = 57; - - init() {} - - receive("show ops") { - let i: Int = -12; // temporary variable, runtime Int type is always int257 (range -2^256 to 2^256 - 1) - dump(i); - - i = self.i1 * 3 + (self.i2 - i); // basic math expressions - dump(i); - - i = self.i1 % 10; // modulo (remainder after division), 3001 % 10 = 1 - dump(i); - - i = self.i1 / 1000; // integer division (truncation toward zero), 3001 / 1000 = 3 - dump(i); - - i = self.i1 >> 3; // shift right (multiply by 2^n) - dump(i); - - i = self.i1 << 2; // shift left (divide by 2^n) - dump(i); - - i = min(self.i2, 11); // minimum between two numbers - dump(i); - - i = max(self.i2, 66); // maximum between two numbers - dump(i); - - i = abs(-1 * self.i2); // absolute value - dump(i); - - dump(self.i1 == 3001); - dump(self.i1 > 2000); - dump(self.i1 >= 3002); - dump(self.i1 != 70); - } -}`;function Q(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function w(){const n=a.Cell.fromBase64("te6ccgECFQEAA5MAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWQLLf8ofye1UBAUCAVgREgFC7UTQ1AH4Y9IAAZ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MlTFwAcoA4skB+wAUAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAULtRNDUAfhj0gABl9N/0h9ZbBLgMPgo1wsKgwm68uCJ2zwWAAqBC7mAOR3r/go=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:n,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:E});this.address=e,this.init=t}static async init(){return await w()}static async fromInit(){const e=await w(),t=a.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,o,s){let i=null;if(s==="show ops"&&(i=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(i=a.beginCell().store(Q(s)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:i})}}function M(n,e,t){let o;f(n,d,r=>t(2,o=r));let s,i;return B(d,o={markdown:b,tactCode:D,deploy:async()=>{const r=await I.Blockchain.create(),c=await r.treasury("deployer");s=c.getSender(),i=r.openContract(await l.fromInit());const m={[c.address.toString()]:"deployer",[i.address.toString()]:"contract"};return[[i],m,[await i.send(c.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show ops":async()=>[await i.send(s,{value:a.toNano(1)},"show ops")]},getters:{},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class H extends y{constructor(e){super(),C(this,e,M,null,h,{})}}export{H as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.3a5c1355.js b/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.3a5c1355.js new file mode 100644 index 0000000..aca2682 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-integer-ops-page.svelte.3a5c1355.js @@ -0,0 +1,61 @@ +var g=Object.defineProperty;var w=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(w(n,typeof e!="symbol"?e+"":e,t),t);import{S as u,i as f,s as h,I as B,ac as C}from"../chunks/index.9fe14626.js";import{d as a,g as d,s as m}from"../chunks/store.476c3091.js";import{d as I}from"../chunks/index.c056099e.js";const b=`# Integer Operations + +Since all runtime calculations with integers are done at 257-bit, overflows are quite rare. An overflow can happen if the result of a math operation is too big to fit. + +**For example, multiplying 2^256 by 2^256 will not fit within 257-bit.** + +Nevertheless, if any math operation overflows, an exception will be thrown, and the transaction will fail. You could say that Tact's math is safe by default. + +There is no problem with mixing variables of different state sizes in the same calculation. At runtime, they are all the same type—**always 257-bit signed**. This is the largest supported integer type, so they all fit. + +## Decimal Point with Integers + +Arithmetic with dollars, for example, requires two decimal places. How can we represent the number \`1.25\` if we are only able to work with integers? The solution is to work with _cents_. In this way, \`1.25\` becomes \`125\`. We simply remember that the two rightmost digits represent the numbers after the decimal point. + +Similarly, working with TON coins requires nine decimal places instead of two. Therefore, the amount of 1.25 TON, which can be represented in Tact as \`ton("1.25")\`, is actually the number \`1250000000\`. + +**We refer to these as _nano-tons_ rather than cents.** +`,D=`import "@stdlib/deploy"; + +contract Integers with Deployable { + + // contract persistent state variables + i1: Int as uint128 = 3001; + i2: Int as int32 = 57; + + init() {} + + receive("show ops") { + let i: Int = -12; // temporary variable, runtime Int type is always int257 (range -2^256 to 2^256 - 1) + dump(i); + + i = self.i1 * 3 + (self.i2 - i); // basic math expressions + dump(i); + + i = self.i1 % 10; // modulo (remainder after division), 3001 % 10 = 1 + dump(i); + + i = self.i1 / 1000; // integer division (truncation toward zero), 3001 / 1000 = 3 + dump(i); + + i = self.i1 >> 3; // shift right (divide by 2^n) + dump(i); + + i = self.i1 << 2; // shift left (multiply by 2^n) + dump(i); + + i = min(self.i2, 11); // minimum between two numbers + dump(i); + + i = max(self.i2, 66); // maximum between two numbers + dump(i); + + i = abs(-1 * self.i2); // absolute value + dump(i); + + dump(self.i1 == 3001); + dump(self.i1 > 2000); + dump(self.i1 >= 3002); + dump(self.i1 != 70); + } +}`;function E(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function p(){const n=a.Cell.fromBase64("te6ccgECFgEAA64AART/APSkE/S88sgLAQIBYgIDApzQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZAst/yh/J7VQEBQIBWBITAULtRNDUAfhj0gABl9N/0h9ZbBLgMPgo1wsKgwm68uCJ2zwGAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAcIAAqBC7mAOQE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwJAVr5AYLwrpsV8NUOlRZO9nf+vFel+a43mzrPchtpSkgsd9tlw9W6joXbPH/bMeALAcrIcQHKAVAHAcoAcAHKAlAFINdJ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:n,data:o}}const Q={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},M=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],v=[],k=[{receiver:"internal",message:{kind:"text",text:"show ops"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:M,getters:v,receivers:k,errors:Q});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=a.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,o,s){let i=null;if(s==="show ops"&&(i=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(i=a.beginCell().store(E(s)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:i})}}function O(n,e,t){let o;B(n,m,r=>t(2,o=r));let s,i;return C(m,o={markdown:b,tactCode:D,deploy:async()=>{const r=await I.Blockchain.create(),c=await r.treasury("deployer");s=c.getSender(),i=r.openContract(await A.fromInit());const y={[c.address.toString()]:"deployer",[i.address.toString()]:"contract"};return[[i],y,[await i.send(c.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show ops":async()=>[await i.send(s,{value:a.toNano(1)},"show ops")]},getters:{},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class H extends u{constructor(e){super(),f(this,e,O,null,h,{})}}export{H as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.4c442c50.js b/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.4c442c50.js deleted file mode 100644 index ec549e5..0000000 --- a/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.4c442c50.js +++ /dev/null @@ -1,57 +0,0 @@ -var b=Object.defineProperty;var w=(n,e,t)=>e in n?b(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var A=(n,e,t)=>(w(n,typeof e!="symbol"?e+"":e,t),t);import{S as C,i as B,s as p,I,ac as m}from"../chunks/index.9fe14626.js";import{d as i,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as f}from"../chunks/index.78404594.js";const h=`# Integers - -Tact supports a number of primitive data types that are tailored for smart contract use. - -\`Int\` is the primary number type. Math in smart contracts is always done with integers and never with floating points since floats are [unpredictable](https://learn.microsoft.com/en-us/cpp/build/why-floating-point-numbers-may-lose-precision). - -The runtime type \`Int\` is *always* 257-bit signed, so all runtime calculations are done at 257-bit. This should be large enough for pretty much anything you need as it's large enough to hold the number of atoms in the universe. - -Persistent state variables can be initialized inline or inside \`init()\`. If you forget to initialize a state variable, the code will not compile. - -## State costs - -When encoding \`Int\` to persistent state, we will usually use smaller representations than 257-bit to reduce storage cost. The persistent state size is specified in every declaration of a state variable after the \`as\` keyword. - -Storing 1000 257-bit integers in state [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about 0.184 TON per year. Storing 1000 32-bit integers only costs 0.023 TON per year by comparison.`,M=`import "@stdlib/deploy"; - -contract Integers with Deployable { - - // contract persistent state variables - // integers can be persisted in state in various sizes - i1: Int as int257 = 3001; // range -2^256 to 2^256 - 1 (takes 257 bit = 32 bytes + 1 bit) - i2: Int as uint256; // range 0 to 2^256 - 1 (takes 256 bit = 32 bytes) - i3: Int as int256 = 17; // range -2^255 to 2^255 - 1 (takes 256 bit = 32 bytes) - i4: Int as uint128; // range 0 to 2^128 - 1 (takes 128 bit = 16 bytes) - i5: Int as int128; // range -2^127 to 2^127 - 1 (takes 128 bit = 16 bytes) - i6: Int as coins; // range 0 to 2^120 - 1 (takes 120 bit = 15 bytes) - i7: Int as uint64 = 0x1c4a; // range 0 to 18,446,744,073,709,551,615 (takes 64 bit = 8 bytes) - i8: Int as int64 = -203; // range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (takes 64 bit = 8 bytes) - i9: Int as uint32 = 0; // range 0 to 4,294,967,295 (takes 32 bit = 4 bytes) - i10: Int as int32 = 0; // range -2,147,483,648 to 2,147,483,647 (takes 32 bit = 4 bytes) - i11: Int as uint16 = 0; // range 0 to 65,535 (takes 16 bit = 2 bytes) - i12: Int as int16 = 0; // range -32,768 to 32,767 (takes 16 bit = 2 bytes) - i13: Int as uint8 = 0; // range 0 to 255 (takes 8 bit = 1 byte) - i14: Int as int8 = 0; // range -128 to 127 (takes 8 bit = 1 byte) - - init() { - self.i2 = 0x83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8; // we can define numbers in hex (base 16) - self.i4 = 1507998500293440234999; // we can define numbers in decimal (base 10) - self.i5 = pow(10, 9); // this is 10^9 = 1,000,000,000 - self.i6 = ton("1.23"); // easy to read coin balances (coins type is nano-tons, like cents, just with 9 decimals) - } - - receive("show all") { - dump(self.i1); - dump(self.i2); - dump(self.i3); - dump(self.i4); - dump(self.i5); - dump(self.i6); - dump(self.i7); - dump(self.i8); - } - - get fun result(): Int { - return self.i1; - } -}`;function Q(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function u(){const n=i.Cell.fromBase64("te6ccgECFQEAA+YAART/APSkE/S88sgLAQIBYgIDAvTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVHds8MMj4QwHMfwHKAFXQUN6BAQHPABvL/xnK/xfLfwXIyn9QBPoCEss/yj/LHxLKHxLLDxLKDxLLBxLKB8kBzMntVA4EAgEgDA0Cru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAUGAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus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cLCoMJuvLgids8FgCigQu5gBGBHEqB/zVwVHAAUwCC8IPf1VLmNym0cvy8yMRevMZpFwJVi2jsdSfhukA6DzGoCQiCOFG/ruZMZEzl94IQO5rKAFCYghBJUE+ACFUzhlh4ZA==");let t=i.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:n,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:E});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=i.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,o,s){let a=null;if(s==="show all"&&(a=i.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof i.Slice)&&s.$$type==="Deploy"&&(a=i.beginCell().store(Q(s)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getResult(e){let t=new i.TupleBuilder;return(await e.get("result",t.build())).stack.readBigNumber()}}function v(n,e,t){let o;I(n,g,r=>t(2,o=r));let s,a;return m(g,o={markdown:h,tactCode:M,deploy:async()=>{const r=await f.Blockchain.create(),c=await r.treasury("deployer");s=c.getSender(),a=r.openContract(await l.fromInit());const y={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],y,[await a.send(c.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await a.send(s,{value:i.toNano(1)},"show all")]},getters:{result:async()=>await a.getResult()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class k extends C{constructor(e){super(),B(this,e,v,null,p,{})}}export{k as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.98d16c1c.js b/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.98d16c1c.js new file mode 100644 index 0000000..89833e0 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-integers-page.svelte.98d16c1c.js @@ -0,0 +1,59 @@ +var m=Object.defineProperty;var u=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(u(n,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as b,s as w,I,ac as B}from"../chunks/index.9fe14626.js";import{d as i,g as d,s as p}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const h=`# Integers + +Tact supports a number of primitive data types that are tailored for smart contract use. + +\`Int\` is the primary number type. Math in smart contracts is always done with integers and never with floating points since floats are [unpredictable](https://learn.microsoft.com/en-us/cpp/build/why-floating-point-numbers-may-lose-precision). + +The runtime type \`Int\` is _always_ 257-bit signed, so all runtime calculations are done at 257-bit. This should be large enough for pretty much anything you need as it's large enough to hold the number of atoms in the universe. + +Persistent state variables can be initialized inline or inside \`init()\`. If you forget to initialize a state variable, the code will not compile. + +## State costs + +When encoding \`Int\` to persistent state, we will usually use smaller representations than 257-bit to reduce storage cost. The persistent state size is specified in every declaration of a state variable after the \`as\` keyword. + +- Storing 1000 257-bit integers in state [costs](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees) about **0.184 TON** per year. +- Storing 1000 32-bit integers only costs **0.023 TON** per year by comparison. +`,D=`import "@stdlib/deploy"; + +contract Integers with Deployable { + + // contract persistent state variables + // integers can be persisted in state in various sizes + i1: Int as int257 = 3001; // range -2^256 to 2^256 - 1 (takes 257 bit = 32 bytes + 1 bit) + i2: Int as uint256; // range 0 to 2^256 - 1 (takes 256 bit = 32 bytes) + i3: Int as int256 = 17; // range -2^255 to 2^255 - 1 (takes 256 bit = 32 bytes) + i4: Int as uint128; // range 0 to 2^128 - 1 (takes 128 bit = 16 bytes) + i5: Int as int128; // range -2^127 to 2^127 - 1 (takes 128 bit = 16 bytes) + i6: Int as coins; // range 0 to 2^120 - 1 (takes 120 bit = 15 bytes) + i7: Int as uint64 = 0x1c4a; // range 0 to 18,446,744,073,709,551,615 (takes 64 bit = 8 bytes) + i8: Int as int64 = -203; // range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (takes 64 bit = 8 bytes) + i9: Int as uint32 = 0; // range 0 to 4,294,967,295 (takes 32 bit = 4 bytes) + i10: Int as int32 = 0; // range -2,147,483,648 to 2,147,483,647 (takes 32 bit = 4 bytes) + i11: Int as uint16 = 0; // range 0 to 65,535 (takes 16 bit = 2 bytes) + i12: Int as int16 = 0; // range -32,768 to 32,767 (takes 16 bit = 2 bytes) + i13: Int as uint8 = 0; // range 0 to 255 (takes 8 bit = 1 byte) + i14: Int as int8 = 0; // range -128 to 127 (takes 8 bit = 1 byte) + + init() { + self.i2 = 0x83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8; // we can define numbers in hex (base 16) + self.i4 = 1507998500293440234999; // we can define numbers in decimal (base 10) + self.i5 = pow(10, 9); // this is 10^9 = 1,000,000,000 + self.i6 = ton("1.23"); // easy to read coin balances (coins type is nano-tons, like cents, just with 9 decimals) + } + + receive("show all") { + dump(self.i1); + dump(self.i2); + dump(self.i3); + dump(self.i4); + dump(self.i5); + dump(self.i6); + dump(self.i7); + dump(self.i8); + } + + get fun result(): Int { + return self.i1; + } +}`;function M(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function y(){const n=i.Cell.fromBase64("te6ccgECFgEABAEAART/APSkE/S88sgLAQIBYgIDAvjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVHds88uCCyPhDAcx/AcoAVdBQ3oEBAc8AG8v/Gcr/F8t/BcjKf1AE+gISyz/KP8sfEsofEssPEsoPEssHEsoHyQHMye1UDwQCASANDgKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAFBgE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwHAVr5AYLwMkLMZZUvBdmwfSssqtkWOKNByOHyU8I41N5guQv9c0q6joXbPH/bMeAJAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAgAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwEJi3bPP4UMCzbPP4UMCvbPP4UMCoMDAwKBCTbPP4UMCnbPP4UMCjbPP4UMCcMDAwLAhbbPP4UMCbbPP4UMAwMAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydACEb9yltnm2eNnDA8QAgEgEhMBkO1E0NQB+GPSAAGOLYEBAdcA0//S/9N/1AHQ0n/6ANM/0j/TH9If0w/SD9MH0gcwE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r2zz+FDAqEhISEAQk2zz+FDAp2zz+FDAo2zz+FDAnEhISEQIW2zz+FDAm2zz+FDASEgDeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGQ7UTQ1AH4Y9IAAY4tgQEB1wDT/9L/03/UAdDSf/oA0z/SP9Mf0h/TD9IP0wfSBzAQrhCtEKwQq2we4DD4KNcLCoMJuvLgids8FwCigQu5gBGBHEqB/zVwVHAAUwCC8IPf1VLmNym0cvy8yMRevMZpFwJVi2jsdSfhukA6DzGoCQiCOFG/ruZMZEzl94IQO5rKAFCYghBJUE+ACFUzp0c78Q==");let t=i.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:n,data:o}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],v=[{name:"result",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],H=[{receiver:"internal",message:{kind:"text",text:"show all"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:Q,getters:v,receivers:H,errors:k});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=i.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,o,s){let a=null;if(s==="show all"&&(a=i.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof i.Slice)&&s.$$type==="Deploy"&&(a=i.beginCell().store(M(s)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getResult(e){let t=new i.TupleBuilder;return(await e.get("result",t.build())).stack.readBigNumber()}}function E(n,e,t){let o;I(n,p,r=>t(2,o=r));let s,a;return B(p,o={markdown:h,tactCode:D,deploy:async()=>{const r=await C.Blockchain.create(),c=await r.treasury("deployer");s=c.getSender(),a=r.openContract(await A.fromInit());const g={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],g,[await a.send(c.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await a.send(s,{value:i.toNano(1)},"show all")]},getters:{result:async()=>await a.getResult()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class N extends f{constructor(e){super(),b(this,e,E,null,w,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.598e9ee6.js b/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.598e9ee6.js new file mode 100644 index 0000000..8f6a2f7 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.598e9ee6.js @@ -0,0 +1,58 @@ +var m=Object.defineProperty;var w=(a,e,t)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(w(a,typeof e!="symbol"?e+"":e,t),t);import{S as u,i as B,s as C,I,ac as f}from"../chunks/index.9fe14626.js";import{d as i,g as c,s as g}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const h=`# Strings + +Tact has basic support for strings. Strings support unicode and don't have any special escape characters like \`\\n\`. + +The use of strings in smart contracts should be quite limited. Smart contracts are very exact programs for managing money, they're not intended for interactive CLI. + +Strings are immutable. Once a sequence of characters is created, this sequence cannot be modified. + +If you need to concatenate strings in run-time, you can use a \`StringBuilder\`. This object handles gas efficiently and supports \`append()\` of various types to the string.`,D=`import "@stdlib/deploy"; + +contract Strings with Deployable { + + // contract persistent state variables + s1: String = "hello world"; + s2: String = "yes unicode 😀 😅 你好 no escaping"; /// TODO: https://github.com/tact-lang/tact/issues/25 \\n \\t"; + s3: String; + s4: String; + s5: String; + s6: String; + + init() { + let i1: Int = -12345; + let i2: Int = 6780000000; // coins = ton("6.78") + + self.s3 = i1.toString(); + self.s4 = i1.toFloatString(3); + self.s5 = i2.toCoinsString(); + + // gas efficient helper to concatenate strings in run-time + let sb: StringBuilder = beginString(); + sb.append(self.s1); + sb.append(", your balance is: "); + sb.append(self.s5); + self.s6 = sb.toString(); + } + + receive("show all") { + dump(self.s1); + dump(self.s2); + dump(self.s3); + dump(self.s4); + dump(self.s5); + dump(self.s6); + } + + receive("show ops") { + let s: String = "how are you?"; // temporary variable + dump(s); + + /// TODO: https://github.com/tact-lang/tact/issues/24 + /// dump(self.s1 == "hello world"); + /// dump(self.s1 != s); + } + + get fun result(): String { + return self.s1; + } +}`;function Q(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function p(){const a=i.Cell.fromBase64("te6ccgECFwEABSAAART/APSkE/S88sgLAQIBYgIDA3rQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFds88uCCDAQFAgEgCgsCoO2i7fsBkjB/4HAh10nCH5UwINcLH94gghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wBgcAksj4QwHMfwHKAFVQyFAGzxbJUAbMyFAEzxbJUAPMyMhQA88WyVjMyFADzxbJWMzIUATPFslQA8zIyFADzxbJWMzJAczJAczJ7V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();return{code:a,data:o}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},v=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],M=[{name:"result",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}}],H=[{receiver:"internal",message:{kind:"text",text:"show all"}},{receiver:"internal",message:{kind:"text",text:"show ops"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:v,getters:M,receivers:H,errors:S});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=i.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,o,n){let s=null;if(n==="show all"&&(s=i.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="show ops"&&(s=i.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof i.Slice)&&n.$$type==="Deploy"&&(s=i.beginCell().store(Q(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:s})}async getResult(e){let t=new i.TupleBuilder;return(await e.get("result",t.build())).stack.readString()}}function F(a,e,t){let o;I(a,g,l=>t(2,o=l));let n,s;return f(g,o={markdown:h,tactCode:D,deploy:async()=>{const l=await b.Blockchain.create(),d=await l.treasury("deployer");n=d.getSender(),s=l.openContract(await A.fromInit());const y={[d.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],y,[await s.send(d.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await s.send(n,{value:i.toNano(1)},"show all")],"show ops":async()=>[await s.send(n,{value:i.toNano(1)},"show ops")]},getters:{result:async()=>await s.getResult()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},o),[]}class O extends u{constructor(e){super(),B(this,e,F,null,C,{})}}export{O as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.b8782a94.js b/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.b8782a94.js deleted file mode 100644 index 0fcb25e..0000000 --- a/docs/_app/immutable/entry/(examples)-02-strings-page.svelte.b8782a94.js +++ /dev/null @@ -1,58 +0,0 @@ -var I=Object.defineProperty;var u=(A,e,s)=>e in A?I(A,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):A[e]=s;var i=(A,e,s)=>(u(A,typeof e!="symbol"?e+"":e,s),s);import{S as B,i as p,s as y,I as b,ac as m}from"../chunks/index.9fe14626.js";import{d as r,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as D}from"../chunks/index.78404594.js";const h=`# Strings - -Tact has basic support for strings. Strings support unicode and don't have any special escape characters like \`\\n\`. - -The use of strings in smart contracts should be quite limited. Smart contracts are very exact programs for managing money, they're not intended for interactive CLI. - -Strings are immutable. Once a sequence of characters is created, this sequence cannot be modified. - -If you need to concatenate strings in run-time, you can use a \`StringBuilder\`. This object handles gas efficiently and supports \`append()\` of various types to the string.`,f=`import "@stdlib/deploy"; - -contract Strings with Deployable { - - // contract persistent state variables - s1: String = "hello world"; - s2: String = "yes unicode 😀 😅 你好 no escaping"; /// TODO: https://github.com/tact-lang/tact/issues/25 \\n \\t"; - s3: String; - s4: String; - s5: String; - s6: String; - - init() { - let i1: Int = -12345; - let i2: Int = 6780000000; // coins = ton("6.78") - - self.s3 = i1.toString(); - self.s4 = i1.toFloatString(3); - self.s5 = i2.toCoinsString(); - - // gas efficient helper to concatenate strings in run-time - let sb: StringBuilder = beginString(); - sb.append(self.s1); - sb.append(", your balance is: "); - sb.append(self.s5); - self.s6 = sb.toString(); - } - - receive("show all") { - dump(self.s1); - dump(self.s2); - dump(self.s3); - dump(self.s4); - dump(self.s5); - dump(self.s6); - } - - receive("show ops") { - let s: String = "how are you?"; // temporary variable - dump(s); - - /// TODO: https://github.com/tact-lang/tact/issues/24 - /// dump(self.s1 == "hello world"); - /// dump(self.s1 != s); - } - - get fun result(): String { - return self.s1; - } -}`;function Q(A){return e=>{let s=e;s.storeUint(2490013878,32),s.storeUint(A.queryId,64)}}async function w(){const A=r.Cell.fromBase64("te6ccgECFgEABQUAART/APSkE/S88sgLAQIBYgIDA3bQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFds8MAsEBQIBIAkKAq7tou37cCHXScIflTAg1wsf3gKSW3/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAkTDjDXAGBwCSyPhDAcx/AcoAVVDIUAbPFslQBszIUATPFslQA8zIyFADzxbJWMzIUAPPFslYzMhQBM8WyVADzMjIUAPPFslYzMkBzMkBzMntVAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAIAP75ASCC8DJCzGWVLwXZsH0rLKrZFjijQcjh8lPCONTeYLkL/XNKuo4cMCX+FDAk/hQwI/4UMCL+FDAh/hQwIP4UMH/bMeCC8K6bFfDVDpUWTvZ3/rxXpfmuN5s6z3IbaUpILHfbZcPVuo4Ui8aG93IGFyZSB5b3U/j+FDB/2zHgAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAhG/cpbZ5tnjYwwLDAIBIBITAXztRNDUAfhj0gABjiPUAdAB1AHQAdQB0NQB0AHUAdAB1AHQAdQw0NQw0BBGEEVsFuAw+CjXCwqDCbry4InbPA0AAiUErIu2hlbGxvIHdvcmxkiNCh5ZXMgdW5pY29kZSDwn5iAIPCfmIUg5L2g5aW9IG5vIGVzY2FwaW5nggc/HghGUHpcAIds8AnPbPAF52zzIbwABb4xtb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dQw0CDXSiHXSZJwIOLi6F8DANogwQEhwk2x8tCGyCLBAJiALQHLBwKjAt5/cG8ABI4bBHqpDCDAAFIwsLObcDOmMBRvjASkBAORMOIE5AGzlwKALm+MAqTejhADeqkMpjATb4wDpCLAABA05jMipQOaUxJvgQHLBwKlAuRsIcnQAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydCSzw7H");let s=r.beginCell();s.storeRef(e),s.storeUint(0,1);const o=s.endCell();return{code:A,data:o}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,s){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:M});this.address=e,this.init=s}static async init(){return await w()}static async fromInit(){const e=await w(),s=r.contractAddress(0,e);return new l(s,e)}static fromAddress(e){return new l(e)}async send(e,s,o,n){let t=null;if(n==="show all"&&(t=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="show ops"&&(t=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof r.Slice)&&n.$$type==="Deploy"&&(t=r.beginCell().store(Q(n)).endCell()),t===null)throw new Error("Invalid message type");await e.internal(s,{...o,body:t})}async getResult(e){let s=new r.TupleBuilder;return(await e.get("result",s.build())).stack.readString()}}function S(A,e,s){let o;b(A,d,a=>s(2,o=a));let n,t;return m(d,o={markdown:h,tactCode:f,deploy:async()=>{const a=await D.Blockchain.create(),c=await a.treasury("deployer");n=c.getSender(),t=a.openContract(await l.fromInit());const C={[c.address.toString()]:"deployer",[t.address.toString()]:"contract"};return[[t],C,[await t.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show all":async()=>[await t.send(n,{value:r.toNano(1)},"show all")],"show ops":async()=>[await t.send(n,{value:r.toNano(1)},"show ops")]},getters:{result:async()=>await t.getResult()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class F extends B{constructor(e){super(),p(this,e,S,null,y,{})}}export{F as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.7c71934f.js b/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.7c71934f.js new file mode 100644 index 0000000..bf94f66 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.7c71934f.js @@ -0,0 +1,46 @@ +var y=Object.defineProperty;var u=(n,e,t)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(u(n,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as w,s as b,I as h,ac as B}from"../chunks/index.9fe14626.js";import{d as o,g as p,s as A}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const I=`# Variables + +The most important variables are those that are persisted in state and retain their value between contract executions. They must be defined in the scope of the contract like \`contractVar1\`. + +Persisting data in state costs gas. The contract must pay rent periodically from its balance. State storage is expensive, about [4 TON per MB per year](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees). If the contract runs out of balance, the data will be deleted. If you need to store large amounts of data, like images, a service like [TON Storage](https://ton.org/docs/participate/ton-storage/storage-faq) would be more suitable. + +Persistent state variables can only change in _receivers_ by sending messages as transactions. **Sending these transactions will cost gas to users.** + +Executing _getters_ is read-only, they can access all variables, but cannot change state variables. They are free to execute and don't cost any gas. + +Local variables like \`localVar1\` are temporary. They're not persisted to state. You can define them in any function and they will only exist in run-time during the execution of the function. You can change their value in _getters_ too. +`,v=`import "@stdlib/deploy"; + +contract Variables with Deployable { + + // contract variables are persisted in state and can change their value between transactions + // they cost rent per their specified size + contractVar1: Int as coins = ton("1.26"); + contractVar2: Int as uint64; + + init(arg1: Int) { + // contract variables support complex initializations that are calculated in run-time + self.contractVar2 = min(arg1, pow(2, 64) - 1); + } + + // receivers handle incoming messages and can change state + receive("increment") { + // local variables are temporary, not persisted in state + let localVar1: Int = 100 * 1000; + localVar1 = localVar1 * 2; + + // contract variables that are persisted in state can only change in receivers + self.contractVar1 = self.contractVar1 + 1; + self.contractVar2 = self.contractVar2 + 1; + } + + // getters are executed by users to query data and can't change state + get fun sum(arg1: Int): Int { + // local variables are temporary, not persisted in state + let localVar1: Int = 100 * 1000; + localVar1 = localVar1 * 2; + + // getters can access everything but for read-only operations only + return arg1 + self.contractVar1 + localVar1; + } +}`;function k(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}function E(n){return e=>{e.storeInt(n.arg1,257)}}async function m(n){const e=o.Cell.fromBase64("te6ccgECEgEAAsUAART/APSkE/S88sgLAQIBYgIDApzQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZWfoCyz/J7VQPBAIBWAkKAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAUGATpt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IhUUFMDbwT4YQL4Yts8Wts88uCCyPhDAcx/AcoAWVn6Ass/ye1UEg0CoO2i7fsBkjB/4HAh10nCH5UwINcLH94gghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wDw4AXPkBgvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqXAaQBpH/bMeABOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8EAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wARAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAVDtRNDUAfhj0gABl/oA0z9ZbBLg+CjXCwqDCbry4ImBAQHXAAEB0ds8EwAWghBLGhMAAYQ/tgiC5t8a");let a=o.beginCell();a.storeRef(t),a.storeUint(0,1),E({$$type:"Variables_init_args",arg1:n})(a);const s=a.endCell();return{code:e,data:s}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},V=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],Q=[{name:"sum",arguments:[{name:"arg1",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],M=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:V,getters:Q,receivers:M,errors:D});this.address=e,this.init=t}static async init(e){return await m(e)}static async fromInit(e){const t=await m(e),a=o.contractAddress(0,t);return new c(a,t)}static fromAddress(e){return new c(e)}async send(e,t,a,s){let r=null;if(s==="increment"&&(r=o.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof o.Slice)&&s.$$type==="Deploy"&&(r=o.beginCell().store(k(s)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:r})}async getSum(e,t){let a=new o.TupleBuilder;return a.writeNumber(t),(await e.get("sum",a.build())).stack.readBigNumber()}}function H(n,e,t){let a;h(n,A,i=>t(2,a=i));let s,r;return B(A,a={markdown:I,tactCode:v,deploy:async()=>{const i=await C.Blockchain.create(),d=await i.treasury("deployer");s=d.getSender(),r=i.openContract(await c.fromInit(17n));const g={[d.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],g,[await r.send(d.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await r.send(s,{value:o.toNano(1)},"increment")]},getters:{sum:async()=>await r.getSum(18n)},prev:p(import.meta.url).prev,next:p(import.meta.url).next},a),[]}class z extends f{constructor(e){super(),w(this,e,H,null,b,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.a2ce09b8.js b/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.a2ce09b8.js deleted file mode 100644 index fef6026..0000000 --- a/docs/_app/immutable/entry/(examples)-02-variables-page.svelte.a2ce09b8.js +++ /dev/null @@ -1,45 +0,0 @@ -var y=Object.defineProperty;var p=(n,e,t)=>e in n?y(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var i=(n,e,t)=>(p(n,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as f,s as C,I as B,ac as h}from"../chunks/index.9fe14626.js";import{d as o,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const I=`# Variables - -The most important variables are those that are persisted in state and retain their value between contract executions. They must be defined in the scope of the contract like \`contractVar1\`. - -Persisting data in state costs gas. The contract must pay rent periodically from its balance. State storage is expensive, about [4 TON per MB per year](https://ton.org/docs/develop/smart-contracts/fees#how-to-calculate-fees). If the contract runs out of balance, the data will be deleted. If you need to store large amounts of data, like images, a service like [TON Storage](https://ton.org/docs/participate/ton-storage/storage-faq) would be more suitable. - -Persistent state variables can only change in *receivers* by sending messages as transactions. Sending these transactions will cost gas to users. - -Executing *getters* is read-only, they can access all variables, but cannot change state variables. They are free to execute and don't cost any gas. - -Local variables like \`localVar1\` are temporary. They're not persisted to state. You can define them in any function and they will only exist in run-time during the execution of the function. You can change their value in *getters* too.`,v=`import "@stdlib/deploy"; - -contract Variables with Deployable { - - // contract variables are persisted in state and can change their value between transactions - // they cost rent per their specified size - contractVar1: Int as coins = ton("1.26"); - contractVar2: Int as uint64; - - init(arg1: Int) { - // contract variables support complex initializations that are calculated in run-time - self.contractVar2 = min(arg1, pow(2, 64) - 1); - } - - // receivers handle incoming messages and can change state - receive("increment") { - // local variables are temporary, not persisted in state - let localVar1: Int = 100 * 1000; - localVar1 = localVar1 * 2; - - // contract variables that are persisted in state can only change in receivers - self.contractVar1 = self.contractVar1 + 1; - self.contractVar2 = self.contractVar2 + 1; - } - - // getters are executed by users to query data and can't change state - get fun sum(arg1: Int): Int { - // local variables are temporary, not persisted in state - let localVar1: Int = 100 * 1000; - localVar1 = localVar1 * 2; - - // getters can access everything but for read-only operations only - return arg1 + self.contractVar1 + localVar1; - } -}`;function V(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}function Q(n){return e=>{e.storeInt(n.arg1,257)}}async function u(n){const e=o.Cell.fromBase64("te6ccgECEQEAAqoAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWVn6Ass/ye1UDgQCAVgICQKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr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ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wts8MMj4QwHMfwHKAFlZ+gLLP8ntVBENAq7tou37cCHXScIflTAg1wsf3gKSW3/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAkTDjDXAPDgBc+QGC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuupcBpAGkf9sx4AHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAQAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAVDtRNDUAfhj0gABl/oA0z9ZbBLg+CjXCwqDCbry4ImBAQHXAAEB0ds8EgAWghBLGhMAAYQ/tghYCFm1");let a=o.beginCell();a.storeRef(t),a.storeUint(0,1),Q({$$type:"Variables_init_args",arg1:n})(a);const s=a.endCell();return{code:e,data:s}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:D});this.address=e,this.init=t}static async init(e){return await u(e)}static async fromInit(e){const t=await u(e),a=o.contractAddress(0,t);return new l(a,t)}static fromAddress(e){return new l(e)}async send(e,t,a,s){let r=null;if(s==="increment"&&(r=o.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof o.Slice)&&s.$$type==="Deploy"&&(r=o.beginCell().store(V(s)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:r})}async getSum(e,t){let a=new o.TupleBuilder;return a.writeNumber(t),(await e.get("sum",a.build())).stack.readBigNumber()}}function E(n,e,t){let a;B(n,d,c=>t(2,a=c));let s,r;return h(d,a={markdown:I,tactCode:v,deploy:async()=>{const c=await b.Blockchain.create(),A=await c.treasury("deployer");s=A.getSender(),r=c.openContract(await l.fromInit(17n));const m={[A.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],m,[await r.send(A.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await r.send(s,{value:o.toNano(1)},"increment")]},getters:{sum:async()=>await r.getSum(18n)},prev:g(import.meta.url).prev,next:g(import.meta.url).next},a),[]}class T extends w{constructor(e){super(),f(this,e,E,null,C,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.04ea2a0b.js b/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.04ea2a0b.js deleted file mode 100644 index 94e4735..0000000 --- a/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.04ea2a0b.js +++ /dev/null @@ -1,48 +0,0 @@ -var y=Object.defineProperty;var u=(A,e,t)=>e in A?y(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t;var i=(A,e,t)=>(u(A,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as h,s as I,I as B,ac as f}from"../chunks/index.9fe14626.js";import{d as a,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as p}from"../chunks/index.78404594.js";const v=`# Emitting Logs - -It is sometimes useful to emit events from the contract in order to indicate that certain things happened. - -This data can later be analyzed off-chain and indexed by using [RPC API](https://orbs.com/ton-access) to query all transactions sent to the contract. - -Consider for example a staking contract that wants to indicate how much time passed before users unstaked for analytics purposes. By analyzing this data, the developer can think of improvements to the product. - -One way to achieve this is by sending messages back to the sender using \`reply()\` or by sending messages to the zero address. These two methods work, but they are not the most efficient in terms of gas. - -The \`emit()\` function will output a message (binary or textual) from the contract. This message does not actually have a recipient and is very gas-efficient because it doesn't actually need to be delivered. - -The messages emitted in this way are still recorded on the blockchain and can be analyzed by anyone at any later time.`,b=`import "@stdlib/deploy"; - -message TransferEvent { - amount: Int as coins; - recipient: Address; -} - -message StakeEvent { - amount: Int as coins; -} - -contract Emit with Deployable { - - init() {} - - receive("action") { - // handle action here - // ... - // emit log that the action was handled - emit("Action handled".asComment()); - } - - receive("transfer") { - // handle transfer here - // ... - // emit log that the transfer happened - emit(TransferEvent{amount: ton("1.25"), recipient: sender()}.toCell()); - } - - receive("stake") { - // handle stake here - // ... - // emit log that stake happened - emit(StakeEvent{amount: ton("0.007")}.toCell()); - } -}`;function Q(A){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(A.queryId,64)}}async function m(){const A=a.Cell.fromBase64("te6ccgECEQEAA3AAART/APSkE/S88sgLAQIBYgIDAo7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwMMj4QwHMfwHKAMntVAQFAgFYDQ4BNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8BgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wBw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yzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKO0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MDDI+EMBzH8BygDJ7VQRCgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wDwsD2PkBIILwXsoCtjzu92n8Bt/OOmUr4nYpoM/NU58QSg7YWosDSIS6jp0wiMiCWMAAAAAAAAAAAAAAAAEBy2fMyXD7AH/bMeAggvCnwr18B3X5QcKPxxl3v3/Ce0iZUwAHfdIkKD9DQzX43LrjAg4NDACqgvC45sL/4lCNUGqhzKoBeL6RnV7LB4W0tojGr8+Wvsu1nrqOL4IIas/AyAGCEK3sJiJYyx8B+gLJyIJYwAAAAAAAAAAAAAAAAQHLZ8zJcPsAf9sx4ACmMIIQSoF8gPhCyFmCEC4PJRtQA8sfAfoCASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsnIgljAAAAAAAAAAAAAAAABActnzMlw+wB/2zEAJAAAAABBY3Rpb24gaGFuZGxlZAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAQAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATTtRNDUAfhj0gAwkW3g+CjXCwqDCbry4InbPBIAAm01yWvP");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:A,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"TransferEvent",header:772744475,fields:[]},{name:"StakeEvent",header:2917934626,fields:[]}],errors:E});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,o,n){let s=null;if(n==="action"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="transfer"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="stake"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(s=a.beginCell().store(Q(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:s})}}function H(A,e,t){let o;B(A,g,r=>t(2,o=r));let n,s;return f(g,o={markdown:v,tactCode:b,deploy:async()=>{const r=await p.Blockchain.create(),l=await r.treasury("deployer");n=l.getSender(),s=r.openContract(await c.fromInit());const C={[l.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],C,[await s.send(l.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{action:async()=>[await s.send(n,{value:a.toNano(1)},"action")],transfer:async()=>[await s.send(n,{value:a.toNano(1)},"transfer")],stake:async()=>[await s.send(n,{value:a.toNano(1)},"stake")]},getters:{},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class U extends w{constructor(e){super(),h(this,e,H,null,I,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.a9c5ca71.js b/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.a9c5ca71.js new file mode 100644 index 0000000..e9da791 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-emit-page.svelte.a9c5ca71.js @@ -0,0 +1,48 @@ +var g=Object.defineProperty;var u=(o,e,t)=>e in o?g(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A=(o,e,t)=>(u(o,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as w,s as I,I as C,ac as h}from"../chunks/index.9fe14626.js";import{d as s,g as c,s as m}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const b=`# Emitting Logs + +It is sometimes useful to emit events from the contract in order to indicate that certain things happened. + +This data can later be analyzed off-chain and indexed by using [RPC API](https://orbs.com/ton-access) to query all transactions sent to the contract. + +Consider for example a staking contract that wants to indicate how much time passed before users unstaked for analytics purposes. By analyzing this data, the developer can think of improvements to the product. + +One way to achieve this is by sending messages back to the sender using \`self.reply()\` or by sending messages to the zero address. These two methods work, but they are not the most efficient in terms of gas. + +The \`emit()\` function will output a message (binary or textual) from the contract. This message does not actually have a recipient and is very gas-efficient because it doesn't actually need to be delivered. + +The messages emitted in this way are still recorded on the blockchain and can be analyzed by anyone at any later time.`,v=`import "@stdlib/deploy"; + +message TransferEvent { + amount: Int as coins; + recipient: Address; +} + +message StakeEvent { + amount: Int as coins; +} + +contract Emit with Deployable { + + init() {} + + receive("action") { + // handle action here + // ... + // emit log that the action was handled + emit("Action handled".asComment()); + } + + receive("transfer") { + // handle transfer here + // ... + // emit log that the transfer happened + emit(TransferEvent{amount: ton("1.25"), recipient: sender()}.toCell()); + } + + receive("stake") { + // handle stake here + // ... + // emit log that stake happened + emit(StakeEvent{amount: ton("0.007")}.toCell()); + } +}`;function k(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}async function p(){const o=s.Cell.fromBase64("te6ccgECEgEAA4sAART/APSkE/S88sgLAQIBYgIDApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4IIwyPhDAcx/AcoAye1UBAUCAVgODwE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwGAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAcIAAJtATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAkD2PkBIILwXsoCtjzu92n8Bt/OOmUr4nYpoM/NU58QSg7YWosDSIS6jp0wiMiCWMAAAAAAAAAAAAAAAAEBy2fMyXD7AH/bMeAggvCnwr18B3X5QcKPxxl3v3/Ce0iZUwAHfdIkKD9DQzX43LrjAgsMDQHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAKAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMACQAAAAAQWN0aW9uIGhhbmRsZWQApjCCEEqBfID4QshZghAuDyUbUAPLHwH6AgEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJyIJYwAAAAAAAAAAAAAAAAQ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Z66ji+CCGrPwMgBghCt7CYiWMsfAfoCyciCWMAAAAAAAAAAAAAAAAEBy2fMyXD7AH/bMeAApjCCEEqBfID4QshZghAuDyUbUAPLHwH6AgEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJyIJYwAAAAAAAAAAAAAAAAQHLZ8zJcPsAf9sxACQAAAAAQWN0aW9uIGhhbmRsZWQBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8EAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wARAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATTtRNDUAfhj0gAwkW3g+CjXCwqDCbry4InbPBMAAm05vLYx");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:o,data:i}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},E=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TransferEvent",header:772744475,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"recipient",type:{kind:"simple",type:"address",optional:!1}}]},{name:"StakeEvent",header:2917934626,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}}]}],D=[],Q=[{receiver:"internal",message:{kind:"text",text:"action"}},{receiver:"internal",message:{kind:"text",text:"transfer"}},{receiver:"internal",message:{kind:"text",text:"stake"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"TransferEvent",header:772744475,fields:[]},{name:"StakeEvent",header:2917934626,fields:[]}],types:E,getters:D,receivers:Q,errors:M});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=s.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,i,n){let a=null;if(n==="action"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="transfer"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="stake"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(k(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:a})}}function z(o,e,t){let i;C(o,m,r=>t(2,i=r));let n,a;return h(m,i={markdown:b,tactCode:v,deploy:async()=>{const r=await B.Blockchain.create(),d=await r.treasury("deployer");n=d.getSender(),a=r.openContract(await l.fromInit());const y={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],y,[await a.send(d.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{action:async()=>[await a.send(n,{value:s.toNano(1)},"action")],transfer:async()=>[await a.send(n,{value:s.toNano(1)},"transfer")],stake:async()=>[await a.send(n,{value:s.toNano(1)},"stake")]},getters:{},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class U extends f{constructor(e){super(),w(this,e,z,null,I,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.2feac366.js b/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.2feac366.js new file mode 100644 index 0000000..ef14ea4 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.2feac366.js @@ -0,0 +1,48 @@ +var u=Object.defineProperty;var p=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>(p(r,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as v,s as w,I as C,ac as h}from"../chunks/index.9fe14626.js";import{d as s,g as A,s as g}from"../chunks/store.476c3091.js";import{d as I}from"../chunks/index.c056099e.js";const b=`# Throwing Errors + +Processing an incoming message in a transaction isn't always successful. The contract may encounter some error and fail. + +This can be due to an explicit decision of the contract author, usually by writing a \`require()\` on a condition that isn't met, or this may happen implicitly due to some computation error in run-time, like a math overflow. + +When an error is thrown, the transaction reverts. This means that all persistent state changes that took place during this transaction, even those that happened before the error was thrown, are all reverted and return to their original values. + +## Notifying the sender about the error + +How would the sender of the incoming message know that the message they had sent was rejected due to an error? + +All communication is via messages, so naturally the sender should receive a message about the error. TON will actually return the original message back to the sender and mark it as *bounced* - just like a snail mail letter that couldn't be delivered.`,B=`import "@stdlib/deploy"; + +message Divide { + by: Int as uint32; +} + +contract Errors with Deployable { + + val: Int as int64; + + init() { + self.val = 0; + } + + // not meeting the condition will raise an error, revert the transaction and all state changes + receive("increment") { + self.val = self.val + 1; + require(self.val < 5, "Counter is too high"); + } + + // any exceptions during execution will also revert the transaction and all state changes + receive(msg: Divide) { + self.val = 4; + self.val = self.val / msg.by; + } + + // advanced: revert the transaction and return a specific non-zero exit code manually + // https://ton.org/docs/learn/tvm-instructions/tvm-exit-codes + receive("no access") { + throw(132); + } + + get fun value(): Int { + return self.val; + } +}`;function D(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}function E(r){return e=>{let t=e;t.storeUint(158375295,32),t.storeUint(r.by,32)}}async function y(){const r=s.Cell.fromBase64("te6ccgECEgEAAvgAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAco/ye1UDwQCAVgJCgLk7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEAlwnX+6jhcw0x8BghAJcJ1/uvLggdMfATF0MqkEf+AgghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYy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cbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHKP8ntVBINAuTtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQCXCdf7qOFzDTHwGCEAlwnX+68uCB0x8BMXQyqQR/4CCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAPDgDC+QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqeMKSCALPaIcEF8vR/2zHggvC2jY5xHzmO8HJ7Au3I6x9PkMuAgofZ6zqHCkztlqFSybqW8sCEf9sx4AE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwQAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABEAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBPO1E0NQB+GPSAAGU0j8BMeAw+CjXCwqDCbry4InbPBMAAnCRInr0");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:r,data:o}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},46042:{message:"Counter is too high"}},x=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Divide",header:158375295,fields:[{name:"by",type:{kind:"simple",type:"uint",optional:!1,format:32}}]}],Q=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],H=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"typed",type:"Divide"}},{receiver:"internal",message:{kind:"text",text:"no access"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Divide",header:158375295,fields:[]}],types:x,getters:Q,receivers:H,errors:k});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=s.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,o,n){let a=null;if(n==="increment"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Divide"&&(a=s.beginCell().store(E(n)).endCell()),n==="no access"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(D(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getValue(e){let t=new s.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function M(r,e,t){let o;C(r,g,i=>t(2,o=i));let n,a;return h(g,o={markdown:b,tactCode:B,deploy:async()=>{const i=await I.Blockchain.create(),d=await i.treasury("deployer");n=d.getSender(),a=i.openContract(await c.fromInit());const m={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],m,[await a.send(d.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await a.send(n,{value:s.toNano(1)},"increment")],"Divide{2}":async()=>[await a.send(n,{value:s.toNano(1)},{$$type:"Divide",by:2n})],"Divide{0}":async()=>[await a.send(n,{value:s.toNano(1)},{$$type:"Divide",by:0n})],"no access":async()=>[await a.send(n,{value:s.toNano(1)},"no access")]},getters:{value:async()=>await a.getValue()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},o),[]}class T extends f{constructor(e){super(),v(this,e,M,null,w,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.d4a69a6f.js b/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.d4a69a6f.js deleted file mode 100644 index 59cfd72..0000000 --- a/docs/_app/immutable/entry/(examples)-03-errors-page.svelte.d4a69a6f.js +++ /dev/null @@ -1,48 +0,0 @@ -var m=Object.defineProperty;var w=(a,e,t)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var c=(a,e,t)=>(w(a,typeof e!="symbol"?e+"":e,t),t);import{S as C,i as h,s as f,I as p,ac as v}from"../chunks/index.9fe14626.js";import{d as s,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as I}from"../chunks/index.78404594.js";const b=`# Throwing Errors - -Processing an incoming message in a transaction isn't always successful. The contract may encounter some error and fail. - -This can be due to an explicit decision of the contract author, usually by writing a \`require()\` on a condition that isn't met, or this may happen implicitly due to some computation error in run-time, like a math overflow. - -When an error is thrown, the transaction reverts. This means that all persistent state changes that took place during this transaction, even those that happened before the error was thrown, are all reverted and return to their original values. - -## Notifying the sender about the error - -How would the sender of the incoming message know that the message they had sent was rejected due to an error? - -All communication is via messages, so naturally the sender should receive a message about the error. TON will actually return the original message back to the sender and mark it as *bounced* - just like a snail mail letter that couldn't be delivered.`,B=`import "@stdlib/deploy"; - -message Divide { - by: Int as uint32; -} - -contract Errors with Deployable { - - val: Int as int64; - - init() { - self.val = 0; - } - - // not meeting the condition will raise an error, revert the transaction and all state changes - receive("increment") { - self.val = self.val + 1; - require(self.val < 5, "Counter is too high"); - } - - // any exceptions during execution will also revert the transaction and all state changes - receive(msg: Divide) { - self.val = 4; - self.val = self.val / msg.by; - } - - // advanced: revert the transaction and return a specific non-zero exit code manually - // https://ton.org/docs/learn/tvm-instructions/tvm-exit-codes - receive("no access") { - throw(132); - } - - get fun value(): Int { - return self.val; - } -}`;function D(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}function M(a){return e=>{let t=e;t.storeUint(158375295,32),t.storeUint(a.by,32)}}async function u(){const a=s.Cell.fromBase64("te6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4YxEIAAIgAHOndxoatLgzOZ0Xl6i2sTWqqTGtOxipmZimsyoqN6Oyphm3HCCZJZs8oyGlnKUbt7igs5mxpTI5I5rBABGwr7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKU0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEByj/J7VQRDQLy7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEAlwnX+6jhcx0x8BghAJcJ1/uvLggdMfATF0MqkEf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcA8OAML5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuup4wpIIAs9ohwQXy9H/bMeCC8LaNjnEfOY7wcnsC7cjrH0+Qy4CCh9nrOocKTO2WoVLJupbywIR/2zHgAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABAAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBPO1E0NQB+GPSAAGU0j8BMeAw+CjXCwqDCbry4InbPBIAAnDJf7kH");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:a,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},46042:{message:"Counter is too high"}};class l{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Divide",header:158375295,fields:[]}],errors:E});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=s.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,o,n){let r=null;if(n==="increment"&&(r=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Divide"&&(r=s.beginCell().store(M(n)).endCell()),n==="no access"&&(r=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(r=s.beginCell().store(D(n)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:r})}async getValue(e){let t=new s.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function H(a,e,t){let o;p(a,g,i=>t(2,o=i));let n,r;return v(g,o={markdown:b,tactCode:B,deploy:async()=>{const i=await I.Blockchain.create(),A=await i.treasury("deployer");n=A.getSender(),r=i.openContract(await l.fromInit());const y={[A.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],y,[await r.send(A.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await r.send(n,{value:s.toNano(1)},"increment")],"Divide{2}":async()=>[await r.send(n,{value:s.toNano(1)},{$$type:"Divide",by:2n})],"Divide{0}":async()=>[await r.send(n,{value:s.toNano(1)},{$$type:"Divide",by:0n})],"no access":async()=>[await r.send(n,{value:s.toNano(1)},"no access")]},getters:{value:async()=>await r.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class L extends C{constructor(e){super(),h(this,e,H,null,f,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.8a5c130f.js b/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.8a5c130f.js new file mode 100644 index 0000000..8dce9b5 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.8a5c130f.js @@ -0,0 +1,63 @@ +var p=Object.defineProperty;var m=(r,e,t)=>e in r?p(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>(m(r,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as f,s as w,I,ac as B}from"../chunks/index.9fe14626.js";import{d as s,g as A,s as d}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const C=`# Getters + +Getters are special contract functions that allow users to query information from the contract. + +Contract methods starting with the prefix \`get fun\` are all getters. You can define as many getters are you want. Each getter must also specify its return type - \`counter()\` for example returns an \`Int\`. + +Calling getters is free and does not cost gas. The call is executed by a full node and doesn't go through consensus with all the validators nor is added to a new block. + +Getters are read-only, they cannot change the contract persistent state. + +If we were to omit the \`get\` keyword from the function declaration of a getter, it will stop being a getter. External users would no longer be able call this function and it would essentially become a private method of the contract. + +## Getters between contracts + +**A contract cannot execute a getter of another contract.** + +Getters are only executable by end-users off-chain. Since contracts are running on-chain, they do not have access to each other's getters. + +So, if you can't call a getter, how can two contracts communicate? + +The only way for contracts to communicate on-chain is by sending messages to each other. Messages are handled in _receivers_. + +
+
+ Info: TON Blockchain is an asynchronous blockchain, which means that smart contracts can interact with each other only by sending messages. +
+`,h=`import "@stdlib/deploy"; + +contract Getters with Deployable { + + count: Int as uint32; + + init() { + self.count = 17; + } + + get fun counter(): Int { + return self.count; + } + + get fun location(): Address { + return myAddress(); + } + + get fun greeting(): String { + return "hello world"; + } + + get fun sum(a: Int, b: Int): Int { + return a + b; + } + + get fun and(a: Bool, b: Bool): Bool { + return a && b; + } + + get fun answer(a: Int): String { + let sb: StringBuilder = beginString(); + sb.append("The meaning of life is "); + sb.append(a.toString()); + return sb.toString(); + } +}`;function k(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function g(){const r=s.Cell.fromBase64("te6ccgECIgEAA+4AART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcsfye1UHQQCASAICQGKAZIwf+BwIddJwh+VMCDXCx/eghCUapi2uo6n0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4DBwBQE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwGAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAcAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCD72NVtnm2eGMHQoCASALDAAai7aGVsbG8gd29ybGSAIBIA0OAgEgFhcCAW4PEAIBIBMUAg6qGNs82zwxHRECDqiL2zzbPDEdEgACIAAE+CgCEbIXNs8Wds8MYB0VALmy9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkcl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KIddJknAg4uLoXwMCASANDAB1sm7jQ1aXBmczovL1FtVFJlUE5McjdxZGp3UDhiRG9rTW1ZN1Q0Qkxjc1JFS0VuWFd6NlJoS05KWk2CACASAQDgIRrf/tniztnhjAIg8AAqAAEa1fdqJoaQAAwAIBIBYSAgEgFBMAubL0YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAIRshc2zxZ2zwxgIhUACgGSMHDfAgFuGRcCDqiL2zzbPDEiGAAE+CgCDqoY2zzbPDEiGgACIAIPvY1W2ebZ4YwiHAAai7aGVsbG8gd29ybGSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLH8ntVCIeAYoBkjB/4HAh10nCH5UwINcLH96CEJRqmLa6jqfTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gMHAfATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPCAByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAIQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTTHwEx4DD4KNcLCoMJuvLgids8IwAEgBEEVE/b");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const a=t.endCell();return{code:r,data:a}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},S=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],M=[{name:"counter",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"location",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}},{name:"greeting",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}},{name:"sum",arguments:[{name:"a",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"b",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"and",arguments:[{name:"a",type:{kind:"simple",type:"bool",optional:!1}},{name:"b",type:{kind:"simple",type:"bool",optional:!1}}],returnType:{kind:"simple",type:"bool",optional:!1}},{name:"answer",arguments:[{name:"a",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"string",optional:!1}}],E=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:S,getters:M,receivers:E,errors:D});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=s.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,a,n){let o=null;if(n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(o=s.beginCell().store(k(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:o})}async getCounter(e){let t=new s.TupleBuilder;return(await e.get("counter",t.build())).stack.readBigNumber()}async getLocation(e){let t=new s.TupleBuilder;return(await e.get("location",t.build())).stack.readAddress()}async getGreeting(e){let t=new s.TupleBuilder;return(await e.get("greeting",t.build())).stack.readString()}async getSum(e,t,a){let n=new s.TupleBuilder;return n.writeNumber(t),n.writeNumber(a),(await e.get("sum",n.build())).stack.readBigNumber()}async getAnd(e,t,a){let n=new s.TupleBuilder;return n.writeBoolean(t),n.writeBoolean(a),(await e.get("and",n.build())).stack.readBoolean()}async getAnswer(e,t){let a=new s.TupleBuilder;return a.writeNumber(t),(await e.get("answer",a.build())).stack.readString()}}function v(r,e,t){let a;I(r,d,o=>t(2,a=o));let n;return B(d,a={markdown:C,tactCode:h,deploy:async()=>{const o=await b.Blockchain.create(),i=await o.treasury("deployer");i.getSender(),n=o.openContract(await c.fromInit());const u={[i.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],u,[await n.send(i.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{counter:async()=>await n.getCounter(),location:async()=>await n.getLocation(),greeting:async()=>await n.getGreeting(),"sum(3,4)":async()=>await n.getSum(3n,4n),"and(true,false)":async()=>await n.getAnd(!0,!1),"answer(42)":async()=>await n.getAnswer(42n)},prev:A(import.meta.url).prev,next:A(import.meta.url).next},a),[]}class J extends y{constructor(e){super(),f(this,e,v,null,w,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.c80071cf.js b/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.c80071cf.js deleted file mode 100644 index 4b755e5..0000000 --- a/docs/_app/immutable/entry/(examples)-03-getters-page.svelte.c80071cf.js +++ /dev/null @@ -1,53 +0,0 @@ -var w=Object.defineProperty;var B=(a,e,t)=>e in a?w(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var c=(a,e,t)=>(B(a,typeof e!="symbol"?e+"":e,t),t);import{S as m,i as I,s as y,I as C,ac as f}from"../chunks/index.9fe14626.js";import{d as s,g as l,s as g}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const h=`# Getters - -Getters are special contract functions that allow users to query information from the contract. - -Contract methods starting with the prefix \`get fun\` are all getters. You can define as many getters are you want. Each getter must also specify its return type - \`counter()\` for example returns an \`Int\`. - -Calling getters is free and does not cost gas. The call is executed by a full node and doesn't go through consensus with all the validators nor is added to a new block. - -Getters are read-only, they cannot change the contract persistent state. - -If we were to omit the \`get\` keyword from the function declaration of a getter, it will stop being a getter. External users would no longer be able call this function and it would essentially become a private method of the contract. - -## Getters between contracts - -A contract cannot execute a getter of another contract. Getters are only executable by end-users off-chain. Since contracts are running on-chain, they do not have access to each other's getters. - -So, if you can't call a getter, how can two contracts communicate? The only way for contracts to communicate on-chain is by sending messages to each other. Messages are handled in *receivers*.`,p=`import "@stdlib/deploy"; - -contract Getters with Deployable { - - count: Int as uint32; - - init() { - self.count = 17; - } - - get fun counter(): Int { - return self.count; - } - - get fun location(): Address { - return myAddress(); - } - - get fun greeting(): String { - return "hello world"; - } - - get fun sum(a: Int, b: Int): Int { - return a + b; - } - - get fun and(a: Bool, b: Bool): Bool { - return a && b; - } - - get fun answer(a: Int): String { - let sb: StringBuilder = beginString(); - sb.append("The meaning of life is "); - sb.append(a.toString()); - return sb.toString(); - } -}`;function M(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function u(){const a=s.Cell.fromBase64("te6ccgECIQEAA9MAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLH8ntVBwEAgEgBwgBmHAh10nCH5UwINcLH94Cklt/4AGCEJRqmLa6jq3THwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gMHAFAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAYAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCD72NVtnm2eGMHAkCASAKCwAai7aGVsbG8gd29ybGSAIBIAwNAgEgFRYCAW4ODwIBIBITAg6qGNs82zwxHBACDqiL2zzbPDEcEQACIAAE+CgCEbIXNs8W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8izzGrAqEFqwJRVbYIIMIAnCCqAhXXGFAzzxZAFN5ZbwJTQaHCAJnIAW8CUEShqgKOEjEzwgCZ1DDQINdKIddJknAg4uLoXwMCASANDAB1sm7jQ1aXBmczovL1FtUzEzQ0M2WVpDTDg5aUZhUUx2a0VURHNld1NzQm5hMlJha3REU0R6eWVHMXaCACASAQDgIRrf/tniztnhjAIQ8AAqAAEa1fdqJoaQAAwAIBIBYSAgEgFBMAubL0YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAIRshc2zxZ2zwxgIRUACgGSMHDfAgFuGRcCDqiL2zzbPDEhGAAE+CgCDqoY2zzbPDEhGgACIAIPvY1W2ebZ4YwhHAAai7aGVsbG8gd29ybGSAKU0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEByx/J7VQhHgGYcCHXScIflTAg1wsf3gKSW3/gAYIQlGqYtrqOrdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+AwcB8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAIACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTTHwEx4DD4KNcLCoMJuvLgids8IgAEgBHIQDQK");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:a,data:r}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class i{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:D});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=s.contractAddress(0,e);return new i(t,e)}static fromAddress(e){return new i(e)}async send(e,t,r,n){let o=null;if(n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(o=s.beginCell().store(M(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getCounter(e){let t=new s.TupleBuilder;return(await e.get("counter",t.build())).stack.readBigNumber()}async getLocation(e){let t=new s.TupleBuilder;return(await e.get("location",t.build())).stack.readAddress()}async getGreeting(e){let t=new s.TupleBuilder;return(await e.get("greeting",t.build())).stack.readString()}async getSum(e,t,r){let n=new s.TupleBuilder;return n.writeNumber(t),n.writeNumber(r),(await e.get("sum",n.build())).stack.readBigNumber()}async getAnd(e,t,r){let n=new s.TupleBuilder;return n.writeBoolean(t),n.writeBoolean(r),(await e.get("and",n.build())).stack.readBoolean()}async getAnswer(e,t){let r=new s.TupleBuilder;return r.writeNumber(t),(await e.get("answer",r.build())).stack.readString()}}function H(a,e,t){let r;C(a,g,o=>t(2,r=o));let n;return f(g,r={markdown:h,tactCode:p,deploy:async()=>{const o=await b.Blockchain.create(),A=await o.treasury("deployer");A.getSender(),n=o.openContract(await i.fromInit());const d={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],d,[await n.send(A.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{counter:async()=>await n.getCounter(),location:async()=>await n.getLocation(),greeting:async()=>await n.getGreeting(),"sum(3,4)":async()=>await n.getSum(3n,4n),"and(true,false)":async()=>await n.getAnd(!0,!1),"answer(42)":async()=>await n.getAnswer(42n)},prev:l(import.meta.url).prev,next:l(import.meta.url).next},r),[]}class z extends m{constructor(e){super(),I(this,e,H,null,y,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c64b8ae1.js b/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c64b8ae1.js new file mode 100644 index 0000000..bc944d9 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c64b8ae1.js @@ -0,0 +1,97 @@ +var C=Object.defineProperty;var B=(s,e,t)=>e in s?C(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var i=(s,e,t)=>(B(s,typeof e!="symbol"?e+"":e,t),t);import{S as h,i as w,s as I,I as b,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g as m,s as p}from"../chunks/store.476c3091.js";import{d as k}from"../chunks/index.c056099e.js";const D=`# Messages Between Contracts + +Different contracts can communicate with each other only by sending messages. This example showcases two separate contracts working in tandem: + +- \`Counter\` - A simple counter that can increment only by 1. +- \`BulkAdder\` - This contract instructs \`Counter\` to increment multiple times. + +Click the Deploy button to deploy both contracts. To make the counter reach 5, send the \`Reach\` message to BulkAdder by clicking the Send Reach{5} button. + +Observe the number of messages exchanged between the two contracts. Each message is processed as a _separate_ transaction. Also note that BulkAdder cannot call a _getter_ on Counter; it must send a \`query\` message instead. + +## Who's Paying for Gas + +**By default, the original sender is responsible for covering the gas costs of the entire cascade of messages they initiate.** This is funded by the original TON coin value sent with the first \`Reach\` message. + +Internally, this is managed by each message handler forwarding the remaining excess TON coin value to the next message it sends. + +
+
+ Challenge: Try to modify the code to refund the original sender any unused excess gas. +
+`,E=`import "@stdlib/deploy"; + +message CounterValue { + value: Int as uint32; +} + +//////////////////////////////////////////////////////////////////////////// +// this is our famous Counter contract, we've seen it before +// this contract is very annoying, it only allows to increment +1 at a time! + +contract Counter with Deployable { + + val: Int as uint32; + + init() { + self.val = 0; + } + + // step 6: this contract allows anyone to ask it to increment by 1 (ie. the other contract) + receive("increment") { + self.val = self.val + 1; + self.reply(CounterValue{value: self.val}.toCell()); + } + + // step 3: this contract replies with its current value to anyone asking (ie. the other contract) + receive("query") { + self.reply(CounterValue{value: self.val}.toCell()); + } + + get fun value(): Int { + return self.val; + } +} + +message Reach { + counter: Address; + target: Int as uint32; +} + +//////////////////////////////////////////////////////////////////////////// +// let's write a second helper contract to make our lives a little easier +// it will keep incrementing the previous contract as many times as we need! + +contract BulkAdder with Deployable { + + target: Int as uint32; + + init() { + self.target = 0; + } + + // step 1: users will send this message to tell us what target value we need to reach + receive(msg: Reach) { + self.target = msg.target; + // step 2: this contract will query the current counter value from the other contract + send(SendParameters{ + to: msg.counter, + value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 + mode: SendRemainingValue + SendIgnoreErrors, /// TODO: issues/31 + body: "query".asComment() + }); + } + + // step 4: the other contract will tell us what is its current value by sending us this message + receive(msg: CounterValue) { + if (msg.value < self.target) { + // step 5: if its value is too low, send it another message to increment it by +1 more + send(SendParameters{ + to: sender(), + value: 0, /// TODO: same issue 31 + mode: SendRemainingValue + SendIgnoreErrors, /// TODO: https://github.com/tact-lang/tact/issues/31 + body: "increment".asComment() + }); + } + } +}`;function H(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function y(){const s=a.Cell.fromBase64("te6ccgECEwEAAvwAART/APSkE/S88s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YG2ebZ4YxMIAAIgAHOndxoatLgzOZ0Xl6i2sxu8mac7NpoyoiqiO6a0m6mzKDE6IzatGK07HKOpube0HLW3LKOnIrWauShBABGwr7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLH8ntVBMNAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcBAOAtL5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6bMKQgyAGCEE5lCrhYyx/LH8n4QgF/bds8f9sx4ILwFmePoYWL344arXlvTJ0LVxL8CRef+HgB52Ok3Urc9xC64wIQDwEyIMgBghBOZQq4WMsfyx/J+EIBf23bPH/bMRABOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8EQHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wASAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwUAAJw6bJCag==");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"CounterValue",header:1315244728,fields:[{name:"value",type:{kind:"simple",type:"uint",optional:!1,format:32}}]},{name:"Reach",header:2577471031,fields:[{name:"counter",type:{kind:"simple",type:"address",optional:!1}},{name:"target",type:{kind:"simple",type:"uint",optional:!1,format:32}}]}],O=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],J=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"query"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"CounterValue",header:1315244728,fields:[]},{name:"Reach",header:2577471031,fields:[]}],types:Q,getters:O,receivers:J,errors:M});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=a.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,r,n){let o=null;if(n==="increment"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="query"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(o=a.beginCell().store(H(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function S(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function x(s){return e=>{let t=e;t.storeUint(1315244728,32),t.storeUint(s.value,32)}}function L(s){return e=>{let t=e;t.storeUint(2577471031,32),t.storeAddress(s.counter),t.storeUint(s.target,32)}}async function g(){const s=a.Cell.fromBase64("te6ccgECEgEAAvMAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNv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7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLH8ntVBIKBNwBkjB/4HAh10nCH5UwINcLH94gghCZoRY3uo9AMNMfAYIQmaEWN7ry4IH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAdMfWWwSMnCAQoh/VTBtbds8f+AgghBOZQq4uuMCghCUapi2uhEPDQsBWI6n0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4DBwDAE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwPAkow0x8BghBOZQq4uvLggdMfATEhuY8N+EJwgEKIf1UwbW3bPN5/Dg8AGgAAAABpbmNyZW1lbnQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAASAAAAAHF1ZXJ5ATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwTAAJwifjLMA==");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const T={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},N=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"CounterValue",header:1315244728,fields:[{name:"value",type:{kind:"simple",type:"uint",optional:!1,format:32}}]},{name:"Reach",header:2577471031,fields:[{name:"counter",type:{kind:"simple",type:"address",optional:!1}},{name:"target",type:{kind:"simple",type:"uint",optional:!1,format:32}}]}],z=[],U=[{receiver:"internal",message:{kind:"typed",type:"Reach"}},{receiver:"internal",message:{kind:"typed",type:"CounterValue"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class u{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"CounterValue",header:1315244728,fields:[]},{name:"Reach",header:2577471031,fields:[]}],types:N,getters:z,receivers:U,errors:T});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=a.contractAddress(0,e);return new u(t,e)}static fromAddress(e){return new u(e)}async send(e,t,r,n){let o=null;if(n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Reach"&&(o=a.beginCell().store(L(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="CounterValue"&&(o=a.beginCell().store(x(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(o=a.beginCell().store(S(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}}function K(s,e,t){let r;b(s,p,c=>t(3,r=c));let n,o,l;return v(p,r={markdown:D,tactCode:E,deploy:async()=>{const c=await k.Blockchain.create(),d=await c.treasury("deployer");n=d.getSender(),o=c.openContract(await A.fromInit()),l=c.openContract(await u.fromInit());const f={[d.address.toString()]:"deployer",[o.address.toString()]:"Counter",[l.address.toString()]:"BulkAdder"};return[[o,l],f,[await o.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n}),await l.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Reach{5}":async()=>[await l.send(n,{value:a.toNano(1)},{$$type:"Reach",counter:o.address,target:5n})]},getters:{value:async()=>await o.getValue()},prev:m(import.meta.url).prev,next:m(import.meta.url).next},r),[]}class F extends h{constructor(e){super(),w(this,e,K,null,I,{})}}export{F as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c9d4d4f9.js b/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c9d4d4f9.js deleted file mode 100644 index 591337a..0000000 --- a/docs/_app/immutable/entry/(examples)-03-messages-between-contracts-page.svelte.c9d4d4f9.js +++ /dev/null @@ -1,94 +0,0 @@ -var h=Object.defineProperty;var f=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var A=(r,e,t)=>(f(r,typeof e!="symbol"?e+"":e,t),t);import{S as B,i as I,s as p,I as b,ac as v}from"../chunks/index.9fe14626.js";import{d as s,g as d,s as C}from"../chunks/store.d3ab02ad.js";import{d as E}from"../chunks/index.78404594.js";const H=`# Messages Between Contracts - -Different contracts can only communicate with each other by sending each other messages. This example shows two separate contracts that work together: - -* \`Counter\` - Our simple counter that can only increment by 1. - -* \`BulkAdder\` - This contract will tell \`Counter\` to increment multiple times. - -Press the Deploy button to deploy both. Then, to make the counter reach 5, send BulkAdder the \`Reach\` message by pressing the Send Reach{5} button. - -Notice how many messages are sent back and forth between the two contracts as a result. Each of these messages is processed as a *separate* transaction! Also notice that BulkAdder can't call a *getter* on Counter, it must send the \`query\` message instead. - -## Who's paying for gas - -The default behavior is that the original sender will pay for the entire cascade of messages that they triggered. This is funded from the original TON coin value sent on the first \`Reach\` message. - -Under the hood, this works by each message handler sending the remaining excess TON coin value it received on the next message it sends out. - -**Challenge:** modify the code to refund the original sender any unused excess gas.`,D=`import "@stdlib/deploy"; - -message CounterValue { - value: Int as uint32; -} - -//////////////////////////////////////////////////////////////////////////// -// this is our famous Counter contract, we've seen it before -// this contract is very annoying, it only allows to increment +1 at a time! - -contract Counter with Deployable { - - val: Int as uint32; - - init() { - self.val = 0; - } - - // step 6: this contract allows anyone to ask it to increment by 1 (ie. the other contract) - receive("increment") { - self.val = self.val + 1; - reply(CounterValue{value: self.val}.toCell()); - } - - // step 3: this contract replies with its current value to anyone asking (ie. the other contract) - receive("query") { - reply(CounterValue{value: self.val}.toCell()); - } - - get fun value(): Int { - return self.val; - } -} - -message Reach { - counter: Address; - target: Int as uint32; -} - -//////////////////////////////////////////////////////////////////////////// -// let's write a second helper contract to make our lives a little easier -// it will keep incrementing the previous contract as many times as we need! - -contract BulkAdder with Deployable { - - target: Int as uint32; - - init() { - self.target = 0; - } - - // step 1: users will send this message to tell us what target value we need to reach - receive(msg: Reach) { - self.target = msg.target; - // step 2: this contract will query the current counter value from the other contract - send(SendParameters{ - to: msg.counter, - value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 - mode: SendRemainingValue + SendIgnoreErrors, /// TODO: issues/31 - body: "query".asComment() - }); - } - - // step 4: the other contract will tell us what is its current value by sending us this message - receive(msg: CounterValue) { - if (msg.value < self.target) { - // step 5: if its value is too low, send it another message to increment it by +1 more - send(SendParameters{ - to: sender(), - value: 0, /// TODO: same issue 31 - mode: SendRemainingValue + SendIgnoreErrors, /// TODO: https://github.com/tact-lang/tact/issues/31 - body: "increment".asComment() - }); - } - } -}`;function Q(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function w(){const r=s.Cell.fromBase64("te6ccgECEgEAAu0AART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLH8ntVA8EAgFYCQoCru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAcFAt75ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6hMKQgyAGCEE5lCrhYyx/LH8l/+EJwWAOAQgFtbds8f9sx4ILwF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5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wEA4C3vkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jqEwpCDIAYIQTmUKuFjLH8sfyX/4QnBYA4BCAW1t2zx/2zHggvAWZ4+hhYvfjhqteW9MnQtXEvwJF5/4eAHnY6TdStz3ELrjAhAPAT4gyAGCEE5lCrhYyx/LH8l/+EJwWAOAQgFtbds8f9sxEAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wARAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwTAAJwqi6ujA==");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:r,data:o}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class g{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"CounterValue",header:1315244728,fields:[]},{name:"Reach",header:2577471031,fields:[]}],errors:M});this.address=e,this.init=t}static async init(){return await w()}static async fromInit(){const e=await w(),t=s.contractAddress(0,e);return new g(t,e)}static fromAddress(e){return new g(e)}async send(e,t,o,n){let a=null;if(n==="increment"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="query"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(Q(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getValue(e){let t=new s.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function x(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}function J(r){return e=>{let t=e;t.storeUint(1315244728,32),t.storeUint(r.value,32)}}function O(r){return e=>{let t=e;t.storeUint(2577471031,32),t.storeAddress(r.counter),t.storeUint(r.target,32)}}async function m(){const r=s.Cell.fromBase64("te6ccgECEQEAAtgAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLH8ntVAQFAgFYDQ4BPO1E0NQB+GPSAAGU0x8BMeAw+CjXCwqDCbry4InbPAYE3nAh10nCH5UwINcLH94Cklt/4CGCEJmhFje6j0Ax0x8BghCZoRY3uvLggfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB0x9ZbBIycIBCiH9VMG1t2zx/4CGCEE5lCri64wIBghCUapi2ugcLCAkAAnAAEgAAAABxdWVyeQJKMdMfAYIQTmUKuLry4IHTHwExIbmPDfhCcIBCiH9VMG1t2z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EKIf1UwbW3bPH/gIYIQTmUKuLrjAgGCEJRqmLa6EA4MCwFkjq3THwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gMHAOAkox0x8BghBOZQq4uvLggdMfATEhuY8N+EJwgEKIf1UwbW3bPN5/DQ4AGgAAAABpbmNyZW1lbnQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAASAAAAAHF1ZXJ5ATztRNDUAfhj0gABlNMfATHgMPgo1wsKgwm68uCJ2zwSAAJw9BeHjQ==");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:r,data:o}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class u{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"CounterValue",header:1315244728,fields:[]},{name:"Reach",header:2577471031,fields:[]}],errors:S});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=s.contractAddress(0,e);return new u(t,e)}static fromAddress(e){return new u(e)}async send(e,t,o,n){let a=null;if(n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Reach"&&(a=s.beginCell().store(O(n)).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="CounterValue"&&(a=s.beginCell().store(J(n)).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(x(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}}function L(r,e,t){let o;b(r,C,l=>t(3,o=l));let n,a,i;return v(C,o={markdown:H,tactCode:D,deploy:async()=>{const l=await E.Blockchain.create(),c=await l.treasury("deployer");n=c.getSender(),a=l.openContract(await g.fromInit()),i=l.openContract(await u.fromInit());const y={[c.address.toString()]:"deployer",[a.address.toString()]:"Counter",[i.address.toString()]:"BulkAdder"};return[[a,i],y,[await a.send(c.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n}),await i.send(c.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Reach{5}":async()=>[await i.send(n,{value:s.toNano(1)},{$$type:"Reach",counter:a.address,target:5n})]},getters:{value:async()=>await a.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class k extends B{constructor(e){super(),I(this,e,L,null,p,{})}}export{k as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.4a6d677b.js b/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.4a6d677b.js new file mode 100644 index 0000000..c117aea --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.4a6d677b.js @@ -0,0 +1,53 @@ +var p=Object.defineProperty;var u=(i,e,n)=>e in i?p(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var l=(i,e,n)=>(u(i,typeof e!="symbol"?e+"":e,n),n);import{S as w,i as f,s as h,I as B,ac as v}from"../chunks/index.9fe14626.js";import{d as s,g as A,s as g}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const b=`# Receiving TON Coins + +Every contract has a TON coin balance. This balance is used to pay ongoing rent for storage and should not run out otherwise the contract may be deleted. You can store extra coins in the balance for any purpose. + +Every incoming message normally carries some TON coin value sent by the sender. This value is used to pay gas for handling this message. Unused excess will stay in the contract balance. If the value doesn't cover the gas cost, the transaction will revert. + +You can query the contract balance with \`myBalance()\` - note that the value is in nano-tons (like cents, just with 9 decimals). The balance already contains the incoming message value. + +
+
+ Info: More detail about myBalance() can be found here: myBalance() +
+ +## Refunding senders + +If the transaction reverts, unused excess value will be sent back to sender on the _bounced_ message. + +You can also refund the excess if the transaction succeeds by sending it back using \`self.reply()\` in a response message. This is the best way to guarantee senders are only paying for the exact gas that their message consumed. +`,I=`import "@stdlib/deploy"; + +contract ReceiveCoins with Deployable { + + val: Int as int64; + + init() { + self.val = 0; + } + + // receive empty messages, these are usually simple TON coin transfers to the contract + receive() { + dump("empty message received"); + // revert the transaction if balance is growing over 3 TON + require(myBalance() <= ton("3"), "Balance getting too high"); + } + + receive("increment") { + // print how much TON coin were sent with this message + dump(context().value); + self.val = self.val + 1; + } + + receive("refunding increment") { + // print how much TON coin were sent with this message + dump(context().value); + self.val = self.val + 1; + // return all the unused excess TON coin value on the message back to the sender (with a textual string message) + self.reply("increment refund".asComment()); + } + + get fun balance(): Int { + return myBalance(); // in nano-tons (like cents, just with 9 decimals) + } +}`;function Q(i){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(i.queryId,64)}}async function m(){const i=s.Cell.fromBase64("te6ccgECFgEAA7wAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvh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Om1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8FAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAVAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNI/ATHgMPgo1wsKgwm68uCJ2zwXAAJwSN9PBA==");let n=s.beginCell();n.storeRef(e),n.storeUint(0,1);const o=n.endCell();return{code:i,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},41168:{message:"Balance getting too high"}},M=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],k=[{name:"balance",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],L=[{receiver:"internal",message:{kind:"empty"}},{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"refunding increment"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,n){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:M,getters:k,receivers:L,errors:E});this.address=e,this.init=n}static async init(){return await m()}static async fromInit(){const e=await m(),n=s.contractAddress(0,e);return new c(n,e)}static fromAddress(e){return new c(e)}async send(e,n,o,t){let a=null;if(t===null&&(a=new s.Cell),t==="increment"&&(a=s.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="refunding increment"&&(a=s.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof s.Slice)&&t.$$type==="Deploy"&&(a=s.beginCell().store(Q(t)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:a})}async getBalance(e){let n=new s.TupleBuilder;return(await e.get("balance",n.build())).stack.readBigNumber()}}function D(i,e,n){let o;B(i,g,r=>n(2,o=r));let t,a;return v(g,o={markdown:b,tactCode:I,deploy:async()=>{const r=await C.Blockchain.create(),d=await r.treasury("deployer");t=d.getSender(),a=r.openContract(await c.fromInit());const y={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],y,[await a.send(d.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"1 TON":async()=>[await a.send(t,{value:s.toNano(1)},null)],increment:async()=>[await a.send(t,{value:s.toNano(1)},"increment")],"refunding increment":async()=>[await a.send(t,{value:s.toNano(1)},"refunding increment")]},getters:{balance:async()=>await a.getBalance()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},o),[]}class j extends w{constructor(e){super(),f(this,e,D,null,h,{})}}export{j as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.a5e74603.js b/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.a5e74603.js deleted file mode 100644 index a98e7e6..0000000 --- a/docs/_app/immutable/entry/(examples)-03-receive-coins-page.svelte.a5e74603.js +++ /dev/null @@ -1,47 +0,0 @@ -var m=Object.defineProperty;var B=(r,e,n)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var A=(r,e,n)=>(B(r,typeof e!="symbol"?e+"":e,n),n);import{S as y,i as h,s as p,I as C,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as f}from"../chunks/index.78404594.js";const I=`# Receiving TON Coins - -Every contract has a TON coin balance. This balance is used to pay ongoing rent for storage and should not run out otherwise the contract may be deleted. You can store extra coins in the balance for any purpose. - -Every incoming message normally carries some TON coin value sent by the sender. This value is used to pay gas for handling this message. Unused excess will stay in the contract balance. If the value doesn't cover the gas cost, the transaction will revert. - -You can query the contract balance with \`myBalance()\` - note that the value is in nano-tons (like cents, just with 9 decimals). The balance already contains the incoming message value. - -## Refunding senders - -If the transaction reverts, unused excess value will be sent back to sender on the *bounced* message. - -You can also refund the excess if the transaction succeeds by sending it back using \`reply()\` in a response message. This is the best way to guarantee senders are only paying for the exact gas that their message consumed.`,Q=`import "@stdlib/deploy"; - -contract ReceiveCoins with Deployable { - - val: Int as int64; - - init() { - self.val = 0; - } - - // receive empty messages, these are usually simple TON coin transfers to the contract - receive() { - dump("empty message received"); - // revert the transaction if balance is growing over 3 TON - require(myBalance() <= ton("3"), "Balance getting too high"); - } - - receive("increment") { - // print how much TON coin were sent with this message - dump(context().value); - self.val = self.val + 1; - } - - receive("refunding increment") { - // print how much TON coin were sent with this message - dump(context().value); - self.val = self.val + 1; - // return all the unused excess TON coin value on the message back to the sender (with a textual string message) - reply("increment refund".asComment()); - } - - get fun balance(): Int { - return myBalance(); // in nano-tons (like cents, just with 9 decimals) - } -}`;function b(r){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(r.queryId,64)}}async function u(){const r=a.Cell.fromBase64("te6ccgECFQEAA6cAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHKP8ntVBAEAgFYDA0Cxu2i7ftwIddJwh+VMCDXCx/eApJbf+AhwAAh10nBIbCOL1uNBZlbXB0eSBtZXNzYWdlIHJlY2VpdmVkg/hQwggCg0PgnbxCCELLQXgC78vR/4CGCEJRqmLa64wIBwACRMOMNcAUGAVwx0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/CgK++QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqOkTD4QW8kE18D2zz+FDCkf9sx4ILw+uPRj2OjBEWqI632oDhGguq9jELZ7AXJ1xUualZ1Lxi64wIIBwM8+EFvJBNfA9s8/hQwpIh/+EJwWAOAQgFtbds8f9sxCAkKAN7I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DXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHKP8ntVBUNAsbtou37cCHXScIflTAg1wsf3gKSW3/gIcAAIddJwSGwji9bjQWZW1wdHkgbWVzc2FnZSByZWNlaXZlZIP4UMIIAoND4J28QghCy0F4Au/L0f+AhghCUapi2uuMCAcAAkTDjDXASDgK++QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqOkTD4QW8kE18D2zz+FDCkf9sx4ILw+uPRj2OjBEWqI632oDhGguq9jELZ7AXJ1xUualZ1Lxi64wIRDwM8+EFvJBNfA9s8/hQwpIh/+EJwWAOAQgFtbds8f9sxERATACgAAAAAaW5jcmVtZW50IHJlZnVuZADeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAVwx0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/EwHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAUAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNI/ATHgMPgo1wsKgwm68uCJ2zwWAAJwfV0JUw==");let n=a.beginCell();n.storeRef(e),n.storeUint(0,1);const o=n.endCell();return{code:r,data:o}}const N={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},41168:{message:"Balance getting too high"}};class c{constructor(e,n){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:N});this.address=e,this.init=n}static async init(){return await u()}static async fromInit(){const e=await u(),n=a.contractAddress(0,e);return new c(n,e)}static fromAddress(e){return new c(e)}async send(e,n,o,t){let s=null;if(t===null&&(s=new a.Cell),t==="increment"&&(s=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="refunding increment"&&(s=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(s=a.beginCell().store(b(t)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:s})}async getBalance(e){let n=new a.TupleBuilder;return(await e.get("balance",n.build())).stack.readBigNumber()}}function D(r,e,n){let o;C(r,d,i=>n(2,o=i));let t,s;return v(d,o={markdown:I,tactCode:Q,deploy:async()=>{const i=await f.Blockchain.create(),l=await i.treasury("deployer");t=l.getSender(),s=i.openContract(await c.fromInit());const w={[l.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],w,[await s.send(l.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"1 TON":async()=>[await s.send(t,{value:a.toNano(1)},null)],increment:async()=>[await s.send(t,{value:a.toNano(1)},"increment")],"refunding increment":async()=>[await s.send(t,{value:a.toNano(1)},"refunding increment")]},getters:{balance:async()=>await s.getBalance()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class L extends y{constructor(e){super(),h(this,e,D,null,p,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.381dfaca.js b/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.381dfaca.js new file mode 100644 index 0000000..926c5fc --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.381dfaca.js @@ -0,0 +1,72 @@ +var p=Object.defineProperty;var A=(s,n,e)=>n in s?p(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e;var l=(s,n,e)=>(A(s,typeof n!="symbol"?n+"":n,e),e);import{S as f,i as h,s as v,I as w,ac as C}from"../chunks/index.9fe14626.js";import{d as a,g as u,s as m}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const I=`# Receivers and Messages + +In TON, users interact with contracts by sending them messages. Different contracts can only communicate with each other by sending each other messages. + +Since users actually use wallet contracts, messages from users are actually messages coming from just another contract. + +Sending a message to a contract costs gas and is processed in the course of a transaction. The transaction executes when validators add the transaction to a new block. This can take a few seconds. Messages are also able to change the contract's persistent state. + +## Receivers + +When designing your contract, make a list of every operation that your contract supports, then, define a message for each operation, and finally, implement a handler for each message containing the logic of what to do when it arrives. + +Contract methods named \`receive()\` are the handlers that process each incoming message type. Tact will automatically route every incoming message to the correct receiver listening for it according to its type. A message is only handled by one receiver. + +Messages are defined using the \`message\` keyword. They can carry input arguments. Notice that for integers, you must define the encoding size, just like in state variables. When somebody sends the message, they serialize it over the wire.`,B=`import "@stdlib/deploy"; + +// this message will cause our contract to add an amount to the counter +message Add { + amount: Int as uint32; +} + +// this message will cause our contract to subtract an amount from the counter +message Subtract { + amount: Int as uint32; +} + +// this message will cause our contract to do a complex math operation on the counter +message MultiMath { + add: Int as uint32; + subtract: Int as uint32; + multiply: Int as uint32; +} + +contract Receivers with Deployable { + + val: Int as int64; + + init() { + self.val = 0; + } + + // handler for the "Add" message - this is a binary message that has an input argument (amount) + receive(msg: Add) { + self.val = self.val + msg.amount; + } + + // handler for the "Subtract" message - this is a different binary message although its format is identical + receive(msg: Subtract) { + self.val = self.val - msg.amount; + } + + // handler for the "MultiMath" message - this is a binary message that holds multiple input arguments + receive(msg: MultiMath) { + self.val = self.val + msg.add; + self.val = self.val - msg.subtract; + self.val = self.val * msg.multiply; + } + + // handler for "increment" textual message - this is a textual string message, these cannot carry input arguments + receive("increment") { + self.val = self.val + 1; + } + + // handler for "decrement" textual message - this is a different textual string message, you can have as many as you want + receive("decrement") { + self.val = self.val - 1; + } + + get fun value(): Int { + return self.val; + } +}`;function M(s){return n=>{let e=n;e.storeUint(2490013878,32),e.storeUint(s.queryId,64)}}function k(s){return n=>{let e=n;e.storeUint(2278832834,32),e.storeUint(s.amount,32)}}function D(s){return n=>{let e=n;e.storeUint(1552846265,32),e.storeUint(s.amount,32)}}function E(s){return n=>{let e=n;e.storeUint(2221071617,32),e.storeUint(s.add,32),e.storeUint(s.subtract,32),e.storeUint(s.multiply,32)}}async function g(){const s=a.Cell.fromBase64("te6ccgECFAEAAzcAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAco/ye1UEQQCAVgLDAPe7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEIfUOsK6jhQw0x8BghCH1DrCuvLggdMfATGgf+AgghBcjo25uo4UMNMfAYIQXI6Nubry4IHTHwExoX/gIIIQhGLdAbrjAiCCEJRqmLa64wLAAJEw4w1wBQYHAD4w0x8BghCEYt0BuvLggdMf0x/TH1UgbBNaoFihAah/AVAw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/CACs+QEggvDE+NcjEu3971t77Hgzvb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yPhDAcx/AcoAAQHKP8ntVBQNA97tou37AZIwf+BwIddJwh+VMCDXCx/eIIIQh9Q6wrqOFDDTHwGCEIfUOsK68uCB0x8BMaB/4CCCEFyOjbm6jhQw0x8BghBcjo25uvLggdMfATGhf+AgghCEYt0BuuMCIIIQlGqYtrrjAsAAkTDjDXATDw4ArPkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66lTCkf9sx4ILwhZFbG/WUP9KFO7ZgM4rKz6450fc1VJzvkiJVqZRazD66lKV/2zHgAVAw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/EAE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwRAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABIAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwAPjDTHwGCEIRi3QG68uCB0x/TH9MfVSBsE1qgWKEBqH8BPO1E0NQB+GPSAAGU0j8BMeAw+CjXCwqDCbry4InbPBUAAnAo1rzV");let e=a.beginCell();e.storeRef(n),e.storeUint(0,1);const i=e.endCell();return{code:s,data:i}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Add",header:2278832834,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:32}}]},{name:"Subtract",header:1552846265,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:32}}]},{name:"MultiMath",header:2221071617,fields:[{name:"add",type:{kind:"simple",type:"uint",optional:!1,format:32}},{name:"subtract",type:{kind:"simple",type:"uint",optional:!1,format:32}},{name:"multiply",type:{kind:"simple",type:"uint",optional:!1,format:32}}]}],x=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],L=[{receiver:"internal",message:{kind:"typed",type:"Add"}},{receiver:"internal",message:{kind:"typed",type:"Subtract"}},{receiver:"internal",message:{kind:"typed",type:"MultiMath"}},{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"decrement"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(n,e){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Add",header:2278832834,fields:[]},{name:"Subtract",header:1552846265,fields:[]},{name:"MultiMath",header:2221071617,fields:[]}],types:Q,getters:x,receivers:L,errors:S});this.address=n,this.init=e}static async init(){return await g()}static async fromInit(){const n=await g(),e=a.contractAddress(0,n);return new c(e,n)}static fromAddress(n){return new c(n)}async send(n,e,i,t){let r=null;if(t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Add"&&(r=a.beginCell().store(k(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Subtract"&&(r=a.beginCell().store(D(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="MultiMath"&&(r=a.beginCell().store(E(t)).endCell()),t==="increment"&&(r=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="decrement"&&(r=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(r=a.beginCell().store(M(t)).endCell()),r===null)throw new Error("Invalid message type");await n.internal(e,{...i,body:r})}async getValue(n){let e=new a.TupleBuilder;return(await n.get("value",e.build())).stack.readBigNumber()}}function T(s,n,e){let i;w(s,m,o=>e(2,i=o));let t,r;return C(m,i={markdown:I,tactCode:B,deploy:async()=>{const o=await b.Blockchain.create(),d=await o.treasury("deployer");t=d.getSender(),r=o.openContract(await c.fromInit());const y={[d.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],y,[await r.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await r.send(t,{value:a.toNano(1)},"increment")],decrement:async()=>[await r.send(t,{value:a.toNano(1)},"decrement")],"Add{3}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"Add",amount:3n})],"Subtract{2}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"Subtract",amount:2n})],"MultiMath{1,0,2}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"MultiMath",add:1n,subtract:0n,multiply:2n})],"MultiMath{0,3,3}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"MultiMath",add:0n,subtract:3n,multiply:3n})]},getters:{value:async()=>await r.getValue()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},i),[]}class N extends f{constructor(n){super(),h(this,n,T,null,v,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.bac11b86.js b/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.bac11b86.js deleted file mode 100644 index 5a7037c..0000000 --- a/docs/_app/immutable/entry/(examples)-03-receivers-page.svelte.bac11b86.js +++ /dev/null @@ -1,72 +0,0 @@ -var y=Object.defineProperty;var h=(s,n,e)=>n in s?y(s,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[n]=e;var l=(s,n,e)=>(h(s,typeof n!="symbol"?n+"":n,e),e);import{S as f,i as C,s as w,I as p,ac as b}from"../chunks/index.9fe14626.js";import{d as a,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as v}from"../chunks/index.78404594.js";const I=`# Receivers and Messages - -In TON, users interact with contracts by sending them messages. Different contracts can only communicate with each other by sending each other messages. - -Since users actually use wallet contracts, messages from users are actually messages coming from just another contract. - -Sending a message to a contract costs gas and is processed in the course of a transaction. The transaction executes when validators add the transaction to a new block. This can take a few seconds. Messages are also able to change the contract's persistent state. - -## Receivers - -When designing your contract, make a list of every operation that your contract supports, then, define a message for each operation, and finally, implement a handler for each message containing the logic of what to do when it arrives. - -Contract methods named \`receive()\` are the handlers that process each incoming message type. Tact will automatically route every incoming message to the correct receiver listening for it according to its type. A message is only handled by one receiver. - -Messages are defined using the \`message\` keyword. They can carry input arguments. Notice that for integers, you must define the encoding size, just like in state variables. When somebody sends the message, they serialize it over the wire.`,B=`import "@stdlib/deploy"; - -// this message will cause our contract to add an amount to the counter -message Add { - amount: Int as uint32; -} - -// this message will cause our contract to subtract an amount from the counter -message Subtract { - amount: Int as uint32; -} - -// this message will cause our contract to do a complex math operation on the counter -message MultiMath { - add: Int as uint32; - subtract: Int as uint32; - multiply: Int as uint32; -} - -contract Receivers with Deployable { - - val: Int as int64; - - init() { - self.val = 0; - } - - // handler for the "Add" message - this is a binary message that has an input argument (amount) - receive(msg: Add) { - self.val = self.val + msg.amount; - } - - // handler for the "Subtract" message - this is a different binary message although its format is identical - receive(msg: Subtract) { - self.val = self.val - msg.amount; - } - - // handler for the "MultiMath" message - this is a binary message that holds multiple input arguments - receive(msg: MultiMath) { - self.val = self.val + msg.add; - self.val = self.val - msg.subtract; - self.val = self.val * msg.multiply; - } - - // handler for "increment" textual message - this is a textual string message, these cannot carry input arguments - receive("increment") { - self.val = self.val + 1; - } - - // handler for "decrement" textual message - this is a different textual string message, you can have as many as you want - receive("decrement") { - self.val = self.val - 1; - } - - get fun value(): Int { - return self.val; - } -}`;function M(s){return n=>{let e=n;e.storeUint(2490013878,32),e.storeUint(s.queryId,64)}}function D(s){return n=>{let e=n;e.storeUint(2278832834,32),e.storeUint(s.amount,32)}}function H(s){return n=>{let e=n;e.storeUint(1552846265,32),e.storeUint(s.amount,32)}}function E(s){return n=>{let e=n;e.storeUint(2221071617,32),e.storeUint(s.add,32),e.storeUint(s.subtract,32),e.storeUint(s.multiply,32)}}async function A(){const s=a.Cell.fromBase64("te6ccgECEwEAAxwAART/APSkE/S88sgLAQIBYgI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(0,1);const o=e.endCell();return{code:s,data:o}}const Q={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(n,e){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Add",header:2278832834,fields:[]},{name:"Subtract",header:1552846265,fields:[]},{name:"MultiMath",header:2221071617,fields:[]}],errors:Q});this.address=n,this.init=e}static async init(){return await A()}static async fromInit(){const n=await A(),e=a.contractAddress(0,n);return new c(e,n)}static fromAddress(n){return new c(n)}async send(n,e,o,t){let r=null;if(t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Add"&&(r=a.beginCell().store(D(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Subtract"&&(r=a.beginCell().store(H(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="MultiMath"&&(r=a.beginCell().store(E(t)).endCell()),t==="increment"&&(r=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="decrement"&&(r=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(r=a.beginCell().store(M(t)).endCell()),r===null)throw new Error("Invalid message type");await n.internal(e,{...o,body:r})}async getValue(n){let e=new a.TupleBuilder;return(await n.get("value",e.build())).stack.readBigNumber()}}function S(s,n,e){let o;p(s,g,i=>e(2,o=i));let t,r;return b(g,o={markdown:I,tactCode:B,deploy:async()=>{const i=await v.Blockchain.create(),u=await i.treasury("deployer");t=u.getSender(),r=i.openContract(await c.fromInit());const m={[u.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],m,[await r.send(u.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await r.send(t,{value:a.toNano(1)},"increment")],decrement:async()=>[await r.send(t,{value:a.toNano(1)},"decrement")],"Add{3}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"Add",amount:3n})],"Subtract{2}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"Subtract",amount:2n})],"MultiMath{1,0,2}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"MultiMath",add:1n,subtract:0n,multiply:2n})],"MultiMath{0,3,3}":async()=>[await r.send(t,{value:a.toNano(1)},{$$type:"MultiMath",add:0n,subtract:3n,multiply:3n})]},getters:{value:async()=>await r.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class J extends f{constructor(n){super(),C(this,n,S,null,w,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.07670f1d.js b/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.07670f1d.js deleted file mode 100644 index 37c9cb1..0000000 --- a/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.07670f1d.js +++ /dev/null @@ -1,73 +0,0 @@ -var h=Object.defineProperty;var y=(o,e,n)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var l=(o,e,n)=>(y(o,typeof e!="symbol"?e+"":e,n),n);import{S as m,i as I,s as f,I as B,ac as b}from"../chunks/index.9fe14626.js";import{d as a,g,s as w}from"../chunks/store.d3ab02ad.js";import{d as p}from"../chunks/index.78404594.js";const E=`# Sending TON Coins - -This contract allows to withdraw TON coins from its balance. Notice that only the deployer is permitted to do that, otherwise this money could be stolen. - -The withdrawn funds are sent as value on an outgoing message to the sender. It's a good idea to set the \`bounce\` flag explicitly to \`true\` (although this also the default), so if the outgoing message fails for any reason, the money would return to the contract. - -Contracts need to have a non-zero balance so they can pay storage costs occasionally, otherwise they may get deleted. This contract can make sure you always leave 0.01 TON which is [enough](https://ton.org/docs/develop/smart-contracts/fees#storage-fee) to store 1 KB of state for 2.5 years. - -## The intricate math - -\`myBalance()\` is the contract balance including the value for gas sent on the incoming message. \`myBalance() - context().value\` is the balance without the value for gas sent on the incoming message. - -Send mode \`SendRemainingValue\` will add to the outgoing value any excess left from the incoming message after all gas costs are deducted from it. - -Send mode \`SendRemainingBalance\` will ignore the outgoing value and send the entire balance of the contract. Note that this will not leave any balance for storage costs so the contract may be deleted.`,Q=`import "@stdlib/deploy"; - -message Withdraw { - amount: Int as coins; -} - -contract SendCoins with Deployable { - - const MinTonForStorage: Int = ton("0.01"); // enough for 1 KB of storage for 2.5 years - deployer: Address; - - init() { - self.deployer = sender(); - } - - // accept incoming TON transfers - receive() { - dump("funds received"); - } - - // this will withdraw the entire balance of the contract and leave 0 - receive("withdraw all") { - require(sender() == self.deployer, "Only deployer is allowed to withdraw"); - send(SendParameters{ - to: sender(), - bounce: true, - value: 0, - mode: SendRemainingBalance + SendIgnoreErrors - }); - } - - // this will withdraw the entire balance but leave 0.01 for storage rent costs - receive("withdraw safe") { - require(sender() == self.deployer, "Only deployer is allowed to withdraw"); - send(SendParameters{ - to: sender(), - bounce: true, - value: myBalance() - context().value - self.MinTonForStorage, - mode: SendRemainingValue + SendIgnoreErrors - }); - } - - // this will withdraw a specific amount but leave 0.01 for storage rent costs - receive(msg: Withdraw) { - require(sender() == self.deployer, "Only deployer is allowed to withdraw"); - let amount: Int = min(msg.amount, myBalance() - context().value - self.MinTonForStorage); - require(amount > 0, "Insufficient balance"); - send(SendParameters{ - to: sender(), - bounce: true, - value: amount, - mode: SendRemainingValue + SendIgnoreErrors - }); - } - - get fun balance(): String { - return myBalance().toCoinsString(); - } -}`;function v(o){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(o.queryId,64)}}function M(o){return e=>{let n=e;n.storeUint(195467089,32),n.storeCoins(o.amount)}}async function u(){const o=a.Cell.fromBase64("te6ccgECFAEABB8AART/APSkE/S88sgLAQIBYgIDAsrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsntVA4EAgFYCgsD9u2i7ftwIddJwh+VMCDXCx/eApJbf+AhwAAh10nBIbCOFVuL5mdW5kcyByZWNlaXZlZI/hQwf+AhghALppdRuuMCIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAQUIBgGQMdMfAYIQC6aXUbry4IH6AAExgTyV+EJSMMcF8vT4J28Q+EFvJBNfA6GCCJiWgKG2CIIA1VchwgDy9PhCf1iAQhAjbW1t2zx/CALmwACPa/kBIILwUJK13OBxWlfdlp9ftab5MCWgsC6rMpRwyis2XKDX6Tq6jp0wgTyV+EJSIMcF8vT4Qn9wgQCCECNtbW3bPH/bMeCC8L6yk1qCCJsVTTL5nEN3qpYKoRU2bMLGAnVeNrl/UFzsuuMCkTDicAgHAViBPJX4QlIgxwXy9PhCf/gnbxD4QW8kE18DoYIImJaAoYBCECNtbW3bPH/bMQgByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsACQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDc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Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJ7VQUDgP27aLt+3Ah10nCH5UwINcLH94Cklt/4CHAACHXScEhsI4VW4vmZ1bmRzIHJlY2VpdmVkj+FDB/4CGCEAuml1G64wIhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABERIPAubAAI9r+QEggvBQkrXc4HFaV92Wn1+1pvkwJaCwLqsylHDKKzZcoNfpOrqOnTCBPJX4QlIgxwXy9PhCf3CBAIIQI21tbds8f9sx4ILwvrKTWoIImxVNMvmcQ3eqlgqhFTZswsYCdV42uX9QXOy64wKRMOJwEhABWIE8lfhCUiDHBfL0+EJ/+CdvEPhBbyQTXwOhggiYloChgEIQI21tbds8f9sxEgGQMdMfAYIQC6aXUbry4IH6AAExgTyV+EJSMMcF8vT4J28Q+EFvJBNfA6GCCJiWgKG2CIIA1VchwgDy9PhCf1iAQhAjbW1t2zx/EgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wATAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAXbtRNDUAfhj0gABjiD6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIMeAw+CjXCwqDCbry4InbPBUABPhCmXKXKw==");let n=a.beginCell();n.storeRef(e),n.storeUint(0,1);const r=n.endCell();return{code:o,data:r}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},15509:{message:"Only deployer is allowed to withdraw"},54615:{message:"Insufficient balance"}};class c{constructor(e,n){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Withdraw",header:195467089,fields:[]}],errors:S});this.address=e,this.init=n}static async init(){return await u()}static async fromInit(){const e=await u(),n=a.contractAddress(0,e);return new c(n,e)}static fromAddress(e){return new c(e)}async send(e,n,r,t){let s=null;if(t===null&&(s=new a.Cell),t==="withdraw all"&&(s=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="withdraw safe"&&(s=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Withdraw"&&(s=a.beginCell().store(M(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(s=a.beginCell().store(v(t)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(n,{...r,body:s})}async getBalance(e){let n=new a.TupleBuilder;return(await e.get("balance",n.build())).stack.readString()}}function T(o,e,n){let r;B(o,w,i=>n(3,r=i));let t,s;return b(w,r={markdown:E,tactCode:Q,deploy:async()=>{const i=await p.Blockchain.create(),d=await i.treasury("deployer");t=d.getSender();const A=await i.treasury("another");A.getSender(),s=i.openContract(await c.fromInit());const C={[d.address.toString()]:"deployer",[A.address.toString()]:"sender 2",[s.address.toString()]:"contract"};return[[s],C,[await s.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"1 TON":async()=>[await s.send(t,{value:a.toNano(1)},null)],"withdraw all":async()=>[await s.send(t,{value:a.toNano(1)},"withdraw all")],"withdraw safe":async()=>[await s.send(t,{value:a.toNano(1)},"withdraw safe")],"Withdraw{1 TON}":async()=>[await s.send(t,{value:a.toNano(1)},{$$type:"Withdraw",amount:a.toNano(1)})]},getters:{balance:async()=>await s.getBalance()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},r),[]}class L extends m{constructor(e){super(),I(this,e,T,null,f,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.0ca9331f.js b/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.0ca9331f.js new file mode 100644 index 0000000..89e09e0 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-send-coins-page.svelte.0ca9331f.js @@ -0,0 +1,80 @@ +var w=Object.defineProperty;var u=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(u(s,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as h,s as C,I,ac as b}from"../chunks/index.9fe14626.js";import{d as a,g as A,s as y}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const Q=`# Sending TON Coins + +This contract allows to withdraw TON coins from its balance. Notice that only the deployer is permitted to do that, otherwise this money could be stolen. + +The withdrawn funds are sent as value on an outgoing message to the sender. It's a good idea to set the \`bounce\` flag explicitly to \`true\` (although this also the default), so if the outgoing message fails for any reason, the money would return to the contract. + +Contracts need to have a non-zero balance so they can pay storage costs occasionally, otherwise they may get deleted. This contract can make sure you always leave 0.01 TON which is [enough](https://ton.org/docs/develop/smart-contracts/fees#storage-fee) to store 1 KB of state for 2.5 years. + +## The intricate math + +\`myBalance()\` is the contract balance including the value for gas sent on the incoming message. \`myBalance() - context().value\` is the balance without the value for gas sent on the incoming message. + +Send mode \`SendRemainingValue\` will add to the outgoing value any excess left from the incoming message after all gas costs are deducted from it. + +Send mode \`SendRemainingBalance\` will ignore the outgoing value and send the entire balance of the contract. Note that this will not leave any balance for storage costs so the contract may be deleted. + +
+
+ Info: More details for different sending modes can check + here +
+`,v=`import "@stdlib/deploy"; + +message Withdraw { + amount: Int as coins; +} + +contract SendCoins with Deployable { + + const MinTonForStorage: Int = ton("0.01"); // enough for 1 KB of storage for 2.5 years + deployer: Address; + + init() { + self.deployer = sender(); + } + + // accept incoming TON transfers + receive() { + dump("funds received"); + } + + // this will withdraw the entire balance of the contract and leave 0 + receive("withdraw all") { + require(sender() == self.deployer, "Only deployer is allowed to withdraw"); + send(SendParameters{ + to: sender(), + bounce: true, + value: 0, + mode: SendRemainingBalance + SendIgnoreErrors + }); + } + + // this will withdraw the entire balance but leave 0.01 for storage rent costs + receive("withdraw safe") { + require(sender() == self.deployer, "Only deployer is allowed to withdraw"); + send(SendParameters{ + to: sender(), + bounce: true, + value: myBalance() - context().value - self.MinTonForStorage, + mode: SendRemainingValue + SendIgnoreErrors + }); + } + + // this will withdraw a specific amount but leave 0.01 for storage rent costs + receive(msg: Withdraw) { + require(sender() == self.deployer, "Only deployer is allowed to withdraw"); + let amount: Int = min(msg.amount, myBalance() - context().value - self.MinTonForStorage); + require(amount > 0, "Insufficient balance"); + send(SendParameters{ + to: sender(), + bounce: true, + value: amount, + mode: SendRemainingValue + SendIgnoreErrors + }); + } + + get fun balance(): String { + return myBalance().toCoinsString(); + } +}`;function E(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function D(s){return e=>{let t=e;t.storeUint(195467089,32),t.storeCoins(s.amount)}}async function p(){const s=a.Cell.fromBase64("te6ccgECFQEABDkAART/APSkE/S88sgLAQIBYgIDAs7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUw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Wlfdlp9ftab5MCWgsC6rMpRwyis2XKDX6Tq6jp0wgTyV+EJSIMcF8vT4Qn9wgQCCECNtbW3bPH/bMeCC8L6yk1qCCJsVTTL5nEN3qpYKoRU2bMLGAnVeNrl/UFzsuuMCExABWIE8lfhCUiDHBfL0+EJ/+CdvEPhBbyQTXwOhggiYloChgEIQI21tbds8f9sxEwE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwTAZAw0x8BghALppdRuvLggfoAATGBPJX4QlIwxwXy9PgnbxD4QW8kE18DoYIImJaAobYIggDVVyHCAPL0+EJ/WIBCECNtbW3bPH8TAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABQAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBdu1E0NQB+GPSAAGOIPpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4Igx4DD4KNcLCoMJuvLgids8FgAE+EKsoc0K");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},15509:{message:"Only deployer is allowed to withdraw"},54615:{message:"Insufficient balance"}},T=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Withdraw",header:195467089,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}}]}],k=[{name:"balance",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}}],M=[{receiver:"internal",message:{kind:"empty"}},{receiver:"internal",message:{kind:"text",text:"withdraw all"}},{receiver:"internal",message:{kind:"text",text:"withdraw safe"}},{receiver:"internal",message:{kind:"typed",type:"Withdraw"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class d{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Withdraw",header:195467089,fields:[]}],types:T,getters:k,receivers:M,errors:S});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=a.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,r,n){let o=null;if(n===null&&(o=new a.Cell),n==="withdraw all"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="withdraw safe"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Withdraw"&&(o=a.beginCell().store(D(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(o=a.beginCell().store(E(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getBalance(e){let t=new a.TupleBuilder;return(await e.get("balance",t.build())).stack.readString()}}function L(s,e,t){let r;I(s,y,i=>t(3,r=i));let n,o;return b(y,r={markdown:Q,tactCode:v,deploy:async()=>{const i=await B.Blockchain.create(),c=await i.treasury("deployer");n=c.getSender();const g=await i.treasury("another");g.getSender(),o=i.openContract(await d.fromInit());const m={[c.address.toString()]:"deployer",[g.address.toString()]:"sender 2",[o.address.toString()]:"contract"};return[[o],m,[await o.send(c.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"1 TON":async()=>[await o.send(n,{value:a.toNano(1)},null)],"withdraw all":async()=>[await o.send(n,{value:a.toNano(1)},"withdraw all")],"withdraw safe":async()=>[await o.send(n,{value:a.toNano(1)},"withdraw safe")],"Withdraw{1 TON}":async()=>[await o.send(n,{value:a.toNano(1)},{$$type:"Withdraw",amount:a.toNano(1)})]},getters:{balance:async()=>await o.getBalance()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},r),[]}class J extends f{constructor(e){super(),h(this,e,L,null,C,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.0b2aaa0f.js b/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.0b2aaa0f.js new file mode 100644 index 0000000..dd95405 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.0b2aaa0f.js @@ -0,0 +1,43 @@ +var w=Object.defineProperty;var C=(a,e,t)=>e in a?w(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var d=(a,e,t)=>(C(a,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as I,s as B,I as h,ac as v}from"../chunks/index.9fe14626.js";import{d as s,g as y,s as p}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const E=`# Message Sender + +Every incoming message is sent from some contract that has an address. + +You can query the address of the message sender by calling \`sender()\`. Alternatively, the address is also available through \`context().sender\`. + +The sender during execution of the \`init()\` method of the contract is the address who deployed the contract. + +## Authenticating messages + +The main way to authenticate an incoming message, particularly for priviliges actions, is to verify the sender. This field is secure and impossible to fake. + +
+
+ Info: More detail about context can find in here: context() +
+`,Q=`import "@stdlib/deploy"; + +contract MessageSender with Deployable { + + deployer: Address; + lastSender: Address; + + init() { + self.deployer = sender(); // sender() of init is who deployed the contract + self.lastSender = newAddress(0, 0); // zero address + } + + receive("who") { + if (sender() == self.deployer) { + dump("deployer"); + } else { + dump("not deployer!"); + } + } + + receive("hello") { + if (sender() != self.lastSender) { + self.lastSender = sender(); + dump("hello new sender!"); + } + } +}`;function D(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function m(){const a=s.Cell.fromBase64("te6ccgECEQEAA7QAART/APSkE/S88sgLAQIBYgIDA3jQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4IIEBQYCAVgNDgG67UTQ1AH4Y9IAAY5C+kABINdJgQELuvLg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gFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBuu1E0NQB+GPSAAGOQvpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsEuAw+CjXCwqDCbry4InbPBIAYPhCcCDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiPntNGk=");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:a,data:i}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},S=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],M=[],L=[{receiver:"internal",message:{kind:"text",text:"who"}},{receiver:"internal",message:{kind:"text",text:"hello"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class g{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:S,getters:M,receivers:L,errors:k});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=s.contractAddress(0,e);return new g(t,e)}static fromAddress(e){return new g(e)}async send(e,t,i,n){let o=null;if(n==="who"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="hello"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(o=s.beginCell().store(D(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}}function x(a,e,t){let i;h(a,p,l=>t(3,i=l));let n,o,r;return v(p,i={markdown:E,tactCode:Q,deploy:async()=>{const l=await b.Blockchain.create(),c=await l.treasury("deployer");n=c.getSender();const A=await l.treasury("another");o=A.getSender(),r=l.openContract(await g.fromInit());const u={[c.address.toString()]:"deployer",[A.address.toString()]:"sender 2",[r.address.toString()]:"contract"};return[[r],u,[await r.send(c.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"who (from deployer)":async()=>[await r.send(n,{value:s.toNano(1)},"who")],"who (from sender 2)":async()=>[await r.send(o,{value:s.toNano(1)},"who")],"hello (from deployer)":async()=>[await r.send(n,{value:s.toNano(1)},"hello")],"hello (from sender 2)":async()=>[await r.send(o,{value:s.toNano(1)},"hello")]},getters:{},prev:y(import.meta.url).prev,next:y(import.meta.url).next},i),[]}class z extends f{constructor(e){super(),I(this,e,x,null,B,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.3be840de.js b/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.3be840de.js deleted file mode 100644 index 9ba2549..0000000 --- a/docs/_app/immutable/entry/(examples)-03-sender-page.svelte.3be840de.js +++ /dev/null @@ -1,37 +0,0 @@ -var I=Object.defineProperty;var m=(r,e,s)=>e in r?I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var l=(r,e,s)=>(m(r,typeof e!="symbol"?e+"":e,s),s);import{S as B,i as h,s as f,I as b,ac as p}from"../chunks/index.9fe14626.js";import{d as t,g as u,s as y}from"../chunks/store.d3ab02ad.js";import{d as E}from"../chunks/index.78404594.js";const v=`# Message Sender - -Every incoming message is sent from some contract that has an address. - -You can query the address of the message sender by calling \`sender()\`. Alternatively, the address is also available through \`context().sender\`. - -The sender during execution of the \`init()\` method of the contract is the address who deployed the contract. - -## Authenticating messages - -The main way to authenticate an incoming message, particularly for priviliges actions, is to verify the sender. This field is secure and impossible to fake.`,Q=`import "@stdlib/deploy"; - -contract MessageSender with Deployable { - - deployer: Address; - lastSender: Address; - - init() { - self.deployer = sender(); // sender() of init is who deployed the contract - self.lastSender = newAddress(0, 0); // zero address - } - - receive("who") { - if (sender() == self.deployer) { - dump("deployer"); - } else { - dump("not deployer!"); - } - } - - receive("hello") { - if (sender() != self.lastSender) { - self.lastSender = sender(); - dump("hello new sender!"); - } - } -}`;function D(r){return e=>{let s=e;s.storeUint(2490013878,32),s.storeUint(r.queryId,64)}}async function C(){const r=t.Cell.fromBase64("te6ccgECEAEAA5kAART/APSkE/S88sgLAQIBYgIDA3TQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwBAUGAgFYDA0Buu1E0NQB+GPSAAGOQvpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsEuAw+CjXCwqDCbry4InbPAcCru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAgJAJbI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFgEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJ7VQAYPhCcCDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAKAfb5ASCC8NYj+Em0/b07GRv4JGgbc9Toa+PI/e9HVTBG1Eltoon/uo4tMPhCUiDHBZ2LhkZXBsb3llco/hQwjhKL1ub3QgZGVwbG95ZXIhj+FDDif9sx4ILwVR9sPo1659mzrFO8qbb4LP8yL7FhE4IHdtFKP5O5OVG64wILAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAE74QlIQxwWzjhow+EKNBFoZWxsbyBuZXcgc2VuZGVyIYP4UMN5/2zEAubu9G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AcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AA8AmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBuu1E0NQB+GPSAAGOQvpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsEuAw+CjXCwqDCbry4InbPBEAYPhCcCDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFp++zk=");let s=t.beginCell();s.storeRef(e),s.storeUint(0,1);const i=s.endCell();return{code:r,data:i}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class g{constructor(e,s){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:S});this.address=e,this.init=s}static async init(){return await C()}static async fromInit(){const e=await C(),s=t.contractAddress(0,e);return new g(s,e)}static fromAddress(e){return new g(e)}async send(e,s,i,n){let o=null;if(n==="who"&&(o=t.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="hello"&&(o=t.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof t.Slice)&&n.$$type==="Deploy"&&(o=t.beginCell().store(D(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(s,{...i,body:o})}}function L(r,e,s){let i;b(r,y,A=>s(3,i=A));let n,o,a;return p(y,i={markdown:v,tactCode:Q,deploy:async()=>{const A=await E.Blockchain.create(),d=await A.treasury("deployer");n=d.getSender();const c=await A.treasury("another");o=c.getSender(),a=A.openContract(await g.fromInit());const w={[d.address.toString()]:"deployer",[c.address.toString()]:"sender 2",[a.address.toString()]:"contract"};return[[a],w,[await a.send(d.getSender(),{value:t.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"who (from deployer)":async()=>[await a.send(n,{value:t.toNano(1)},"who")],"who (from sender 2)":async()=>[await a.send(o,{value:t.toNano(1)},"who")],"hello (from deployer)":async()=>[await a.send(n,{value:t.toNano(1)},"hello")],"hello (from sender 2)":async()=>[await a.send(o,{value:t.toNano(1)},"hello")]},getters:{},prev:u(import.meta.url).prev,next:u(import.meta.url).next},i),[]}class x extends B{constructor(e){super(),h(this,e,L,null,f,{})}}export{x as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.5112e5f1.js b/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.5112e5f1.js deleted file mode 100644 index 050db76..0000000 --- a/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.5112e5f1.js +++ /dev/null @@ -1,62 +0,0 @@ -var p=Object.defineProperty;var f=(n,e,t)=>e in n?p(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(f(n,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as B,s as h,I as C,ac as I}from"../chunks/index.9fe14626.js";import{d as r,g as d,s as u}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const Q=`# Structs - -Structs allow you to combine multiple primitives together in a more semantic way. They're a great tool to make your code more readable. - -Structs can define complex data types that contain multiple fields of different types. They can also be nested. - -Structs can also include both default fields and optional fields. This can be quite useful when you have many fields but don't want to keep respecifying them. - -Structs are also useful as return values from *getters* or other internal functions. They effectively allow a single getter to return multiple return values. - -The order of fields does not matter. Unlike other languages, Tact does not have any padding between fields. - -## Structs vs. messages - -Structs and messages are almost identical with the only difference that messages have a 32-bit header containing their unique numeric id. This allows messages to be used with receivers since the contract can tell different types of messages apart based on this id.`,P=`import "@stdlib/deploy"; - -struct Point { - x: Int as int64; - y: Int as int64; -} - -struct Params { - name: String = "Satoshi"; // default value - age: Int? = null; // optional field - point: Point; // nested structs -} - -message Add { - point: Point; // message can hold a struct -} - -contract Structs with Deployable { - - // contract persistent state variables - s1: Point; - s2: Params; - - init() { - self.s1 = Point{x: 2, y: 3}; - self.s2 = Params{point: self.s1}; - } - - receive("show ops") { - // temporary variable - let s: Point = Point{x: 4, y: 5}; - - self.s1 = s; - } - - receive(msg: Add) { - self.s1.x = self.s1.x + msg.point.x; - self.s1.y = self.s1.y + msg.point.y; - } - - get fun point(): Point { - return self.s1; - } - - get fun params(): Params { - return self.s2; - } -}`;function E(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}function S(n){return e=>{let t=e;t.storeInt(n.x,64),t.storeInt(n.y,64)}}function m(n){let e=n.readBigNumber(),t=n.readBigNumber();return{$$type:"Point",x:e,y:t}}function v(n){let e=n.readString(),t=n.readBigNumberOpt();const o=m(n.readTuple());return{$$type:"Params",name:e,age:t,point:o}}function T(n){return e=>{let t=e;t.storeUint(4279624855,32),t.store(S(n.point))}}async function g(){const n=r.Cell.fromBase64("te6ccgECFAEAAygAART/APSkE/S88sgLAQIBYgIDAujQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvh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9RbVBZUUV3bW9zSzJrYTk4dGhoZ3prcUpLbWdpNUtTZ1hmakJ2Q3JSbVpwZDNvggAgFICggCFKrV2zzbPGxkbwIUCQAIVHMhIwAQqr7tRNDSAAECASANDAC5t3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwTgQKuANwDOxymcsHVcjktlhwTgN6k73yqLLeOOp6e8CrOGTQThOy6ctWadluZ0HSzbKM3RSQAhG0bttnm2eNjFAUDgAEU1QC6NAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUV2zwwyPhDAcx/AcoAVVBGVALKP8o/RDTIUATPFslQBMwhbrOZfwHKAIEBAc8AlHAyygDiWQLKP8o/ye1UFBAC9O2i7ftwIddJwh+VMCDXCx/eApJbf+AhghD/FeSXuo4dMdMfAYIQ/xXkl7ry4IHSP9I/WWwSUHegUFagBH/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAEhEAbI4w+QGC8K6bFfDVDpUWTvZ3/rxXpfmuN5s6z3IbaUpILHfbZcPVupk0NHR1UFR/2zHgkTDicAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wATAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAX7tRNDUAfhj0gABjiTSP9I/WQLUAdAB0gABlYEBAdcAkm0B4tI/0j9ZECQQIxBGbBbgMPgo1wsKgwm68uCJ2zwVAB5yc1yLdTYXRvc2hpgCbQLkYOxW");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:n,data:o}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class A{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Point",header:null,fields:[]},{name:"Params",header:null,fields:[]},{name:"Add",header:4279624855,fields:[]}],errors:H});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=r.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,o,s){let a=null;if(s==="show ops"&&(a=r.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof r.Slice)&&s.$$type==="Add"&&(a=r.beginCell().store(T(s)).endCell()),s&&typeof s=="object"&&!(s instanceof r.Slice)&&s.$$type==="Deploy"&&(a=r.beginCell().store(E(s)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:a})}async getPoint(e){let t=new r.TupleBuilder,o=(await e.get("point",t.build())).stack;return m(o)}async getParams(e){let t=new r.TupleBuilder,o=(await e.get("params",t.build())).stack;return v(o)}}function M(n,e,t){let o;C(n,u,i=>t(2,o=i));let s,a;return I(u,o={markdown:Q,tactCode:P,deploy:async()=>{const i=await b.Blockchain.create(),c=await i.treasury("deployer");s=c.getSender(),a=i.openContract(await A.fromInit());const y={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],y,[await a.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show ops":async()=>[await a.send(s,{value:r.toNano(1)},"show ops")],"Add{Point{1,-1}}":async()=>[await a.send(s,{value:r.toNano(1)},{$$type:"Add",point:{$$type:"Point",x:1n,y:-1n}})]},getters:{point:async()=>await a.getPoint(),params:async()=>await a.getParams()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},o),[]}class k extends w{constructor(e){super(),B(this,e,M,null,h,{})}}export{k as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.d8304256.js b/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.d8304256.js new file mode 100644 index 0000000..88906f2 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-structs-page.svelte.d8304256.js @@ -0,0 +1,68 @@ +var g=Object.defineProperty;var f=(n,e,t)=>e in n?g(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(f(n,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as h,s as b,I,ac as C}from"../chunks/index.9fe14626.js";import{d as o,g as c,s as A}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const Q=`# Structs + +Structs allow you to combine multiple primitives together in a more semantic way. They're a great tool to make your code more readable. + +Structs can define complex data types that contain multiple fields of different types. They can also be nested. + +Structs can also include both default fields and optional fields. This can be quite useful when you have many fields but don't want to keep respecifying them. + +Structs are also useful as return values from _getters_ or other internal functions. They effectively allow a single getter to return multiple return values. + +The order of fields does not matter. Unlike other languages, Tact does not have any padding between fields. + +
+
+ Info: You can check more "Optionals" examples here: Optionals +
+ +## Structs vs. messages + +Structs and messages are almost identical with the only difference that messages have a 32-bit header containing their unique numeric id. This allows messages to be used with receivers since the contract can tell different types of messages apart based on this id. +`,k=`import "@stdlib/deploy"; + +struct Point { + x: Int as int64; + y: Int as int64; +} + +struct Params { + name: String = "Satoshi"; // default value + age: Int? = null; // optional field + point: Point; // nested structs +} + +message Add { + point: Point; // message can hold a struct +} + +contract Structs with Deployable { + + // contract persistent state variables + s1: Point; + s2: Params; + + init() { + self.s1 = Point{x: 2, y: 3}; + self.s2 = Params{point: self.s1}; + } + + receive("show ops") { + // temporary variable + let s: Point = Point{x: 4, y: 5}; + + self.s1 = s; + } + + receive(msg: Add) { + self.s1.x = self.s1.x + msg.point.x; + self.s1.y = self.s1.y + msg.point.y; + } + + get fun point(): Point { + return self.s1; + } + + get fun params(): Params { + return self.s2; + } +}`;function P(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}function v(n){return e=>{let t=e;t.storeInt(n.x,64),t.storeInt(n.y,64)}}function u(n){let e=n.readBigNumber(),t=n.readBigNumber();return{$$type:"Point",x:e,y:t}}function S(n){let e=n.readString(),t=n.readBigNumberOpt();const i=u(n.readTuple());return{$$type:"Params",name:e,age:t,point:i}}function D(n){return e=>{let t=e;t.storeUint(4279624855,32),t.store(v(n.point))}}async function m(){const n=o.Cell.fromBase64("te6ccgECFQEAA0IAART/APSkE/S88sgLAQIBYgIDAuzQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFds88uCCyPhDAcx/AcoAVVBGVALKP8o/RDTIUATPFslQBMwhbrOZfwHKAIEBAc8AlHAyygDiWQLKP8o/ye1UEgQCAVgJCgLw7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEP8V5Je6jh0w0x8BghD/FeSXuvLggdI/0j9ZbBJQd6BQVqAEf+AgghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wBQYBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8BwBg+QGC8K6bFfDVDpUWTvZ3/rxXpfm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TA28E+GEC+GLbPFUV2zzy4ILI+EMBzH8BygBVUEZUAso/yj9ENMhQBM8WyVAEzCFus5l/AcoAgQEBzwCUcDLKAOJZAso/yj/J7VQVEALw7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEP8V5Je6jh0w0x8BghD/FeSXuvLggdI/0j9ZbBJQd6BQVqAEf+AgghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wEhEAYPkBgvCumxXw1Q6VFk72d/68V6X5rjebOs9yG2lKSCx322XD1bqZNDR0dVBUf9sx4AE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwTAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABQAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBfu1E0NQB+GPSAAGOJNI/0j9ZAtQB0AHSAAGVgQEB1wCSbQHi0j/SP1kQJBAjEEZsFuAw+CjXCwqDCbry4InbPBYAHnJzXIt1NhdG9zaGmAJtAi0aAXc=");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:n,data:i}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},x=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Point",header:null,fields:[{name:"x",type:{kind:"simple",type:"int",optional:!1,format:64}},{name:"y",type:{kind:"simple",type:"int",optional:!1,format:64}}]},{name:"Params",header:null,fields:[{name:"name",type:{kind:"simple",type:"string",optional:!1}},{name:"age",type:{kind:"simple",type:"int",optional:!0,format:257}},{name:"point",type:{kind:"simple",type:"Point",optional:!1}}]},{name:"Add",header:4279624855,fields:[{name:"point",type:{kind:"simple",type:"Point",optional:!1}}]}],H=[{name:"point",arguments:[],returnType:{kind:"simple",type:"Point",optional:!1}},{name:"params",arguments:[],returnType:{kind:"simple",type:"Params",optional:!1}}],T=[{receiver:"internal",message:{kind:"text",text:"show ops"}},{receiver:"internal",message:{kind:"typed",type:"Add"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class d{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Point",header:null,fields:[]},{name:"Params",header:null,fields:[]},{name:"Add",header:4279624855,fields:[]}],types:x,getters:H,receivers:T,errors:E});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=o.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,i,a){let s=null;if(a==="show ops"&&(s=o.beginCell().storeUint(0,32).storeStringTail(a).endCell()),a&&typeof a=="object"&&!(a instanceof o.Slice)&&a.$$type==="Add"&&(s=o.beginCell().store(D(a)).endCell()),a&&typeof a=="object"&&!(a instanceof o.Slice)&&a.$$type==="Deploy"&&(s=o.beginCell().store(P(a)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:s})}async getPoint(e){let t=new o.TupleBuilder,i=(await e.get("point",t.build())).stack;return u(i)}async getParams(e){let t=new o.TupleBuilder,i=(await e.get("params",t.build())).stack;return S(i)}}function L(n,e,t){let i;I(n,A,r=>t(2,i=r));let a,s;return C(A,i={markdown:Q,tactCode:k,deploy:async()=>{const r=await B.Blockchain.create(),p=await r.treasury("deployer");a=p.getSender(),s=r.openContract(await d.fromInit());const y={[p.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],y,[await s.send(p.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"show ops":async()=>[await s.send(a,{value:o.toNano(1)},"show ops")],"Add{Point{1,-1}}":async()=>[await s.send(a,{value:o.toNano(1)},{$$type:"Add",point:{$$type:"Point",x:1n,y:-1n}})]},getters:{point:async()=>await s.getPoint(),params:async()=>await s.getParams()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class J extends w{constructor(e){super(),h(this,e,L,null,b,{})}}export{J as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.491b23de.js b/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.491b23de.js deleted file mode 100644 index 8169944..0000000 --- a/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.491b23de.js +++ /dev/null @@ -1,51 +0,0 @@ -var w=Object.defineProperty;var y=(r,e,t)=>e in r?w(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var c=(r,e,t)=>(y(r,typeof e!="symbol"?e+"":e,t),t);import{S as h,i as C,s as f,I as v,ac as b}from"../chunks/index.9fe14626.js";import{d as a,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as p}from"../chunks/index.78404594.js";const I=`# Textual Messages - -Most of the messages we saw in the previous example were defined with the \`message\` keyword. They are considered *binary* messages. This means that when somebody wants to send them, they serialize them into bits and bytes of binary data. - -The disadvantage with binary messages is that they're not human readable. - -## Hardware wallets and blind signing - -When working with dangerous contracts that handle a lot of money, users are encouraged to use hardware wallets like [Ledger](https://www.ledger.com/). Hardware wallets cannot decode binary messages to confirm to the user what they're actually signing. Tact supports textual messages for this reason, since they're human readable and can easily be confirmed with users, eliminating phishing risks. - -Textual messages are limited because they cannot contain arguments. Future versions of Tact will add this functionality. - -## Using the comment field - -If you've ever made a transfer using a TON wallet, you probably noticed that you can add a *comment* (also known as a *memo* or a *tag*). This is how textual messages are sent. - -Receivers for textual messages just define the string that they expect. Tact automatically does string matching and calls the matching receiver when a comment message arrives.`,B=`import "@stdlib/deploy"; - -contract Receivers with Deployable { - - val: Int as int64; - - init() { - self.val = 0; - } - - // this receiver is called when the string "increment" is received in an incoming string comment message - receive("increment") { - self.val = self.val + 1; - } - - // this receiver is called when the string "decrement" is received in an incoming string comment message - receive("decrement") { - self.val = self.val - 1; - } - - // this receiver is called when the string "increment by 2" is received in an incoming string comment message - receive("increment by 2") { - self.val = self.val + 2; - } - - // if none of the previous receivers match the comment string, this one is called - receive(msg: String) { - dump("unknown textual message received:"); - dump(msg); - } - - get fun value(): Int { - return self.val; - } -}`;function x(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function m(){const r=a.Cell.fromBase64("te6ccgECEwEAAx4AART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHKP8ntVBAEAgFYCgsCru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAUGAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAcC/iD5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuupVbpH/bMeAggvCFkVsb9ZQ/0oU7tmAzisrPrjnR9zVUnO+SIlWplFrMPrqVW6V/2zHggvBtBDeiHZ7wNqzBK6tO44aAnxVS5ZTOZzbE9qDiFjAoUbrjAiAICQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAAMMKYCf9sxAHLXScIfjjGAINchjQhdW5rbm93biB0ZXh0dWFsIG1lc3NhZ2UgcmVjZWl2ZWQ6g/hQw/hQwf9sx4DAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjm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UAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTSPwEx4DD4KNcLCoMJuvLgids8FAACcNsuYkA=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:r,data:i}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:M});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=a.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,i,n){let s=null;if(n==="increment"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="decrement"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="increment by 2"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),typeof n=="string"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(s=a.beginCell().store(x(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:s})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function D(r,e,t){let i;v(r,g,o=>t(2,i=o));let n,s;return b(g,i={markdown:I,tactCode:B,deploy:async()=>{const o=await p.Blockchain.create(),A=await o.treasury("deployer");n=A.getSender(),s=o.openContract(await l.fromInit());const u={[A.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],u,[await s.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await s.send(n,{value:a.toNano(1)},"increment")],decrement:async()=>[await s.send(n,{value:a.toNano(1)},"decrement")],"increment by 2":async()=>[await s.send(n,{value:a.toNano(1)},"increment by 2")],"increment by 3":async()=>[await s.send(n,{value:a.toNano(1)},"increment by 3")]},getters:{value:async()=>await s.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},i),[]}class T extends h{constructor(e){super(),C(this,e,D,null,f,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.bcb73eb2.js b/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.bcb73eb2.js new file mode 100644 index 0000000..2c256a2 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-03-textual-messages-page.svelte.bcb73eb2.js @@ -0,0 +1,54 @@ +var p=Object.defineProperty;var y=(i,e,t)=>e in i?p(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var l=(i,e,t)=>(y(i,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as w,s as h,I as C,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g as m,s as g}from"../chunks/store.476c3091.js";import{d as I}from"../chunks/index.c056099e.js";const b=`# Textual Messages + +Most of the messages we saw in the previous example were defined with the \`message\` keyword. They are considered _binary_ messages. This means that when somebody wants to send them, they serialize them into bits and bytes of binary data. + +The disadvantage with binary messages is that they're not human readable. + +## Hardware wallets and blind signing + +When working with dangerous contracts that handle a lot of money, users are encouraged to use hardware wallets like [Ledger](https://www.ledger.com/). Hardware wallets cannot decode binary messages to confirm to the user what they're actually signing. + +Tact supports textual messages for this reason, since they're human readable and can easily be confirmed with users, eliminating phishing risks. + +**Textual messages are limited because they cannot contain arguments.** Future versions of Tact will add this functionality. + +## Using the comment field + +If you've ever made a transfer using a TON wallet, you probably noticed that you can add a _comment_ (also known as a _memo_ or a _tag_). This is how textual messages are sent. + +Receivers for textual messages just define the string that they expect. Tact automatically does string matching and calls the matching receiver when a comment message arrives. +`,B=`import "@stdlib/deploy"; + +contract Receivers with Deployable { + + val: Int as int64; + + init() { + self.val = 0; + } + + // this receiver is called when the string "increment" is received in an incoming string comment message + receive("increment") { + self.val = self.val + 1; + } + + // this receiver is called when the string "decrement" is received in an incoming string comment message + receive("decrement") { + self.val = self.val - 1; + } + + // this receiver is called when the string "increment by 2" is received in an incoming string comment message + receive("increment by 2") { + self.val = self.val + 2; + } + + // if none of the previous receivers match the comment string, this one is called + receive(msg: String) { + dump("unknown textual message received:"); + dump(msg); + } + + get fun value(): Int { + return self.val; + } +}`;function x(i){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(i.queryId,64)}}async function A(){const i=a.Cell.fromBase64("te6ccgECFAEAAzkAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAco/ye1UEQQCAVgLDAKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAFBgE6bW0ibr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cCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHKP8ntVBQNAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcBEOAv4g+QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqVW6R/2zHgIILwhZFbG/WUP9KFO7ZgM4rKz6450fc1VJzvkiJVqZRazD66lVulf9sx4ILwbQQ3oh2e8DaswSurTuOGgJ8VUuWUzmc2xPag4hYwKFG64wIgEA8ActdJwh+OMYAg1yGNCF1bmtub3duIHRleHR1YWwgbWVzc2FnZSByZWNlaXZlZDqD+FDD+FDB/2zHgMAAMMKYCf9sxATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBIByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTSPwEx4DD4KNcLCoMJuvLgids8FQACcCfBbSE=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:i,data:r}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},z=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],D=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],Q=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"decrement"}},{receiver:"internal",message:{kind:"text",text:"increment by 2"}},{receiver:"internal",message:{kind:"text"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:z,getters:D,receivers:Q,errors:k});this.address=e,this.init=t}static async init(){return await A()}static async fromInit(){const e=await A(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,r,n){let s=null;if(n==="increment"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="decrement"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="increment by 2"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),typeof n=="string"&&(s=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(s=a.beginCell().store(x(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:s})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}}function H(i,e,t){let r;C(i,g,o=>t(2,r=o));let n,s;return v(g,r={markdown:b,tactCode:B,deploy:async()=>{const o=await I.Blockchain.create(),d=await o.treasury("deployer");n=d.getSender(),s=o.openContract(await c.fromInit());const u={[d.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],u,[await s.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await s.send(n,{value:a.toNano(1)},"increment")],decrement:async()=>[await s.send(n,{value:a.toNano(1)},"decrement")],"increment by 2":async()=>[await s.send(n,{value:a.toNano(1)},"increment by 2")],"increment by 3":async()=>[await s.send(n,{value:a.toNano(1)},"increment by 3")]},getters:{value:async()=>await s.getValue()},prev:m(import.meta.url).prev,next:m(import.meta.url).next},r),[]}class K extends f{constructor(e){super(),w(this,e,H,null,h,{})}}export{K as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.17eacec4.js b/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.17eacec4.js deleted file mode 100644 index aadf877..0000000 --- a/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.17eacec4.js +++ /dev/null @@ -1,62 +0,0 @@ -var w=Object.defineProperty;var y=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var A=(s,e,t)=>(y(s,typeof e!="symbol"?e+"":e,t),t);import{S as p,i as I,s as B,I as h,ac as C}from"../chunks/index.9fe14626.js";import{d as n,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as f}from"../chunks/index.78404594.js";const M=`# Arrays - -You can implement simple arrays in Tact by relying on the map type. - -To create an array, define a map with \`Int\` type as key. The key will hold the index in the array. Add another length variable to rememebr how many items are in the array. - -The example contract records the last 5 timestamps of when the \`timer\` message was received. The timestamps are held in a cyclical array implemented as a map. - -## Limit the number of items - -Maps are designed to hold a limited number of items. Only use a map if you know the upper bound of items that it may hold. It's also a good idea to [write a test](https://github.com/tact-lang/tact-emulator) to add the maximum number of elements to the map and see how gas behaves under stress. - -If the number of items is unbounded and can potentially grow to billions, you'll need to architect your contract differently. We will discuss unbounded arrays later on under the topic of contract sharding.`,b=`import "@stdlib/deploy"; - -// this contract records the last 5 timestamps of when "timer" message was received -contract Arrays with Deployable { - - const MaxSize: Int = 5; - arr: map; // this is our array implemented with a map - arrLength: Int as uint8 = 0; - arrStart: Int as uint8 = 0; // our array is cyclic - - init() {} - - // push an item to the end of the array - fun arrPush(item: Int) { - if (self.arrLength < self.MaxSize) { - self.arr.set(self.arrLength, item); - self.arrLength = self.arrLength + 1; - } else { - self.arr.set(self.arrStart, item); - self.arrStart = (self.arrStart + 1) % self.MaxSize; - } - } - - // iterate over all items in the array and dump them - fun arrPrint() { - let i: Int = self.arrStart; - repeat (self.arrLength) { - dump(self.arr.get(i)!!); // !! tells the compiler this can't be null - i = (i + 1) % self.MaxSize; - } - } - - // record the timestamp when each "timer" message is received - receive("timer") { - let timestamp: Int = now(); - self.arrPush(timestamp); - } - - receive("dump") { - self.arrPrint(); - } - - get fun length(): Int { - return self.arrLength; - } - - get fun map(): map { - return self.arr; - } -}`;function E(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function m(){const s=n.Cell.fromBase64("te6ccgECFwEAA8cAART/APSkE/S88sgLAQIBYgIDAqLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgUCP0AMsHywfJ7VQSBAIBWAsMAq7tou37cCHXScIflTAg1wsf3gKSW3/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAkTDjDXAFBgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAHArj5ASCC8My+Jal7OGTGItLF4Hb3NKVIlZ1IECH/oa0nY5VtLA5Buo6IMPgj2zx/2zHggvCvBQNFC0d8IyperCDHUyaUMOJk7LRk63DYTO+HdU3eFbqOhds8f9sx4AgJAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAI4iwQWOHYEBASAQNVREMyFulVtZ9FowmMgBzwBBM/RC4gGkjiGBAQEgEDVURTMhbpVbWfRaMJjIAc8AQTP0QuICpHWpCFniWAFWUwGOpYEBAVRUAFIwQTP0DG+hlAHXADCSW23iIG7y0IDbPP4UMKR1qQjkMAoA3sghwQ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RMOMNcBURArj5ASCC8My+Jal7OGTGItLF4Hb3NKVIlZ1IECH/oa0nY5VtLA5Buo6IMPgj2zx/2zHggvCvBQNFC0d8IyperCDHUyaUMOJk7LRk63DYTO+HdU3eFbqOhds8f9sx4BQSAVZTAY6lgQEBVFQAUjBBM/QMb6GUAdcAMJJbbeIgbvLQgNs8/hQwpHWpCOQwEwDeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAI4iwQWOHYEBASAQNVREMyFulVtZ9FowmMgBzwBBM/RC4gGkjiGBAQEgEDVURTMhbpVbWfRaMJjIAc8AQTP0QuICpHWpCFniWAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAWAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAUjtRNDUAfhj0gABmvQE0wfTB1UgbBPgMPgo1wsKgwm68uCJ2zwYAAZtcCC6GUUc");let t=n.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:s,data:i}}const Q={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:Q});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=n.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,i,r){let a=null;if(r==="timer"&&(a=n.beginCell().storeUint(0,32).storeStringTail(r).endCell()),r==="dump"&&(a=n.beginCell().storeUint(0,32).storeStringTail(r).endCell()),r&&typeof r=="object"&&!(r instanceof n.Slice)&&r.$$type==="Deploy"&&(a=n.beginCell().store(E(r)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:a})}async getLength(e){let t=new n.TupleBuilder;return(await e.get("length",t.build())).stack.readBigNumber()}async getMap(e){let t=new n.TupleBuilder,i=(await e.get("map",t.build())).stack;return n.Dictionary.loadDirect(n.Dictionary.Keys.BigInt(257),n.Dictionary.Values.BigInt(257),i.readCellOpt())}}function H(s,e,t){let i;h(s,d,o=>t(2,i=o));let r,a;return C(d,i={markdown:M,tactCode:b,deploy:async()=>{const o=await f.Blockchain.create(),c=await o.treasury("deployer");r=c.getSender(),a=o.openContract(await l.fromInit());const u={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],u,[await a.send(c.getSender(),{value:n.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{timer:async()=>[await a.send(r,{value:n.toNano(1)},"timer")],dump:async()=>[await a.send(r,{value:n.toNano(1)},"dump")]},getters:{length:async()=>await a.getLength(),map:async()=>await a.getMap()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},i),[]}class v extends p{constructor(e){super(),I(this,e,H,null,B,{})}}export{v as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.865ed365.js b/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.865ed365.js new file mode 100644 index 0000000..abdb106 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-arrays-page.svelte.865ed365.js @@ -0,0 +1,63 @@ +var y=Object.defineProperty;var u=(r,e,t)=>e in r?y(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var o=(r,e,t)=>(u(r,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as f,s as h,I,ac as B}from"../chunks/index.9fe14626.js";import{d as n,g as c,s as d}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const b=`# Arrays + +You can implement simple arrays in Tact by using the \`map\` type. + +To create an array, define a map with an \`Int\` type as the key. This key will represent the index in the array. Additionally, include a variable to keep track of the number of items in the array. + +The example contract records the last five timestamps when the \`timer\` message was received. These timestamps are stored in a cyclical array, implemented as a map. + +## Limit the Number of Items + +Maps are designed to hold a limited number of items. Only use a map if you know the maximum number of items it will contain. It's also a good idea to [write a test](https://github.com/tact-lang/tact-emulator) to populate the map with its maximum number of elements and observe how gas consumption behaves under stress. + +If the number of items is unbounded and could potentially grow into the billions, you will need to architect your contract differently. We will discuss unbounded arrays later, under the topic of contract sharding. +`,E=`import "@stdlib/deploy"; + +// this contract records the last 5 timestamps of when "timer" message was received +contract Arrays with Deployable { + + const MaxSize: Int = 5; + arr: map; // this is our array implemented with a map + arrLength: Int as uint8 = 0; + arrStart: Int as uint8 = 0; // our array is cyclic + + init() {} + + // push an item to the end of the array + fun arrPush(item: Int) { + if (self.arrLength < self.MaxSize) { + self.arr.set(self.arrLength, item); + self.arrLength = self.arrLength + 1; + } else { + self.arr.set(self.arrStart, item); + self.arrStart = (self.arrStart + 1) % self.MaxSize; + } + } + + // iterate over all items in the array and dump them + fun arrPrint() { + let i: Int = self.arrStart; + repeat (self.arrLength) { + dump(self.arr.get(i)!!); // !! tells the compiler this can't be null + i = (i + 1) % self.MaxSize; + } + } + + // record the timestamp when each "timer" message is received + receive("timer") { + let timestamp: Int = now(); + self.arrPush(timestamp); + } + + receive("dump") { + self.arrPrint(); + } + + get fun length(): Int { + return self.arrLength; + } + + get fun map(): map { + return self.arr; + } +}`;function M(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function p(){const r=n.Cell.fromBase64("te6ccgECGAEAA+IAART/APSkE/S88sgLAQIBYgIDAqbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBQI/QAywfLB8ntVBMEAgFYDA0CoO2i7fsBkjB/4HAh10nCH5UwINcLH94gghCUapi2uo6oMNMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+DAAJEw4w1wBQYBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8BwK4+QEggvDMviWpezhkxiLSxeB29zSlSJWdSBAh/6GtJ2OVbSwOQbqOiDD4I9s8f9sx4ILwrwUDRQtHfCMqXqwgx1MmlDDiZOy0ZOtw2Ezvh3VN3hW6joXbPH/bMeAJCgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAIAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAI4iwQWOHYEBASAQNVREMyFulVtZ9FowmMgBzwBBM/RC4gGkjiGBAQEgEDVURTMhbpVbWfRaMJjIAc8AQTP0QuICpHWpCFniWAFWUwGOpYEBAVRUAFIwQTP0DG+hlAHXADCSW23iIG7y0IDbPP4UMKR1qQjk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AXBt2zx/4MAAkTDjDXAVEQK4+QEggvDMviWpezhkxiLSxeB29zSlSJWdSBAh/6GtJ2OVbSwOQbqOiDD4I9s8f9sx4ILwrwUDRQtHfCMqXqwgx1MmlDDiZOy0ZOtw2Ezvh3VN3hW6joXbPH/bMeAUEgFWUwGOpYEBAVRUAFIwQTP0DG+hlAHXADCSW23iIG7y0IDbPP4UMKR1qQjkMBMA3sghwQCYgC0BywcBowHeIYI4Mnyyc0EZ07epqh25jiBwIHGOFAR6qQymMCWoEqAEqgcCpCHAAEUw5jAzqgLPAY4rbwBwjhEjeqkIEm+MAaQDeqkEIMAAFOYzIqUDnFMCb4GmMFjLBwKlWeQwMeLJ0ACOIsEFjh2BAQEgEDVURDMhbpVbWfRaMJjIAc8AQTP0QuIBpI4hgQEBIBA1VEUzIW6VW1n0WjCYyAHPAEEz9ELiAqR1qQhZ4lgBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8FgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAXAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAUjtRNDUAfhj0gABmvQE0wfTB1UgbBPgMPgo1wsKgwm68uCJ2zwZAAZtcCAeOBIB");let t=n.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:r,data:i}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},k=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],Q=[{name:"length",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"map",arguments:[],returnType:{kind:"dict",key:"int",value:"int"}}],S=[{receiver:"internal",message:{kind:"text",text:"timer"}},{receiver:"internal",message:{kind:"text",text:"dump"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){o(this,"address");o(this,"init");o(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:k,getters:Q,receivers:S,errors:D});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=n.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,i,a){let s=null;if(a==="timer"&&(s=n.beginCell().storeUint(0,32).storeStringTail(a).endCell()),a==="dump"&&(s=n.beginCell().storeUint(0,32).storeStringTail(a).endCell()),a&&typeof a=="object"&&!(a instanceof n.Slice)&&a.$$type==="Deploy"&&(s=n.beginCell().store(M(a)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:s})}async getLength(e){let t=new n.TupleBuilder;return(await e.get("length",t.build())).stack.readBigNumber()}async getMap(e){let t=new n.TupleBuilder,i=(await e.get("map",t.build())).stack;return n.Dictionary.loadDirect(n.Dictionary.Keys.BigInt(257),n.Dictionary.Values.BigInt(257),i.readCellOpt())}}function v(r,e,t){let i;I(r,d,l=>t(2,i=l));let a,s;return B(d,i={markdown:b,tactCode:E,deploy:async()=>{const l=await C.Blockchain.create(),m=await l.treasury("deployer");a=m.getSender(),s=l.openContract(await A.fromInit());const g={[m.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],g,[await s.send(m.getSender(),{value:n.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{timer:async()=>[await s.send(a,{value:n.toNano(1)},"timer")],dump:async()=>[await s.send(a,{value:n.toNano(1)},"dump")]},getters:{length:async()=>await s.getLength(),map:async()=>await s.getMap()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class L extends w{constructor(e){super(),f(this,e,v,null,h,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.66041234.js b/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.66041234.js deleted file mode 100644 index b5fd7a5..0000000 --- a/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.66041234.js +++ /dev/null @@ -1,41 +0,0 @@ -var m=Object.defineProperty;var y=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>(y(i,typeof e!="symbol"?e+"":e,t),t);import{S as I,i as C,s as B,I as h,ac as b}from"../chunks/index.9fe14626.js";import{d as r,g,s as d}from"../chunks/store.d3ab02ad.js";import{d as p}from"../chunks/index.78404594.js";const f=`# Current Time - -Many blockchains rely on the current *block number* to give a sense of progress to contracts. This approach isn't well suited for TON because contracts on TON can run on multiple workchains and those may have different block seqnos. - -In TON, the best practice is to rely on the current time instead, which is available by calling \`now()\`. Standard [unix time](https://en.wikipedia.org/wiki/Unix_time) is returned, meaning the number of seconds since 1 January 1970. - -Transactions are not executed until validators add them to a new block. The current time will therefore be the timestamp of the new block when called in the context of a *receiver*. - -If you need to store the time in state or encode it in a message, use \`Int as uint32\`. - -If you need to compare two points in time simply subtract the earlier from the later. This will give you the number of seconds between the two. Divide by 60 to get the difference in minutes, by 60 * 60 to get the difference in hours and by 24 * 60 * 60 to get the difference in days.`,D=`import "@stdlib/deploy"; - -contract CurrentTime with Deployable { - - deployTime: Int as uint32; - - init() { - self.deployTime = now(); // returns unix time, the number of seconds since the epoch - } - - receive("wait 10s") { - require(now() - self.deployTime > 10, "Did not wait long enough"); - dump("thanks for waiting 10 seconds"); - } - - receive("wait 10d") { - require(now() - self.deployTime > 10*24*60*60, "Did not wait long enough"); - dump("thanks for waiting 10 days"); - } - - get fun unixTime(): Int { - return now(); - } - - get fun stringTime(): String { - let sb: StringBuilder = beginString(); - sb.append(now().toString()); - sb.append(" seconds elapsed since 1 January 1970"); - return sb.toString(); - } -}`;function M(i){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(i.queryId,64)}}async function u(){const i=r.Cell.fromBase64("te6ccgECFgEABEMAART/APSkE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7VGm2ebZ4YwFhcClNAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFnbPDDI+EMBzH8BygABAcsfye1UFhECru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcBQSAf75ASCC8KHHX80dXy2XzNgCLuha13rFdURhIAx13G5NlUqaxhr1uo4zMIIA5ab4IyKhwgry9I0HXRoYW5rcyBmb3Igd2FpdGluZyAxMCBzZWNvbmRzg/hQwf9sx4ILwXG5tb1rb1e40S1J67KvvvBM4kJwQ30sPBzZ4BryZT6C6EwBsjjOCAOWm+CMioYIIDS8AvPL0jQadGhhbmtzIGZvciB3YWl0aW5nIDEwIGRheXOD+FDB/2zHgAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABUAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBPO1E0NQB+GPSAAGU0x8BMeAw+CjXCwqDCbry4InbPBcABPgjrgbHXQ==");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:i,data:o}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},58790:{message:"Did not wait long enough"}};class c{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:v});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=r.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,o,n){let s=null;if(n==="wait 10s"&&(s=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="wait 10d"&&(s=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof r.Slice)&&n.$$type==="Deploy"&&(s=r.beginCell().store(M(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:s})}async getUnixTime(e){let t=new r.TupleBuilder;return(await e.get("unixTime",t.build())).stack.readBigNumber()}async getStringTime(e){let t=new r.TupleBuilder;return(await e.get("stringTime",t.build())).stack.readString()}}function Q(i,e,t){let o;h(i,d,a=>t(2,o=a));let n,s;return b(d,o={markdown:f,tactCode:D,deploy:async()=>{const a=await p.Blockchain.create(),l=await a.treasury("deployer");n=l.getSender(),s=a.openContract(await c.fromInit());const w={[l.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],w,[await s.send(l.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"wait 10s":async()=>[await s.send(n,{value:r.toNano(1)},"wait 10s")],"wait 10d":async()=>[await s.send(n,{value:r.toNano(1)},"wait 10d")]},getters:{unixTime:async()=>await s.getUnixTime(),stringTime:async()=>await s.getStringTime()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class S extends I{constructor(e){super(),C(this,e,Q,null,B,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.b35ef983.js b/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.b35ef983.js new file mode 100644 index 0000000..9ef12f2 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-current-time-page.svelte.b35ef983.js @@ -0,0 +1,41 @@ +var u=Object.defineProperty;var y=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(y(s,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as C,s as I,I as B,ac as f}from"../chunks/index.9fe14626.js";import{d as a,g as c,s as g}from"../chunks/store.476c3091.js";import{d as h}from"../chunks/index.c056099e.js";const b=`# Current Time + +Many blockchains rely on the current *block number* to give a sense of progress to contracts. This approach isn't well suited for TON because contracts on TON can run on multiple workchains and those may have different block seqnos. + +In TON, the best practice is to rely on the current time instead, which is available by calling \`now()\`. Standard [unix time](https://en.wikipedia.org/wiki/Unix_time) is returned, meaning the number of seconds since 1 January 1970. + +Transactions are not executed until validators add them to a new block. The current time will therefore be the timestamp of the new block when called in the context of a *receiver*. + +If you need to store the time in state or encode it in a message, use \`Int as uint32\`. + +If you need to compare two points in time simply subtract the earlier from the later. This will give you the number of seconds between the two. Divide by 60 to get the difference in minutes, by 60 * 60 to get the difference in hours and by 24 * 60 * 60 to get the difference in days.`,M=`import "@stdlib/deploy"; + +contract CurrentTime with Deployable { + + deployTime: Int as uint32; + + init() { + self.deployTime = now(); // returns unix time, the number of seconds since the epoch + } + + receive("wait 10s") { + require(now() - self.deployTime > 10, "Did not wait long enough"); + dump("thanks for waiting 10 seconds"); + } + + receive("wait 10d") { + require(now() - self.deployTime > 10*24*60*60, "Did not wait long enough"); + dump("thanks for waiting 10 days"); + } + + get fun unixTime(): Int { + return now(); + } + + get fun stringTime(): String { + let sb: StringBuilder = beginString(); + sb.append(now().toString()); + sb.append(" seconds elapsed since 1 January 1970"); + return sb.toString(); + } +}`;function T(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function m(){const s=a.Cell.fromBase64("te6ccgECFwEABF4AART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcsfye1UEAQCAVgKCwKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAFBgE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwHAf75ASCC8KHHX80dXy2XzNgCLuha13rFdURhIAx13G5NlUqaxhr1uo4zMIIA5ab4IyKhwgry9I0HXRoYW5rcyBmb3Igd2FpdGluZyAxMCBzZWNvbmRzg/hQwf9sx4ILwXG5tb1rb1e40S1J67KvvvBM4kJwQ30sPBzZ4BryZT6C6CQHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAIAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAGyOM4IA5ab4IyKhgggNLwC88vSNBp0aGFua3MgZm9yIHdhaXRpbmcgMTAgZGF5c4P4UMH/bMeACASAMDQIBSBUWAg+1Rptnm2eGMBASAgEgDg8CD7E8Ns82zwxgEBEAubL0YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAE87UTQ1AH4Y9IAAZ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i6F8DAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydACD7VGm2ebZ4YwFxgCmNAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFnbPPLggsj4QwHMfwHKAAEByx/J7VQXEQKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAUEgH++QEggvChx1/NHV8tl8zYAi7oWtd6xXVEYSAMddxuTZVKmsYa9bqOMzCCAOWm+CMiocIK8vSNB10aGFua3MgZm9yIHdhaXRpbmcgMTAgc2Vjb25kc4P4UMH/bMeCC8FxubW9a29XuNEtSeuyr77wTOJCcEN9LDwc2eAa8mU+guhMAbI4zggDlpvgjIqGCCA0vALzy9I0GnRoYW5rcyBmb3Igd2FpdGluZyAxMCBkYXlzg/hQwf9sx4AE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwVAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABYAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBPO1E0NQB+GPSAAGU0x8BMeAw+CjXCwqDCbry4InbPBgABPgj3pF7Kw==");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},58790:{message:"Did not wait long enough"}},D=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],k=[{name:"unixTime",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"stringTime",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}}],x=[{receiver:"internal",message:{kind:"text",text:"wait 10s"}},{receiver:"internal",message:{kind:"text",text:"wait 10d"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:D,getters:k,receivers:x,errors:v});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=a.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,r,n){let i=null;if(n==="wait 10s"&&(i=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="wait 10d"&&(i=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(i=a.beginCell().store(T(n)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:i})}async getUnixTime(e){let t=new a.TupleBuilder;return(await e.get("unixTime",t.build())).stack.readBigNumber()}async getStringTime(e){let t=new a.TupleBuilder;return(await e.get("stringTime",t.build())).stack.readString()}}function S(s,e,t){let r;B(s,g,o=>t(2,r=o));let n,i;return f(g,r={markdown:b,tactCode:M,deploy:async()=>{const o=await h.Blockchain.create(),d=await o.treasury("deployer");n=d.getSender(),i=o.openContract(await A.fromInit());const p={[d.address.toString()]:"deployer",[i.address.toString()]:"contract"};return[[i],p,[await i.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"wait 10s":async()=>[await i.send(n,{value:a.toNano(1)},"wait 10s")],"wait 10d":async()=>[await i.send(n,{value:a.toNano(1)},"wait 10d")]},getters:{unixTime:async()=>await i.getUnixTime(),stringTime:async()=>await i.getStringTime()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},r),[]}class z extends w{constructor(e){super(),C(this,e,S,null,I,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.b75e8d41.js b/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.b75e8d41.js new file mode 100644 index 0000000..a6ebf81 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.b75e8d41.js @@ -0,0 +1,63 @@ +var y=Object.defineProperty;var g=(s,e,t)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(g(s,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as f,s as h,I,ac as C}from"../chunks/index.9fe14626.js";import{d as o,g as p,s as A}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const b=`# Decimal Point + +All numbers in Tact are integers. Floating point types are not used in smart contracts because they're [unpredictable](https://learn.microsoft.com/en-us/cpp/build/why-floating-point-numbers-may-lose-precision). + +Arithmetics with dollars, for example, requires 2 decimal places. How can we represent the number \`1.25\` if we can only work with integers? The answer is to work with _cents_. So \`1.25\` becomes \`125\`. We just remember that the two lowest digits are coming after the decimal point. + +In the same way, working with TON coins has 9 decimal places instead of 2. So the amount 1.25 TON is actually the number \`1250000000\` - we call these _nano-tons_ instead of cents. + +## Calculating interest + +This example calculates the earned interest over a deposit of 500 TON coins. The yearly interest rate in the example is 3.25%. + +Since we can't hold the number \`3.25\` we will use thousandth of a percent as unit ([percent-mille](https://en.wikipedia.org/wiki/Per_cent_mille)). So 3.25% becomes \`3250\` (3.25 \\* 1000). + +On withdraw, to calculate earned interest, we multiply the amount by the fraction of a year that passed (duration in seconds divided by total seconds in a year) and then by the interest rate divided by 100,000 (100% in percent-mille, meaning 100 \\* 1000). + +
+
+ Info: Notice that total is returned in nano-tons. + +
+`,E=`import "@stdlib/deploy"; + +message Deposit { + amount: Int as coins; // nano-tons +} + +message Withdraw { + amount: Int as coins; // nano-tons +} + +const SecondsPerYear: Int = 365 * 24 * 60 * 60; + +contract Interest with Deployable { + + interestPercent: Int as int32; + depositTime: Int as uint32 = 0; // seconds since the epoch + depositAmount: Int as coins = 0; // nano-tons + totalEarned: Int as coins = 0; // nano-tons + + init() { + self.interestPercent = 3250; // 3.25% yearly interest rate in percent-mille + } + + receive(msg: Deposit) { + require(self.depositAmount == 0, "No multiple deposits"); + self.depositTime = now(); + self.depositAmount = msg.amount; + } + + receive(msg: Withdraw) { + require(msg.amount >= self.depositAmount, "Cannot withdraw more than deposit"); + self.depositAmount = self.depositAmount - msg.amount; + let durationSeconds: Int = now() - self.depositTime; + let earned: Int = msg.amount * durationSeconds * self.interestPercent / SecondsPerYear / 100000; + dump(earned); + self.totalEarned = self.totalEarned + earned; + } + + get fun total(): Int { + return self.totalEarned; // in nano-tons + } +}`;function k(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function M(s){return e=>{let t=e;t.storeUint(569292295,32),t.storeCoins(s.amount)}}function D(s){return e=>{let t=e;t.storeUint(195467089,32),t.storeCoins(s.amount)}}async function m(){const s=o.Cell.fromBase64("te6ccgECEwEAA2oAART/APSkE/S88sgLAQIBYgIDAq7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s88uCCyPhDAcx/AcoAVTBQNMofyx8B+gIB+gLJ7VQOBAIBWAoLAvYBkjB/4HAh10nCH5UwINcLH94gghAh7rYHuo4hMNMfAYIQIe62B7ry4IH6AAExM4IAiTsCwAAS8vT4I1l/4CCCEAuml1G64wKCEJRqmLa6jqfTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gMHAFBgF2MNMfAYIQC6aXUbry4IH6AAExggCmOFMTvvL0USKh+CMkoROoJKiCCeEzgKkEggGGoKkEINs8/hQwoH8HATptbSJus5lbIG7y0IBvIgGRMuIQ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fpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8VRPbPPLggsj4QwHMfwHKAFUwUDTKH8sfAfoCAfoCye1UEw0C9gGSMH/gcCHXScIflTAg1wsf3iCCECHutge6jiEw0x8BghAh7rYHuvLggfoAATEzggCJOwLAABLy9PgjWX/gIIIQC6aXUbrjAoIQlGqYtrqOp9MfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+AwcBEOATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPA8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAF2MNMfAYIQC6aXUbry4IH6AAExggCmOFMTvvL0USKh+CMkoROoJKiCCeEzgKkEggGGoKkEINs8/hQwoH8SAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydABTO1E0NQB+GPSAAGc0h/TH/oA+gBVMGwU4DD4KNcLCoMJuvLgids8FAAQcFMAgQyyVSBx2iG0");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:s,data:i}}const Q={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},35131:{message:"No multiple deposits"},42552:{message:"Cannot withdraw more than deposit"}},H=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Deposit",header:569292295,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}}]},{name:"Withdraw",header:195467089,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}}]}],v=[{name:"total",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],T=[{receiver:"internal",message:{kind:"typed",type:"Deposit"}},{receiver:"internal",message:{kind:"typed",type:"Withdraw"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class d{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Deposit",header:569292295,fields:[]},{name:"Withdraw",header:195467089,fields:[]}],types:H,getters:v,receivers:T,errors:Q});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=o.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,i,n){let a=null;if(n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deposit"&&(a=o.beginCell().store(M(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Withdraw"&&(a=o.beginCell().store(D(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(a=o.beginCell().store(k(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:a})}async getTotal(e){let t=new o.TupleBuilder;return(await e.get("total",t.build())).stack.readBigNumber()}}function N(s,e,t){let i;I(s,A,r=>t(2,i=r));let n,a;return C(A,i={markdown:b,tactCode:E,deploy:async()=>{const r=await B.Blockchain.create(),c=await r.treasury("deployer");n=c.getSender(),a=r.openContract(await d.fromInit());const u={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],u,[await a.send(c.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Deposit{500}":async()=>[await a.send(n,{value:o.toNano(1)},{$$type:"Deposit",amount:o.toNano(500)})],"Withdraw{500}":async()=>[await a.send(n,{value:o.toNano(1)},{$$type:"Withdraw",amount:o.toNano(500)})]},getters:{total:async()=>await a.getTotal()},prev:p(import.meta.url).prev,next:p(import.meta.url).next},i),[]}class F extends w{constructor(e){super(),f(this,e,N,null,h,{})}}export{F as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.bde99b18.js b/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.bde99b18.js deleted file mode 100644 index 564be66..0000000 --- a/docs/_app/immutable/entry/(examples)-04-decimal-point-page.svelte.bde99b18.js +++ /dev/null @@ -1,58 +0,0 @@ -var m=Object.defineProperty;var p=(s,e,t)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var A=(s,e,t)=>(p(s,typeof e!="symbol"?e+"":e,t),t);import{S as h,i as y,s as C,I,ac as f}from"../chunks/index.9fe14626.js";import{d as o,g as d,s as g}from"../chunks/store.d3ab02ad.js";import{d as B}from"../chunks/index.78404594.js";const b=`# Decimal Point - -All numbers in Tact are integers. Floating point types are not used in smart contracts because they're [unpredictable](https://learn.microsoft.com/en-us/cpp/build/why-floating-point-numbers-may-lose-precision). - -Arithmetics with dollars, for example, requires 2 decimal places. How can we represent the number \`1.25\` if we can only work with integers? The answer is to work with *cents*. So \`1.25\` becomes \`125\`. We just remember that the two lowest digits are coming after the decimal point. - -In the same way, working with TON coins has 9 decimal places instead of 2. So the amount 1.25 TON is actually the number \`1250000000\` - we call these *nano-tons* instead of cents. - -## Calculating interest - -This example calculates the earned interest over a deposit of 500 TON coins. The yearly interest rate in the example is 3.25%. - -Since we can't hold the number \`3.25\` we will use thousandth of a percent as unit ([percent-mille](https://en.wikipedia.org/wiki/Per_cent_mille)). So 3.25% becomes \`3250\` (3.25 * 1000). - -On withdraw, to calculate earned interest, we multiply the amount by the fraction of a year that passed (duration in seconds divided by total seconds in a year) and then by the interest rate divided by 100,000 (100% in percent-mille, meaning 100 * 1000). - -Notice that total is returned in nano-tons.`,H=`import "@stdlib/deploy"; - -message Deposit { - amount: Int as coins; // nano-tons -} - -message Withdraw { - amount: Int as coins; // nano-tons -} - -const SecondsPerYear: Int = 365 * 24 * 60 * 60; - -contract Interest with Deployable { - - interestPercent: Int as int32; - depositTime: Int as uint32 = 0; // seconds since the epoch - depositAmount: Int as coins = 0; // nano-tons - totalEarned: Int as coins = 0; // nano-tons - - init() { - self.interestPercent = 3250; // 3.25% yearly interest rate in percent-mille - } - - receive(msg: Deposit) { - require(self.depositAmount == 0, "No multiple deposits"); - self.depositTime = now(); - self.depositAmount = msg.amount; - } - - receive(msg: Withdraw) { - require(msg.amount >= self.depositAmount, "Cannot withdraw more than deposit"); - self.depositAmount = self.depositAmount - msg.amount; - let durationSeconds: Int = now() - self.depositTime; - let earned: Int = msg.amount * durationSeconds * self.interestPercent / SecondsPerYear / 100000; - dump(earned); - self.totalEarned = self.totalEarned + earned; - } - - get fun total(): Int { - return self.totalEarned; // in nano-tons - } -}`;function Q(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function D(s){return e=>{let t=e;t.storeUint(569292295,32),t.storeCoins(s.amount)}}function M(s){return e=>{let t=e;t.storeUint(195467089,32),t.storeCoins(s.amount)}}async function u(){const s=o.Cell.fromBase64("te6ccgECEwEAA1EAART/APSkE/S88sgLAQIBYgIDAqrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s8MMj4QwHMfwHKAFUwUDTKH8sfAfoCAfoCye1UDgQCAVgKCwKocCHXScIflTAg1wsf3gKSW3/gIYIQIe62B7qOITHTHwGCECHutge68uCB+gABMTOCAIk7AsAAEvL0+CNZf+AhghALppdRuuMCAYIQlGqYtrrjAjBwBQYBdjHTHwGCEAuml1G68uCB+gABMYIApjhTE77y9FEiofgjJKETqCSoggnhM4CpBIIBhqCpBCDbPP4UMKB/BwFa0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/CADeyCHBAJ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MDbwT4YQL4Yts8VRPbPDDI+EMBzH8BygBVMFA0yh/LHwH6AgH6AsntVBMNAqhwIddJwh+VMCDXCx/eApJbf+AhghAh7rYHuo4hMdMfAYIQIe62B7ry4IH6AAExM4IAiTsCwAAS8vT4I1l/4CGCEAuml1G64wIBghCUapi2uuMCMHARDgFa0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/DwHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAQAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAXYx0x8BghALppdRuvLggfoAATGCAKY4UxO+8vRRIqH4IyShE6gkqIIJ4TOAqQSCAYagqQQg2zz+FDCgfxIA3sghwQCYgC0BywcBowHeIYI4Mnyyc0EZ07epqh25jiBwIHGOFAR6qQymMCWoEqAEqgcCpCHAAEUw5jAzqgLPAY4rbwBwjhEjeqkIEm+MAaQDeqkEIMAAFOYzIqUDnFMCb4GmMFjLBwKlWeQwMeLJ0AFM7UTQ1AH4Y9IAAZzSH9Mf+gD6AFUwbBTgMPgo1wsKgwm68uCJ2zwUABBwUwCBDLJVILAISnU=");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const T={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},35131:{message:"No multiple deposits"},42552:{message:"Cannot withdraw more than deposit"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Deposit",header:569292295,fields:[]},{name:"Withdraw",header:195467089,fields:[]}],errors:T});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=o.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,r,n){let a=null;if(n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deposit"&&(a=o.beginCell().store(D(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Withdraw"&&(a=o.beginCell().store(M(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(a=o.beginCell().store(Q(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getTotal(e){let t=new o.TupleBuilder;return(await e.get("total",t.build())).stack.readBigNumber()}}function E(s,e,t){let r;I(s,g,i=>t(2,r=i));let n,a;return f(g,r={markdown:b,tactCode:H,deploy:async()=>{const i=await B.Blockchain.create(),c=await i.treasury("deployer");n=c.getSender(),a=i.openContract(await l.fromInit());const w={[c.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],w,[await a.send(c.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Deposit{500}":async()=>[await a.send(n,{value:o.toNano(1)},{$$type:"Deposit",amount:o.toNano(500)})],"Withdraw{500}":async()=>[await a.send(n,{value:o.toNano(1)},{$$type:"Withdraw",amount:o.toNano(500)})]},getters:{total:async()=>await a.getTotal()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},r),[]}class O extends h{constructor(e){super(),y(this,e,E,null,C,{})}}export{O as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.23d826a6.js b/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.23d826a6.js deleted file mode 100644 index 0b67c91..0000000 --- a/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.23d826a6.js +++ /dev/null @@ -1,57 +0,0 @@ -var I=Object.defineProperty;var w=(r,e,t)=>e in r?I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var c=(r,e,t)=>(w(r,typeof e!="symbol"?e+"":e,t),t);import{S as B,i as y,s as m,I as f,ac as h}from"../chunks/index.9fe14626.js";import{d as o,g as u,s as d}from"../chunks/store.d3ab02ad.js";import{d as p}from"../chunks/index.78404594.js";const b=`# Functions - -To make your code more readable and promote code reuse, you're encouraged to divide it into functions. - -Functions in Tact start with the \`fun\` keyword. Functions can receive multiple input arguments and can optionally return a single output value. You can return a \`struct\` if you want to return multiple values. - -Global static functions are defined outside the scope of contracts. You can call them from anywhere, but they can't access the contract or any of the contract state variables. - -Contract methods are functions that are defined inside the scope of a contract. You can call them only from other contract methods like *receivers* and *getters*. They can access the contract's state variables.`,v=`import "@stdlib/deploy"; - -struct TokenInfo { - ticker: String; - decimals: Int as uint8; -} - -// this is a global static function that can be called from anywhere -fun average(a: Int, b: Int): Int { - return (a + b) / 2; -} - -contract Functions with Deployable { - - deployer: Address; - - init() { - self.deployer = sender(); - } - - // this contract method can be called from within this contract and access its variables - fun onlyDeployer() { - require(sender() == self.deployer, "Only the deployer is permitted here"); - } - - receive("priviliged") { - self.onlyDeployer(); - } - - // this contract method returns multiple return values using a struct - fun getInfo(index: Int): TokenInfo { - if (index == 1) { - return TokenInfo{ticker: "TON", decimals: 9}; - } - if (index == 2) { - return TokenInfo{ticker: "ETH", decimals: 18}; - } - return TokenInfo{ticker: "unknown", decimals: 0}; - } - - receive("best L1") { - let best: TokenInfo = self.getInfo(1); - reply(best.ticker.asComment()); - } - - get fun result(): Int { - return average(1, 10); - } -}`;function D(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function g(){const r=o.Cell.fromBase64("te6ccgECFwEAA8MAART/APSkE/S88sgLAQIBYgIDAsrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsntVA8EAgEgDQ4Cru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAoFAqj5ASCC8GeV8BwFgvT7ogGXybH4Kw6Ih0EF6xpKtG65cqOrM8s/uo6GMNs8f9sx4ILwtWslXE4ZY81SKUhkH+u90gsBVEaHuaelNJ7pBt1kTNO64wIGBwAYggDTGPhCUiDHBfL0Ayxx2zww2zx/+EJwWAOAQgFtbds8f9sxCAkKAEIgwAGXMIs1RPToeeDAApeLNFVEiIAS4It3Vua25vd26HABQshwAcsfbwABb4xtb4wB2zxvIgHJkyFus5YBbyJZzMnoMQsByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADAC6INdKIddJlyDCACLCALGOSgNvIoB/Is8xqwKhBasCUVW2CCDCAJwgqgIV1xhQM88WQBTeWW8CU0GhwgCZyAFvAlBEoaoCjhIxM8IAmdQw0CDXSiHXSZJwIOLi6F8DAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu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JVxOGWPNUilIZB/rvdILAVRGh7mnpTSe6QbdZEzTuuMCFBADLHHbPDDbPH/4QnBYA4BCAW1t2zx/2zETERUBQshwAcsfbwABb4xtb4wB2zxvIgHJkyFus5YBbyJZzMnoMRIAuiDXSiHXSZcgwgAiwgCxjkoDbyKAfyLPMasCoQWrAlFVtgggwgCcIKoCFdcYUDPPFkAU3llvAlNBocIAmcgBbwJQRKGqAo4SMTPCAJnUMNAg10oh10mScCDi4uhfAwBCIMABlzCLNUT06HngwAKXizRVRIiAEuCLd1bmtub3duhwABiCANMY+EJSIMcF8vQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAF27UTQ1AH4Y9IAAY4g+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDHgMPgo1wsKgwm68uCJ2zwYAAT4QiNILm4=");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const a=t.endCell();return{code:r,data:a}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},54040:{message:"Only the deployer is permitted here"}};class A{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"TokenInfo",header:null,fields:[]}],errors:E});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=o.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,a,n){let s=null;if(n==="priviliged"&&(s=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="best L1"&&(s=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(s=o.beginCell().store(D(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:s})}async getResult(e){let t=new o.TupleBuilder;return(await e.get("result",t.build())).stack.readBigNumber()}}function Q(r,e,t){let a;f(r,d,i=>t(2,a=i));let n,s;return h(d,a={markdown:b,tactCode:v,deploy:async()=>{const i=await p.Blockchain.create(),l=await i.treasury("deployer");n=l.getSender(),s=i.openContract(await A.fromInit());const C={[l.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],C,[await s.send(l.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{priviliged:async()=>[await s.send(n,{value:o.toNano(1)},"priviliged")],"best L1":async()=>[await s.send(n,{value:o.toNano(1)},"best L1")]},getters:{result:async()=>await s.getResult()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},a),[]}class N extends B{constructor(e){super(),y(this,e,Q,null,m,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.3c89d138.js b/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.3c89d138.js new file mode 100644 index 0000000..c95aeff --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-functions-page.svelte.3c89d138.js @@ -0,0 +1,57 @@ +var y=Object.defineProperty;var m=(a,e,t)=>e in a?y(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var l=(a,e,t)=>(m(a,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as I,s as w,I as C,ac as B}from"../chunks/index.9fe14626.js";import{d as o,g as A,s as u}from"../chunks/store.476c3091.js";import{d as h}from"../chunks/index.c056099e.js";const b=`# Functions + +To make your code more readable and promote code reuse, you're encouraged to divide it into functions. + +Functions in Tact start with the \`fun\` keyword. Functions can receive multiple input arguments and can optionally return a single output value. You can return a \`struct\` if you want to return multiple values. + +Global static functions are defined outside the scope of contracts. You can call them from anywhere, but they can't access the contract or any of the contract state variables. + +Contract methods are functions that are defined inside the scope of a contract. You can call them only from other contract methods like *receivers* and *getters*. They can access the contract's state variables.`,v=`import "@stdlib/deploy"; + +struct TokenInfo { + ticker: String; + decimals: Int as uint8; +} + +// this is a global static function that can be called from anywhere +fun average(a: Int, b: Int): Int { + return (a + b) / 2; +} + +contract Functions with Deployable { + + deployer: Address; + + init() { + self.deployer = sender(); + } + + // this contract method can be called from within this contract and access its variables + fun onlyDeployer() { + require(sender() == self.deployer, "Only the deployer is permitted here"); + } + + receive("priviliged") { + self.onlyDeployer(); + } + + // this contract method returns multiple return values using a struct + fun getInfo(index: Int): TokenInfo { + if (index == 1) { + return TokenInfo{ticker: "TON", decimals: 9}; + } + if (index == 2) { + return TokenInfo{ticker: "ETH", decimals: 18}; + } + return TokenInfo{ticker: "unknown", decimals: 0}; + } + + receive("best L1") { + let best: TokenInfo = self.getInfo(1); + self.reply(best.ticker.asComment()); + } + + get fun result(): Int { + return average(1, 10); + } +}`;function k(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function g(){const a=o.Cell.fromBase64("te6ccgECGAEAA9gAART/APSkE/S88sgLAQIBYgIDAs7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQ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bm93bocAAYggDTGPhCUiDHBfL0ATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBYByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAF27UTQ1AH4Y9IAAY4g+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDHgMPgo1wsKgwm68uCJ2zwZAAT4QloOxuA=");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:a,data:r}}const L={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},54040:{message:"Only the deployer is permitted here"}},D=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TokenInfo",header:null,fields:[{name:"ticker",type:{kind:"simple",type:"string",optional:!1}},{name:"decimals",type:{kind:"simple",type:"uint",optional:!1,format:8}}]}],Q=[{name:"result",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],M=[{receiver:"internal",message:{kind:"text",text:"priviliged"}},{receiver:"internal",message:{kind:"text",text:"best L1"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"TokenInfo",header:null,fields:[]}],types:D,getters:Q,receivers:M,errors:L});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=o.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,r,n){let s=null;if(n==="priviliged"&&(s=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="best L1"&&(s=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(s=o.beginCell().store(k(n)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:s})}async getResult(e){let t=new o.TupleBuilder;return(await e.get("result",t.build())).stack.readBigNumber()}}function E(a,e,t){let r;C(a,u,i=>t(2,r=i));let n,s;return B(u,r={markdown:b,tactCode:v,deploy:async()=>{const i=await h.Blockchain.create(),d=await i.treasury("deployer");n=d.getSender(),s=i.openContract(await c.fromInit());const p={[d.address.toString()]:"deployer",[s.address.toString()]:"contract"};return[[s],p,[await s.send(d.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{priviliged:async()=>[await s.send(n,{value:o.toNano(1)},"priviliged")],"best L1":async()=>[await s.send(n,{value:o.toNano(1)},"best L1")]},getters:{result:async()=>await s.getResult()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},r),[]}class S extends f{constructor(e){super(),I(this,e,E,null,w,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.7ab9cd84.js b/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.7ab9cd84.js index a96414b..c7b88ff 100644 --- a/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.7ab9cd84.js +++ b/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.7ab9cd84.js @@ -4,7 +4,7 @@ Tact supports if statements in a similar syntax to most programming languages th The condition of the statement can be any boolean expression. -There is no \`switch\` statement in Tact. If you need to need to handle a group of outcomes separately, follow the \`else if\` patten you can see in the third example.`,D=`import "@stdlib/deploy"; +There is no \`switch\` statement in Tact. If you need to handle a group of outcomes separately, follow the \`else if\` patten you can see in the third example.`,D=`import "@stdlib/deploy"; contract IfStatements with Deployable { diff --git a/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.c7e8f278.js b/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.c7e8f278.js new file mode 100644 index 0000000..77daa19 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-if-statements-page.svelte.c7e8f278.js @@ -0,0 +1,41 @@ +var u=Object.defineProperty;var y=(o,e,t)=>e in o?u(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var r=(o,e,t)=>(y(o,typeof e!="symbol"?e+"":e,t),t);import{S as C,i as f,s as I,I as h,ac as D}from"../chunks/index.9fe14626.js";import{d as s,g as A,s as m}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const w=`# If Statements + +Tact supports if statements in a similar syntax to most programming languages that you're used to. Curly braces are required though, so you can't leave them out. + +The condition of the statement can be any boolean expression. + +There is no \`switch\` statement in Tact. If you need to need to handle a group of outcomes separately, follow the \`else if\` pattern you can see in the third example. +`,v=`import "@stdlib/deploy"; + +contract IfStatements with Deployable { + + val: Int as int32; + + init() { + self.val = 17; + } + + receive("check1") { + if (self.val > 10) { + dump("larger than 10"); + } + } + + receive("check2") { + if (self.val > 100) { + dump("larger than 100"); + } else { + dump("smaller than 100"); + } + } + + receive("check3") { + if (self.val > 1000) { + dump("larger than 1000"); + } else if (self.val > 500) { + dump("between 500 and 1000"); + } else { + dump("smaller than 500"); + } + } +}`;function M(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}async function g(){const o=s.Cell.fromBase64("te6ccgECEgEAA5EAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcofye1UBAUCAVgODwE87UTQ1AH4Y9IAAZTSHwEx4DD4KNcLCoMJuvLgids8BgKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAHCAAEgBEBOm1tIm6zmVsgbvLQgG8i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Lgids8EwAEgBFyT2m4");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:o,data:i}}const b={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},k=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],x=[],U=[{receiver:"internal",message:{kind:"text",text:"check1"}},{receiver:"internal",message:{kind:"text",text:"check2"}},{receiver:"internal",message:{kind:"text",text:"check3"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:k,getters:x,receivers:U,errors:b});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=s.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,i,n){let a=null;if(n==="check1"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="check2"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="check3"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(M(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:a})}}function H(o,e,t){let i;h(o,m,l=>t(2,i=l));let n,a;return D(m,i={markdown:w,tactCode:v,deploy:async()=>{const l=await B.Blockchain.create(),d=await l.treasury("deployer");n=d.getSender(),a=l.openContract(await c.fromInit());const p={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],p,[await a.send(d.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{check1:async()=>[await a.send(n,{value:s.toNano(1)},"check1")],check2:async()=>[await a.send(n,{value:s.toNano(1)},"check2")],check3:async()=>[await a.send(n,{value:s.toNano(1)},"check3")]},getters:{},prev:A(import.meta.url).prev,next:A(import.meta.url).next},i),[]}class T extends C{constructor(e){super(),f(this,e,H,null,I,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.5763d2aa.js b/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.5763d2aa.js deleted file mode 100644 index 60d12d7..0000000 --- a/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.5763d2aa.js +++ /dev/null @@ -1,44 +0,0 @@ -var C=Object.defineProperty;var p=(a,e,t)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var A=(a,e,t)=>(p(a,typeof e!="symbol"?e+"":e,t),t);import{S as m,i as B,s as I,I as y,ac as f}from"../chunks/index.9fe14626.js";import{d as s,g as u,s as g}from"../chunks/store.d3ab02ad.js";import{d as h}from"../chunks/index.78404594.js";const M="# Loops\n\nTact does not support traditional `for` loops, but its loop statements are equivalent and can easily implement the same things. Also note that Tact does not support `break` and `continue` statements in loops like some languages.\n\nThe `repeat` loop statement input number must fit within an `int32`, otherwise an exception will be thrown.\n\nThe condition of the `while` and `until` loop statements can be any boolean expression.\n\nSmart contracts consume gas for execution. The amount of gas is proportional to the number of iterations. The last example iterates too many times and reverts due to an out of gas exception.",H=`import "@stdlib/deploy"; - -contract Loops with Deployable { - - init() {} - - receive("loop1") { - let sum: Int = 0; - let i: Int = 0; - repeat (10) { // repeat exactly 10 times - i = i + 1; - sum = sum + i; - } - dump(sum); - } - - receive("loop2") { - let sum: Int = 0; - let i: Int = 0; - while (i < 10) { // loop while a condition is true - i = i + 1; - sum = sum + i; - } - dump(sum); - } - - receive("loop3") { - let sum: Int = 0; - let i: Int = 0; - do { // loop until a condition is true - i = i + 1; - sum = sum + i; - } until (i >= 10); - dump(sum); - } - - receive("out of gas") { - let i: Int = 0; - while (i < pow(10, 6)) { // 1 million iterations is too much - i = i + 1; - } - dump(i); - } -}`;function Q(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function d(){const a=s.Cell.fromBase64("te6ccgECEAEA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cCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydAByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwRAAJtsa05YA==");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:a,data:i}}const b={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:b});this.address=e,this.init=t}static async init(){return await d()}static async fromInit(){const e=await d(),t=s.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,i,n){let o=null;if(n==="loop1"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="loop2"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="loop3"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="out of gas"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(o=s.beginCell().store(Q(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}}function D(a,e,t){let i;y(a,g,r=>t(2,i=r));let n,o;return f(g,i={markdown:M,tactCode:H,deploy:async()=>{const r=await h.Blockchain.create(),c=await r.treasury("deployer");n=c.getSender(),o=r.openContract(await l.fromInit());const w={[c.address.toString()]:"deployer",[o.address.toString()]:"contract"};return[[o],w,[await o.send(c.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{loop1:async()=>[await o.send(n,{value:s.toNano(1)},"loop1")],loop2:async()=>[await o.send(n,{value:s.toNano(1)},"loop2")],loop3:async()=>[await o.send(n,{value:s.toNano(1)},"loop3")],"out of gas":async()=>[await o.send(n,{value:s.toNano(1)},"out of gas")]},getters:{},prev:u(import.meta.url).prev,next:u(import.meta.url).next},i),[]}class K extends m{constructor(e){super(),B(this,e,D,null,I,{})}}export{K as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.6e785c6e.js b/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.6e785c6e.js new file mode 100644 index 0000000..0fd6fb0 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-loops-page.svelte.6e785c6e.js @@ -0,0 +1,44 @@ +var g=Object.defineProperty;var C=(a,e,t)=>e in a?g(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(C(a,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as w,s as I,I as f,ac as B}from"../chunks/index.9fe14626.js";import{d as s,g as c,s as d}from"../chunks/store.476c3091.js";import{d as M}from"../chunks/index.c056099e.js";const h="# Loops\n\nTact does not support traditional `for` loops, but its loop statements are equivalent and can easily implement the same things. Also note that Tact does not support `break` and `continue` statements in loops like some languages.\n\nThe `repeat` loop statement input number must fit within an `int32`, otherwise an exception will be thrown.\n\nThe condition of the `while` and `until` loop statements can be any boolean expression.\n\nSmart contracts consume gas for execution. The amount of gas is proportional to the number of iterations. The last example iterates too many times and reverts due to an out of gas exception.",b=`import "@stdlib/deploy"; + +contract Loops with Deployable { + + init() {} + + receive("loop1") { + let sum: Int = 0; + let i: Int = 0; + repeat (10) { // repeat exactly 10 times + i = i + 1; + sum = sum + i; + } + dump(sum); + } + + receive("loop2") { + let sum: Int = 0; + let i: Int = 0; + while (i < 10) { // loop while a condition is true + i = i + 1; + sum = sum + i; + } + dump(sum); + } + + receive("loop3") { + let sum: Int = 0; + let i: Int = 0; + do { // loop until a condition is true + i = i + 1; + sum = sum + i; + } until (i >= 10); + dump(sum); + } + + receive("out of gas") { + let i: Int = 0; + while (i < pow(10, 6)) { // 1 million iterations is too much + i = i + 1; + } + dump(i); + } +}`;function D(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function m(){const a=s.Cell.fromBase64("te6ccgECEQEAA8IAART/APSkE/S88sgLAQIBYgIDApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4IIwyPhDAcx/AcoAye1UBAUCAVgNDgE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwGAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAcIAAJtATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAkD8vkBIILw6kM1iQMxUeRqbm3EOTZ8ioiq13eJBFMZ2E7MEFVEaK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zJY0A3ABygDicAHKAAJ/AcoAAslYzAE07UTQ1AH4Y9IAMJFt4Pgo1wsKgwm68uCJ2zwSAAJtAP6BGw==");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:a,data:i}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},H=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],Q=[],v=[{receiver:"internal",message:{kind:"text",text:"loop1"}},{receiver:"internal",message:{kind:"text",text:"loop2"}},{receiver:"internal",message:{kind:"text",text:"loop3"}},{receiver:"internal",message:{kind:"text",text:"out of gas"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:H,getters:Q,receivers:v,errors:k});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=s.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,i,n){let o=null;if(n==="loop1"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="loop2"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="loop3"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="out of gas"&&(o=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(o=s.beginCell().store(D(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}}function x(a,e,t){let i;f(a,d,l=>t(2,i=l));let n,o;return B(d,i={markdown:h,tactCode:b,deploy:async()=>{const l=await M.Blockchain.create(),p=await l.treasury("deployer");n=p.getSender(),o=l.openContract(await A.fromInit());const u={[p.address.toString()]:"deployer",[o.address.toString()]:"contract"};return[[o],u,[await o.send(p.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{loop1:async()=>[await o.send(n,{value:s.toNano(1)},"loop1")],loop2:async()=>[await o.send(n,{value:s.toNano(1)},"loop2")],loop3:async()=>[await o.send(n,{value:s.toNano(1)},"loop3")],"out of gas":async()=>[await o.send(n,{value:s.toNano(1)},"out of gas")]},getters:{},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class S extends y{constructor(e){super(),w(this,e,x,null,I,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.02c629fd.js b/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.02c629fd.js new file mode 100644 index 0000000..1d40a55 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.02c629fd.js @@ -0,0 +1,105 @@ +var y=Object.defineProperty;var u=(a,e,t)=>e in a?y(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(u(a,typeof e!="symbol"?e+"":e,t),t);import{S as g,i as f,s as I,I as Q,ac as E}from"../chunks/index.9fe14626.js";import{d as s,g as c,s as m}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const b=`# Maps + +Maps are a dictionary type that can hold an arbitrary number of items, each under a different key. + +The keys in maps can either be an \`Int\` type or an \`Address\` type. + +You can check if a key is found in the map by calling the \`get()\` method. This will return \`null\` if the key is missing or the value if the key is found. Replace the value under a key by calling the \`set()\` method. + +Integers in maps stored in state currently use the largest integer size (257-bit). Future versions of Tact will let you optimize the encoding size. + +## Limit the number of items + +Maps are designed to hold a limited number of items. Only use a map if you know the upper bound of items that it may hold. It's also a good idea to [write a test](https://github.com/tact-lang/tact-emulator) to add the maximum number of elements to the map and see how gas behaves under stress. + +If the number of items is unbounded and can potentially grow to billions, you'll need to architect your contract differently. We will discuss unbounded maps later on under the topic of contract sharding.`,M=`import "@stdlib/deploy"; + +struct TokenInfo { + ticker: String; + decimals: Int; +} + +// messages can contain maps +message Replace { + items: map; +} + +contract Maps with Deployable { + + // maps with Int as key + mi1: map; + mi2: map; + mi3: map; + mi4: map; + + // maps with Address as key + ma1: map; + ma2: map; + ma3: map; + ma4: map; + + init(arg: map) { + // no need to initialize maps if they're empty + self.mi2 = arg; + } + + receive("set keys") { + // keys are Int + self.mi1.set(17, TokenInfo{ticker: "SHIB", decimals: 9}); + self.mi2.set(0x9377433ff21832, true); + self.mi3.set(pow(2,240), pow(2,230)); + self.mi4.set(-900, address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N")); + // keys are Address + self.ma1.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), TokenInfo{ticker: "DOGE", decimals: 18}); + self.ma2.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), true); + self.ma3.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), ton("1.23")); + self.ma4.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), myAddress()); + } + + receive("delete keys") { + // keys are Int + self.mi1.set(17, null); + self.mi2.set(0x9377433ff21832, null); + self.mi3.set(pow(2,240), null); + self.mi4.set(-900, null); + // keys are Address + self.ma1.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), null); + self.ma2.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), null); + self.ma3.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), null); + self.ma4.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), null); + } + + receive("clear") { + self.mi1 = emptyMap(); + self.mi2 = emptyMap(); + self.mi3 = emptyMap(); + self.mi4 = emptyMap(); + self.ma1 = emptyMap(); + self.ma2 = emptyMap(); + self.ma3 = emptyMap(); + self.ma4 = emptyMap(); + } + + receive(msg: Replace) { + // replace all items in the map with those coming in the message + self.mi4 = msg.items; + } + + // if the key is not found, the get() method returns null + get fun oneItem(key: Int): Address? { + return self.mi4.get(key); + } + + get fun itemCheck(): String { + if (self.mi1.get(17) == null) { + return "not found"; + } + let item: TokenInfo = self.mi1.get(17)!!; // !! tells the compiler this can't be null + return item.ticker; + } + + // you can return maps from getters + get fun allItems(): map { + return self.ma1; + } +}`;function w(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}function k(a){return e=>{let t=e;t.storeStringRefTail(a.ticker),t.storeInt(a.decimals,257)}}function h(a){let e=a,t=e.loadStringRefTail(),i=e.loadIntBig(257);return{$$type:"TokenInfo",ticker:t,decimals:i}}function H(){return{serialize:(a,e)=>{e.storeRef(s.beginCell().store(k(a)).endCell())},parse:a=>h(a.loadRef().beginParse())}}function R(a){return e=>{let t=e;t.storeUint(1384510466,32),t.storeDict(a.items,s.Dictionary.Keys.BigInt(257),s.Dictionary.Values.Address())}}function D(a){return e=>{e.storeDict(a.arg,s.Dictionary.Keys.BigInt(257),s.Dictionary.Values.Bool())}}async function p(a){const e=s.Cell.fromBase64("te6ccgECIQEABwoAART/APSkE/S88sgLAQIBYgIDAtbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVF9s88uCCyPhDAcx/AcoAVXBQePQAFfQAA8j0ABL0APQAAsj0ABP0ABP0AMlYzMkBzMntVBwEAgEgEhMC3u2i7fsBkjB/4HAh10nCH5UwINcLH94gghBShfQCuo4UMNMfAYIQUoX0Arry4IH0BAExNX/gIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAUGATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAcD/vkBIILwLbhRpWp9E8I4pZeD2P+AzxhY3xUEMJy9lA8dqk8y3sW6joYw2zx/2zHgIILwyxLyeEtLERf/i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y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBeO1E0NQB+GPSAAGOHfQE9ATUAdD0BPQE9ATUMND0BPQE9AQwEGgQZ2wY4Pgo1wsKgwm68uCJ9AQBAdHbPCIAEG0BbW1tbW1tDc68GQ==");let i=s.beginCell();i.storeRef(t),i.storeUint(0,1),D({$$type:"Maps_init_args",arg:a})(i);const n=i.endCell();return{code:e,data:n}}const W={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},v=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TokenInfo",header:null,fields:[{name:"ticker",type:{kind:"simple",type:"string",optional:!1}},{name:"decimals",type:{kind:"simple",type:"int",optional:!1,format:257}}]},{name:"Replace",header:1384510466,fields:[{name:"items",type:{kind:"dict",key:"int",value:"address"}}]}],S=[{name:"oneItem",arguments:[{name:"key",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"address",optional:!0}},{name:"itemCheck",arguments:[],returnType:{kind:"simple",type:"string",optional:!1}},{name:"allItems",arguments:[],returnType:{kind:"dict",key:"address",value:"TokenInfo",valueFormat:"ref"}}],z=[{receiver:"internal",message:{kind:"text",text:"set keys"}},{receiver:"internal",message:{kind:"text",text:"delete keys"}},{receiver:"internal",message:{kind:"text",text:"clear"}},{receiver:"internal",message:{kind:"typed",type:"Replace"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"TokenInfo",header:null,fields:[]},{name:"Replace",header:1384510466,fields:[]}],types:v,getters:S,receivers:z,errors:W});this.address=e,this.init=t}static async init(e){return await p(e)}static async fromInit(e){const t=await p(e),i=s.contractAddress(0,t);return new A(i,t)}static fromAddress(e){return new A(e)}async send(e,t,i,n){let l=null;if(n==="set keys"&&(l=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="delete keys"&&(l=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="clear"&&(l=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Replace"&&(l=s.beginCell().store(R(n)).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(l=s.beginCell().store(w(n)).endCell()),l===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:l})}async getOneItem(e,t){let i=new s.TupleBuilder;return i.writeNumber(t),(await e.get("oneItem",i.build())).stack.readAddressOpt()}async getItemCheck(e){let t=new s.TupleBuilder;return(await e.get("itemCheck",t.build())).stack.readString()}async getAllItems(e){let t=new s.TupleBuilder,i=(await e.get("allItems",t.build())).stack;return s.Dictionary.loadDirect(s.Dictionary.Keys.Address(),H(),i.readCellOpt())}}function G(a,e,t){let i;Q(a,m,o=>t(2,i=o));let n,l;return E(m,i={markdown:b,tactCode:M,deploy:async()=>{const o=await C.Blockchain.create(),d=await o.treasury("deployer");n=d.getSender(),l=o.openContract(await A.fromInit(s.Dictionary.empty()));const B={[d.address.toString()]:"deployer",[l.address.toString()]:"contract"};return[[l],B,[await l.send(d.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"set keys":async()=>[await l.send(n,{value:s.toNano(1)},"set keys")],"delete keys":async()=>[await l.send(n,{value:s.toNano(1)},"delete keys")],clear:async()=>[await l.send(n,{value:s.toNano(1)},"clear")],"Replace{{-900:my}}":async()=>{const o=s.Dictionary.empty().set(-900n,n.address);return[await l.send(n,{value:s.toNano(1)},{$$type:"Replace",items:o})]}},getters:{"oneItem(-900)":async()=>await l.getOneItem(-900n),itemCheck:async()=>await l.getItemCheck(),allItems:async()=>await l.getAllItems()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class N extends g{constructor(e){super(),f(this,e,G,null,I,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.6d5eb568.js b/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.6d5eb568.js deleted file mode 100644 index 605c28c..0000000 --- a/docs/_app/immutable/entry/(examples)-04-maps-page.svelte.6d5eb568.js +++ /dev/null @@ -1,105 +0,0 @@ -var u=Object.defineProperty;var I=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(I(a,typeof e!="symbol"?e+"":e,t),t);import{S as p,i as Q,s as E,I as f,ac as y}from"../chunks/index.9fe14626.js";import{d as s,g as c,s as d}from"../chunks/store.d3ab02ad.js";import{d as C}from"../chunks/index.78404594.js";const b=`# Maps - -Maps are a dictionary type that can hold an arbitrary number of items, each under a different key. - -The keys in maps can either be an \`Int\` type or an \`Address\` type. - -You can check if a key is found in the map by calling the \`get()\` method. This will return \`null\` if the key is missing or the value if the key is found. Replace the value under a key by calling the \`set()\` method. - -Integers in maps stored in state currently use the largest integer size (257-bit). Future versions of Tact will let you optimize the encoding size. - -## Limit the number of items - -Maps are designed to hold a limited number of items. Only use a map if you know the upper bound of items that it may hold. It's also a good idea to [write a test](https://github.com/tact-lang/tact-emulator) to add the maximum number of elements to the map and see how gas behaves under stress. - -If the number of items is unbounded and can potentially grow to billions, you'll need to architect your contract differently. We will discuss unbounded maps later on under the topic of contract sharding.`,w=`import "@stdlib/deploy"; - -struct TokenInfo { - ticker: String; - decimals: Int; -} - -// messages can contain maps -message Replace { - items: map; -} - -contract Maps with Deployable { - - // maps with Int as key - mi1: map; - mi2: map; - mi3: map; - mi4: map; - - // maps with Address as key - ma1: map; - ma2: map; - ma3: map; - ma4: map; - - init(arg: map) { - // no need to initialize maps if they're empty - self.mi2 = arg; - } - - receive("set keys") { - // keys are Int - self.mi1.set(17, TokenInfo{ticker: "SHIB", decimals: 9}); - self.mi2.set(0x9377433ff21832, true); - self.mi3.set(pow(2,240), pow(2,230)); - self.mi4.set(-900, address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N")); - // keys are Address - self.ma1.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), TokenInfo{ticker: "DOGE", decimals: 18}); - self.ma2.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), true); - self.ma3.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), ton("1.23")); - self.ma4.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), myAddress()); - } - - receive("delete keys") { - // keys are Int - self.mi1.set(17, null); - self.mi2.set(0x9377433ff21832, null); - self.mi3.set(pow(2,240), null); - self.mi4.set(-900, null); - // keys are Address - self.ma1.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), null); - self.ma2.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), null); - self.ma3.set(address("EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"), null); - self.ma4.set(address("UQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqEBI"), null); - } - - receive("clear") { - self.mi1 = emptyMap(); - self.mi2 = emptyMap(); - self.mi3 = emptyMap(); - self.mi4 = emptyMap(); - self.ma1 = emptyMap(); - self.ma2 = emptyMap(); - self.ma3 = emptyMap(); - self.ma4 = emptyMap(); - } - - receive(msg: Replace) { - // replace all items in the map with those coming in the message - self.mi4 = msg.items; - } - - // if the key is not found, the get() method returns null - get fun oneItem(key: Int): Address? { - return self.mi4.get(key); - } - - get fun itemCheck(): String { - if (self.mi1.get(17) == null) { - return "not found"; - } - let item: TokenInfo = self.mi1.get(17)!!; // !! tells the compiler this can't be null - return item.ticker; - } - - // you can return maps from getters - get fun allItems(): map { - return self.ma1; - } -}`;function M(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}function H(a){return e=>{let t=e;t.storeStringRefTail(a.ticker),t.storeInt(a.decimals,257)}}function h(a){let e=a,t=e.loadStringRefTail(),A=e.loadIntBig(257);return{$$type:"TokenInfo",ticker:t,decimals:A}}function k(){return{serialize:(a,e)=>{e.storeRef(s.beginCell().store(H(a)).endCell())},parse:a=>h(a.loadRef().beginParse())}}function R(a){return e=>{let t=e;t.storeUint(1384510466,32),t.storeDict(a.items,s.Dictionary.Keys.BigInt(257),s.Dictionary.Values.Address())}}function S(a){return e=>{e.storeDict(a.arg,s.Dictionary.Keys.BigInt(257),s.Dictionary.Values.Bool())}}async function g(a){const e=s.Cell.fromBase64("te6ccgECIAEABu8AART/APSkE/S88sgLAQIBYgIDAtLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVF9s8MMj4QwHMfwHKAFVwUHj0ABX0AAPI9AAS9AD0AALI9AAT9AAT9ADJWMzJAczJ7VQbBAIBIBESAuztou37cCHXScIflTAg1wsf3gKSW3/gIYIQUoX0ArqOFDHTHwGCEFKF9AK68uCB9AQBMTV/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wBQYByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsABwP++QEggvAtuFGlan0Twjill4PY/4DPGFjfFQQwnL2UDx2qTzLexbqOhjDbPH/bMeAggvDLEvJ4S0sRF/+JalScNEcF3aIAfYwoPZcLxuzzpi9GUbqOhjDbPH/bMeCC8Awc12WUYLD4G5QjfNX/wTpPtY6mibKBXedN03cGRqTquggJCgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3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YZAAwQRRA0QTAC4oEBAYARi0U0hJQoechZyFjPFslYzIEBAc8AyRA6IG6VMFn0WjCUQTP0FeIGgQEBgiiTd0M/8hgyf3EhbpVbWfRaMJjIAc8AQTP0QuKBAQGD74PlIhBJIW6VW1n0WjCYyAHPAEEz9ELigQEBgfx8iRA3HRsD+CBulTBZ9FowlEEz9BTigQELjQhgBB7+qpcxuU2jl+XmRiL15jNIuBKsW0djqT8N0gHQeY1Ei0RE9HRYgBLIWchYzxbJWMyBAQHPAMkQNiBulTBZ9FkwlEEz9BPigQELiRAkf3EhbpVbWfRZMJjIAc8AQTP0QeKBAQuJECMdHRwAxIIQSVBPgIEBASFulVtZ9FkwmMgBzwBBM/RB4oEBC40IYAQe/qqXMblNo5fl5kYi9eYzSLgSrFtHY6k/DdIB0HmNRPgoEDogbpUwWfRZMJjIAc8WQTP0QeIQZxBWEEUQNEEwAEOAEHv6qlzG5TaOX5eZGIvXmM0i4EqxbR2OpPw3SAdB5jUQAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AB8AmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBeO1E0NQB+GPSAAGOHfQE9ATUAdD0BPQE9ATUMND0BPQE9AQwEGgQZ2wY4Pgo1wsKgwm68uCJ9AQBAdHbPCEAEG0BbW1tbW1tNjEgLw==");let A=s.beginCell();A.storeRef(t),A.storeUint(0,1),S({$$type:"Maps_init_args",arg:a})(A);const n=A.endCell();return{code:e,data:n}}const Y={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,t){o(this,"address");o(this,"init");o(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"TokenInfo",header:null,fields:[]},{name:"Replace",header:1384510466,fields:[]}],errors:Y});this.address=e,this.init=t}static async init(e){return await g(e)}static async fromInit(e){const t=await g(e),A=s.contractAddress(0,t);return new l(A,t)}static fromAddress(e){return new l(e)}async send(e,t,A,n){let r=null;if(n==="set keys"&&(r=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="delete keys"&&(r=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="clear"&&(r=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Replace"&&(r=s.beginCell().store(R(n)).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(r=s.beginCell().store(M(n)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...A,body:r})}async getOneItem(e,t){let A=new s.TupleBuilder;return A.writeNumber(t),(await e.get("oneItem",A.build())).stack.readAddressOpt()}async getItemCheck(e){let t=new s.TupleBuilder;return(await e.get("itemCheck",t.build())).stack.readString()}async getAllItems(e){let t=new s.TupleBuilder,A=(await e.get("allItems",t.build())).stack;return s.Dictionary.loadDirect(s.Dictionary.Keys.Address(),k(),A.readCellOpt())}}function z(a,e,t){let A;f(a,d,i=>t(2,A=i));let n,r;return y(d,A={markdown:b,tactCode:w,deploy:async()=>{const i=await C.Blockchain.create(),B=await i.treasury("deployer");n=B.getSender(),r=i.openContract(await l.fromInit(s.Dictionary.empty()));const m={[B.address.toString()]:"deployer",[r.address.toString()]:"contract"};return[[r],m,[await r.send(B.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"set keys":async()=>[await r.send(n,{value:s.toNano(1)},"set keys")],"delete keys":async()=>[await r.send(n,{value:s.toNano(1)},"delete keys")],clear:async()=>[await r.send(n,{value:s.toNano(1)},"clear")],"Replace{{-900:my}}":async()=>{const i=s.Dictionary.empty().set(-900n,n.address);return[await r.send(n,{value:s.toNano(1)},{$$type:"Replace",items:i})]}},getters:{"oneItem(-900)":async()=>await r.getOneItem(-900n),itemCheck:async()=>await r.getItemCheck(),allItems:async()=>await r.getAllItems()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},A),[]}class G extends p{constructor(e){super(),Q(this,e,z,null,E,{})}}export{G as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.73f352b1.js b/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.73f352b1.js deleted file mode 100644 index 769286f..0000000 --- a/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.73f352b1.js +++ /dev/null @@ -1,57 +0,0 @@ -var I=Object.defineProperty;var w=(t,s,e)=>s in t?I(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var a=(t,s,e)=>(w(t,typeof s!="symbol"?s+"":s,e),e);import{S as C,i as p,s as y,I as m,ac as b}from"../chunks/index.9fe14626.js";import{d as l,g as u,s as c}from"../chunks/store.d3ab02ad.js";import{d as Q}from"../chunks/index.78404594.js";const f="# Optionals\n\nOptionals are variables or struct fields that can be null and don't necessarily hold a value. They are useful to reduce state size when the variable isn't necessarily used.\n\nYou can make any variable optional by adding `?` after its type.\n\nOptional variables that are not defined hold the `null` value. You cannot access them without checking for `null` first.\n\nIf you're certain an optional variable is not null, append to the end of its name `!!` to access its value. Trying to access the value without `!!` will result in a compilation error.",v=`import "@stdlib/deploy"; - -struct StrctOpts { - sa: Int?; - sb: Bool?; - sc: Address?; -} - -message MsgOpts { - ma: Int?; - mb: Bool?; - mc: Address?; - md: StrctOpts?; -} - -contract Optionals with Deployable { - - ca: Int?; - cb: Bool?; - cc: Address?; - cd: StrctOpts?; - - init(a: Int?, b: Bool?, c: Address?) { - self.ca = a; - self.cb = b; - self.cc = c; - self.cd = StrctOpts{sa: null, sb: true, sc: null}; - } - - receive(msg: MsgOpts) { - let i: Int = 12; - if (msg.ma != null) { - i = i + msg.ma!!; // !! tells the compiler this can't be null - self.ca = i; - } - } - - get fun optInt(): Int? { - return self.ca; - } - - get fun optIntVal(): Int { - if (self.ca == null) { - return -1; - } else { - return self.ca!!; // !! tells the compiler this can't be null - } - } - - get fun optNested(): Int? { - if (self.cd != null && (self.cd!!).sa != null) { - return (self.cd!!).sa!!; // !! tells the compiler this can't be null - } else { - return null; - } - } -}`;function M(t){return s=>{let e=s;e.storeUint(2490013878,32),e.storeUint(t.queryId,64)}}function E(t){return s=>{let e=s;t.sa!==null&&t.sa!==void 0?e.storeBit(!0).storeInt(t.sa,257):e.storeBit(!1),t.sb!==null&&t.sb!==void 0?e.storeBit(!0).storeBit(t.sb):e.storeBit(!1),e.storeAddress(t.sc)}}function h(t){return s=>{let e=s;e.storeUint(162313165,32),t.ma!==null&&t.ma!==void 0?e.storeBit(!0).storeInt(t.ma,257):e.storeBit(!1),t.mb!==null&&t.mb!==void 0?e.storeBit(!0).storeBit(t.mb):e.storeBit(!1),e.storeAddress(t.mc);let r=new l.Builder;t.md!==null&&t.md!==void 0?(r.storeBit(!0),r.store(E(t.md))):r.storeBit(!1),e.storeRef(r.endCell())}}function L(t){return s=>{let e=s;t.a!==null&&t.a!==void 0?e.storeBit(!0).storeInt(t.a,257):e.storeBit(!1),t.b!==null&&t.b!==void 0?e.storeBit(!0).storeBit(t.b):e.storeBit(!1),e.storeAddress(t.c)}}async function B(t,s,e){const r=l.Cell.fromBase64("te6ccgECGwEABNcAART/APSkE/S88sgLAQIBYgIDA3bQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s8MBQEBQIBIAoLAqxwIddJwh+VMCDXCx/eApJbf+AhghAJrLPNuuMCAYIQlGqYtrqOrdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+AwcAYHAeDI+EMBzH8BygBVMCNus5t/UAXKABOBAQHPAJgzcFAEygAQI+IhbrOWfwHKAMoAlHAyygDiASBulTBwAcsBjh4g10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbiyCJus5UycFjKAOMNyQHMye1UCQHqMdMfAYIQCayzzbry4IHSAAGVgQEB1wCSbQHi0gABktIAkm0B4vpAIdcLAcMAjh0BINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiJIxbeIB1AHQ0gABkjBt4w0UQzBsFF8DIG6zmjQDIG7y0ICmDAORMOJ/FgHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAIAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAMB/AcoAAiBu8tCAbyMQNCJus5t/UATKABKBAQHPAJcycFADygAS4iFus5Z/AcoAygCUcDLKAOIBIG6VMHABywGOHiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFuICEb4D9tnm2eNiDBQMAgEgDQ4ARiBus5sgIG7y0IBvI1tus5Fw4p4gIG7y0IBvI1sgbvLQgOBtAgEgDxACAUgZGgIBWBESALm3ejBOC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cMAjh0BINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiJIxbeJDMAPRWNs8GwAKbX9tbwMAkNIAAZWBAQHXAJJtAeLSAAGS0gCSbQHi+kAh1wsBwwCOHQEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIkjFt4kMwbBNvA24T46M=");let A=l.beginCell();A.storeRef(n),A.storeUint(0,1),L({$$type:"Optionals_init_args",a:t,b:s,c:e})(A);const o=A.endCell();return{code:r,data:o}}const J={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class i{constructor(s,e){a(this,"address");a(this,"init");a(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"StrctOpts",header:null,fields:[]},{name:"MsgOpts",header:162313165,fields:[]}],errors:J});this.address=s,this.init=e}static async init(s,e,r){return await B(s,e,r)}static async fromInit(s,e,r){const n=await B(s,e,r),A=l.contractAddress(0,n);return new i(A,n)}static fromAddress(s){return new i(s)}async send(s,e,r,n){let A=null;if(n&&typeof n=="object"&&!(n instanceof l.Slice)&&n.$$type==="MsgOpts"&&(A=l.beginCell().store(h(n)).endCell()),n&&typeof n=="object"&&!(n instanceof l.Slice)&&n.$$type==="Deploy"&&(A=l.beginCell().store(M(n)).endCell()),A===null)throw new Error("Invalid message type");await s.internal(e,{...r,body:A})}async getOptInt(s){let e=new l.TupleBuilder;return(await s.get("optInt",e.build())).stack.readBigNumberOpt()}async getOptIntVal(s){let e=new l.TupleBuilder;return(await s.get("optIntVal",e.build())).stack.readBigNumber()}async getOptNested(s){let e=new l.TupleBuilder;return(await s.get("optNested",e.build())).stack.readBigNumberOpt()}}function D(t,s,e){let r;m(t,c,o=>e(2,r=o));let n,A;return b(c,r={markdown:f,tactCode:v,deploy:async()=>{const o=await Q.Blockchain.create(),g=await o.treasury("deployer");n=g.getSender(),A=o.openContract(await i.fromInit(null,null,null));const d={[g.address.toString()]:"deployer",[A.address.toString()]:"contract"};return[[A],d,[await A.send(g.getSender(),{value:l.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"MsgOpts{ma:5}":async()=>[await A.send(n,{value:l.toNano(1)},{$$type:"MsgOpts",ma:5n,mb:null,mc:null,md:null})]},getters:{optInt:async()=>await A.getOptInt(),optIntVal:async()=>await A.getOptIntVal(),optNested:async()=>await A.getOptNested()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},r),[]}class k extends C{constructor(s){super(),p(this,s,D,null,y,{})}}export{k as default}; diff --git a/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.85e8f359.js b/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.85e8f359.js new file mode 100644 index 0000000..40d6c8b --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-04-optionals-page.svelte.85e8f359.js @@ -0,0 +1,57 @@ +var m=Object.defineProperty;var B=(t,n,e)=>n in t?m(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var r=(t,n,e)=>(B(t,typeof n!="symbol"?n+"":n,e),e);import{S as y,i as I,s as w,I as C,ac as f}from"../chunks/index.9fe14626.js";import{d as i,g as p,s as u}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const Q="# Optionals\n\nOptionals are variables or struct fields that can be null and don't necessarily hold a value. They are useful to reduce state size when the variable isn't necessarily used.\n\nYou can make any variable optional by adding `?` after its type.\n\nOptional variables that are not defined hold the `null` value. You cannot access them without checking for `null` first.\n\nIf you're certain an optional variable is not null, append to the end of its name `!!` to access its value. Trying to access the value without `!!` will result in a compilation error.",v=`import "@stdlib/deploy"; + +struct StrctOpts { + sa: Int?; + sb: Bool?; + sc: Address?; +} + +message MsgOpts { + ma: Int?; + mb: Bool?; + mc: Address?; + md: StrctOpts?; +} + +contract Optionals with Deployable { + + ca: Int?; + cb: Bool?; + cc: Address?; + cd: StrctOpts?; + + init(a: Int?, b: Bool?, c: Address?) { + self.ca = a; + self.cb = b; + self.cc = c; + self.cd = StrctOpts{sa: null, sb: true, sc: null}; + } + + receive(msg: MsgOpts) { + let i: Int = 12; + if (msg.ma != null) { + i = i + msg.ma!!; // !! tells the compiler this can't be null + self.ca = i; + } + } + + get fun optInt(): Int? { + return self.ca; + } + + get fun optIntVal(): Int { + if (self.ca == null) { + return -1; + } else { + return self.ca!!; // !! tells the compiler this can't be null + } + } + + get fun optNested(): Int? { + if (self.cd != null && (self.cd!!).sa != null) { + return (self.cd!!).sa!!; // !! tells the compiler this can't be null + } else { + return null; + } + } +}`;function E(t){return n=>{let e=n;e.storeUint(2490013878,32),e.storeUint(t.queryId,64)}}function h(t){return n=>{let e=n;t.sa!==null&&t.sa!==void 0?e.storeBit(!0).storeInt(t.sa,257):e.storeBit(!1),t.sb!==null&&t.sb!==void 0?e.storeBit(!0).storeBit(t.sb):e.storeBit(!1),e.storeAddress(t.sc)}}function k(t){return n=>{let e=n;e.storeUint(162313165,32),t.ma!==null&&t.ma!==void 0?e.storeBit(!0).storeInt(t.ma,257):e.storeBit(!1),t.mb!==null&&t.mb!==void 0?e.storeBit(!0).storeBit(t.mb):e.storeBit(!1),e.storeAddress(t.mc);let l=new i.Builder;t.md!==null&&t.md!==void 0?(l.storeBit(!0),l.store(h(t.md))):l.storeBit(!1),e.storeRef(l.endCell())}}function M(t){return n=>{let e=n;t.a!==null&&t.a!==void 0?e.storeBit(!0).storeInt(t.a,257):e.storeBit(!1),t.b!==null&&t.b!==void 0?e.storeBit(!0).storeBit(t.b):e.storeBit(!1),e.storeAddress(t.c)}}async function g(t,n,e){const l=i.Cell.fromBase64("te6ccgECHAEABPIAART/APSkE/S88sgLAQIBYgIDA3rQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s88uCCFQQFAgEgCwwCngGSMH/gcCHXScIflTAg1wsf3iCCEAmss8264wKCEJRqmLa6jqfTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gMHAGBwHgyPhDAcx/AcoAVTAjbrObf1AFygATgQEBzwCYM3BQBMoAECPiIW6zln8BygDKAJRwMsoA4gEgbpUwcAHLAY4eINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8W4sgibrOVMnBYygDjDckBzMntVAoB6jDTHwGCEAmss8268uCB0gABlYEBAdcAkm0B4tIAAZLSAJJtAeL6QCHXCwHDAI4dASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IiSMW3iAdQB0NIAAZIwbeMNFEMwbBRfAyBus5o0AyBu8tCApgwDkTDifxcBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8CAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAJAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAMB/AcoAAiBu8tCAbyMQNCJus5t/UATKABKBAQHPAJcycFADygAS4iFus5Z/AcoAygCUcDLKAOIBIG6VMHABywGOHiDXSYEBC7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EB1wCSbQHi0gABktIAkm0B4vpAIdcLAcMAjh0BINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiJIxbeIB1AHQ0gABkjBt4w0UQzBsFOD4KNcLCoMJuvLgiR0bAZLSAAGVgQEB1wCSbQHi0gABktIAkm0B4vpAIdcLAcMAjh0BINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiJIxbeJDMAPRWNs8HAAKbX9tbwMAkNIAAZWBAQHXAJJtAeLSAAGS0gCSbQHi+kAh1wsBwwCOHQEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIkjFt4kMwbBNvA/p4gvU=");let a=i.beginCell();a.storeRef(s),a.storeUint(0,1),M({$$type:"Optionals_init_args",a:t,b:n,c:e})(a);const o=a.endCell();return{code:l,data:o}}const O={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},H=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"StrctOpts",header:null,fields:[{name:"sa",type:{kind:"simple",type:"int",optional:!0,format:257}},{name:"sb",type:{kind:"simple",type:"bool",optional:!0}},{name:"sc",type:{kind:"simple",type:"address",optional:!0}}]},{name:"MsgOpts",header:162313165,fields:[{name:"ma",type:{kind:"simple",type:"int",optional:!0,format:257}},{name:"mb",type:{kind:"simple",type:"bool",optional:!0}},{name:"mc",type:{kind:"simple",type:"address",optional:!0}},{name:"md",type:{kind:"simple",type:"StrctOpts",optional:!0}}]}],D=[{name:"optInt",arguments:[],returnType:{kind:"simple",type:"int",optional:!0,format:257}},{name:"optIntVal",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"optNested",arguments:[],returnType:{kind:"simple",type:"int",optional:!0,format:257}}],S=[{receiver:"internal",message:{kind:"typed",type:"MsgOpts"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class A{constructor(n,e){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"StrctOpts",header:null,fields:[]},{name:"MsgOpts",header:162313165,fields:[]}],types:H,getters:D,receivers:S,errors:O});this.address=n,this.init=e}static async init(n,e,l){return await g(n,e,l)}static async fromInit(n,e,l){const s=await g(n,e,l),a=i.contractAddress(0,s);return new A(a,s)}static fromAddress(n){return new A(n)}async send(n,e,l,s){let a=null;if(s&&typeof s=="object"&&!(s instanceof i.Slice)&&s.$$type==="MsgOpts"&&(a=i.beginCell().store(k(s)).endCell()),s&&typeof s=="object"&&!(s instanceof i.Slice)&&s.$$type==="Deploy"&&(a=i.beginCell().store(E(s)).endCell()),a===null)throw new Error("Invalid message type");await n.internal(e,{...l,body:a})}async getOptInt(n){let e=new i.TupleBuilder;return(await n.get("optInt",e.build())).stack.readBigNumberOpt()}async getOptIntVal(n){let e=new i.TupleBuilder;return(await n.get("optIntVal",e.build())).stack.readBigNumber()}async getOptNested(n){let e=new i.TupleBuilder;return(await n.get("optNested",e.build())).stack.readBigNumberOpt()}}function L(t,n,e){let l;C(t,u,o=>e(2,l=o));let s,a;return f(u,l={markdown:Q,tactCode:v,deploy:async()=>{const o=await b.Blockchain.create(),d=await o.treasury("deployer");s=d.getSender(),a=o.openContract(await A.fromInit(null,null,null));const c={[d.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],c,[await a.send(d.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"MsgOpts{ma:5}":async()=>[await a.send(s,{value:i.toNano(1)},{$$type:"MsgOpts",ma:5n,mb:null,mc:null,md:null})]},getters:{optInt:async()=>await a.getOptInt(),optIntVal:async()=>await a.getOptIntVal(),optNested:async()=>await a.getOptNested()},prev:p(import.meta.url).prev,next:p(import.meta.url).next},l),[]}class F extends y{constructor(n){super(),I(this,n,L,null,w,{})}}export{F as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.1df58f22.js b/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.1df58f22.js deleted file mode 100644 index 71fbcd7..0000000 --- a/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.1df58f22.js +++ /dev/null @@ -1,46 +0,0 @@ -var m=Object.defineProperty;var I=(s,e,t)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var A=(s,e,t)=>(I(s,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as b,s as h,I as p,ac as B}from"../chunks/index.9fe14626.js";import{d as r,g,s as w}from"../chunks/store.d3ab02ad.js";import{d as v}from"../chunks/index.78404594.js";const D=`# The Ownable Trait - -Tact allows you to add common boilerplate behaviors to your contract by using traits. - -The Ownable trait allows the contract to set an \`owner\` role, which can have higher priviliges from everybody else. - -For example, if your contract allows upgrades, it would make sense to limit upgrades to the owner only, otherwise anyone could break the contract. - -Be aware that dapps are supposed to be *decentralized* and an owner role is by definition [centralized](https://defi.org/ton). If you're building a dapp, try to minimize reliance on Ownable. - -Note that this trait doesn't allow the owner to transfer ownership to a different owner. - -## How to use Ownable - -Define a state variable named \`owner: Address\` and call \`self.requireOwner()\` in priviliged receivers.`,M=`// this trait has to be imported -import "@stdlib/ownable"; -import "@stdlib/deploy"; - -// the Ownable trait can limit certain actions to the owner only -contract Counter with Deployable, Ownable { - - owner: Address; // The Ownable trait requires you to add this exact state variable - val: Int as uint32; - - init() { - self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case - self.val = 0; - } - - // this message is available to anyone - receive("increment") { - self.val = self.val + 1; - } - - // this message in only available to the owner - receive("double") { - self.requireOwner(); - self.val = self.val * 2; - } - - get fun value(): Int { - return self.val; - } - - // get fun owner(): Address is added automatically to query who the owner is -}`;function Q(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function y(){const s=r.Cell.fromBase64("te6ccgECFQEAAyoAART/APSkE/S88sgLAQIBYgIDAtDQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2z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Xl6i2pzUyPSUpvCM0tLS4GbCZIKOsILe0szE9IKw1shshsam9KioqHDO4HKQpJhxBABGwr7tRNDSAAGAA3bu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSCcEDOdWnnFfnSULAdYW4mR7KAIRviju2ebZ42EMFQ4AAiEC0NAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFrbPDDI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFssfye1UFRACru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcBMRAbT5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuupUwpH/bMeCC8Mh17uDIvZBpthqIAyVgLhscxblPsuKlgeLK/Isb7hnOuo6H2zyqAH/bMeASABL4QlIgxwXy4IQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGA7UTQ1AH4Y9IAAY4l+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTH1lsEuAw+CjXCwqDCbry4InbPBYABvhCcDxd7vg=");let t=r.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:s,data:o}}const x={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class d{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:x});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=r.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,o,n){let i=null;if(n==="increment"&&(i=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="double"&&(i=r.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof r.Slice)&&n.$$type==="Deploy"&&(i=r.beginCell().store(Q(n)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:i})}async getValue(e){let t=new r.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getOwner(e){let t=new r.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function E(s,e,t){let o;p(s,w,l=>t(3,o=l));let n,i,a;return B(w,o={markdown:D,tactCode:M,deploy:async()=>{const l=await v.Blockchain.create(),c=await l.treasury("deployer");n=c.getSender();const u=await l.treasury("another");i=u.getSender(),a=l.openContract(await d.fromInit());const C={[c.address.toString()]:"deployer",[u.address.toString()]:"sender 2",[a.address.toString()]:"contract"};return[[a],C,[await a.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"increment (from deployer)":async()=>[await a.send(n,{value:r.toNano(1)},"increment")],"increment (from sender 2)":async()=>[await a.send(i,{value:r.toNano(1)},"increment")],"double (from deployer)":async()=>[await a.send(n,{value:r.toNano(1)},"double")],"double (from sender 2)":async()=>[await a.send(i,{value:r.toNano(1)},"double")]},getters:{owner:async()=>await a.getOwner(),value:async()=>await a.getValue()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class S extends f{constructor(e){super(),b(this,e,E,null,h,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.b917ff9a.js b/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.b917ff9a.js new file mode 100644 index 0000000..07818b5 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-05-the-ownable-trait-page.svelte.b917ff9a.js @@ -0,0 +1,53 @@ +var w=Object.defineProperty;var f=(r,e,t)=>e in r?w(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var d=(r,e,t)=>(f(r,typeof e!="symbol"?e+"":e,t),t);import{S as C,i as b,s as h,I,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g as p,s as g}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const k=`# The Ownable Trait + +Tact allows you to add common boilerplate behaviors to your contract by using traits. + +The Ownable trait allows the contract to set an \`owner\` role, which can have higher priviliges from everybody else. + +For example, if your contract allows upgrades, it would make sense to limit upgrades to the owner only, otherwise anyone could break the contract. + +Be aware that dapps are supposed to be _decentralized_ and an owner role is by definition [centralized](https://defi.org/ton). If you're building a dapp, try to minimize reliance on Ownable. + +Note that this trait doesn't allow the owner to transfer ownership to a different owner. + +## How to use Ownable + +Define a state variable named \`owner: Address\` and call \`self.requireOwner()\` in priviliged receivers. + +
+
+ Info: The Ownable trait is defined in the standard library + +
+`,D=`// this trait has to be imported +import "@stdlib/ownable"; +import "@stdlib/deploy"; + +// the Ownable trait can limit certain actions to the owner only +contract Counter with Deployable, Ownable { + + owner: Address; // The Ownable trait requires you to add this exact state variable + val: Int as uint32; + + init() { + self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case + self.val = 0; + } + + // this message is available to anyone + receive("increment") { + self.val = self.val + 1; + } + + // this message in only available to the owner + receive("double") { + self.requireOwner(); + self.val = self.val * 2; + } + + get fun value(): Int { + return self.val; + } + + // get fun owner(): Address is added automatically to query who the owner is +}`;function L(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function m(){const r=a.Cell.fromBase64("te6ccgECFgEAA0UAART/APSkE/S88sgLAQIBYgIDAtTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFssfye1UEwQCASAKCwKg7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAkTDjDXAFBgE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwHAbT5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuupUwpH/bMeCC8Mh17uDIvZBpthqIAyVgLhscxblPsuKlgeLK/Isb7hnOuo6H2zyqAH/bMeAJAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAgAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwAEvh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N69lVyrrqVMKR/2zHggvDIde7gyL2QabYaiAMlYC4bHMW5T7LipYHiyvyLG+4ZzrqOh9s8qgB/2zHgEgAS+EJSIMcF8uCEATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGA7UTQ1AH4Y9IAAY4l+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTH1lsEuAw+CjXCwqDCbry4InbPBcABvhCcKtR9Ss=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:r,data:i}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},E=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],O=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],Q=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"double"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:E,getters:O,receivers:Q,errors:H});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,i,n){let o=null;if(n==="increment"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="double"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(o=a.beginCell().store(L(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getOwner(e){let t=new a.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function M(r,e,t){let i;I(r,g,l=>t(3,i=l));let n,o,s;return v(g,i={markdown:k,tactCode:D,deploy:async()=>{const l=await B.Blockchain.create(),u=await l.treasury("deployer");n=u.getSender();const A=await l.treasury("another");o=A.getSender(),s=l.openContract(await c.fromInit());const y={[u.address.toString()]:"deployer",[A.address.toString()]:"sender 2",[s.address.toString()]:"contract"};return[[s],y,[await s.send(u.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"increment (from deployer)":async()=>[await s.send(n,{value:a.toNano(1)},"increment")],"increment (from sender 2)":async()=>[await s.send(o,{value:a.toNano(1)},"increment")],"double (from deployer)":async()=>[await s.send(n,{value:a.toNano(1)},"double")],"double (from sender 2)":async()=>[await s.send(o,{value:a.toNano(1)},"double")]},getters:{owner:async()=>await s.getOwner(),value:async()=>await s.getValue()},prev:p(import.meta.url).prev,next:p(import.meta.url).next},i),[]}class N extends C{constructor(e){super(),b(this,e,M,null,h,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.3d90c8f0.js b/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.3d90c8f0.js new file mode 100644 index 0000000..809a43e --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.3d90c8f0.js @@ -0,0 +1,52 @@ +var m=Object.defineProperty;var f=(a,e,n)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n;var d=(a,e,n)=>(f(a,typeof e!="symbol"?e+"":e,n),n);import{S as C,i as h,s as b,I,ac as v}from"../chunks/index.9fe14626.js";import{d as r,g as c,s as p}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const L=`# The Ownable-Transferable Trait + +The Ownable-Transferable trait is almost identical to the Ownable trait that we covered in the previous example. + +It adds one important feature which is the ability for the owner to transfer ownership to a new owner. This can also be used to renounce ownership completely by transferring ownership to an unusable address like the zero address. + +If you're building a dapp and aiming for decentralization, always prefer this trait over Ownable. At some point in the dapps future, when you consider the owner role no longer unnecessary, you will be able to renounce ownership and make the dapp fully decentralized. + +## How to use OwnableTransferable + +Use it in a contract just like Ownable. Define a state variable named \`owner: Address\` and call \`self.requireOwner()\` in priviliged receivers. + +Your contract will automatically handle the \`ChangeOwner{newOwner: Address}\` message which allows the owner to transfer ownership. + +
+
+ Info: The OwnableTransferable trait is defined in the standard library + +
+`,O=`// this trait has to be imported +import "@stdlib/ownable"; +import "@stdlib/deploy"; + +// the OwnableTransferable trait can limit certain actions to the owner only +contract Counter with Deployable, OwnableTransferable { + + owner: Address; // The OwnableTransferable trait requires you to add this exact state variable + val: Int as uint32; + + init() { + self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case + self.val = 0; + } + + // this message is available to anyone + receive("increment") { + self.val = self.val + 1; + } + + // this message in only available to the owner + receive("double") { + self.requireOwner(); + self.val = self.val * 2; + } + + get fun value(): Int { + return self.val; + } + + // receive(msg: ChangeOwner) is added automatically to transfer ownership + // get fun owner(): Address is added automatically to query who the owner is +}`;function k(a){return e=>{let n=e;n.storeUint(2174598809,32),n.storeUint(a.queryId,64),n.storeAddress(a.newOwner)}}function E(a){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(a.queryId,64)}}async function y(){const a=r.Cell.fromBase64("te6ccgECGAEAA9gAART/APSkE/S88sgLAQIBYgIDAtTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFssfye1UFQQCASALDAO07aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4CCCEIGdvpm64wLAAJEw4w1wBwUGAt4w0x8BghCBnb6ZuvLggdM/+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsElrbPDFRIchZghAyeytKUAPLH8s/ASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskS+EIBf23bPH8KBwG0+QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqVMKR/2zHggvDIde7gyL2QabYaiAMlYC4bHMW5T7LipYHiyvyLG+4ZzrqOh9s8qgB/2zHgCgE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwIAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAkAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwAEvhCUiDHBfLghAIRviju2ebZ42EMFQ0CASAODwACIQHdu70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9P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LK/Isb7hnOuo6H2zyqAH/bMeAUAt4w0x8BghCBnb6ZuvLggdM/+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsElrbPDFRIchZghAyeytKUAPLH8s/ASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskS+EIBf23bPH8UFQAS+EJSIMcF8uCEATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBYByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGA7UTQ1AH4Y9IAAY4l+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTH1lsEuAw+CjXCwqDCbry4InbPBkABvhCcK07RMY=");let n=r.beginCell();n.storeRef(e),n.storeUint(0,1);const i=n.endCell();return{code:a,data:i}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],S=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],H=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"text",text:"double"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}},{receiver:"internal",message:{kind:"typed",type:"ChangeOwner"}}];class u{constructor(e,n){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:Q,getters:S,receivers:H,errors:D});this.address=e,this.init=n}static async init(){return await y()}static async fromInit(){const e=await y(),n=r.contractAddress(0,e);return new u(n,e)}static fromAddress(e){return new u(e)}async send(e,n,i,t){let s=null;if(t==="increment"&&(s=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="double"&&(s=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="Deploy"&&(s=r.beginCell().store(E(t)).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="ChangeOwner"&&(s=r.beginCell().store(k(t)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(n,{...i,body:s})}async getValue(e){let n=new r.TupleBuilder;return(await e.get("value",n.build())).stack.readBigNumber()}async getOwner(e){let n=new r.TupleBuilder;return(await e.get("owner",n.build())).stack.readAddress()}}function M(a,e,n){let i;I(a,p,l=>n(3,i=l));let t,s,o;return v(p,i={markdown:L,tactCode:O,deploy:async()=>{const l=await B.Blockchain.create(),g=await l.treasury("deployer");t=g.getSender();const A=await l.treasury("another");s=A.getSender(),o=l.openContract(await u.fromInit());const w={[g.address.toString()]:"deployer",[A.address.toString()]:"sender 2",[o.address.toString()]:"contract"};return[[o],w,[await o.send(g.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"ChangeOwner{sender 2} (from deployer)":async()=>[await o.send(t,{value:r.toNano(1)},{$$type:"ChangeOwner",newOwner:s.address})],"ChangeOwner{deployer} (from sender 2)":async()=>[await o.send(s,{value:r.toNano(1)},{$$type:"ChangeOwner",newOwner:t.address})]},getters:{owner:async()=>await o.getOwner(),value:async()=>await o.getValue()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class U extends C{constructor(e){super(),h(this,e,M,null,b,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.ae64f791.js b/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.ae64f791.js deleted file mode 100644 index fe38b7b..0000000 --- a/docs/_app/immutable/entry/(examples)-05-the-ownable-transferable-trait-page.svelte.ae64f791.js +++ /dev/null @@ -1,45 +0,0 @@ -var h=Object.defineProperty;var m=(a,e,n)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n;var A=(a,e,n)=>(m(a,typeof e!="symbol"?e+"":e,n),n);import{S as f,i as I,s as B,I as p,ac as b}from"../chunks/index.9fe14626.js";import{d as r,g as u,s as w}from"../chunks/store.d3ab02ad.js";import{d as v}from"../chunks/index.78404594.js";const D=`# The Ownable-Transferable Trait - -The Ownable-Transferable trait is almost identical to the Ownable trait that we covered in the previous example. - -It adds one important feature which is the ability for the owner to transfer ownership to a new owner. This can also be used to renounce ownership completely by transferring ownership to an unusable address like the zero address. - -If you're building a dapp and aiming for decentralization, always prefer this trait over Ownable. At some point in the dapps future, when you consider the owner role no longer unnecessary, you will be able to renounce ownership and make the dapp fully decentralized. - -## How to use OwnableTransferable - -Use it in a contract just like Ownable. Define a state variable named \`owner: Address\` and call \`self.requireOwner()\` in priviliged receivers. - -Your contract will automatically handle the \`ChangeOwner{newOwner: Address}\` message which allows the owner to transfer ownership.`,E=`// this trait has to be imported -import "@stdlib/ownable"; -import "@stdlib/deploy"; - -// the OwnableTransferable trait can limit certain actions to the owner only -contract Counter with Deployable, OwnableTransferable { - - owner: Address; // The OwnableTransferable trait requires you to add this exact state variable - val: Int as uint32; - - init() { - self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case - self.val = 0; - } - - // this message is available to anyone - receive("increment") { - self.val = self.val + 1; - } - - // this message in only available to the owner - receive("double") { - self.requireOwner(); - self.val = self.val * 2; - } - - get fun value(): Int { - return self.val; - } - - // receive(msg: ChangeOwner) is added automatically to transfer ownership - // get fun owner(): Address is added automatically to query who the owner is -}`;function Q(a){return e=>{let n=e;n.storeUint(256331011,32),n.storeAddress(a.newOwner)}}function O(a){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(a.queryId,64)}}async function C(){const a=r.Cell.fromBase64("te6ccgECFwEAA4AAART/APSkE/S88sgLAQIBYgIDAtDQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWVkg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbLH8ntVBQEAgEgCgsDwu2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+AhghAPR00DuuMCAcAAkTDjDXAFBgcByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsACAFmMdMfAYIQD0dNA7ry4IH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIMVnbPDF/CQG0+QEggvDE+NcjEu3971t77HgzvbsWLRURvXipEq7Q8mN69lVyrrqVMKR/2zHggvDIde7gyL2QabYaiAMlYC4bHMW5T7LipYHiyvyLG+4ZzrqOh9s8qgB/2zHgCQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAAS+EJSIMcF8uCEAhG+KO7Z5tnjYQwUDAIBIA0OAAIhAd27vRgnBc7D1dLK57HoTsOdZKhRtmgnCd1jUtK2R8syLTry398WI5gnAgVcAbgGdjlM5YO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mi9kGm2GogDJWAuGxzFuU+y4qWB4sr8ixvuGc66jofbPKoAf9sx4BQBZjHTHwGCEA9HTQO68uCB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDFZ2zwxfxQAEvhCUiDHBfLghAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAWAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAYDtRNDUAfhj0gABjiX6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAdMfWWwS4DD4KNcLCoMJuvLgids8GAAG+EJw8gITiw==");let n=r.beginCell();n.storeRef(e),n.storeUint(0,1);const o=n.endCell();return{code:a,data:o}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class d{constructor(e,n){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:M});this.address=e,this.init=n}static async init(){return await C()}static async fromInit(){const e=await C(),n=r.contractAddress(0,e);return new d(n,e)}static fromAddress(e){return new d(e)}async send(e,n,o,t){let s=null;if(t==="increment"&&(s=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t==="double"&&(s=r.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="Deploy"&&(s=r.beginCell().store(O(t)).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="ChangeOwner"&&(s=r.beginCell().store(Q(t)).endCell()),s===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:s})}async getValue(e){let n=new r.TupleBuilder;return(await e.get("value",n.build())).stack.readBigNumber()}async getOwner(e){let n=new r.TupleBuilder;return(await e.get("owner",n.build())).stack.readAddress()}}function J(a,e,n){let o;p(a,w,l=>n(3,o=l));let t,s,i;return b(w,o={markdown:D,tactCode:E,deploy:async()=>{const l=await v.Blockchain.create(),c=await l.treasury("deployer");t=c.getSender();const g=await l.treasury("another");s=g.getSender(),i=l.openContract(await d.fromInit());const y={[c.address.toString()]:"deployer",[g.address.toString()]:"sender 2",[i.address.toString()]:"contract"};return[[i],y,[await i.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"ChangeOwner{sender 2} (from deployer)":async()=>[await i.send(t,{value:r.toNano(1)},{$$type:"ChangeOwner",newOwner:s.address})],"ChangeOwner{deployer} (from sender 2)":async()=>[await i.send(s,{value:r.toNano(1)},{$$type:"ChangeOwner",newOwner:t.address})]},getters:{owner:async()=>await i.getOwner(),value:async()=>await i.getValue()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},o),[]}class K extends f{constructor(e){super(),I(this,e,J,null,B,{})}}export{K as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.910751fd.js b/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.910751fd.js new file mode 100644 index 0000000..65dbb09 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.910751fd.js @@ -0,0 +1,52 @@ +var m=Object.defineProperty;var y=(o,e,t)=>e in o?m(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var l=(o,e,t)=>(y(o,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as C,s as f,I as B,ac as b}from"../chunks/index.9fe14626.js";import{d as s,g as A,s as c}from"../chunks/store.476c3091.js";import{d as h}from"../chunks/index.c056099e.js";const I=`# The Resumable Trait + +The Resumable trait is almost identical to the Stoppable trait that we covered in the previous example. + +It adds one important feature which is the ability for the owner to resume a stopped contract. + +The Stoppable trait by itself may be a little dangerous because the owner cannot change their mind. If you're not sure which trait to use, use this one. + +This trait implicitly adds the Ownable and Stoppable traits. Note that the Ownable trait doesn't allow the owner to transfer ownership to a different owner. To allow changing ownership, also add the \`OwnableTransferable\` trait. + +## How to use Resumable + +Define state variables named \`owner: Address\` and \`stopped: Bool\` and call \`self.requireNotStopped()\` on actions that should be stopped. + +
+
+ Info: The OwnableTransferable trait is defined in the standard library + +
+`,v=`// this trait has to be imported +import "@stdlib/stoppable"; +import "@stdlib/ownable"; +import "@stdlib/deploy"; + +// the Resumable trait allows the owner to stop/resume the contract which can limit certain actions +contract Counter with Deployable, Resumable { + + owner: Address; // The Resumable trait requires you to add this exact state variable + stopped: Bool; // The Resumable trait requires you to add this exact state variable + val: Int as uint32; + + init() { + self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case + self.stopped = false; + self.val = 0; + } + + // this message will only work as long as the contract is not stopped + receive("increment") { + self.requireNotStopped(); + self.val = self.val + 1; + } + + get fun value(): Int { + return self.val; + } + + // receive("Resume") is added automatically to allow owner to resume the contract + // receive("Stop") is added automatically to allow owner to stop the contract + // get fun stopped(): Bool is added automatically to query if contract is stopped + // get fun owner(): Address is added automatically to query who the owner is +}`;function D(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}async function u(){const o=s.Cell.fromBase64("te6ccgECIgEABBAAART/APSkE/S88sgLAQIBYgIDAt7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBaINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WEsoAyx/J7VQfBAIBIBITAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcA8FA/75ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6HMNs8pH/bMeAggvBsj0T0X+20zf7U3o2xSqWxOtVdQw91nQZpIQt0xI/j37qOhjDbPH/bMeCC8Lz693aQfHGcyNN52PGUqqon6Moocc1ZF4FyHyFaRUUBDAYHBBDbPNs8MXCIEgsICQ4BErqOhds8f9sx4AoADoIA0DAi8vQAFgAAAABSZXN1bWVkBBDbPNs8MX+IEgsMDQ4AEvhCUjDHBfLghAAQggCdsCKz8vQAFgAAAABTdG9wcGVkAQ74QgF/bds8DwE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwQAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABEAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCASAUFQIBIBgZAhG6F72zzbPGwxgfFgIRuFHds82zxsMYHxcAAiEAAiIB3bu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbx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W3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6HMNs8pH/bMeAggvBsj0T0X+20zf7U3o2xSqWxOtVdQw91nQZpIQt0xI/j37qOhjDbPH/bMeCC8Lz693aQfHGcyNN52PGUqqon6Moocc1ZF4FyHyFaRUUBHhkWARK6joXbPH/bMeAXBBDbPNs8MX+IEh0eGBoAFgAAAABTdG9wcGVkBBDbPNs8MXCIEh0cGxoBDvhCAX9t2zwfABYAAAAAUmVzdW1lZAAOggDQMCLy9AAS+EJSMMcF8uCEABCCAJ2wIrPy9AE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwgAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ACEAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwBhu1E0NQB+GPSAAGOKPpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB0gDTH1UgbBPgMPgo1wsKgwm68uCJ2zwjAAj4QnBw2D9aCg==");let t=s.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:o,data:r}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},40368:{message:"Contract stopped"},53296:{message:"Contract not stopped"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],S=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"stopped",arguments:[],returnType:{kind:"simple",type:"bool",optional:!1}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],M=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}},{receiver:"internal",message:{kind:"text",text:"Resume"}},{receiver:"internal",message:{kind:"text",text:"Stop"}}];class d{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:Q,getters:S,receivers:M,errors:k});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=s.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,r,n){let a=null;if(n==="increment"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof s.Slice)&&n.$$type==="Deploy"&&(a=s.beginCell().store(D(n)).endCell()),n==="Resume"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="Stop"&&(a=s.beginCell().storeUint(0,32).storeStringTail(n).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getValue(e){let t=new s.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStopped(e){let t=new s.TupleBuilder;return(await e.get("stopped",t.build())).stack.readBoolean()}async getOwner(e){let t=new s.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function E(o,e,t){let r;B(o,c,i=>t(2,r=i));let n,a;return b(c,r={markdown:I,tactCode:v,deploy:async()=>{const i=await h.Blockchain.create(),p=await i.treasury("deployer");n=p.getSender(),a=i.openContract(await d.fromInit());const g={[p.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[a,g,[await a.send(p.getSender(),{value:s.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await a.send(n,{value:s.toNano(1)},"increment")],Stop:async()=>[await a.send(n,{value:s.toNano(1)},"Stop")],Resume:async()=>[await a.send(n,{value:s.toNano(1)},"Resume")]},getters:{stopped:async()=>await a.getStopped(),value:async()=>await a.getValue()},prev:A(import.meta.url).prev,next:A(import.meta.url).next},r),[]}class z extends w{constructor(e){super(),C(this,e,E,null,f,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.bdeae906.js b/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.bdeae906.js deleted file mode 100644 index aec4e72..0000000 --- a/docs/_app/immutable/entry/(examples)-05-the-resumable-trait-page.svelte.bdeae906.js +++ /dev/null @@ -1,45 +0,0 @@ -var C=Object.defineProperty;var p=(o,e,t)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A=(o,e,t)=>(p(o,typeof e!="symbol"?e+"":e,t),t);import{S as B,i as m,s as I,I as h,ac as f}from"../chunks/index.9fe14626.js";import{d as a,g as d,s as u}from"../chunks/store.d3ab02ad.js";import{d as b}from"../chunks/index.78404594.js";const y=`# The Resumable Trait - -The Resumable trait is almost identical to the Stoppable trait that we covered in the previous example. - -It adds one important feature which is the ability for the owner to resume a stopped contract. - -The Stoppable trait by itself may be a little dangerous because the owner cannot change their mind. If you're not sure which trait to use, use this one. - -This trait implicitly adds the Ownable and Stoppable traits. Note that the Ownable trait doesn't allow the owner to transfer ownership to a different owner. To allow changing ownership, also add the \`OwnableTransferable\` trait. - -## How to use Resumable - -Define state variables named \`owner: Address\` and \`stopped: Bool\` and call \`self.requireNotStopped()\` on actions that should be stopped.`,v=`// this trait has to be imported -import "@stdlib/stoppable"; -import "@stdlib/ownable"; -import "@stdlib/deploy"; - -// the Resumable trait allows the owner to stop/resume the contract which can limit certain actions -contract Counter with Deployable, Resumable { - - owner: Address; // The Resumable trait requires you to add this exact state variable - stopped: Bool; // The Resumable trait requires you to add this exact state variable - val: Int as uint32; - - init() { - self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case - self.stopped = false; - self.val = 0; - } - - // this message will only work as long as the contract is not stopped - receive("increment") { - self.requireNotStopped(); - self.val = self.val + 1; - } - - get fun value(): Int { - return self.val; - } - - // receive("Resume") is added automatically to allow owner to resume the contract - // receive("Stop") is added automatically to allow owner to stop the contract - // get fun stopped(): Bool is added automatically to query if contract is stopped - // get fun owner(): Address is added automatically to query who the owner is -}`;function E(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}async function g(){const o=a.Cell.fromBase64("te6ccgECIQEAA/oAART/APSkE/S88sgLAQIBYgIDAtrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgWiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFhLKAMsfye1UHgQCASAREgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wDwUD/vkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4CCC8GyPRPRf7bTN/tTejbFKpbE61V1DD3WdBmkhC3TEj+Pfuo6GMNs8f9sx4ILwvPr3dpB8cZzI03nY8ZSqqifoyihxzVkXgXIfIVpFRQEMBgcEDts82zwxcIgLCAkOARK6joXbPH/bMeAKAA6CANAwIvL0ABYAAAAAUmVzdW1lZAQO2zzbPDF/iAsMDQ4AEvhCUjDHBfLghAAQggCdsCKz8vQAFgAAAABTdG9wcGVkARx/+EJwWAOAQgFtbds8AQ8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJU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mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zwwyPhDAcx/AcoAVSBaINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WEsoAyx/J7VQhFAKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wHxUD/vkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4CCC8GyPRPRf7bTN/tTejbFKpbE61V1DD3WdBmkhC3TEj+Pfuo6GMNs8f9sx4ILwvPr3dpB8cZzI03nY8ZSqqifoyihxzVkXgXIfIVpFRQEeGRYBErqOhds8f9sx4BcEDts82zwxf4gdHhgaABYAAAAAU3RvcHBlZAQO2zzbPDFwiB0cGxoBHH/4QnBYA4BCAW1t2zwBHwAWAAAAAFJlc3VtZWQADoIA0DAi8vQAEvhCUjDHBfLghAAQggCdsCKz8vQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAIACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGG7UTQ1AH4Y9IAAY4o+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHSANMfVSBsE+Aw+CjXCwqDCbry4InbPCIACPhCcHAsMc2w");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:o,data:r}}const x={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},40368:{message:"Contract stopped"},53296:{message:"Contract not stopped"}};class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:x});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=a.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,r,s){let n=null;if(s==="increment"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(n=a.beginCell().store(E(s)).endCell()),s==="Resume"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s==="Stop"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:n})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStopped(e){let t=new a.TupleBuilder;return(await e.get("stopped",t.build())).stack.readBoolean()}async getOwner(e){let t=new a.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function Q(o,e,t){let r;h(o,u,i=>t(2,r=i));let s,n;return f(u,r={markdown:y,tactCode:v,deploy:async()=>{const i=await b.Blockchain.create(),c=await i.treasury("deployer");s=c.getSender(),n=i.openContract(await l.fromInit());const w={[c.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[n,w,[await n.send(c.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await n.send(s,{value:a.toNano(1)},"increment")],Stop:async()=>[await n.send(s,{value:a.toNano(1)},"Stop")],Resume:async()=>[await n.send(s,{value:a.toNano(1)},"Resume")]},getters:{stopped:async()=>await n.getStopped(),value:async()=>await n.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},r),[]}class z extends B{constructor(e){super(),m(this,e,Q,null,I,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.22f8243f.js b/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.22f8243f.js new file mode 100644 index 0000000..f3fd6d3 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.22f8243f.js @@ -0,0 +1,53 @@ +var g=Object.defineProperty;var y=(s,e,t)=>e in s?g(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(y(s,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as C,s as f,I as B,ac as I}from"../chunks/index.9fe14626.js";import{d as o,g as c,s as u}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const h=`# The Stoppable Trait + +Tact allows you to add common boilerplate behaviors to your contract by using traits. + +The Stoppable trait allows the contract to allow an \`owner\` role to stop the contract. + +Consider for example a protocol where users can deposit funds, like a staking service or a compounding vault. If somebody discovers a security issue, we may want to stop the contract from accepting funds from new users. + +Note that this trait doesn't allow to resume the contract after it has been stopped. + +This trait implicitly adds the Ownable trait. Note that the Ownable trait doesn't allow the owner to transfer ownership to a different owner. To allow changing ownership, also add the \`OwnableTransferable\` trait. + +## How to use Stoppable + +Define state variables named \`owner: Address\` and \`stopped: Bool\` and call \`self.requireNotStopped()\` on actions that should be stopped. + +
+
+ Info: The stoppable trait is defined in the standard library + +
+`,v=`// this trait has to be imported +import "@stdlib/stoppable"; +import "@stdlib/ownable"; +import "@stdlib/deploy"; + +// the Stoppable trait allows the owner to stop the contract which can limit certain actions +contract Counter with Deployable, Stoppable { + + owner: Address; // The Stoppable trait requires you to add this exact state variable + stopped: Bool; // The Stoppable trait requires you to add this exact state variable + val: Int as uint32; + + init() { + self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case + self.stopped = false; + self.val = 0; + } + + // this message will only work until the contract was stopped + receive("increment") { + self.requireNotStopped(); + self.val = self.val + 1; + } + + get fun value(): Int { + return self.val; + } + + // receive("Stop") is added automatically to allow owner to stop the contract + // get fun stopped(): Bool is added automatically to query if contract is stopped + // get fun owner(): Address is added automatically to query who the owner is +}`;function S(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}async function A(){const s=o.Cell.fromBase64("te6ccgECHgEAA6kAART/APSkE/S88sgLAQIBYgIDAt7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBaINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WEsoAyx/J7VQbBAIBIA4PAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcAsFArb5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6HMNs8pH/bMeCC8Lz693aQfHGcyNN52PGUqqon6Moocc1ZF4FyHyFaRUUBuo6F2zx/2zHgCAYEENs82zwxf4gSBwgJCgAS+EJSMMcF8uCEABCCAJ2wIrPy9AAWAAAAAFN0b3BwZWQBDvhCAX9t2zwLATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAwByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uC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AiEC3tAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zzy4ILI+EMBzH8BygBVIFog10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYSygDLH8ntVB4UAqDtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQlGqYtrqOqDDTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/J+EIBcG3bPH/gwACRMOMNcBsVArb5ASCC8MT41yMS7f3vW3vseDO9uxYtFRG9eKkSrtDyY3r2VXKuuo6HMNs8pH/bMeCC8Lz693aQfHGcyNN52PGUqqon6Moocc1ZF4FyHyFaRUUBuo6F2zx/2zHgGhYEENs82zwxf4gSGRoYFwEO+EIBf23bPBsAFgAAAABTdG9wcGVkABL4QlIwxwXy4IQAEIIAnbAis/L0ATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPBwByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAHQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGG7UTQ1AH4Y9IAAY4o+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHSANMfVSBsE+Aw+CjXCwqDCbry4InbPB8ACPhCcHDmjH1i");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const k={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},40368:{message:"Contract stopped"},53296:{message:"Contract not stopped"}},D=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],H=[{name:"value",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"stopped",arguments:[],returnType:{kind:"simple",type:"bool",optional:!1}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],x=[{receiver:"internal",message:{kind:"text",text:"increment"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}},{receiver:"internal",message:{kind:"text",text:"Stop"}}];class d{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:D,getters:H,receivers:x,errors:k});this.address=e,this.init=t}static async init(){return await A()}static async fromInit(){const e=await A(),t=o.contractAddress(0,e);return new d(t,e)}static fromAddress(e){return new d(e)}async send(e,t,r,n){let a=null;if(n==="increment"&&(a=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(a=o.beginCell().store(S(n)).endCell()),n==="Stop"&&(a=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getValue(e){let t=new o.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStopped(e){let t=new o.TupleBuilder;return(await e.get("stopped",t.build())).stack.readBoolean()}async getOwner(e){let t=new o.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function J(s,e,t){let r;B(s,u,i=>t(2,r=i));let n,a;return I(u,r={markdown:h,tactCode:v,deploy:async()=>{const i=await b.Blockchain.create(),p=await i.treasury("deployer");n=p.getSender(),a=i.openContract(await d.fromInit());const m={[p.address.toString()]:"deployer",[a.address.toString()]:"contract"};return[[a],m,[await a.send(p.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await a.send(n,{value:o.toNano(1)},"increment")],Stop:async()=>[await a.send(n,{value:o.toNano(1)},"Stop")]},getters:{stopped:async()=>await a.getStopped(),value:async()=>await a.getValue()},prev:c(import.meta.url).prev,next:c(import.meta.url).next},r),[]}class T extends w{constructor(e){super(),C(this,e,J,null,f,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.63297e5f.js b/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.63297e5f.js deleted file mode 100644 index 5bd644b..0000000 --- a/docs/_app/immutable/entry/(examples)-05-the-stoppable-trait-page.svelte.63297e5f.js +++ /dev/null @@ -1,46 +0,0 @@ -var p=Object.defineProperty;var C=(a,e,t)=>e in a?p(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var l=(a,e,t)=>(C(a,typeof e!="symbol"?e+"":e,t),t);import{S as B,i as I,s as m,I as h,ac as b}from"../chunks/index.9fe14626.js";import{d as n,g as d,s as u}from"../chunks/store.d3ab02ad.js";import{d as f}from"../chunks/index.78404594.js";const y=`# The Stoppable Trait - -Tact allows you to add common boilerplate behaviors to your contract by using traits. - -The Stoppable trait allows the contract to allow an \`owner\` role to stop the contract. - -Consider for example a protocol where users can deposit funds, like a staking service or a compounding vault. If somebody discovers a security issue, we may want to stop the contract from accepting funds from new users. - -Note that this trait doesn't allow to resume the contract after it has been stopped. - -This trait implicitly adds the Ownable trait. Note that the Ownable trait doesn't allow the owner to transfer ownership to a different owner. To allow changing ownership, also add the \`OwnableTransferable\` trait. - -## How to use Stoppable - -Define state variables named \`owner: Address\` and \`stopped: Bool\` and call \`self.requireNotStopped()\` on actions that should be stopped.`,v=`// this trait has to be imported -import "@stdlib/stoppable"; -import "@stdlib/ownable"; -import "@stdlib/deploy"; - -// the Stoppable trait allows the owner to stop the contract which can limit certain actions -contract Counter with Deployable, Stoppable { - - owner: Address; // The Stoppable trait requires you to add this exact state variable - stopped: Bool; // The Stoppable trait requires you to add this exact state variable - val: Int as uint32; - - init() { - self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case - self.stopped = false; - self.val = 0; - } - - // this message will only work until the contract was stopped - receive("increment") { - self.requireNotStopped(); - self.val = self.val + 1; - } - - get fun value(): Int { - return self.val; - } - - // receive("Stop") is added automatically to allow owner to stop the contract - // get fun stopped(): Bool is added automatically to query if contract is stopped - // get fun owner(): Address is added automatically to query who the owner is -}`;function L(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function g(){const a=n.Cell.fromBase64("te6ccgECHQEAA5QAART/APSkE/S88sgLAQIBYgIDAtrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgWiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFhLKAMsfye1UGgQCASANDgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wCwUCtvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwvPr3dpB8cZzI03nY8ZSqqifoyihxzVkXgXIfIVpFRQG6joXbPH/bMeAIBgQO2zzbPDF/iAcICQoAEvhCUjDHBfLghAAQggCdsCKz8vQAFgAAAABTdG9wcGVkARx/+EJwWAOAQgFtbds8AQsByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tC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ggQT/uvLQiYMJuvLgiM8WEsoAyx/J7VQdFAKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wGxUCtvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwvPr3dpB8cZzI03nY8ZSqqifoyihxzVkXgXIfIVpFRQG6joXbPH/bMeAaFgQO2zzbPDF/iBkaGBcBHH/4QnBYA4BCAW1t2zwBGwAWAAAAAFN0b3BwZWQAEvhCUjDHBfLghAAQggCdsCKz8vQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAHACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGG7UTQ1AH4Y9IAAY4o+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHSANMfVSBsE+Aw+CjXCwqDCbry4InbPB4ACPhCcHC5GXcL");let t=n.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:a,data:r}}const Q={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},40368:{message:"Contract stopped"},53296:{message:"Contract not stopped"}};class A{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:Q});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=n.contractAddress(0,e);return new A(t,e)}static fromAddress(e){return new A(e)}async send(e,t,r,s){let o=null;if(s==="increment"&&(o=n.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof n.Slice)&&s.$$type==="Deploy"&&(o=n.beginCell().store(L(s)).endCell()),s==="Stop"&&(o=n.beginCell().storeUint(0,32).storeStringTail(s).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getValue(e){let t=new n.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStopped(e){let t=new n.TupleBuilder;return(await e.get("stopped",t.build())).stack.readBoolean()}async getOwner(e){let t=new n.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function H(a,e,t){let r;h(a,u,i=>t(2,r=i));let s,o;return b(u,r={markdown:y,tactCode:v,deploy:async()=>{const i=await f.Blockchain.create(),c=await i.treasury("deployer");s=c.getSender(),o=i.openContract(await A.fromInit());const w={[c.address.toString()]:"deployer",[o.address.toString()]:"contract"};return[[o],w,[await o.send(c.getSender(),{value:n.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await o.send(s,{value:n.toNano(1)},"increment")],Stop:async()=>[await o.send(s,{value:n.toNano(1)},"Stop")]},getters:{stopped:async()=>await o.getStopped(),value:async()=>await o.getValue()},prev:d(import.meta.url).prev,next:d(import.meta.url).next},r),[]}class z extends B{constructor(e){super(),I(this,e,H,null,m,{})}}export{z as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.6378d45b.js b/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.6378d45b.js new file mode 100644 index 0000000..8b7e759 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.6378d45b.js @@ -0,0 +1,91 @@ +var m=Object.defineProperty;var h=(r,e,t)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>(h(r,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as C,s as f,I,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g as u,s as d}from"../chunks/store.476c3091.js";import{d as B}from"../chunks/index.c056099e.js";const b=`# Writing Your Own Trait + +Tact doesn't support classical class inheritance and instead introduces the concept of *traits*. Traits are similar to simplified base classes that potentially add state variables, receivers, getters or contract methods. + +Contracts can rely on multiple traits. Extract logic into a trait if you have multiple contracts that share this logic. + +## The Trackable trait + +This example shows how to write a new trait that adds simple analytics behavior to any contract. + +This trait also makes use of the \`virtual\` keyword which lets the contract relying on the trait override some of the trait's behaviors. In the example, the default filter behavior ignores messages from owner in the analytics. + +The contract relying on the trait can change this default behavior by specifying the \`override\` keyword and providing a new implementation to this method. In our case, the custom filter is to have no filters.`,p=`import "@stdlib/deploy"; +import "@stdlib/ownable"; + +///////////////////////////////////////////////////////////////////////////// +// this trait adds basic analytics to any contract to track how popular it is + +trait Trackable with Ownable { // your new trait may rely on other traits + + // Storage + + owner: Address; + numMessagesReceived: Int; // your new trait may add state variables but should not specify their size + + // Receivers + + receive("reset stats") { // your new trait may handle specific messages + self.requireOwner(); + self.numMessagesReceived = 0; + self.reply("reset done".asComment()); + } + + // Getters + + get fun stats(): Int { // your new trait may add getters + return self.numMessagesReceived; + } + + // Methods + + fun receivedNewMessage() { // your new trait may define new contract methods + if (self.filterMessage()) { + self.numMessagesReceived = self.numMessagesReceived + 1; + } + } + + virtual fun filterMessage(): Bool { // virtual functions can be overridden by users of this trait + // the default filtering behavior is to ignore messages sent by the owner + if (sender() == self.owner) { + return false; + } + return true; + } +} + +///////////////////////////////////////////////////////////////////////////// +// this Counter contract is going to use our new trait to add analytics to it + +contract Counter with Deployable, Trackable { + + owner: Address; // The Trackable trait requires this exact state variable + numMessagesReceived: Int as uint64; // The Trackable trait requires this exact state variable + val: Int as uint32; + + init() { + self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case + self.numMessagesReceived = 0; + self.val = 0; + } + + receive("increment") { + self.receivedNewMessage(); // here we are using our trait + self.val = self.val + 1; + } + + get fun value(): Int { + return self.val; + } + + // the trait allows us to override the default filtering behavior + override fun filterMessage(): Bool { + // our contract's custom filtering behavior is to remove all filters and count all messages + return true; + } + + // receive("reset stats") is added automatically to allow owner to reset the stats + // get fun stats(): Int is added automatically to query the stats + // get fun owner(): Address is added automatically to query who the owner is +} +`;function L(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function g(){const r=a.Cell.fromBase64("te6ccgECHAEAA3wAART/APSkE/S88sgLAQIBYgIDAtrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgWiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFhLLP8sfye1UGQQCASANDgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wCwUCqvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwagSuzyfQDA4/QYygK93T3PzDjfuHHaL6tsnnxzYYZQ+64wIGBwEO2zyTAaQB3ggDLNs8MXCIf/hCcFgDgEIBbW3bPAF/2zEJCgsAAn8AEvhCUjDH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d2zzbPGwxgHBEAAiIC2tAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zwwyPhDAcx/AcoAVSBaINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WEss/yx/J7VQcEwKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wGhQCqvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwagSuzyfQDA4/QYygK93T3PzDjfuHHaL6tsnnxzYYZQ+64wIYFQMs2zwxcIh/+EJwWAOAQgFtbds8AX/bMRcWGgAcAAAAAHJlc2V0IGRvbmUAEvhCUjDHBfLghAEO2zyTAaQB3hkAAn8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAGwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGG7UTQ1AH4Y9IAAY4o+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTP9MfVSBsE+Aw+CjXCwqDCbry4InbPB0ACPhCcCDj7h7k");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:r,data:i}}const x={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]}],errors:x});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,i,s){let n=null;if(s==="increment"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(n=a.beginCell().store(L(s)).endCell()),s==="reset stats"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:n})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStats(e){let t=new a.TupleBuilder;return(await e.get("stats",t.build())).stack.readBigNumber()}async getOwner(e){let t=new a.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function E(r,e,t){let i;I(r,d,o=>t(2,i=o));let s,n;return v(d,i={markdown:b,tactCode:p,deploy:async()=>{const o=await B.Blockchain.create(),A=await o.treasury("deployer");s=A.getSender(),n=o.openContract(await c.fromInit());const w={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],w,[await n.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await n.send(s,{value:a.toNano(1)},"increment")],"reset stats":async()=>[await n.send(s,{value:a.toNano(1)},"reset stats")]},getters:{value:async()=>await n.getValue(),stats:async()=>await n.getStats()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},i),[]}class T extends y{constructor(e){super(),C(this,e,E,null,f,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.71da5b94.js b/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.71da5b94.js deleted file mode 100644 index 6ed0a4f..0000000 --- a/docs/_app/immutable/entry/(examples)-05-your-own-trait-page.svelte.71da5b94.js +++ /dev/null @@ -1,90 +0,0 @@ -var m=Object.defineProperty;var h=(r,e,t)=>e in r?m(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var l=(r,e,t)=>(h(r,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as C,s as f,I,ac as v}from"../chunks/index.9fe14626.js";import{d as a,g as u,s as d}from"../chunks/store.d3ab02ad.js";import{d as B}from"../chunks/index.78404594.js";const b=`# Writing Your Own Trait - -Tact doesn't support classical class inheritance and instead introduces the concept of *traits*. Traits are similar to simplified base classes that potentially add state variables, receivers, getters or contract methods. - -Contracts can rely on multiple traits. Extract logic into a trait if you have multiple contracts that share this logic. - -## The Trackable trait - -This example shows how to write a new trait that adds simple analytics behavior to any contract. - -This trait also makes use of the \`virtual\` keyword which lets the contract relying on the trait override some of the trait's behaviors. In the example, the default filter behavior ignores messages from owner in the analytics. - -The contract relying on the trait can change this default behavior by specifying the \`overrides\` keyword and providing a new implementation to this method. In our case, the custom filter is to have no filters.`,p=`import "@stdlib/deploy"; -import "@stdlib/ownable"; - -///////////////////////////////////////////////////////////////////////////// -// this trait adds basic analytics to any contract to track how popular it is - -trait Trackable with Ownable { // your new trait may rely on other traits - - // Storage - - owner: Address; - numMessagesReceived: Int; // your new trait may add state variables but should not specify their size - - // Receivers - - receive("reset stats") { // your new trait may handle specific messages - self.requireOwner(); - self.numMessagesReceived = 0; - reply("reset done".asComment()); - } - - // Getters - - get fun stats(): Int { // your new trait may add getters - return self.numMessagesReceived; - } - - // Methods - - fun receivedNewMessage() { // your new trait may define new contract methods - if (self.filterMessage()) { - self.numMessagesReceived = self.numMessagesReceived + 1; - } - } - - virtual fun filterMessage(): Bool { // virtual functions can be overridden by users of this trait - // the default filtering behavior is to ignore messages sent by the owner - if (sender() == self.owner) { - return false; - } - return true; - } -} - -///////////////////////////////////////////////////////////////////////////// -// this Counter contract is going to use our new trait to add analytics to it - -contract Counter with Deployable, Trackable { - - owner: Address; // The Trackable trait requires this exact state variable - numMessagesReceived: Int as uint64; // The Trackable trait requires this exact state variable - val: Int as uint32; - - init() { - self.owner = sender(); // we can initialize owner to any value we want, the deployer in this case - self.numMessagesReceived = 0; - self.val = 0; - } - - receive("increment") { - self.receivedNewMessage(); // here we are using our trait - self.val = self.val + 1; - } - - get fun value(): Int { - return self.val; - } - - // the trait allows us to override the default filtering behavior - overrides fun filterMessage(): Bool { - // our contract's custom filtering behavior is to remove all filters and count all messages - return true; - } - - // receive("reset stats") is added automatically to allow owner to reset the stats - // get fun stats(): Int is added automatically to query the stats - // get fun owner(): Address is added automatically to query who the owner is -}`;function L(r){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(r.queryId,64)}}async function g(){const r=a.Cell.fromBase64("te6ccgECHAEAA3wAART/APSkE/S88sgLAQIBYgIDAtrQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MMj4QwHMfwHKAFUgWiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFhLLP8sfye1UGQQCASANDgKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wCwUCqvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwagSuzyfQDA4/Q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Une+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSCcEDOdWnnFfnSULAdYW4mR7KAIBahAOAhGzeLbPNs8bDGAcDwACIQIRsUd2zzbPGwxgHBEAAiIC2tAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zwwyPhDAcx/AcoAVSBaINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WEss/yx/J7VQcEwKu7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wGhQCqvkBIILwxPjXIxLt/e9be+x4M727Fi0VEb14qRKu0PJjevZVcq66jocw2zykf9sx4ILwagSuzyfQDA4/QYygK93T3PzDjfuHHaL6tsnnxzYYZQ+64wIYFQMs2zwxcIh/+EJwWAOAQgFtbds8AX/bMRcWGgAcAAAAAHJlc2V0IGRvbmUAEvhCUjDHBfLghAEO2zyTAaQB3hkAAn8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAGwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAGG7UTQ1AH4Y9IAAY4o+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTP9MfVSBsE+Aw+CjXCwqDCbry4InbPB0ACPhCcCDj7h7k");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const i=t.endCell();return{code:r,data:i}}const x={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(e,t){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]}],errors:x});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=a.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,i,s){let n=null;if(s==="increment"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(n=a.beginCell().store(L(s)).endCell()),s==="reset stats"&&(n=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),n===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:n})}async getValue(e){let t=new a.TupleBuilder;return(await e.get("value",t.build())).stack.readBigNumber()}async getStats(e){let t=new a.TupleBuilder;return(await e.get("stats",t.build())).stack.readBigNumber()}async getOwner(e){let t=new a.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function E(r,e,t){let i;I(r,d,o=>t(2,i=o));let s,n;return v(d,i={markdown:b,tactCode:p,deploy:async()=>{const o=await B.Blockchain.create(),A=await o.treasury("deployer");s=A.getSender(),n=o.openContract(await c.fromInit());const w={[A.address.toString()]:"deployer",[n.address.toString()]:"contract"};return[[n],w,[await n.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{increment:async()=>[await n.send(s,{value:a.toNano(1)},"increment")],"reset stats":async()=>[await n.send(s,{value:a.toNano(1)},"reset stats")]},getters:{value:async()=>await n.getValue(),stats:async()=>await n.getStats()},prev:u(import.meta.url).prev,next:u(import.meta.url).next},i),[]}class T extends y{constructor(e){super(),C(this,e,E,null,f,{})}}export{T as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.51d1628e.js b/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.51d1628e.js deleted file mode 100644 index 7f82ee5..0000000 --- a/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.51d1628e.js +++ /dev/null @@ -1,75 +0,0 @@ -var u=Object.defineProperty;var I=(s,e,n)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var i=(s,e,n)=>(I(s,typeof e!="symbol"?e+"":e,n),n);import{S as y,i as h,s as Q,I as p,ac as f}from"../chunks/index.9fe14626.js";import{d as A,g as l,s as B}from"../chunks/store.d3ab02ad.js";import{d as H}from"../chunks/index.78404594.js";const E=`# Authenticating Children - -If you look closely at the previous example you will notice that it is somewhat dangerous. - -What happens if some user tries to send a \`HiFromChild\` message and impersonate a child? What happens if some user tries to send a \`HiFromParent\` message and impersonate the parent? - -To add authentication that messages came from where we think they came from, we simply need to add \`require()\` in the beginning of every protected receiver and make sure that the sender is who we expect it is. - -It is best practice to add this authentication to every message coming from a parent and every message coming from a child. - -## Let's try to hack this contract - -Try pressing the Send HiFromChild{1} button. This will send the parent an impersonated \`HiFromChild\` message, but from some user, not from a real child. - -Since this code is now protected, it will notice that the sender is incorrect and reject the message with an access denied error.`,D=`import "@stdlib/deploy"; - -message HiFromParent { - greeting: String; -} - -message HiFromChild { - fromSeqno: Int as uint64; - greeting: String; -} - -// we have multiple instances of the children -contract TodoChild { - - parent: Address; // we added this variable so a child always knows who the parent is - seqno: Int as uint64; - - // when deploying an instance, we must specify its index (sequence number) - init(parent: Address, seqno: Int) { - self.parent = parent; - self.seqno = seqno; - } - - receive(msg: HiFromParent) { - require(sender() == self.parent, "Access denied"); - // only the real parent can get here - dump(self.seqno); - dump("handling hi from parent"); - reply(HiFromChild{fromSeqno: self.seqno, greeting: "sup"}.toCell()); - } -} - -// we have one instance of the parent -contract TodoParent with Deployable { - - init() {} - - receive("greet 3") { - let i: Int = 0; - repeat (3) { - i = i + 1; - let init: StateInit = initOf TodoChild(myAddress(), i); - send(SendParameters{ - to: contractAddress(init), - body: HiFromParent{greeting: "darling"}.toCell(), - value: ton("0.1"), // pay for message and potential deployment - mode: SendIgnoreErrors, - code: init.code, // if child is not deployed, also deploy it - data: init.data - }); - } - } - - receive(msg: HiFromChild) { - let expectedAddress: Address = contractAddress(initOf TodoChild(myAddress(), msg.fromSeqno)); - require(sender() == expectedAddress, "Access denied"); - // only the real children can get here - dump("handling hi from child"); - dump(msg.fromSeqno); - } -}`;function M(s){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(s.queryId,64)}}function L(s){return e=>{let n=e;n.storeUint(1237539370,32),n.storeUint(s.fromSeqno,64),n.storeStringRefTail(s.greeting)}}async function C(){const s=A.Cell.fromBase64("te6ccgECEwEABFIAART/APSkE/S88sgLAQIBYgIDAo7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwMMj4QwHMfwHKAMntVAQFAgFYDxABNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8BgPw7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEEnDWiq6jpYx0x8BghBJw1oquvLggdM/1AHQEmwS4CGCEJRqmLa6jq4x0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4AHAAJEw4w1wBwwIAAJtAuww+EP4KCLbPHBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAH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SmRtRmVoZFZnc2aCAAEbCvu1E0NIAAYAC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG9Sd75VFlvHHU9PeBVnDJoJwnZdOWrNOy3M6DpZtlGbopIAtDQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWVkg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbLP8ntVB8aATxwIddJwh+VMCDXCx/eApJbf+ABghDRqGpKuuMCMHAbAtjTHwGCENGoakq68uCB1AHQMTCCAME9+EJSMMcF8vQg2zz+FDCNBdoYW5kbGluZyBoaSBmcm9tIHBhcmVudIP4UMIs3N1cIUhDIWYIQScNaKlADyx/LP8hYzxbJAczJf/hCcFgDgEIBbW3bPH8eHAHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAdAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydAAzO1E0NQB+GPSAAGOJfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB0z9ZbBLg+CjXCwqDCbry4In6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAYEBAdcAWQLRAd1Oons=");let n=A.beginCell();n.storeRef(e),n.storeUint(0,1);const r=n.endCell();return{code:s,data:r}}const F={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},49469:{message:"Access denied"}};class c{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],errors:F});this.address=e,this.init=n}static async init(){return await C()}static async fromInit(){const e=await C(),n=A.contractAddress(0,e);return new c(n,e)}static fromAddress(e){return new c(e)}async send(e,n,r,t){let o=null;if(t==="greet 3"&&(o=A.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="HiFromChild"&&(o=A.beginCell().store(L(t)).endCell()),t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="Deploy"&&(o=A.beginCell().store(M(t)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(n,{...r,body:o})}}function S(s){return e=>{let n=e;n.storeUint(3517475402,32),n.storeStringRefTail(s.greeting)}}function b(s){return e=>{let n=e;n.storeAddress(s.parent),n.storeInt(s.seqno,257)}}async function w(s,e){const n=A.Cell.fromBase64("te6ccgECDgEAA08AART/APSkE/S88sgLAQIBYgIDAtDQAdDT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68uCIINcLCiCBBP+68tCJgwm68uCIAdM/WWwS4Pgo1wsKgwm68uCJ+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAGBAQHXAFkC0QHZjyx4");let t=A.beginCell();t.storeRef(r),t.storeUint(0,1),b({$$type:"TodoChild_init_args",parent:s,seqno:e})(t);const o=t.endCell();return{code:n,data:o}}const J={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},49469:{message:"Access denied"}};class d{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],errors:J});this.address=e,this.init=n}static async init(e,n){return await w(e,n)}static async fromInit(e,n){const r=await w(e,n),t=A.contractAddress(0,r);return new d(t,r)}static fromAddress(e){return new d(e)}async send(e,n,r,t){let o=null;if(t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="HiFromParent"&&(o=A.beginCell().store(S(t)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(n,{...r,body:o})}}function v(s,e,n){let r;p(s,B,g=>n(3,r=g));let t,o,a;return f(B,r={markdown:E,tactCode:D,deploy:async()=>{t=await H.Blockchain.create();const g=await t.treasury("deployer");o=g.getSender(),a=t.openContract(await c.fromInit());const m={[g.address.toString()]:"deployer",[a.address.toString()]:"TodoParent",[(await d.fromInit(a.address,1n)).address.toString()]:"TodoChild(1)",[(await d.fromInit(a.address,2n)).address.toString()]:"TodoChild(2)",[(await d.fromInit(a.address,3n)).address.toString()]:"TodoChild(3)"};return[[a],m,[await a.send(g.getSender(),{value:A.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"greet 3":async()=>[await a.send(o,{value:A.toNano(1)},"greet 3")],"HiFromChild{1}":async()=>[await a.send(o,{value:A.toNano(1)},{$$type:"HiFromChild",fromSeqno:1n,greeting:"hack"})]},getters:{},prev:l(import.meta.url).prev,next:l(import.meta.url).next},r),[]}class k extends y{constructor(e){super(),h(this,e,v,null,Q,{})}}export{k as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.cd310397.js b/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.cd310397.js new file mode 100644 index 0000000..b94c065 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-authenticating-children-page.svelte.cd310397.js @@ -0,0 +1,84 @@ +var B=Object.defineProperty;var w=(s,e,n)=>e in s?B(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var l=(s,e,n)=>(w(s,typeof e!="symbol"?e+"":e,n),n);import{S as C,i as h,s as u,I as f,ac as D}from"../chunks/index.9fe14626.js";import{d as a,g as c,s as m}from"../chunks/store.476c3091.js";import{d as Q}from"../chunks/index.c056099e.js";const E=`# Authenticating Children + +If you look closely at the previous example you will notice that it is somewhat dangerous. + +What happens if some user tries to send a \`HiFromChild\` message and impersonate a child? What happens if some user tries to send a \`HiFromParent\` message and impersonate the parent? + +To add authentication that messages came from where we think they came from, we simply need to add \`require()\` in the beginning of every protected receiver and make sure that the sender is who we expect it is. + +It is best practice to add this authentication to every message coming from a parent and every message coming from a child. + +## Let's try to hack this contract + +Try pressing the Send HiFromChild{1} button. This will send the parent an impersonated \`HiFromChild\` message, but from some user, not from a real child. + +Since this code is now protected, it will notice that the sender is incorrect and reject the message with an access denied error. + +
+
+ Info: Having a error break in the \`Send HiFromChild{1}\` button is expected. Because only the message from the child can be accepted. +
+`,H=`import "@stdlib/deploy"; + +message HiFromParent { + greeting: String; +} + +message HiFromChild { + fromSeqno: Int as uint64; + greeting: String; +} + +// we have multiple instances of the children +contract TodoChild { + + parent: Address; // we added this variable so a child always knows who the parent is + seqno: Int as uint64; + + // when deploying an instance, we must specify its index (sequence number) + init(parent: Address, seqno: Int) { + require(sender() == parent, "not the parent"); + self.parent = parent; + self.seqno = seqno; + } + + receive(msg: HiFromParent) { + require(sender() == self.parent, "Access denied"); // only the real parent can get here + + dump(self.seqno); + dump("😃 handling hi from parent"); + self.reply(HiFromChild{fromSeqno: self.seqno, greeting: "sup"}.toCell()); + } +} + +// we have one instance of the parent +contract TodoParent with Deployable { + + init() {} + + receive("greet 3") { + let i: Int = 0; + repeat (3) { + i = i + 1; + let init: StateInit = initOf TodoChild(myAddress(), i); + send(SendParameters{ + to: contractAddress(init), + body: HiFromParent{ greeting: "darling" }.toCell(), + value: ton("0.1"), // pay for message and potential deployment + mode: SendIgnoreErrors, + code: init.code, // if child is not deployed, also deploy it + data: init.data + }); + } + } + + receive(msg: HiFromChild) { + let expectedAddress: Address = contractAddress(initOf TodoChild(myAddress(), msg.fromSeqno)); + + require(sender() == expectedAddress, "Access denied"); + // only the real children can get here + + dump(msg.fromSeqno); + dump("😑 handling hi from child"); + } +}`;function L(s){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(s.queryId,64)}}function b(s){return e=>{let n=e;n.storeUint(1237539370,32),n.storeUint(s.fromSeqno,64),n.storeStringRefTail(s.greeting)}}async function p(){const s=a.Cell.fromBase64("te6ccgECFAEABHIAART/APSkE/S88sgLAQIBYgIDApLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQU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iJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwA3sghwQCYgC0BywcBowHeIYI4Mnyyc0EZ07epqh25jiBwIHGOFAR6qQymMCWoEqAEqgcCpCHAAEUw5jAzqgLPAY4rbwBwjhEjeqkIEm+MAaQDeqkEIMAAFOYzIqUDnFMCb4GmMFjLBwKlWeQwMeLJ0AHQ7UTQ1AH4Y9IAAY4l+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTP1lsEuD4KNcLCoMJuvLgifpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgBgQEB1wBZAtEB2zwhABiCANvJ+EJSMMcF8vRc3PRt");let n=a.beginCell();n.storeRef(e),n.storeUint(0,1);const o=n.endCell();return{code:s,data:o}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},49469:{message:"Access denied"},56265:{message:"not the parent"}},S=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"HiFromParent",header:3517475402,fields:[{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]},{name:"HiFromChild",header:1237539370,fields:[{name:"fromSeqno",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]}],k=[],M=[{receiver:"internal",message:{kind:"text",text:"greet 3"}},{receiver:"internal",message:{kind:"typed",type:"HiFromChild"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class g{constructor(e,n){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],types:S,getters:k,receivers:M,errors:v});this.address=e,this.init=n}static async init(){return await p()}static async fromInit(){const e=await p(),n=a.contractAddress(0,e);return new g(n,e)}static fromAddress(e){return new g(e)}async send(e,n,o,t){let i=null;if(t==="greet 3"&&(i=a.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="HiFromChild"&&(i=a.beginCell().store(b(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(i=a.beginCell().store(L(t)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:i})}}function F(s){return e=>{let n=e;n.storeUint(3517475402,32),n.storeStringRefTail(s.greeting)}}function J(s){return e=>{let n=e;n.storeAddress(s.parent),n.storeInt(s.seqno,257)}}async function y(s,e){const n=a.Cell.fromBase64("te6ccgECEAEAA4AAART/APSkE/S88sgLAQIBYgIDAtTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFss/ye1UBAUCAVgMDQHQ7UTQ1AH4Y9IAAY4l+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHTP1lsEuD4KNcLCoMJuvLgifpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgBgQEB1wBZAtEB2zwGAToBkjB/4HAh10nCH5UwINcLH96CENGoakq64wIwcAcAGIIA28n4QlIwxwXy9ALW0x8BghDRqGpKuvLggdQB0DEwggDBPfhCUjDHBfL0INs8/hQwjQc8J+YgyBoYW5kbGluZyBoaSBmcm9tIHBhcmVudIP4UMIs3N1cIUhDIWYIQScNaKlADyx/LP8hYzxbJAczJ+EIBf23bPH8ICQDeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAoByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINc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Im6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8DQHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAOAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydAB0O1E0NQB+GPSAAGOJfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB0z9ZbBLg+CjXCwqDCbry4In6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAYEBAdcAWQLRAds8EQAYggDbyfhCUjDHBfL0308J2A==");let t=a.beginCell();t.storeRef(o),t.storeUint(0,1),J({$$type:"TodoChild_init_args",parent:s,seqno:e})(t);const i=t.endCell();return{code:n,data:i}}const Y={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},49469:{message:"Access denied"},56265:{message:"not the parent"}},T=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"HiFromParent",header:3517475402,fields:[{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]},{name:"HiFromChild",header:1237539370,fields:[{name:"fromSeqno",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]}],z=[],P=[{receiver:"internal",message:{kind:"typed",type:"HiFromParent"}}];class d{constructor(e,n){l(this,"address");l(this,"init");l(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],types:T,getters:z,receivers:P,errors:Y});this.address=e,this.init=n}static async init(e,n){return await y(e,n)}static async fromInit(e,n){const o=await y(e,n),t=a.contractAddress(0,o);return new d(t,o)}static fromAddress(e){return new d(e)}async send(e,n,o,t){let i=null;if(t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="HiFromParent"&&(i=a.beginCell().store(F(t)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:i})}}function q(s,e,n){let o;f(s,m,A=>n(3,o=A));let t,i,r;return D(m,o={markdown:E,tactCode:H,deploy:async()=>{t=await Q.Blockchain.create();const A=await t.treasury("deployer");i=A.getSender(),r=t.openContract(await g.fromInit());const I={[A.address.toString()]:"deployer",[r.address.toString()]:"TodoParent",[(await d.fromInit(r.address,1n)).address.toString()]:"TodoChild(1)",[(await d.fromInit(r.address,2n)).address.toString()]:"TodoChild(2)",[(await d.fromInit(r.address,3n)).address.toString()]:"TodoChild(3)"};return[[r],I,[await r.send(A.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"greet 3":async()=>[await r.send(i,{value:a.toNano(1)},"greet 3")],"HiFromChild{1}":async()=>[await r.send(i,{value:a.toNano(1)},{$$type:"HiFromChild",fromSeqno:1n,greeting:"hack"})]},getters:{},prev:c(import.meta.url).prev,next:c(import.meta.url).next},o),[]}class W extends C{constructor(e){super(),h(this,e,q,null,u,{})}}export{W as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.76c19e85.js b/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.76c19e85.js deleted file mode 100644 index 4f36140..0000000 --- a/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.76c19e85.js +++ /dev/null @@ -1,49 +0,0 @@ -var I=Object.defineProperty;var C=(n,e,t)=>e in n?I(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var a=(n,e,t)=>(C(n,typeof e!="symbol"?e+"":e,t),t);import{S as Q,i as m,s as E,I as f,ac as D}from"../chunks/index.9fe14626.js";import{d as A,g as l,s as B}from"../chunks/store.d3ab02ad.js";import{d as H}from"../chunks/index.78404594.js";const h=`# Calculate Contract Address - -When a contract is deployed to the chain, it receives an address by which users can refer to it and send it transactions. - -In this example, we have two different contracts: \`Todo1\` and \`Todo2\`. They are deployed separately and each gets its own unique address. As we've seen before, a contract can always know its own address by running \`myAddress()\`. - -The special bit in this example is that each contract can also get the address of the other contract by running \`contractAddress(stateInit)\`. - -## How is the contract address generated? - -Contract addresses on TON are [derived](https://docs.ton.org/learn/overviews/addresses#account-id) from the initial code of the contract (the compiled bytecode) and the initial data of the contract (the arguments of init). - -Both contracts don't have any constructor arguments, so their initial data is the identical. Their addresses are different because their code is different. - -The combination of the inital code and the initial data is called the *stateInit* of the contract. Tact gives easy access to the *stateInit* using the \`initOf\` statement.`,b=`import "@stdlib/deploy"; - -// first contract -contract Todo1 with Deployable { - - seqno: Int as uint64 = 1; // the code specifies the index (sequence number) - - init() {} - - get fun myAddress(): Address { - return myAddress(); - } - - get fun otherAddress(): Address { - let init: StateInit = initOf Todo2(); - return contractAddress(init); - } -} - -// second contract -contract Todo2 with Deployable { - - seqno: Int as uint64 = 2; // the code specifies the index (sequence number) - - init() {} - - get fun myAddress(): Address { - return myAddress(); - } - - get fun otherAddress(): Address { - let init: StateInit = initOf Todo1(); - return contractAddress(init); - } -}`;function p(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function y(){const n=A.Cell.fromBase64("te6ccgECFAEAAu4AART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVA4EAgEgBwgBmHAh10nCH5UwINcLH94Cklt/4AGCEJRqmLa6jq3THwGCEJRqmLa68uCB0z8BMcgB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Nus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAIwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTTPwEx4DD4KNcLCoMJuvLgids8JQACcu7MdzQ=");let t=A.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:n,data:r}}const L={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class i{constructor(e,t){a(this,"address");a(this,"init");a(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:L});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=A.contractAddress(0,e);return new i(t,e)}static fromAddress(e){return new i(e)}async send(e,t,r,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof A.Slice)&&s.$$type==="Deploy"&&(o=A.beginCell().store(p(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getMyAddress(e){let t=new A.TupleBuilder;return(await e.get("myAddress",t.build())).stack.readAddress()}async getOtherAddress(e){let t=new A.TupleBuilder;return(await e.get("otherAddress",t.build())).stack.readAddress()}}function M(n){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(n.queryId,64)}}async function u(){const n=A.Cell.fromBase64("te6ccgECFAEAAu4AART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVA4EAgEgBwgBmHAh10nCH5UwINcLH94Cklt/4AGCEJRqmLa6jq3THwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gMHAFAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAYAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCD718Ltnm2eGMDgkCASAKCwAE+CgCASAMDQIBSBITAg+3a/tnm2eGMA4PALm3ejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzBOBAq4A3AM7HKZywdVyOS2WHBOA3qTvfKost446np7wKs4ZNBOE7Lpy1Zp2W5nQdLNsozdFJABPO1E0NQB+GPSAAGU0z8BMeAw+CjXCwqDCbry4InbPBABivhD2zxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBEAAnIAiND0BDBtIYFrxQGAEPQPb6Hy4IcBgWvFIgKAEPQXAoFbpgGAEPQPb6Hy4IcSgVumAQKAEPQXyAHI9ADJAcxwAcoAbTDJABGwr7tRNDSAAGAAdbJu40NWlwZnM6Ly9RbVRTVnNlUVlzUlFjdUxOMUozb21zblQ2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AcxwAcoAbTDJAg+9fC7Z5tnhjCQfAAT4KAKU0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds8MMj4QwHMfwHKAAEByz/J7VQkIQGYcCHXScIflTAg1wsf3gKSW3/gAYIQlGqYtrqOrdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+AwcCIByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAIwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAE87UTQ1AH4Y9IAAZTTPwEx4DD4KNcLCoMJuvLgids8JQACcu7MdzQ=");let t=A.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:n,data:r}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class g{constructor(e,t){a(this,"address");a(this,"init");a(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:v});this.address=e,this.init=t}static async init(){return await u()}static async fromInit(){const e=await u(),t=A.contractAddress(0,e);return new g(t,e)}static fromAddress(e){return new g(e)}async send(e,t,r,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof A.Slice)&&s.$$type==="Deploy"&&(o=A.beginCell().store(M(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:o})}async getMyAddress(e){let t=new A.TupleBuilder;return(await e.get("myAddress",t.build())).stack.readAddress()}async getOtherAddress(e){let t=new A.TupleBuilder;return(await e.get("otherAddress",t.build())).stack.readAddress()}}function T(n,e,t){let r;f(n,B,c=>t(3,r=c));let s,o;return D(B,r={markdown:h,tactCode:b,deploy:async()=>{const c=await H.Blockchain.create(),d=await c.treasury("deployer");d.getSender(),s=c.openContract(await i.fromInit()),o=c.openContract(await g.fromInit());const w={[d.address.toString()]:"deployer",[s.address.toString()]:"Todo1",[o.address.toString()]:"Todo2"};return[[s,o],w,[await s.send(d.getSender(),{value:A.toNano(1)},{$$type:"Deploy",queryId:0n}),await o.send(d.getSender(),{value:A.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{"Todo1.myAddress":async()=>await s.getMyAddress(),"Todo1.otherAddress":async()=>await s.getOtherAddress(),"Todo2.myAddress":async()=>await o.getMyAddress(),"Todo2.otherAddress":async()=>await o.getOtherAddress()},prev:l(import.meta.url).prev,next:l(import.meta.url).next},r),[]}class K extends Q{constructor(e){super(),m(this,e,T,null,E,{})}}export{K as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.cb0e43f2.js b/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.cb0e43f2.js new file mode 100644 index 0000000..af3b061 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-calc-contract-address-page.svelte.cb0e43f2.js @@ -0,0 +1,49 @@ +var B=Object.defineProperty;var w=(a,e,t)=>e in a?B(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(w(a,typeof e!="symbol"?e+"":e,t),t);import{S as I,i as f,s as h,I as C,ac as Q}from"../chunks/index.9fe14626.js";import{d as n,g as y,s as g}from"../chunks/store.476c3091.js";import{d as D}from"../chunks/index.c056099e.js";const E=`# Calculate Contract Address + +When a contract is deployed to the chain, it receives an address by which users can refer to it and send it transactions. + +In this example, we have two different contracts: \`Todo1\` and \`Todo2\`. They are deployed separately and each gets its own unique address. As we've seen before, a contract can always know its own address by running \`myAddress()\`. + +The special bit in this example is that each contract can also get the address of the other contract by running \`contractAddress(stateInit)\`. + +## How is the contract address generated? + +Contract addresses on TON are [derived](https://docs.ton.org/learn/overviews/addresses#account-id) from the initial code of the contract (the compiled bytecode) and the initial data of the contract (the arguments of init). + +Both contracts don't have any constructor arguments, so their initial data is the identical. Their addresses are different because their code is different. + +The combination of the inital code and the initial data is called the *stateInit* of the contract. Tact gives easy access to the *stateInit* using the \`initOf\` statement.`,b=`import "@stdlib/deploy"; + +// first contract +contract Todo1 with Deployable { + + seqno: Int as uint64 = 1; // the code specifies the index (sequence number) + + init() {} + + get fun myAddress(): Address { + return myAddress(); + } + + get fun otherAddress(): Address { + let init: StateInit = initOf Todo2(); + return contractAddress(init); + } +} + +// second contract +contract Todo2 with Deployable { + + seqno: Int as uint64 = 2; // the code specifies the index (sequence number) + + init() {} + + get fun myAddress(): Address { + return myAddress(); + } + + get fun otherAddress(): Address { + let init: StateInit = initOf Todo1(); + return contractAddress(init); + } +}`;function H(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function p(){const a=n.Cell.fromBase64("te6ccgECFQEAAwkAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcs/ye1UDwQCASAICQGKAZIwf+BwIddJwh+V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kcAMEgEJQI9s8IwHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAkAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNM/ATHgMPgo1wsKgwm68uCJ2zwmAAJytuyp7A==");let t=n.beginCell();t.storeRef(e),t.storeUint(0,1);const A=t.endCell();return{code:a,data:A}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},v=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],L=[{name:"myAddress",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}},{name:"otherAddress",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],k=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class l{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:v,getters:L,receivers:k,errors:M});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=n.contractAddress(0,e);return new l(t,e)}static fromAddress(e){return new l(e)}async send(e,t,A,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof n.Slice)&&s.$$type==="Deploy"&&(o=n.beginCell().store(H(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...A,body:o})}async getMyAddress(e){let t=new n.TupleBuilder;return(await e.get("myAddress",t.build())).stack.readAddress()}async getOtherAddress(e){let t=new n.TupleBuilder;return(await e.get("otherAddress",t.build())).stack.readAddress()}}function T(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function m(){const a=n.Cell.fromBase64("te6ccgECFQEAAwkAART/APSkE/S88sg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H8BygABAcs/ye1UJSEBigGSMH/gcCHXScIflTAg1wsf3oIQlGqYtrqOp9MfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+AwcCIBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8IwHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAkAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMATztRNDUAfhj0gABlNM/ATHgMPgo1wsKgwm68uCJ2zwmAAJytuyp7A==");let t=n.beginCell();t.storeRef(e),t.storeUint(0,1);const A=t.endCell();return{code:a,data:A}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},z=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],N=[{name:"myAddress",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}},{name:"otherAddress",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],J=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:z,getters:N,receivers:J,errors:S});this.address=e,this.init=t}static async init(){return await m()}static async fromInit(){const e=await m(),t=n.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,A,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof n.Slice)&&s.$$type==="Deploy"&&(o=n.beginCell().store(T(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...A,body:o})}async getMyAddress(e){let t=new n.TupleBuilder;return(await e.get("myAddress",t.build())).stack.readAddress()}async getOtherAddress(e){let t=new n.TupleBuilder;return(await e.get("otherAddress",t.build())).stack.readAddress()}}function P(a,e,t){let A;C(a,g,i=>t(3,A=i));let s,o;return Q(g,A={markdown:E,tactCode:b,deploy:async()=>{const i=await D.Blockchain.create(),d=await i.treasury("deployer");d.getSender(),s=i.openContract(await l.fromInit()),o=i.openContract(await c.fromInit());const u={[d.address.toString()]:"deployer",[s.address.toString()]:"Todo1",[o.address.toString()]:"Todo2"};return[[s,o],u,[await s.send(d.getSender(),{value:n.toNano(1)},{$$type:"Deploy",queryId:0n}),await o.send(d.getSender(),{value:n.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{"Todo1.myAddress":async()=>await s.getMyAddress(),"Todo1.otherAddress":async()=>await s.getOtherAddress(),"Todo2.myAddress":async()=>await o.getMyAddress(),"Todo2.otherAddress":async()=>await o.getOtherAddress()},prev:y(import.meta.url).prev,next:y(import.meta.url).next},A),[]}class X extends I{constructor(e){super(),f(this,e,P,null,h,{})}}export{X as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-communicating-children-page.svelte.b1f7a8a7.js b/docs/_app/immutable/entry/(examples)-06-communicating-children-page.svelte.b1f7a8a7.js deleted file mode 100644 index 80418df..0000000 --- a/docs/_app/immutable/entry/(examples)-06-communicating-children-page.svelte.b1f7a8a7.js +++ /dev/null @@ -1,68 +0,0 @@ -var y=Object.defineProperty;var u=(s,e,n)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var i=(s,e,n)=>(u(s,typeof e!="symbol"?e+"":e,n),n);import{S as h,i as I,s as p,I as H,ac as f}from"../chunks/index.9fe14626.js";import{d as A,g as l,s as B}from"../chunks/store.d3ab02ad.js";import{d as Q}from"../chunks/index.78404594.js";const M=`# Communicating with Children - -In a parent-child relationship, the user would normally just deploy the parent. This is what's happening here when you press the Deploy button. - -In this example, the user is only supposed to communicate with the parent. You can send the parent contract a message by pressing the Send greet 3 button. - -This message will instruct the parent to send its own \`HiFromParent\` message to the first 3 children. Every child will respond to the greeting by sending the parent its own \`HiFromChild\` back. - -## How can parent know if a child is deployed? - -You can't send a message to a contract until it is deployed. How can the parent guarantee that they're not communicating with a child that wasn't deployed yet? - -The best practice is to include the *stateInit* on every message. This way, if the child isn't deployed, it will be. If the child is already deployed, this field will be ignored. - -This is called lazy deployment.`,b=`import "@stdlib/deploy"; - -message HiFromParent { - greeting: String; -} - -message HiFromChild { - fromSeqno: Int as uint64; - greeting: String; -} - -// we have multiple instances of the children -contract TodoChild { - - seqno: Int as uint64; - - // when deploying an instance, we must specify its index (sequence number) - init(seqno: Int) { - self.seqno = seqno; - } - - receive(msg: HiFromParent) { - dump(self.seqno); - dump("handling hi from parent"); - reply(HiFromChild{fromSeqno: self.seqno, greeting: "sup"}.toCell()); - } -} - -// we have one instance of the parent -contract TodoParent with Deployable { - - init() {} - - receive("greet 3") { - let i: Int = 0; - repeat (3) { - i = i + 1; - let init: StateInit = initOf TodoChild(i); - send(SendParameters{ - to: contractAddress(init), - body: HiFromParent{greeting: "darling"}.toCell(), - value: ton("0.1"), // pay for message and potential deployment - mode: SendIgnoreErrors, - code: init.code, // if child is not deployed, also deploy it - data: init.data - }); - } - } - - receive(msg: HiFromChild) { - dump("handling hi from child"); - dump(msg.fromSeqno); - } -}`;function D(s){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(s.queryId,64)}}function F(s){return e=>{let n=e;n.storeUint(1237539370,32),n.storeUint(s.fromSeqno,64),n.storeStringRefTail(s.greeting)}}async function w(){const s=A.Cell.fromBase64("te6ccgECEgEAA9YAART/APSkE/S88sgLAQIBYgIDAo7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwMMj4QwHMfwHKAMntVAQFAgFYDg8BNO1E0NQB+GPSADCRbeD4KNcLCoMJuvLgids8BgPY7aLt+3Ah10nCH5UwINcLH94Cklt/4CGCEEnDWiq6jrkx0x8BghBJw1oquvLggdM/1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QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFnbPDDI+EMBzH8BygABAcs/ye1UHhkBPHAh10nCH5UwINcLH94Cklt/4AGCENGoakq64wIwcBoCwNMfAYIQ0ahqSrry4IHUAdAxMCDbPP4UMI0F2hhbmRsaW5nIGhpIGZyb20gcGFyZW50g/hQwizc3VwhSEMhZghBJw1oqUAPLH8s/yFjPFskBzMl/+EJwWAOAQgFtbds8fx0bAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7ABwAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwA3sghwQCYgC0BywcBowHeIYI4Mnyyc0EZ07epqh25jiBwIHGOFAR6qQymMCWoEqAEqgcCpCHAAEUw5jAzqgLPAY4rbwBwjhEjeqkIEm+MAaQDeqkEIMAAFOYzIqUDnFMCb4GmMFjLBwKlWeQwMeLJ0ABG7UTQ1AH4Y9IAAZTTPwEx4Pgo1wsKgwm68uCJgQEB1wABAdGYWKXA");let n=A.beginCell();n.storeRef(e),n.storeUint(0,1);const o=n.endCell();return{code:s,data:o}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class d{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],errors:E});this.address=e,this.init=n}static async init(){return await w()}static async fromInit(){const e=await w(),n=A.contractAddress(0,e);return new d(n,e)}static fromAddress(e){return new d(e)}async send(e,n,o,t){let r=null;if(t==="greet 3"&&(r=A.beginCell().storeUint(0,32).storeStringTail(t).endCell()),t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="HiFromChild"&&(r=A.beginCell().store(F(t)).endCell()),t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="Deploy"&&(r=A.beginCell().store(D(t)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:r})}}function L(s){return e=>{let n=e;n.storeUint(3517475402,32),n.storeStringRefTail(s.greeting)}}function J(s){return e=>{e.storeInt(s.seqno,257)}}async function m(s){const e=A.Cell.fromBase64("te6ccgECDgEAAuIAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVAQFAgFYCgsARu1E0NQB+GPSAAGU0z8BMeD4KNcLCoMJuvLgiYEBAdcAAQHRATxwIddJwh+VMCDXCx/eApJbf+ABghDRqGpKuuMCMHAGAsDTHwGCENGoakq68uCB1AHQMTAg2zz+FDCNBdoYW5kbGluZyBoaSBmcm9tIHBhcmVudIP4UMIs3N1cIUhDIWYIQScNaKlADyx/LP8hYzxbJAczJf/hCcFgDgEIBbW3bPH8HCADeyCHBAJiALQHLBwGjAd4hgjg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DEwINs8/hQwjQXaGFuZGxpbmcgaGkgZnJvbSBwYXJlbnSD+FDCLNzdXCFIQyFmCEEnDWipQA8sfyz/IWM8WyQHMyX/4QnBYA4BCAW1t2zx/DgwByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzADeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0RZHTB4=");let o=A.beginCell();o.storeRef(n),o.storeUint(0,1),J({$$type:"TodoChild_init_args",seqno:s})(o);const t=o.endCell();return{code:e,data:t}}const S={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class a{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],errors:S});this.address=e,this.init=n}static async init(e){return await m(e)}static async fromInit(e){const n=await m(e),o=A.contractAddress(0,n);return new a(o,n)}static fromAddress(e){return new a(e)}async send(e,n,o,t){let r=null;if(t&&typeof t=="object"&&!(t instanceof A.Slice)&&t.$$type==="HiFromParent"&&(r=A.beginCell().store(L(t)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(n,{...o,body:r})}}function T(s,e,n){let o;H(s,B,c=>n(3,o=c));let t,r,g;return f(B,o={markdown:M,tactCode:b,deploy:async()=>{t=await Q.Blockchain.create();const c=await t.treasury("deployer");r=c.getSender(),g=t.openContract(await d.fromInit());const C={[c.address.toString()]:"deployer",[g.address.toString()]:"TodoParent",[(await a.fromInit(1n)).address.toString()]:"TodoChild(1)",[(await a.fromInit(2n)).address.toString()]:"TodoChild(2)",[(await a.fromInit(3n)).address.toString()]:"TodoChild(3)"};return[[g],C,[await g.send(c.getSender(),{value:A.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"greet 3":async()=>[await g.send(r,{value:A.toNano(1)},"greet 3")]},getters:{},prev:l(import.meta.url).prev,next:l(import.meta.url).next},o),[]}class U extends h{constructor(e){super(),I(this,e,T,null,p,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-communicating-subcontract-page.svelte.a6a9d9a0.js b/docs/_app/immutable/entry/(examples)-06-communicating-subcontract-page.svelte.a6a9d9a0.js new file mode 100644 index 0000000..d78954a --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-communicating-subcontract-page.svelte.a6a9d9a0.js @@ -0,0 +1,68 @@ +var u=Object.defineProperty;var w=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var r=(s,e,t)=>(w(s,typeof e!="symbol"?e+"":e,t),t);import{S as C,i as f,s as I,I as h,ac as H}from"../chunks/index.9fe14626.js";import{d as a,g as c,s as m}from"../chunks/store.476c3091.js";import{d as b}from"../chunks/index.c056099e.js";const Q=`# Communicating with Children + +In a parent-child relationship, the user would normally just deploy the parent. This is what's happening here when you press the Deploy button. + +In this example, the user is only supposed to communicate with the parent. You can send the parent contract a message by pressing the Send greet 3 button. + +This message will instruct the parent to send its own \`HiFromParent\` message to the first 3 children. Every child will respond to the greeting by sending the parent its own \`HiFromChild\` back. + +## How can parent know if a child is deployed? + +You can't send a message to a contract until it is deployed. How can the parent guarantee that they're not communicating with a child that wasn't deployed yet? + +The best practice is to include the *stateInit* on every message. This way, if the child isn't deployed, it will be. If the child is already deployed, this field will be ignored. + +This is called lazy deployment.`,D=`import "@stdlib/deploy"; + +message HiFromParent { + greeting: String; +} + +message HiFromChild { + fromSeqno: Int as uint64; + greeting: String; +} + +// we have multiple instances of the children +contract TodoChild { + + seqno: Int as uint64; + + // when deploying an instance, we must specify its index (sequence number) + init(seqno: Int) { + self.seqno = seqno; + } + + receive(msg: HiFromParent) { + dump(self.seqno); + dump("😃 handling hi from parent"); + self.reply(HiFromChild{fromSeqno: self.seqno, greeting: "sup"}.toCell()); + } +} + +// we have one instance of the parent +contract TodoParent with Deployable { + + init() {} + + receive("greet 3") { + let i: Int = 0; + repeat (3) { + i = i + 1; + let init: StateInit = initOf TodoChild(i); + send(SendParameters{ + to: contractAddress(init), + body: HiFromParent{greeting: "darling"}.toCell(), + value: ton("0.1"), // pay for message and potential deployment + mode: SendIgnoreErrors, + code: init.code, // if child is not deployed, also deploy it + data: init.data + }); + } + } + + receive(msg: HiFromChild) { + dump("😑 handling hi from child"); + dump(msg.fromSeqno); + } +}`;function k(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function M(s){return e=>{let t=e;t.storeUint(1237539370,32),t.storeUint(s.fromSeqno,64),t.storeStringRefTail(s.greeting)}}async function p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(e),t.storeUint(0,1);const i=t.endCell();return{code:s,data:i}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},S=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"HiFromParent",header:3517475402,fields:[{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]},{name:"HiFromChild",header:1237539370,fields:[{name:"fromSeqno",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]}],F=[],v=[{receiver:"internal",message:{kind:"text",text:"greet 3"}},{receiver:"internal",message:{kind:"typed",type:"HiFromChild"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class g{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],types:S,getters:F,receivers:v,errors:E});this.address=e,this.init=t}static async init(){return await p()}static async fromInit(){const e=await p(),t=a.contractAddress(0,e);return new g(t,e)}static fromAddress(e){return new g(e)}async send(e,t,i,n){let o=null;if(n==="greet 3"&&(o=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="HiFromChild"&&(o=a.beginCell().store(M(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(o=a.beginCell().store(k(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}}function T(s){return e=>{let t=e;t.storeUint(3517475402,32),t.storeStringRefTail(s.greeting)}}function J(s){return e=>{e.storeInt(s.seqno,257)}}async function y(s){const e=a.Cell.fromBase64("te6ccgECDwEAAwMAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH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r7tRNDSAAGAAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAKY0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8Wds88uCCyPhDAcx/AcoAAQHLP8ntVBAKA/YBkjB/4HAh10nCH5UwINcLH96CENGoakq6j1/THwGCENGoakq68uCB1AHQMTAg2zz+FDCNBzwn5iDIGhhbmRsaW5nIGhpIGZyb20gcGFyZW50g/hQwizc3VwhSEMhZghBJw1oqUAPLH8s/yFjPFskBzMn4QgF/bds8f+APDAsABDBwATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPA0ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzADeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0Ultvuw=");let i=a.beginCell();i.storeRef(t),i.storeUint(0,1),J({$$type:"TodoChild_init_args",seqno:s})(i);const n=i.endCell();return{code:e,data:n}}const P={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},L=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"HiFromParent",header:3517475402,fields:[{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]},{name:"HiFromChild",header:1237539370,fields:[{name:"fromSeqno",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"greeting",type:{kind:"simple",type:"string",optional:!1}}]}],z=[],G=[{receiver:"internal",message:{kind:"typed",type:"HiFromParent"}}];class l{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"HiFromParent",header:3517475402,fields:[]},{name:"HiFromChild",header:1237539370,fields:[]}],types:L,getters:z,receivers:G,errors:P});this.address=e,this.init=t}static async init(e){return await y(e)}static async fromInit(e){const t=await y(e),i=a.contractAddress(0,t);return new l(i,t)}static fromAddress(e){return new l(e)}async send(e,t,i,n){let o=null;if(n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="HiFromParent"&&(o=a.beginCell().store(T(n)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...i,body:o})}}function q(s,e,t){let i;h(s,m,d=>t(3,i=d));let n,o,A;return H(m,i={markdown:Q,tactCode:D,deploy:async()=>{n=await b.Blockchain.create();const d=await n.treasury("deployer");o=d.getSender(),A=n.openContract(await g.fromInit());const B={[d.address.toString()]:"deployer",[A.address.toString()]:"TodoParent",[(await l.fromInit(1n)).address.toString()]:"TodoChild(1)",[(await l.fromInit(2n)).address.toString()]:"TodoChild(2)",[(await l.fromInit(3n)).address.toString()]:"TodoChild(3)"};return[[A],B,[await A.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"greet 3":async()=>[await A.send(o,{value:a.toNano(1)},"greet 3")]},getters:{},prev:c(import.meta.url).prev,next:c(import.meta.url).next},i),[]}class W extends C{constructor(e){super(),f(this,e,q,null,I,{})}}export{W as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.7deaf25a.js b/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.7deaf25a.js new file mode 100644 index 0000000..1627255 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.7deaf25a.js @@ -0,0 +1,46 @@ +var m=Object.defineProperty;var B=(s,e,t)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var A=(s,e,t)=>(B(s,typeof e!="symbol"?e+"":e,t),t);import{S as u,i as w,s as f,I as h,ac as C}from"../chunks/index.9fe14626.js";import{d as o,g as y,s as g}from"../chunks/store.476c3091.js";import{d as I}from"../chunks/index.c056099e.js";const b=`# A Contract Deploying Another + +Contracts are not necessarily only deployed by users, they can also be deployed by other contracts. + +In this example, when pressing the Deploy button, we only deploy one contract instance - the one with constructor argument 1. + +The second instance (with constructor argument 2) will be deployed by the first contract instance when it receives the \`deploy 2nd\` message. Send this message to the first instance by pressing the Send "deploy 2nd" to 1 button. + +## Messages containing state init + +The combination of the inital code and the initial data of a contract is called the *stateInit* of the contract. + +When sending any message to a contract, we can attach its *stateInit* by specifying the \`code\` and \`data\` fields of the message. This will deploy the contract if it has not already been deployed. If the contract has already been deployed, these fields will be ignored. + +Notice that in this example, we piggyback the deployment on the \`indentify\` message. +`,v=`import "@stdlib/deploy"; + +// we're going to have multiple instances of this contract, each with a different seqno +contract Todo with Deployable { + + seqno: Int as uint64; + + // when deploying an instance, we must specify its index (sequence number) + init(seqno: Int) { + self.seqno = seqno; + } + + // this message handler will just debug print the seqno so we can see when it's called + receive("identify") { + dump(self.seqno); + } + + // this message handler will cause the contract to deploy the second instance + receive("deploy 2nd") { + let init: StateInit = initOf Todo(2); + let address: Address = contractAddress(init); + send(SendParameters{ + to: address, + value: ton("0.1"), // pay for message, the deployment and give some TON for storage + mode: SendIgnoreErrors, + code: init.code, // attaching the state init will cause the message to deploy + data: init.data, + body: "identify".asComment() // we must piggyback the deployment on another message + }); + } +}`;function D(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function M(s){return e=>{e.store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+h8uCHAYFSNyICgBD0F8gByPQAyQHMcAHKAFgBgQEBzwDJAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydABOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8EQHKyHEBygFQBwHKAHABygJQBSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wASAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0dAxevM=");let a=o.beginCell();a.storeRef(t),a.storeUint(0,1),M({$$type:"Todo_init_args",seqno:s})(a);const n=a.endCell();return{code:e,data:n}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},Q=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],k=[],E=[{receiver:"internal",message:{kind:"text",text:"identify"}},{receiver:"internal",message:{kind:"text",text:"deploy 2nd"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class l{constructor(e,t){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:Q,getters:k,receivers:E,errors:H});this.address=e,this.init=t}static async init(e){return await p(e)}static async fromInit(e){const t=await p(e),a=o.contractAddress(0,t);return new l(a,t)}static fromAddress(e){return new l(e)}async send(e,t,a,n){let i=null;if(n==="identify"&&(i=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="deploy 2nd"&&(i=o.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(i=o.beginCell().store(D(n)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...a,body:i})}}function z(s,e,t){let a;h(s,g,r=>t(3,a=r));let n,i,d;return C(g,a={markdown:b,tactCode:v,deploy:async()=>{n=await I.Blockchain.create();const r=await n.treasury("deployer");i=r.getSender(),d=n.openContract(await l.fromInit(1n));const c={[r.address.toString()]:"deployer",[d.address.toString()]:"Todo(1)",[(await l.fromInit(2n)).address.toString()]:"Todo(2)"};return[[d],c,[await d.send(r.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'"identify" to 1':async()=>[await d.send(i,{value:o.toNano(1)},"identify")],'"identify" to 2':async()=>{const r=await l.fromInit(2n);return[await n.openContract(l.fromAddress(r.address)).send(i,{value:o.toNano(1)},"identify")]},'"deploy 2nd" to 1':async()=>[await d.send(i,{value:o.toNano(1)},"deploy 2nd")]},getters:{},prev:y(import.meta.url).prev,next:y(import.meta.url).next},a),[]}class G extends u{constructor(e){super(),w(this,e,z,null,f,{})}}export{G as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.820f8c28.js b/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.820f8c28.js deleted file mode 100644 index f7a22c4..0000000 --- a/docs/_app/immutable/entry/(examples)-06-contract-deploy-another-page.svelte.820f8c28.js +++ /dev/null @@ -1,45 +0,0 @@ -var B=Object.defineProperty;var m=(s,e,t)=>e in s?B(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var d=(s,e,t)=>(m(s,typeof e!="symbol"?e+"":e,t),t);import{S as u,i as h,s as p,I,ac as C}from"../chunks/index.9fe14626.js";import{d as a,g,s as y}from"../chunks/store.d3ab02ad.js";import{d as f}from"../chunks/index.78404594.js";const b=`# A Contract Deploying Another - -Contracts are not necessarily only deployed by users, they can also be deployed by other contracts. - -In this example, when pressing the Deploy button, we only deploy one contract instance - the one with constructor argument 1. - -The second instance (with constructor argument 2) will be deployed by the first contract instance when it receives the \`deploy next\` message. Send this message to the first instance by pressing the Send "deploy 2nd" to 1 button. - -## Messages containing state init - -The combination of the inital code and the initial data of a contract is called the *stateInit* of the contract. - -When sending any message to a contract, we can attach its *stateInit* by specifying the \`code\` and \`data\` fields of the message. This will deploy the contract if it has not already been deployed. If the contract has already been deployed, these fields will be ignored. - -Notice that in this example, we piggyback the deployment on the \`indentify\` message.`,E=`import "@stdlib/deploy"; - -// we're going to have multiple instances of this contract, each with a different seqno -contract Todo with Deployable { - - seqno: Int as uint64; - - // when deploying an instance, we must specify its index (sequence number) - init(seqno: Int) { - self.seqno = seqno; - } - - // this message handler will just debug print the seqno so we can see when it's called - receive("identify") { - dump(self.seqno); - } - - // this message handler will cause the contract to deploy the second instance - receive("deploy 2nd") { - let init: StateInit = initOf Todo(2); - let address: Address = contractAddress(init); - send(SendParameters{ - to: address, - value: ton("0.1"), // pay for message, the deployment and give some TON for storage - mode: SendIgnoreErrors, - code: init.code, // attaching the state init will cause the message to deploy - data: init.data, - body: "identify".asComment() // we must piggyback the deployment on another message - }); - } -}`;function Q(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function M(s){return e=>{e.storeInt(s.seqno,257)}}async function w(s){const e=a.Cell.fromBase64("te6ccgECEQEAA7oAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVAQFAgFYDQ4ARu1E0NQB+GPSAAGU0z8BMeD4KNcLCoMJuvLgiYEBAdcAAQHRAq7tou37cCHXScIflTAg1wsf3gKSW3/gIYIQlGqYtrqOrjHTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gAcAAkTDjDXALBgKw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y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0fJybN0=");let o=a.beginCell();o.storeRef(t),o.storeUint(0,1),M({$$type:"Todo_init_args",seqno:s})(o);const n=o.endCell();return{code:e,data:n}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class r{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:H});this.address=e,this.init=t}static async init(e){return await w(e)}static async fromInit(e){const t=await w(e),o=a.contractAddress(0,t);return new r(o,t)}static fromAddress(e){return new r(e)}async send(e,t,o,n){let A=null;if(n==="identify"&&(A=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n==="deploy 2nd"&&(A=a.beginCell().storeUint(0,32).storeStringTail(n).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(A=a.beginCell().store(Q(n)).endCell()),A===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:A})}}function v(s,e,t){let o;I(s,y,i=>t(3,o=i));let n,A,c;return C(y,o={markdown:b,tactCode:E,deploy:async()=>{n=await f.Blockchain.create();const i=await n.treasury("deployer");A=i.getSender(),c=n.openContract(await r.fromInit(1n));const l={[i.address.toString()]:"deployer",[c.address.toString()]:"Todo(1)",[(await r.fromInit(2n)).address.toString()]:"Todo(2)"};return[[c],l,[await c.send(i.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'"identify" to 1':async()=>[await c.send(A,{value:a.toNano(1)},"identify")],'"identify" to 2':async()=>{const i=await r.fromInit(2n);return[await n.openContract(r.fromAddress(i.address)).send(A,{value:a.toNano(1)},"identify")]},'"deploy 2nd" to 1':async()=>[await c.send(A,{value:a.toNano(1)},"deploy next")]},getters:{},prev:g(import.meta.url).prev,next:g(import.meta.url).next},o),[]}class S extends u{constructor(e){super(),h(this,e,v,null,p,{})}}export{S as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.11f7331f.js b/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.11f7331f.js new file mode 100644 index 0000000..ede2ff0 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.11f7331f.js @@ -0,0 +1,26 @@ +var m=Object.defineProperty;var u=(a,e,t)=>e in a?m(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var c=(a,e,t)=>(u(a,typeof e!="symbol"?e+"":e,t),t);import{S as w,i as f,s as B,I as h,ac as I}from"../chunks/index.9fe14626.js";import{d as i,g as A,s as p}from"../chunks/store.476c3091.js";import{d as C}from"../chunks/index.c056099e.js";const Q=`# Multiple Contract Instances + +Instead of duplicating the code for the two contracts like in the previous example, we can write the code once and still deploy two separate instances. Each instance will have its own unique address. + +We can do this by adding an argument to \`init()\`. When deploying the contract, we need to specify its init arguments. In this example we deploy twice, the first with the argument 1 and the second is deployed with 2. + +We mentioned earlier that contract addresses on TON are [derived](https://docs.ton.org/learn/overviews/addresses#account-id) from the initial code of the contract (the compiled bytecode) and the initial data of the contract (the arguments of init). + +Since we wrote the code once, the initial code is now identical. By adding an contructor argument, we've made the initial data different. This is why we're going to get two different addresses.`,v=`import "@stdlib/deploy"; + +// we're going to have multiple instances of this contract, each with a different seqno +contract Todo with Deployable { + + seqno: Int as uint64; + + // when deploying an instance, we must specify its index (sequence number) + init(seqno: Int) { + self.seqno = seqno; + } + + // each instance can calculate the address of every other instance + get fun addressOf(otherSeqno: Int): Address { + let init: StateInit = initOf Todo(otherSeqno); + return contractAddress(init); + } +}`;function D(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}function b(a){return e=>{e.storeInt(a.seqno,257)}}async function y(a){const e=i.Cell.fromBase64("te6ccgECEQEAAuUAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcs/ye1UCgQCASAICQGKAZIwf+BwIddJwh+VMCDXCx/eghCUapi2uo6n0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4DBwBQE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwGAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAcAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCEb7x3tngDtnhjAoLAgEgDQ4ARu1E0NQB+GPSAAGU0z8BMeD4KNcLCoMJuvLgiYEBAdcAAQHRAYz4QwHbPHBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydAg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIDABkAdD0BDBtAYF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E/7ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wARAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0eZKoEI=");let n=i.beginCell();n.storeRef(t),n.storeUint(0,1),b({$$type:"Todo_init_args",seqno:a})(n);const s=n.endCell();return{code:e,data:s}}const E={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},k=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],H=[{name:"addressOf",arguments:[{name:"otherSeqno",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"address",optional:!1}}],S=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class d{constructor(e,t){c(this,"address");c(this,"init");c(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:k,getters:H,receivers:S,errors:E});this.address=e,this.init=t}static async init(e){return await y(e)}static async fromInit(e){const t=await y(e),n=i.contractAddress(0,t);return new d(n,t)}static fromAddress(e){return new d(e)}async send(e,t,n,s){let o=null;if(s&&typeof s=="object"&&!(s instanceof i.Slice)&&s.$$type==="Deploy"&&(o=i.beginCell().store(D(s)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(t,{...n,body:o})}async getAddressOf(e,t){let n=new i.TupleBuilder;return n.writeNumber(t),(await e.get("addressOf",n.build())).stack.readAddress()}}function L(a,e,t){let n;h(a,p,r=>t(3,n=r));let s,o;return I(p,n={markdown:Q,tactCode:v,deploy:async()=>{const r=await C.Blockchain.create(),l=await r.treasury("deployer");l.getSender(),s=r.openContract(await d.fromInit(1n)),o=r.openContract(await d.fromInit(2n));const g={[l.address.toString()]:"deployer",[s.address.toString()]:"Todo(1)",[o.address.toString()]:"Todo(2)"};return[[s,o],g,[await s.send(l.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n}),await o.send(l.getSender(),{value:i.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{"addressOf(1)":async()=>await s.getAddressOf(1n),"addressOf(2)":async()=>await s.getAddressOf(2n)},prev:A(import.meta.url).prev,next:A(import.meta.url).next},n),[]}class N extends w{constructor(e){super(),f(this,e,L,null,B,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.d7f078ed.js b/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.d7f078ed.js deleted file mode 100644 index dcd14ba..0000000 --- a/docs/_app/immutable/entry/(examples)-06-multiple-contract-instances-page.svelte.d7f078ed.js +++ /dev/null @@ -1,26 +0,0 @@ -var y=Object.defineProperty;var B=(o,e,t)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var d=(o,e,t)=>(B(o,typeof e!="symbol"?e+"":e,t),t);import{S as m,i as h,s as f,I as p,ac as C}from"../chunks/index.9fe14626.js";import{d as r,g,s as l}from"../chunks/store.d3ab02ad.js";import{d as I}from"../chunks/index.78404594.js";const Q=`# Multiple Contract Instances - -Instead of duplicating the code for the two contracts like in the previous example, we can write the code once and still deploy two separate instances. Each instance will have its own unique address. - -We can do this by adding an argument to \`init()\`. When deploying the contract, we need to specify its init arguments. In this example we deploy twice, the first with the argument 1 and the second is deployed with 2. - -We mentioned earlier that contract addresses on TON are [derived](https://docs.ton.org/learn/overviews/addresses#account-id) from the initial code of the contract (the compiled bytecode) and the initial data of the contract (the arguments of init). - -Since we wrote the code once, the initial code is now identical. By adding an contructor argument, we've made the initial data different. This is why we're going to get two different addresses.`,v=`import "@stdlib/deploy"; - -// we're going to have multiple instances of this contract, each with a different seqno -contract Todo with Deployable { - - seqno: Int as uint64; - - // when deploying an instance, we must specify its index (sequence number) - init(seqno: Int) { - self.seqno = seqno; - } - - // each instance can calculate the address of every other instance - get fun addressOf(otherSeqno: Int): Address { - let init: StateInit = initOf Todo(otherSeqno); - return contractAddress(init); - } -}`;function D(o){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(o.queryId,64)}}function H(o){return e=>{e.storeInt(o.seqno,257)}}async function w(o){const e=r.Cell.fromBase64("te6ccgECEAEAAsoAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVAkEAgEgBwgBmHAh10nCH5UwINcLH94Cklt/4AGCEJRqmLa6jq3THwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH/gMHAFAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AAYAmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwCEb7x3tngDtnhjAkKAgEgDA0ARu1E0NQB+GPSAAGU0z8BMeD4KNcLCoMJuvLgiYEBAdcAAQHRAYz4QwHbPHBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydAg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCICwBkAdD0BDBtAYFSNwGAEPQPb6Hy4IcBgVI3IgKAEPQXyAHI9ADJAcxwAcoAWAGBAQHPAMkAubu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSAIBSA4PABGwr7tRNDSAA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S4onfc=");let n=r.beginCell();n.storeRef(t),n.storeUint(0,1),H({$$type:"Todo_init_args",seqno:o})(n);const s=n.endCell();return{code:e,data:s}}const b={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class A{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:b});this.address=e,this.init=t}static async init(e){return await w(e)}static async fromInit(e){const t=await w(e),n=r.contractAddress(0,t);return new A(n,t)}static fromAddress(e){return new A(e)}async send(e,t,n,s){let a=null;if(s&&typeof s=="object"&&!(s instanceof r.Slice)&&s.$$type==="Deploy"&&(a=r.beginCell().store(D(s)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...n,body:a})}async getAddressOf(e,t){let n=new r.TupleBuilder;return n.writeNumber(t),(await e.get("addressOf",n.build())).stack.readAddress()}}function E(o,e,t){let n;p(o,l,i=>t(3,n=i));let s,a;return C(l,n={markdown:Q,tactCode:v,deploy:async()=>{const i=await I.Blockchain.create(),c=await i.treasury("deployer");c.getSender(),s=i.openContract(await A.fromInit(1n)),a=i.openContract(await A.fromInit(2n));const u={[c.address.toString()]:"deployer",[s.address.toString()]:"Todo(1)",[a.address.toString()]:"Todo(2)"};return[[s,a],u,[await s.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n}),await a.send(c.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{},getters:{"addressOf(1)":async()=>await s.getAddressOf(1n),"addressOf(2)":async()=>await s.getAddressOf(2n)},prev:g(import.meta.url).prev,next:g(import.meta.url).next},n),[]}class N extends m{constructor(e){super(),h(this,e,E,null,f,{})}}export{N as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.435d7d43.js b/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.435d7d43.js deleted file mode 100644 index 65f324b..0000000 --- a/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.435d7d43.js +++ /dev/null @@ -1,61 +0,0 @@ -var C=Object.defineProperty;var y=(o,e,n)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n;var i=(o,e,n)=>(y(o,typeof e!="symbol"?e+"":e,n),n);import{S as B,i as p,s as I,I as f,ac as Q}from"../chunks/index.9fe14626.js";import{d as a,g,s as w}from"../chunks/store.d3ab02ad.js";import{d as E}from"../chunks/index.78404594.js";const M=`# Parent-Child Relationship - -A very common design pattern in Tact is implementing two contracts with a parent-child relationship. - -Under this pattern, we would normally have a single instance parent which is deployed by the user. This is the \`TodoParent\` contract in this example. - -The child contract \`TodoChild\` will have multiple instances. These instances will normally be deployed by the parent by sending the parent a message. - -Try this out. Press the Send "deploy another" to parent button multiple times to send the message to the parent and instruct it to deploy more and more children. - -Also notice how we can omit the \`Deployable\` trait from the children. This trait is mostly useful for contracts that users deploy. Since the user only deploys the parent, omitting the trait from the children will explain our intent to readers. - -## Unbounded data structures - -An interesting property of this pattern is that the number of potential children is unbounded! We can have an infinite number of children. - -In general, inifinite data structures that can actually scale to billions are very difficult to implement on blockchain efficiently. This pattern showcases the power of TON.`,H=`import "@stdlib/deploy"; - -// we have multiple instances of the children -contract TodoChild { - - seqno: Int as uint64; - - // when deploying an instance, we must specify its index (sequence number) - init(seqno: Int) { - self.seqno = seqno; - } - - // this message handler will just debug print the seqno so we can see when it's called - receive("identify") { - dump(self.seqno); - } -} - -// we have one instance of the parent -contract TodoParent with Deployable { - - numChildren: Int as uint64; - - init() { - self.numChildren = 0; - } - - // this message handler will cause the contract to deploy another child - receive("deploy another") { - self.numChildren = self.numChildren + 1; - let init: StateInit = initOf TodoChild(self.numChildren); - send(SendParameters{ - to: contractAddress(init), - value: ton("0.1"), // pay for message, the deployment and give some TON for storage - mode: SendIgnoreErrors, - code: init.code, // attaching the state init will cause the message to deploy - data: init.data, - body: "identify".asComment() // we must piggyback the deployment on another message - }); - } - - get fun numChildren(): Int { - return self.numChildren; - } -}`;function b(o){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(o.queryId,64)}}async function u(){const o=a.Cell.fromBase64("te6ccgECFAEAAykAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zwwyPhDAcx/AcoAAQHLP8ntVBEEAgFYCwwCru2i7ftwIddJwh+VMCDXCx/eApJbf+AhghCUapi2uo6uMdMfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8l/+EJwWAOAQgFtbds8f+ABwACRMOMNcAkFAU75AYLwqu63xox+f3M2DuE0KgCOkpKQPsvFEj+HxlHYvx7UJJi64wIGA8Ck+EMh2zxccFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0CDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IiCEAX14QByiBA1RDASfwYFBEEz2zx/2zEHCAkAZAHQ9AQwbQGBaEEBgBD0D2+h8uCHAYFoQSICgBD0F8gByPQAyQHMcAHKAFgBgQEBzwDJABgAAAAAaWRlbnRpZnkByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uC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68uCJgQEB1wABAdFsFL1R");let n=a.beginCell();n.storeRef(e),n.storeUint(0,1);const t=n.endCell();return{code:o,data:t}}const D={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class c{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:D});this.address=e,this.init=n}static async init(){return await u()}static async fromInit(){const e=await u(),n=a.contractAddress(0,e);return new c(n,e)}static fromAddress(e){return new c(e)}async send(e,n,t,s){let r=null;if(s==="deploy another"&&(r=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof a.Slice)&&s.$$type==="Deploy"&&(r=a.beginCell().store(b(s)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(n,{...t,body:r})}async getNumChildren(e){let n=new a.TupleBuilder;return(await e.get("numChildren",n.build())).stack.readBigNumber()}}function S(o){return e=>{e.storeInt(o.seqno,257)}}async function m(o){const e=a.Cell.fromBase64("te6ccgECCwEAAfoAART/APSkE/S88sgLAQIBYgIDApTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zww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hQwf9sx4JEw4nALAN7IIcEAmIAtAcsHAaMB3iGCODJ8snNBGdO3qaoduY4gcCBxjhQEeqkMpjAlqBKgBKoHAqQhwABFMOYwM6oCzwGOK28AcI4RI3qpCBJvjAGkA3qpBCDAABTmMyKlA5xTAm+BpjBYywcCpVnkMDHiydAARu1E0NQB+GPSAAGU0z8BMeD4KNcLCoMJuvLgiYEBAdcAAQHRoz112w==");let t=a.beginCell();t.storeRef(n),t.storeUint(0,1),S({$$type:"TodoChild_init_args",seqno:o})(t);const s=t.endCell();return{code:e,data:s}}const Y={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}};class l{constructor(e,n){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]}],errors:Y});this.address=e,this.init=n}static async init(e){return await m(e)}static async fromInit(e){const n=await m(e),t=a.contractAddress(0,n);return new l(t,n)}static fromAddress(e){return new l(e)}async send(e,n,t,s){let r=null;if(s==="identify"&&(r=a.beginCell().storeUint(0,32).storeStringTail(s).endCell()),r===null)throw new Error("Invalid message type");await e.internal(n,{...t,body:r})}}function v(o,e,n){let t;f(o,w,d=>n(3,t=d));let s,r,A;return Q(w,t={markdown:M,tactCode:H,deploy:async()=>{s=await E.Blockchain.create();const d=await s.treasury("deployer");r=d.getSender(),A=s.openContract(await c.fromInit());const h={[d.address.toString()]:"deployer",[A.address.toString()]:"TodoParent",[(await l.fromInit(1n)).address.toString()]:"TodoChild(1)",[(await l.fromInit(2n)).address.toString()]:"TodoChild(2)",[(await l.fromInit(3n)).address.toString()]:"TodoChild(3)"};return[[A],h,[await A.send(d.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'"deploy another" to parent':async()=>[await A.send(r,{value:a.toNano(1)},"deploy another")]},getters:{numChildren:async()=>await A.getNumChildren()},prev:g(import.meta.url).prev,next:g(import.meta.url).next},t),[]}class L extends B{constructor(e){super(),p(this,e,v,null,I,{})}}export{L as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.f0be9530.js b/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.f0be9530.js new file mode 100644 index 0000000..87754ff --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-parent-child-page.svelte.f0be9530.js @@ -0,0 +1,61 @@ +var C=Object.defineProperty;var f=(a,e,t)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var r=(a,e,t)=>(f(a,typeof e!="symbol"?e+"":e,t),t);import{S as h,i as B,s as w,I,ac as b}from"../chunks/index.9fe14626.js";import{d as o,g as m,s as p}from"../chunks/store.476c3091.js";import{d as Q}from"../chunks/index.c056099e.js";const k=`# Parent-Child Relationship + +A very common design pattern in Tact is implementing two contracts with a parent-child relationship. + +Under this pattern, we would normally have a single instance parent which is deployed by the user. This is the \`TodoParent\` contract in this example. + +The child contract \`TodoChild\` will have multiple instances. These instances will normally be deployed by the parent by sending the parent a message. + +Try this out. Press the Send "deploy another" to parent button multiple times to send the message to the parent and instruct it to deploy more and more children. + +Also notice how we can omit the \`Deployable\` trait from the children. This trait is mostly useful for contracts that users deploy. Since the user only deploys the parent, omitting the trait from the children will explain our intent to readers. + +## Unbounded data structures + +An interesting property of this pattern is that the number of potential children is unbounded! We can have an infinite number of children. + +In general, inifinite data structures that can actually scale to billions are very difficult to implement on blockchain efficiently. This pattern showcases the power of TON.`,D=`import "@stdlib/deploy"; + +// we have multiple instances of the children +contract TodoChild { + + seqno: Int as uint64; + + // when deploying an instance, we must specify its index (sequence number) + init(seqno: Int) { + self.seqno = seqno; + } + + // this message handler will just debug print the seqno so we can see when it's called + receive("identify") { + dump(self.seqno); + } +} + +// we have one instance of the parent +contract TodoParent with Deployable { + + numChildren: Int as uint64; + + init() { + self.numChildren = 0; + } + + // this message handler will cause the contract to deploy another child + receive("deploy another") { + self.numChildren = self.numChildren + 1; + let init: StateInit = initOf TodoChild(self.numChildren); + send(SendParameters{ + to: contractAddress(init), + value: ton("0.1"), // pay for message, the deployment and give some TON for storage + mode: SendIgnoreErrors, + code: init.code, // attaching the state init will cause the message to deploy + data: init.data, + body: "identify".asComment() // we must piggyback the deployment on another message + }); + } + + get fun numChildren(): Int { + return self.numChildren; + } +}`;function M(a){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(a.queryId,64)}}async function g(){const a=o.Cell.fromBase64("te6ccgECFAEAA0IAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcs/ye1UEQQCAVgLDALw7aLt+wGSMH/gcCHXScIflTAg1wsf3iCCEJRqmLa6jqgw0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/4MAAjqf5AYLwqu63xox+f3M2DuE0KgCOkpKQPsvFEj+HxlHYvx7UJJi64wKRMOJwBQYBOm1tIm6zmVsgbvLQgG8iAZEy4hAkcAMEgEJQI9s8CQPApPhDIds8XHBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydAg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIghAF9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H/bMeCRMOJwIADeyCHBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0fE/+cI=");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const n=t.endCell();return{code:a,data:n}}const T={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},v=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],H=[{name:"numChildren",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],E=[{receiver:"internal",message:{kind:"text",text:"deploy another"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class c{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:v,getters:H,receivers:E,errors:T});this.address=e,this.init=t}static async init(){return await g()}static async fromInit(){const e=await g(),t=o.contractAddress(0,e);return new c(t,e)}static fromAddress(e){return new c(e)}async send(e,t,n,s){let i=null;if(s==="deploy another"&&(i=o.beginCell().storeUint(0,32).storeStringTail(s).endCell()),s&&typeof s=="object"&&!(s instanceof o.Slice)&&s.$$type==="Deploy"&&(i=o.beginCell().store(M(s)).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...n,body:i})}async getNumChildren(e){let t=new o.TupleBuilder;return(await e.get("numChildren",t.build())).stack.readBigNumber()}}function S(a){return e=>{e.storeInt(a.seqno,257)}}async function y(a){const e=o.Cell.fromBase64("te6ccgECCwEAAfsAART/APSkE/S88sgLAQIBYgIDApjQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxZ2zzy4ILI+EMBzH8BygABAcs/ye1UBAUCAV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HBAJiALQHLBwGjAd4hgjgyfLJzQRnTt6mqHbmOIHAgcY4UBHqpDKYwJagSoASqBwKkIcAARTDmMDOqAs8BjitvAHCOESN6qQgSb4wBpAN6qQQgwAAU5jMipQOcUwJvgaYwWMsHAqVZ5DAx4snQAEbtRNDUAfhj0gABlNM/ATHg+CjXCwqDCbry4ImBAQHXAAEB0deIa3E=");let n=o.beginCell();n.storeRef(t),n.storeUint(0,1),S({$$type:"TodoChild_init_args",seqno:a})(n);const s=n.endCell();return{code:e,data:s}}const L={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"}},N=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]}],z=[],O=[{receiver:"internal",message:{kind:"text",text:"identify"}}];class d{constructor(e,t){r(this,"address");r(this,"init");r(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]}],types:N,getters:z,receivers:O,errors:L});this.address=e,this.init=t}static async init(e){return await y(e)}static async fromInit(e){const t=await y(e),n=o.contractAddress(0,t);return new d(n,t)}static fromAddress(e){return new d(e)}async send(e,t,n,s){let i=null;if(s==="identify"&&(i=o.beginCell().storeUint(0,32).storeStringTail(s).endCell()),i===null)throw new Error("Invalid message type");await e.internal(t,{...n,body:i})}}function U(a,e,t){let n;I(a,p,A=>t(3,n=A));let s,i,l;return b(p,n={markdown:k,tactCode:D,deploy:async()=>{s=await Q.Blockchain.create();const A=await s.treasury("deployer");i=A.getSender(),l=s.openContract(await c.fromInit());const u={[A.address.toString()]:"deployer",[l.address.toString()]:"TodoParent",[(await d.fromInit(1n)).address.toString()]:"TodoChild(1)",[(await d.fromInit(2n)).address.toString()]:"TodoChild(2)",[(await d.fromInit(3n)).address.toString()]:"TodoChild(3)"};return[[l],u,[await l.send(A.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'"deploy another" to parent':async()=>[await l.send(i,{value:o.toNano(1)},"deploy another")]},getters:{numChildren:async()=>await l.getNumChildren()},prev:m(import.meta.url).prev,next:m(import.meta.url).next},n),[]}class Y extends h{constructor(e){super(),B(this,e,U,null,w,{})}}export{Y as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.11af6030.js b/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.11af6030.js deleted file mode 100644 index 910f7db..0000000 --- a/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.11af6030.js +++ /dev/null @@ -1,123 +0,0 @@ -var w=Object.defineProperty;var m=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var i=(s,e,t)=>(m(s,typeof e!="symbol"?e+"":e,t),t);import{S as y,i as h,s as f,I as p,ac as Q}from"../chunks/index.9fe14626.js";import{d as o,g as u,s as C}from"../chunks/store.d3ab02ad.js";import{d as E}from"../chunks/index.78404594.js";const T=`# Unbounded Arrays - Todo List - -In general, inifinite data structures that can actually grow to billions of elements are very difficult to implement on blockchain. As the contract persistent state grows in size, read and write operations become more expensive in gas. In the extreme, they may cost more than a transaction gas limit, rendering the contract unusable. - -**It is therefore important to design contracts to have an upper bound on state size.** If so, how would we implement a todo list that can scale to billions of items? - -## Infinitely scalable todo list - -The secret of infinite scalability on TON is sharding the data across multiple contracts. We can apply the parent-child design pattern to do just this. - -In this example, every new todo item is a new deployed child contract. The user will interact with the children through the \`TodoParent\` contract. - -When the user sends the \`NewTodo\` message to the parent, the parent deploys a new child to hold the new item. If users want to query the item details, they can call the parent getter \`todoAddress()\` and then call the \`details()\` getter on the child. - -This example also handles gas efficiently. The excess gas from every operation is refunded to the original sender.`,b=`import "@stdlib/deploy"; -import "@stdlib/ownable"; - -message NewTodo { - task: String; -} - -message NewTodoResponse { - seqno: Int as uint256; -} - -message CompleteTodo { - seqno: Int as uint256; -} - -// users are supposed to interact with this parent contract only -contract TodoParent with Deployable, Ownable { - - owner: Address; - numTodos: Int as uint256 = 0; - - init() { - self.owner = sender(); // set the owner as the deployer - } - - // anybody can add a new todo, not just the owner - receive(msg: NewTodo) { - self.numTodos = self.numTodos + 1; - let init: StateInit = initOf TodoChild(myAddress(), self.numTodos); - send(SendParameters{ - to: contractAddress(init), - body: InternalSetTask{task: msg.task}.toCell(), - value: ton("0.02"), // pay for the deployment and leave some TON in the child for storage - mode: SendIgnoreErrors, - code: init.code, // deploy the child - data: init.data - }); - reply(NewTodoResponse{seqno: self.numTodos}.toCell()); // this will return excess gas to sender - } - - // only the owner can mark a todo as completed - receive(msg: CompleteTodo) { - self.requireOwner(); - require(msg.seqno <= self.numTodos, "Todo does not exist"); - send(SendParameters{ // this will forward excess gas - to: contractAddress(initOf TodoChild(myAddress(), msg.seqno)), - body: InternalComplete{excess: sender()}.toCell(), - value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 - mode: SendRemainingValue + SendIgnoreErrors /// TODO: issues/31 - }); - } - - get fun numTodos(): Int { - return self.numTodos; - } - - get fun todoAddress(seqno: Int): Address { - return contractAddress(initOf TodoChild(myAddress(), seqno)); - } -} - -//////////////////////////////////////////////////////////////////////////// -// child contract - internal interface that users shouldn't access directly - -message InternalSetTask { - task: String; -} - -message InternalComplete { - excess: Address; -} - -struct TodoDetails { - task: String; - completed: Bool; -} - -contract TodoChild { - - parent: Address; - seqno: Int as uint256; - task: String = ""; - completed: Bool = false; - - init(parent: Address, seqno: Int) { - self.parent = parent; - self.seqno = seqno; - } - - receive(msg: InternalSetTask) { - require(sender() == self.parent, "Parent only"); - self.task = msg.task; - } - - receive(msg: InternalComplete) { - require(sender() == self.parent, "Parent only"); - self.completed = true; - send(SendParameters{ // this will return excess gas to original sender - to: msg.excess, - value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 - mode: SendRemainingBalance + SendIgnoreErrors /// TODO: issues/31 - }); - } - - get fun details(): TodoDetails { - return TodoDetails{task: self.task, completed: self.completed}; - } -} -`;function L(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function D(s){return e=>{let t=e;t.storeUint(1804651575,32),t.storeStringRefTail(s.task)}}function H(s){return e=>{let t=e;t.storeUint(2587315870,32),t.storeUint(s.seqno,256)}}async function I(){const s=o.Cell.fromBase64("te6ccgECHQEABOAAART/APSkE/S88sgLAQIBYgIDAtDQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWVkg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbL/8ntVBoEAgEgDQ4DvHAh10nCH5UwINcLH94Cklt/4CGCEGuQzDe6jpUx0x8BghBrkMw3uvLggdQB0DHbPH/gIYIQmjdOnrqOlTHTHwGCEJo3Tp668uCB0/8BMds8f+ABghCUapi2uuMCMHAFBgcD4AGk+EP4KCLbPFxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiATIAYIQu+rmXljLH8hYzxbJAczJEDSCCTEtAFpyWX8GRVXbPCAVCwgDrFnbPIEswFMxu/L0+EP4KEEE2zxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiPhCCRUKAVrTHwGCEJRqmLa68uCB0z8BMcgBghCv+Q9XWMsfyz/Jf/hCcFgDgEIBbW3bPH8LATbIAYIQ5WPjnljLH8v/yX/4QnBYA4BCAW1t2zwLABL4QlIgxwXy4IQBbMgBghDPAIxMWMsfASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFslwgEJ/BANtbds8AQsByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHK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gJCMAdazdxoatLgzOZ0Xl6i2sbO3Mxszmqi4O5sxOCW0mbghKbu7q7C7tJw9HLenNJi6oKurorSmujaoHJnBAAhGsNW2ebZ42IUAtJQACXAARsK+7UTQ0gABgALm7vRgnBc7D1dLK57HoTsOdZKhRtmgnCd1jUtK2R8syLTry398WI5gnAgVcAbgGdjlM5YOq5HJbLDgnAb1J3vlUWW8cdT094FWcMmgnCdl05as07LczoOlm2UZuikgC6tAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUT2zwwyPhDAcx/AcoAVTBQQyDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsv/yFADzxbJWMzKAMntVC0pAZJwIddJwh+VMCDXCx/eApJbf+AhghC76uZeuo4gMdMfAYIQu+rmXrry4IHUAdAxMoIA1IT4QlJQxwXy9H/gAYIQzwCMTLrjAjBwKgGS0x8BghDPAIxMuvLggfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgxMYIA1IT4QlJQxwXy9H8BcIEAgn9VIG1tbds8fysByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsALACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAHe7UTQ1AH4Y9IAAY4s+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHT/9QB0AHSAFUwbBTg+CjXCwqDCbry4In6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAYEBAdcAWQLRAds8LgAGiwhwYT14dQ==");let t=o.beginCell();t.storeRef(e),t.storeUint(0,1);const r=t.endCell();return{code:s,data:r}}const M={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},11456:{message:"Todo does not exist"},54404:{message:"Parent only"}};class g{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"NewTodo",header:1804651575,fields:[]},{name:"NewTodoResponse",header:3848528798,fields:[]},{name:"CompleteTodo",header:2587315870,fields:[]},{name:"InternalSetTask",header:3152733790,fields:[]},{name:"InternalComplete",header:3472919628,fields:[]},{name:"TodoDetails",header:null,fields:[]}],errors:M});this.address=e,this.init=t}static async init(){return await I()}static async fromInit(){const e=await I(),t=o.contractAddress(0,e);return new g(t,e)}static fromAddress(e){return new g(e)}async send(e,t,r,n){let a=null;if(n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="NewTodo"&&(a=o.beginCell().store(D(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="CompleteTodo"&&(a=o.beginCell().store(H(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="Deploy"&&(a=o.beginCell().store(L(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getNumTodos(e){let t=new o.TupleBuilder;return(await e.get("numTodos",t.build())).stack.readBigNumber()}async getTodoAddress(e,t){let r=new o.TupleBuilder;return r.writeNumber(t),(await e.get("todoAddress",r.build())).stack.readAddress()}async getOwner(e){let t=new o.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function v(s){return e=>{let t=e;t.storeUint(3152733790,32),t.storeStringRefTail(s.task)}}function J(s){return e=>{let t=e;t.storeUint(3472919628,32),t.storeAddress(s.excess)}}function S(s){let e=s.readString(),t=s.readBoolean();return{$$type:"TodoDetails",task:e,completed:t}}function x(s){return e=>{let t=e;t.storeAddress(s.parent),t.storeInt(s.seqno,257)}}async function B(s,e){const t=o.Cell.fromBase64("te6ccgECEQEAAxYAART/APSkE/S88sgLAQIBYgIDAurQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s8MMj4QwHMfwHKAFUwUEMg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbL/8hQA88WyVjMygDJ7VQOBAIBWAgJAZJwIddJwh+VMCDXCx/eApJbf+AhghC76uZeuo4gMdMfAYIQu+rmXrry4IHUAdAxMoIA1IT4QlJQxwXy9H/gAYIQzwCMTLrjAjBwBQGS0x8BghDPAIxMuvLggfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgxMYIA1IT4QlJQxwXy9H8BcIEAgn9VIG1tbds8fwYByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsABwCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAC5u70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYJwIFXAG4BnY5TOWDquRyWyw4JwG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ry0ImDCbry4IjPFlAD+gJwAcpoI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAQAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMAd7tRNDUAfhj0gABjiz6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAdP/1AHQAdIAVTBsFOD4KNcLCoMJuvLgifpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgBgQEB1wBZAtEB2zwSAAaLCHDCZVRa");let n=o.beginCell();n.storeRef(r),n.storeUint(0,1),x({$$type:"TodoChild_init_args",parent:s,seqno:e})(n);const a=n.endCell();return{code:t,data:a}}const N={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},11456:{message:"Todo does not exist"},54404:{message:"Parent only"}};class l{constructor(e,t){i(this,"address");i(this,"init");i(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"ChangeOwner",header:256331011,fields:[]},{name:"NewTodo",header:1804651575,fields:[]},{name:"NewTodoResponse",header:3848528798,fields:[]},{name:"CompleteTodo",header:2587315870,fields:[]},{name:"InternalSetTask",header:3152733790,fields:[]},{name:"InternalComplete",header:3472919628,fields:[]},{name:"TodoDetails",header:null,fields:[]}],errors:N});this.address=e,this.init=t}static async init(e,t){return await B(e,t)}static async fromInit(e,t){const r=await B(e,t),n=o.contractAddress(0,r);return new l(n,r)}static fromAddress(e){return new l(e)}async send(e,t,r,n){let a=null;if(n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="InternalSetTask"&&(a=o.beginCell().store(v(n)).endCell()),n&&typeof n=="object"&&!(n instanceof o.Slice)&&n.$$type==="InternalComplete"&&(a=o.beginCell().store(J(n)).endCell()),a===null)throw new Error("Invalid message type");await e.internal(t,{...r,body:a})}async getDetails(e){let t=new o.TupleBuilder,r=(await e.get("details",t.build())).stack;return S(r)}}function z(s,e,t){let r;p(s,C,d=>t(3,r=d));let n,a,A;return Q(C,r={markdown:T,tactCode:b,deploy:async()=>{n=await E.Blockchain.create();const d=await n.treasury("deployer");a=d.getSender(),A=n.openContract(await g.fromInit());const c={[d.address.toString()]:"deployer",[A.address.toString()]:"TodoParent",[(await l.fromInit(A.address,1n)).address.toString()]:"TodoChild(1)",[(await l.fromInit(A.address,2n)).address.toString()]:"TodoChild(2)",[(await l.fromInit(A.address,3n)).address.toString()]:"TodoChild(3)"};return[[A],c,[await A.send(d.getSender(),{value:o.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'NewTodo{"bla"}':async()=>[await A.send(a,{value:o.toNano(1)},{$$type:"NewTodo",task:"bla"})],"CompleteTodo{2}":async()=>[await A.send(a,{value:o.toNano(1)},{$$type:"CompleteTodo",seqno:2n})]},getters:{numTodos:async()=>await A.getNumTodos(),"details(todoAddress(2))":async()=>{const d=await A.getTodoAddress(2n);return await n.openContract(await l.fromAddress(d)).getDetails()}},prev:u(import.meta.url).prev,next:u(import.meta.url).next},r),[]}class U extends y{constructor(e){super(),h(this,e,z,null,f,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.de373b50.js b/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.de373b50.js new file mode 100644 index 0000000..207ba48 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-unbounded-arrays-page.svelte.de373b50.js @@ -0,0 +1,130 @@ +var C=Object.defineProperty;var I=(s,e,t)=>e in s?C(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var d=(s,e,t)=>(I(s,typeof e!="symbol"?e+"":e,t),t);import{S as f,i as w,s as B,I as h,ac as T}from"../chunks/index.9fe14626.js";import{d as a,g as p,s as g}from"../chunks/store.476c3091.js";import{d as E}from"../chunks/index.c056099e.js";const k=`# Unbounded Arrays - Todo List + +In general, infinite data structures that can grow to billions of elements are very difficult to implement on a blockchain. As the contract's persistent state grows in size, read and write operations become more expensive in terms of gas. In extreme cases, they may cost more than a transaction's gas limit, rendering the contract unusable. + +Therefore, **it's important to design contracts with an upper bound on state size.** So, how would we implement a to-do list that can scale to billions of items? + +## Infinitely scalable todo list + +The secret to achieving infinite scalability on TON lies in sharding the data across multiple contracts. We can utilize the parent-child design pattern to achieve this. + +In this example, each new todo item is deployed as a new child contract. Users interact with the child contracts through the \`TodoParent\` contract. + +When the user sends the \`NewTodo\` message to the parent, the parent deploys a new child to hold the new item. If users want to query the item details, they can call the parent getter \`todoAddress()\` and then call the \`details()\` getter on the child. + +
+
+ Info: This example also handles gas efficiently. The excess gas from every operation is refunded to the original sender. +
+`,b=`import "@stdlib/deploy"; +import "@stdlib/ownable"; + +message NewTodo { + task: String; +} + +message NewTodoResponse { + seqno: Int as uint256; +} + +message CompleteTodo { + seqno: Int as uint256; +} + +// users are supposed to interact with this parent contract only +contract TodoParent with Deployable, Ownable { + + owner: Address; + numTodos: Int as uint256 = 0; + + init() { + self.owner = sender(); // set the owner as the deployer + } + + // anybody can add a new todo, not just the owner + receive(msg: NewTodo) { + self.numTodos = self.numTodos + 1; + let init: StateInit = initOf TodoChild(myAddress(), self.numTodos); + send(SendParameters{ + to: contractAddress(init), + body: InternalSetTask{task: msg.task}.toCell(), + value: ton("0.02"), // pay for the deployment and leave some TON in the child for storage + mode: SendIgnoreErrors, + code: init.code, // prepare the initial code when deploying the child contract + data: init.data + }); + self.reply(NewTodoResponse{seqno: self.numTodos}.toCell()); // this will return excess gas to sender + } + + // only the owner can mark a todo as completed + receive(msg: CompleteTodo) { + self.requireOwner(); + require(msg.seqno <= self.numTodos, "Todo does not exist"); + send(SendParameters{ // this will forward excess gas + to: contractAddress(initOf TodoChild(myAddress(), msg.seqno)), + body: InternalComplete{excess: sender()}.toCell(), + value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 + mode: SendRemainingValue + SendIgnoreErrors /// TODO: issues/31 + }); + } + + get fun numTodos(): Int { + return self.numTodos; + } + + get fun todoAddress(seqno: Int): Address { + return contractAddress(initOf TodoChild(myAddress(), seqno)); + } +} + +//////////////////////////////////////////////////////////////////////////// +// child contract - internal interface that users shouldn't access directly + +message InternalSetTask { + task: String; +} + +message InternalComplete { + excess: Address; +} + +struct TodoDetails { + task: String; + completed: Bool; +} + +contract TodoChild { + + parent: Address; + seqno: Int as uint256; + task: String = ""; + completed: Bool = false; + + init(parent: Address, seqno: Int) { + self.parent = parent; + self.seqno = seqno; + } + + receive(msg: InternalSetTask) { + require(sender() == self.parent, "Parent only"); + self.task = msg.task; + } + + receive(msg: InternalComplete) { + require(sender() == self.parent, "Parent only"); + self.completed = true; + send(SendParameters{ // this will return excess gas to original sender + to: msg.excess, + value: 0, /// TODO: https://github.com/tact-lang/tact/issues/31 + mode: SendRemainingBalance + SendIgnoreErrors /// TODO: issues/31 + }); + } + + get fun details(): TodoDetails { + return TodoDetails{ + task: self.task, + completed: self.completed + }; + } +} +`;function Q(s){return e=>{let t=e;t.storeUint(2490013878,32),t.storeUint(s.queryId,64)}}function D(s){return e=>{let t=e;t.storeUint(1804651575,32),t.storeStringRefTail(s.task)}}function M(s){return e=>{let t=e;t.storeUint(2587315870,32),t.storeUint(s.seqno,256)}}async function y(){const s=a.Cell.fromBase64("te6ccgECHgEABPUAART/APSkE/S88sgLAQIBYgIDAtTQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsv/ye1UGwQCASAODwO6AZIwf+BwIddJwh+VMCDXCx/eIIIQa5DMN7qOlTDTHwGCEGuQzDe68uCB1AHQMds8f+AgghCaN06euo6VMNMfAYIQmjdOnrry4IHT/wEx2zx/4IIQlGqYtrrjAjBwBQYHA+ABpPhD+Cgi2zxccFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0CDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgEyAGCELvq5l5Yyx/IWM8WyQHMyRA0ggkxLQBacll/BkVV2zwgFgwIA6xZ2zyBLMBTMbvy9PhD+ChBBNs8cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0CDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4Ij4QgkWCgFO0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yfhCAXBt2zx/CwEqyAGCEOVj455Yyx/L/8n4QgF/bds8CwAS+EJSIMcF8uCEAWzIAYIQzwCMTFjLHwEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJcIBCfwQDbW3bPAEMATptbSJus5lbIG7y0IBvIgGRMuIQJHADBIBCUCPbPAwByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsADQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDic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gAgFiKSECAVgoIgIBSCcjAgEgJSQAdazdxoatLgzOZ0Xl6i2qCW7maOwmrixuqEivDimpjQ5u7wjqrGqKbohOTiro7iZuzImNrWoObe9GzDBAAhGsNW2ebZ42IUAuJgACXAARsK+7UTQ0gABgALm7vRgnBc7D1dLK57HoTsOdZKhRtmgnCd1jUtK2R8syLTry398WI5gnAgVcAbgGdjlM5YOq5HJbLDgnAb1J3vlUWW8cdT094FWcMmgnCdl05as07LczoOlm2UZuikgC7tAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUT2zzy4ILI+EMBzH8BygBVMFBDINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8Wy//IUAPPFslYzMoAye1ULioBkAGSMH/gcCHXScIflTAg1wsf3iCCELvq5l66jiAw0x8BghC76uZeuvLggdQB0DEyggDUhPhCUlDHBfL0f+CCEM8AjEy64wIwcCsBktMfAYIQzwCMTLry4IH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIMTGCANSE+EJSUMcF8vR/AXCBAIJ/VSBtbW3bPH8sAcrIcQHKAVAHAcoAcAHKAlAFINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WUAP6AnABymgjbrORf5MkbrPilzMzAXABygDjDSFus5x/AcoAASBu8tCAAcyVMXABygDiyQH7AC0AmH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwB3u1E0NQB+GPSAAGOLPpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB0//UAdAB0gBVMGwU4Pgo1wsKgwm68uCJ+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAGBAQHXAFkC0QHbPC8ABosIcMpkAVM=");let t=a.beginCell();t.storeRef(e),t.storeUint(0,1);const o=t.endCell();return{code:s,data:o}}const v={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},11456:{message:"Todo does not exist"},54404:{message:"Parent only"}},L=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"NewTodo",header:1804651575,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}}]},{name:"NewTodoResponse",header:3848528798,fields:[{name:"seqno",type:{kind:"simple",type:"uint",optional:!1,format:256}}]},{name:"CompleteTodo",header:2587315870,fields:[{name:"seqno",type:{kind:"simple",type:"uint",optional:!1,format:256}}]},{name:"InternalSetTask",header:3152733790,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}}]},{name:"InternalComplete",header:3472919628,fields:[{name:"excess",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TodoDetails",header:null,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}},{name:"completed",type:{kind:"simple",type:"bool",optional:!1}}]}],H=[{name:"numTodos",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"todoAddress",arguments:[{name:"seqno",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"address",optional:!1}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],S=[{receiver:"internal",message:{kind:"typed",type:"NewTodo"}},{receiver:"internal",message:{kind:"typed",type:"CompleteTodo"}},{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class m{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"NewTodo",header:1804651575,fields:[]},{name:"NewTodoResponse",header:3848528798,fields:[]},{name:"CompleteTodo",header:2587315870,fields:[]},{name:"InternalSetTask",header:3152733790,fields:[]},{name:"InternalComplete",header:3472919628,fields:[]},{name:"TodoDetails",header:null,fields:[]}],types:L,getters:H,receivers:S,errors:v});this.address=e,this.init=t}static async init(){return await y()}static async fromInit(){const e=await y(),t=a.contractAddress(0,e);return new m(t,e)}static fromAddress(e){return new m(e)}async send(e,t,o,n){let r=null;if(n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="NewTodo"&&(r=a.beginCell().store(D(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="CompleteTodo"&&(r=a.beginCell().store(M(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="Deploy"&&(r=a.beginCell().store(Q(n)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:r})}async getNumTodos(e){let t=new a.TupleBuilder;return(await e.get("numTodos",t.build())).stack.readBigNumber()}async getTodoAddress(e,t){let o=new a.TupleBuilder;return o.writeNumber(t),(await e.get("todoAddress",o.build())).stack.readAddress()}async getOwner(e){let t=new a.TupleBuilder;return(await e.get("owner",t.build())).stack.readAddress()}}function N(s){return e=>{let t=e;t.storeUint(3152733790,32),t.storeStringRefTail(s.task)}}function O(s){return e=>{let t=e;t.storeUint(3472919628,32),t.storeAddress(s.excess)}}function z(s){let e=s.readString(),t=s.readBoolean();return{$$type:"TodoDetails",task:e,completed:t}}function x(s){return e=>{let t=e;t.storeAddress(s.parent),t.storeInt(s.seqno,257)}}async function u(s,e){const t=a.Cell.fromBase64("te6ccgECEQEAAxcAART/APSkE/S88sgLAQIBYgIDAu7QAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVE9s88uCCyPhDAcx/AcoAVTBQQyDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4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GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcBvUne+VRZbxx1PT3gVZwyaCcJ2XTlqzTstzOg6WbZRm6KSALu0AHQ0wMBcbCjAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IhUUFMDbwT4YQL4Yts8VRPbPPLggsj4QwHMfwHKAFUwUEMg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbL/8hQA88WyVjMygDJ7VQRDQGQAZIwf+BwIddJwh+VMCDXCx/eIIIQu+rmXrqOIDDTHwGCELvq5l668uCB1AHQMTKCANSE+EJSUMcF8vR/4IIQzwCMTLrjAjBwDgGS0x8BghDPAIxMuvLggfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgxMYIA1IT4QlJQxwXy9H8BcIEAgn9VIG1tbds8fw8ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAEACYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzAHe7UTQ1AH4Y9IAAY4s+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHT/9QB0AHSAFUwbBTg+CjXCwqDCbry4In6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAYEBAdcAWQLRAds8EgAGiwhw4HwhKg==");let n=a.beginCell();n.storeRef(o),n.storeUint(0,1),x({$$type:"TodoChild_init_args",parent:s,seqno:e})(n);const r=n.endCell();return{code:t,data:r}}const J={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},11456:{message:"Todo does not exist"},54404:{message:"Parent only"}},P=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"NewTodo",header:1804651575,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}}]},{name:"NewTodoResponse",header:3848528798,fields:[{name:"seqno",type:{kind:"simple",type:"uint",optional:!1,format:256}}]},{name:"CompleteTodo",header:2587315870,fields:[{name:"seqno",type:{kind:"simple",type:"uint",optional:!1,format:256}}]},{name:"InternalSetTask",header:3152733790,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}}]},{name:"InternalComplete",header:3472919628,fields:[{name:"excess",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TodoDetails",header:null,fields:[{name:"task",type:{kind:"simple",type:"string",optional:!1}},{name:"completed",type:{kind:"simple",type:"bool",optional:!1}}]}],F=[{name:"details",arguments:[],returnType:{kind:"simple",type:"TodoDetails",optional:!1}}],U=[{receiver:"internal",message:{kind:"typed",type:"InternalSetTask"}},{receiver:"internal",message:{kind:"typed",type:"InternalComplete"}}];class A{constructor(e,t){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"NewTodo",header:1804651575,fields:[]},{name:"NewTodoResponse",header:3848528798,fields:[]},{name:"CompleteTodo",header:2587315870,fields:[]},{name:"InternalSetTask",header:3152733790,fields:[]},{name:"InternalComplete",header:3472919628,fields:[]},{name:"TodoDetails",header:null,fields:[]}],types:P,getters:F,receivers:U,errors:J});this.address=e,this.init=t}static async init(e,t){return await u(e,t)}static async fromInit(e,t){const o=await u(e,t),n=a.contractAddress(0,o);return new A(n,o)}static fromAddress(e){return new A(e)}async send(e,t,o,n){let r=null;if(n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="InternalSetTask"&&(r=a.beginCell().store(N(n)).endCell()),n&&typeof n=="object"&&!(n instanceof a.Slice)&&n.$$type==="InternalComplete"&&(r=a.beginCell().store(O(n)).endCell()),r===null)throw new Error("Invalid message type");await e.internal(t,{...o,body:r})}async getDetails(e){let t=new a.TupleBuilder,o=(await e.get("details",t.build())).stack;return z(o)}}function G(s,e,t){let o;h(s,g,l=>t(3,o=l));let n,r,i;return T(g,o={markdown:k,tactCode:b,deploy:async()=>{n=await E.Blockchain.create();const l=await n.treasury("deployer");r=l.getSender(),i=n.openContract(await m.fromInit());const c={[l.address.toString()]:"deployer",[i.address.toString()]:"TodoParent",[(await A.fromInit(i.address,1n)).address.toString()]:"TodoChild(1)",[(await A.fromInit(i.address,2n)).address.toString()]:"TodoChild(2)",[(await A.fromInit(i.address,3n)).address.toString()]:"TodoChild(3)"};return[[i],c,[await i.send(l.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{'NewTodo{"bla"}':async()=>[await i.send(r,{value:a.toNano(1)},{$$type:"NewTodo",task:"bla"})],"CompleteTodo{2}":async()=>[await i.send(r,{value:a.toNano(1)},{$$type:"CompleteTodo",seqno:2n})]},getters:{numTodos:async()=>await i.getNumTodos(),"details(todoAddress(2))":async()=>{const l=await i.getTodoAddress(2n);return await n.openContract(await A.fromAddress(l)).getDetails()}},prev:p(import.meta.url).prev,next:p(import.meta.url).next},o),[]}class j extends f{constructor(e){super(),w(this,e,G,null,B,{})}}export{j as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.437d1ed3.js b/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.437d1ed3.js new file mode 100644 index 0000000..6b13b38 --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.437d1ed3.js @@ -0,0 +1,111 @@ +var w=Object.defineProperty;var h=(s,e,n)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var A=(s,e,n)=>(h(s,typeof e!="symbol"?e+"":e,n),n);import{S as E,i as Q,s as b,I as L,ac as k}from"../chunks/index.9fe14626.js";import{d as a,g as u,s as I}from"../chunks/store.476c3091.js";import{d as v}from"../chunks/index.c056099e.js";const D=`# Unbounded Maps - Simplified Token + +In general, inifinite data structures that can actually grow to billions of elements are very difficult to implement on blockchain. As the contract persistent state grows in size, read and write operations become more expensive in gas. In the extreme, they may cost more than a transaction gas limit, rendering the contract unusable. + +**It is therefore important to design contracts to have an upper bound on state size.** If so, how would we implement a token with a map of balances that can scale to billions of holders? + +## Infinitely scalable balance map + +The secret of infinite scalability on TON is sharding the data across multiple contracts. We can apply the parent-child design pattern to do just this. + +In this example, we hold the balance of every holder in a separate child contract. + +To transfer tokens, the owner sends the \`Transfer\` message to the child contract holding their own balance. This will cause the child to deploy its sibling - the child contract holding the recipient's balance - by sending it the \`InternalAddTokens\` message. + +This example also handles gas efficiently. The excess gas from every operation is refunded to the original sender.`,S=`import "@stdlib/deploy"; + +struct Metadata { + symbol: String; + totalSupply: Int; +} + +message Transfer { + amount: Int as coins; + to: Address; +} + +// the token parent, mostly used to query general metadata and get children addresses +contract TokenParent with Deployable { + + symbol: String; + totalSupply: Int as coins; + + init() { + self.symbol = "SHIB"; + self.totalSupply = 500 * pow(10,9); + self.mint(self.totalSupply, sender()); // mint the entire total supply to deployer + } + + fun mint(amount: Int, to: Address) { + let init: StateInit = initOf TokenChild(myAddress(), to); + send(SendParameters{ + to: contractAddress(init), + body: InternalAddTokens{amount: amount, origin: myAddress()}.toCell(), + value: ton("0.03"), // pay for the deployment and leave some TON in the child for storage + mode: SendIgnoreErrors, + code: init.code, // deploy the child if needed + data: init.data + }); + } + + get fun metadata(): Metadata { + return Metadata{symbol: self.symbol, totalSupply: self.totalSupply}; + } + + get fun childAddress(owner: Address): Address { + return contractAddress(initOf TokenChild(myAddress(), owner)); + } +} + +//////////////////////////////////////////////////////////////////////////// +// child contract - the Transfer message is sent by users directly to a child + +message InternalAddTokens { + amount: Int as coins; + origin: Address; +} + +contract TokenChild { + + parent: Address; + owner: Address; // every child holds the balance of a different owner + balance: Int as coins; // this is the balance of the owner + + init(parent: Address, owner: Address) { + self.parent = parent; + self.owner = owner; + self.balance = 0; + } + + // sent by users to initiate a new transfer + receive(msg: Transfer) { + require(sender() == self.owner, "Access denied"); + require(self.balance >= msg.amount, "Insufficient balance"); + self.balance = self.balance - msg.amount; + let init: StateInit = initOf TokenChild(self.parent, msg.to); + send(SendParameters{ + to: contractAddress(init), + body: InternalAddTokens{amount: msg.amount, origin: self.owner}.toCell(), + value: ton("0.03"), // pay for the deployment and leave some TON in the child for storage + mode: SendIgnoreErrors, + code: init.code, // deploy the child if needed + data: init.data + }); + self.reply("transferred".asComment()); + } + + // internal message sent by one child to another to update balances + receive(msg: InternalAddTokens) { + if (msg.origin == self.parent) { // tokens originate in a mint + require(sender() == self.parent, "Parent only"); + } else { // tokens originate in a Transfer + require(sender() == contractAddress(initOf TokenChild(self.parent, msg.origin)), "Sibling only"); + } + self.balance = self.balance + msg.amount; + } + + get fun balance(): Int { + return self.balance; + } +} +`;function T(s){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(s.queryId,64)}}function J(s){let e=s.readString(),n=s.readBigNumber();return{$$type:"Metadata",symbol:e,totalSupply:n}}async function C(){const s=a.Cell.fromBase64("te6ccgECFwEABAAAART/APSkE/S88sgLAQIBYgIDAqbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zzy4ILI+EMBzH8BygBZyFjPFslYzAH6AsntVAsEAgEgBgcBigGSMH/gcCHXScIflTAg1wsf3oIQlGqYtrqOp9MfAYIQlGqYtrry4IHTPwExyAGCEK/5D1dYyx/LP8n4QgFwbds8f+AwcAUBOm1tIm6zmVsgbvLQgG8iA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poI26zkX+TJG6z4pczMwFwAcoA4w0hbrOcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAqAJh/AcoAyHABygBwAcoAJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4iRus51/AcoABCBu8tCAUATMljQDcAHKAOJwAcoAAn8BygACyVjMANYC0PQEMG0BgSHtAYAQ9A9vofLghwGBIe0iAoAQ9BfIAcj0AMkBzHABygBAA1kg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYBINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WyQG87UTQ1AH4Y9IAAY5G+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfoAVSBsE+D4KNcLCoMJuvLgiS0BivpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBIC0QHbPC4AAnCaGX8Z");let n=a.beginCell();n.storeRef(e),n.storeUint(0,1);const r=n.endCell();return{code:s,data:r}}const H={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},20537:{message:"Sibling only"},49469:{message:"Access denied"},54404:{message:"Parent only"},54615:{message:"Insufficient balance"}},M=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Metadata",header:null,fields:[{name:"symbol",type:{kind:"simple",type:"string",optional:!1}},{name:"totalSupply",type:{kind:"simple",type:"int",optional:!1,format:257}}]},{name:"Transfer",header:1943715420,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"to",type:{kind:"simple",type:"address",optional:!1}}]},{name:"InternalAddTokens",header:4162046107,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"origin",type:{kind:"simple",type:"address",optional:!1}}]}],N=[{name:"metadata",arguments:[],returnType:{kind:"simple",type:"Metadata",optional:!1}},{name:"childAddress",arguments:[{name:"owner",type:{kind:"simple",type:"address",optional:!1}}],returnType:{kind:"simple",type:"address",optional:!1}}],Y=[{receiver:"internal",message:{kind:"typed",type:"Deploy"}}];class y{constructor(e,n){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Metadata",header:null,fields:[]},{name:"Transfer",header:1943715420,fields:[]},{name:"InternalAddTokens",header:4162046107,fields:[]}],types:M,getters:N,receivers:Y,errors:H});this.address=e,this.init=n}static async init(){return await C()}static async fromInit(){const e=await C(),n=a.contractAddress(0,e);return new y(n,e)}static fromAddress(e){return new y(e)}async send(e,n,r,t){let o=null;if(t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Deploy"&&(o=a.beginCell().store(T(t)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(n,{...r,body:o})}async getMetadata(e){let n=new a.TupleBuilder,r=(await e.get("metadata",n.build())).stack;return J(r)}async getChildAddress(e,n){let r=new a.TupleBuilder;return r.writeAddress(n),(await e.get("childAddress",r.build())).stack.readAddress()}}function F(s){return e=>{let n=e;n.storeUint(1943715420,32),n.storeCoins(s.amount),n.storeAddress(s.to)}}function P(s){return e=>{let n=e;n.storeUint(4162046107,32),n.storeCoins(s.amount),n.storeAddress(s.origin)}}function X(s){return e=>{let n=e;n.storeAddress(s.parent),n.storeAddress(s.owner)}}async function B(s,e){const n=a.Cell.fromBase64("te6ccgECGQEABRsAART/APSkE/S88sgLAQIBYgIDA3rQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCEwQFAgFYDxACugGSMH/gcCHXScIflTAg1wsf3iCCEHPavly6jrUw0x8BghBz2r5cuvLggfoA+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBJsEts8f+CCEPgTyJu64wIwcAYHAJ7I+EMBzH8BygBVIFog10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCI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EJSUMcF8vSO0YFQOfhDVCBj2zxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiPhCxwXy9OKgfxcCxIIAwT34QlJQxwXy9IIA1VddvvL0USGh+ENUIFTbPFxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFE1FxIDishZghD4E8ibUAPLHwH6AgEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJggnJw4Bacll/BkVV2zyI+EIBf23bPBUUEwE6bW0ibrOZWyBu8tCAbyIBkTLiECRwAwSAQlAj2zwVAB4AAAAAdHJhbnNmZXJyZWQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzADWAtD0BDBtAYEh7QGAEPQPb6Hy4IcBgSHtIgKAEPQXyAHI9ADJAcxwAcoAQANZINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskBvO1E0NQB+GPSAAGORvpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAH6AFUgbBPg+CjXCwqDCbry4IkZAYr6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgSAtEB2zwaAAJwFw4Paw==");let t=a.beginCell();t.storeRef(r),t.storeUint(0,1),X({$$type:"TokenChild_init_args",parent:s,owner:e})(t);const o=t.endCell();return{code:n,data:o}}const z={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},20537:{message:"Sibling only"},49469:{message:"Access denied"},54404:{message:"Parent only"},54615:{message:"Insufficient balance"}},U=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"Deploy",header:2490013878,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"DeployOk",header:2952335191,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"FactoryDeploy",header:1829761339,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"cashback",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Metadata",header:null,fields:[{name:"symbol",type:{kind:"simple",type:"string",optional:!1}},{name:"totalSupply",type:{kind:"simple",type:"int",optional:!1,format:257}}]},{name:"Transfer",header:1943715420,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"to",type:{kind:"simple",type:"address",optional:!1}}]},{name:"InternalAddTokens",header:4162046107,fields:[{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"origin",type:{kind:"simple",type:"address",optional:!1}}]}],K=[{name:"balance",arguments:[],returnType:{kind:"simple",type:"int",optional:!1,format:257}}],W=[{receiver:"internal",message:{kind:"typed",type:"Transfer"}},{receiver:"internal",message:{kind:"typed",type:"InternalAddTokens"}}];class d{constructor(e,n){A(this,"address");A(this,"init");A(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"FactoryDeploy",header:1829761339,fields:[]},{name:"Metadata",header:null,fields:[]},{name:"Transfer",header:1943715420,fields:[]},{name:"InternalAddTokens",header:4162046107,fields:[]}],types:U,getters:K,receivers:W,errors:z});this.address=e,this.init=n}static async init(e,n){return await B(e,n)}static async fromInit(e,n){const r=await B(e,n),t=a.contractAddress(0,r);return new d(t,r)}static fromAddress(e){return new d(e)}async send(e,n,r,t){let o=null;if(t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="Transfer"&&(o=a.beginCell().store(F(t)).endCell()),t&&typeof t=="object"&&!(t instanceof a.Slice)&&t.$$type==="InternalAddTokens"&&(o=a.beginCell().store(P(t)).endCell()),o===null)throw new Error("Invalid message type");await e.internal(n,{...r,body:o})}async getBalance(e){let n=new a.TupleBuilder;return(await e.get("balance",n.build())).stack.readBigNumber()}}function O(s,e,n){let r;L(s,I,i=>n(6,r=i));let t,o,g,l,m,p;return k(I,r={markdown:D,tactCode:S,deploy:async()=>{t=await v.Blockchain.create();const i=await t.treasury("deployer");o=i.getSender();const c=await t.treasury("another");g=c.getSender(),l=t.openContract(await y.fromInit()),m=t.openContract(await d.fromInit(l.address,o.address)),p=t.openContract(await d.fromInit(l.address,g.address));const f={[i.address.toString()]:"deployer",[c.address.toString()]:"user2",[l.address.toString()]:"TokenParent",[m.address.toString()]:"TokenChild(deployer)",[p.address.toString()]:"TokenChild(user2)"};return[[l,m,p],f,[await l.send(i.getSender(),{value:a.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Transfer{100,user2} (from deployer)":async()=>{const i=await l.getChildAddress(o.address);return[await t.openContract(await d.fromAddress(i)).send(o,{value:a.toNano(1)},{$$type:"Transfer",amount:a.toNano(100),to:g.address})]},"Transfer{100,deployer} (from user2)":async()=>{const i=await l.getChildAddress(g.address);return[await t.openContract(await d.fromAddress(i)).send(g,{value:a.toNano(1)},{$$type:"Transfer",amount:a.toNano(100),to:o.address})]}},getters:{metadata:async()=>await l.getMetadata(),"balance(childAddress(deployer))":async()=>{const i=await l.getChildAddress(o.address);return await t.openContract(await d.fromAddress(i)).getBalance()},"balance(childAddress(user2))":async()=>{const i=await l.getChildAddress(g.address);return await t.openContract(await d.fromAddress(i)).getBalance()}},prev:u(import.meta.url).prev,next:u(import.meta.url).next},r),[]}class j extends E{constructor(e){super(),Q(this,e,O,null,b,{})}}export{j as default}; diff --git a/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.6d1cee49.js b/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.6d1cee49.js deleted file mode 100644 index 3115c57..0000000 --- a/docs/_app/immutable/entry/(examples)-06-unbounded-maps-page.svelte.6d1cee49.js +++ /dev/null @@ -1,111 +0,0 @@ -var f=Object.defineProperty;var Q=(s,e,n)=>e in s?f(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n;var d=(s,e,n)=>(Q(s,typeof e!="symbol"?e+"":e,n),n);import{S as E,i as b,s as L,I as p,ac as D}from"../chunks/index.9fe14626.js";import{d as r,g as B,s as y}from"../chunks/store.d3ab02ad.js";import{d as v}from"../chunks/index.78404594.js";const J=`# Unbounded Maps - Simplified Token - -In general, inifinite data structures that can actually grow to billions of elements are very difficult to implement on blockchain. As the contract persistent state grows in size, read and write operations become more expensive in gas. In the extreme, they may cost more than a transaction gas limit, rendering the contract unusable. - -**It is therefore important to design contracts to have an upper bound on state size.** If so, how would we implement a token with a map of balances that can scale to billions of holders? - -## Infinitely scalable balance map - -The secret of infinite scalability on TON is sharding the data across multiple contracts. We can apply the parent-child design pattern to do just this. - -In this example, we hold the balance of every holder in a separate child contract. - -To transfer tokens, the owner sends the \`Transfer\` message to the child contract holding their own balance. This will cause the child to deploy its sibling - the child contract holding the recipient's balance - by sending it the \`InternalAddTokens\` message. - -This example also handles gas efficiently. The excess gas from every operation is refunded to the original sender.`,S=`import "@stdlib/deploy"; - -struct Metadata { - symbol: String; - totalSupply: Int; -} - -message Transfer { - amount: Int as coins; - to: Address; -} - -// the token parent, mostly used to query general metadata and get children addresses -contract TokenParent with Deployable { - - symbol: String; - totalSupply: Int as coins; - - init() { - self.symbol = "SHIB"; - self.totalSupply = 500 * pow(10,9); - self.mint(self.totalSupply, sender()); // mint the entire total supply to deployer - } - - fun mint(amount: Int, to: Address) { - let init: StateInit = initOf TokenChild(myAddress(), to); - send(SendParameters{ - to: contractAddress(init), - body: InternalAddTokens{amount: amount, origin: myAddress()}.toCell(), - value: ton("0.03"), // pay for the deployment and leave some TON in the child for storage - mode: SendIgnoreErrors, - code: init.code, // deploy the child if needed - data: init.data - }); - } - - get fun metadata(): Metadata { - return Metadata{symbol: self.symbol, totalSupply: self.totalSupply}; - } - - get fun childAddress(owner: Address): Address { - return contractAddress(initOf TokenChild(myAddress(), owner)); - } -} - -//////////////////////////////////////////////////////////////////////////// -// child contract - the Transfer message is sent by users directly to a child - -message InternalAddTokens { - amount: Int as coins; - origin: Address; -} - -contract TokenChild { - - parent: Address; - owner: Address; // every child holds the balance of a different owner - balance: Int as coins; // this is the balance of the owner - - init(parent: Address, owner: Address) { - self.parent = parent; - self.owner = owner; - self.balance = 0; - } - - // sent by users to initiate a new transfer - receive(msg: Transfer) { - require(sender() == self.owner, "Access denied"); - require(self.balance >= msg.amount, "Insufficient balance"); - self.balance = self.balance - msg.amount; - let init: StateInit = initOf TokenChild(self.parent, msg.to); - send(SendParameters{ - to: contractAddress(init), - body: InternalAddTokens{amount: msg.amount, origin: self.owner}.toCell(), - value: ton("0.03"), // pay for the deployment and leave some TON in the child for storage - mode: SendIgnoreErrors, - code: init.code, // deploy the child if needed - data: init.data - }); - reply("transferred".asComment()); - } - - // internal message sent by one child to another to update balances - receive(msg: InternalAddTokens) { - if (msg.origin == self.parent) { // tokens originate in a mint - require(sender() == self.parent, "Parent only"); - } else { // tokens originate in a Transfer - require(sender() == contractAddress(initOf TokenChild(self.parent, msg.origin)), "Sibling only"); - } - self.balance = self.balance + msg.amount; - } - - get fun balance(): Int { - return self.balance; - } -} -`;function M(s){return e=>{let n=e;n.storeUint(2490013878,32),n.storeUint(s.queryId,64)}}function H(s){let e=s.readString(),n=s.readBigNumber();return{$$type:"Metadata",symbol:e,totalSupply:n}}async function w(){const s=r.Cell.fromBase64("te6ccgECFgEAA+UAART/APSkE/S88sgLAQIBYgIDAqLQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxa2zwwyPhDAcx/AcoAWchYzxbJWMwB+gLJ7VQKBAIBIAUGAZhwIddJwh+VMCDXCx/eApJbf+ABghCUapi2uo6t0x8BghCUapi2uvLggdM/ATHIAYIQr/kPV1jLH8s/yX/4QnBYA4BCAW1t2zx/4DBwEAIBIAcIAgEgEhMCS7uzEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCI2zxY2zxsIYCgkC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8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMwA1gLQ9AQwbQGBIe0BgBD0D2+h8uCHAYEh7SICgBD0F8gByPQAyQHMcAHKAEADWSDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFgEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxbJAbztRNDUAfhj0gABjkb6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+gBVIGwT4Pgo1wsKgwm68uCJLAGK+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIEgLRAds8LQACcGmY/ZQ=");let n=r.beginCell();n.storeRef(e),n.storeUint(0,1);const a=n.endCell();return{code:s,data:a}}const T={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},20537:{message:"Sibling only"},49469:{message:"Access denied"},54404:{message:"Parent only"},54615:{message:"Insufficient balance"}};class I{constructor(e,n){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Metadata",header:null,fields:[]},{name:"Transfer",header:1943715420,fields:[]},{name:"InternalAddTokens",header:4162046107,fields:[]}],errors:T});this.address=e,this.init=n}static async init(){return await w()}static async fromInit(){const e=await w(),n=r.contractAddress(0,e);return new I(n,e)}static fromAddress(e){return new I(e)}async send(e,n,a,t){let A=null;if(t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="Deploy"&&(A=r.beginCell().store(M(t)).endCell()),A===null)throw new Error("Invalid message type");await e.internal(n,{...a,body:A})}async getMetadata(e){let n=new r.TupleBuilder,a=(await e.get("metadata",n.build())).stack;return H(a)}async getChildAddress(e,n){let a=new r.TupleBuilder;return a.writeAddress(n),(await e.get("childAddress",a.build())).stack.readAddress()}}function Y(s){return e=>{let n=e;n.storeUint(1943715420,32),n.storeCoins(s.amount),n.storeAddress(s.to)}}function N(s){return e=>{let n=e;n.storeUint(4162046107,32),n.storeCoins(s.amount),n.storeAddress(s.origin)}}function P(s){return e=>{let n=e;n.storeAddress(s.parent),n.storeAddress(s.owner)}}async function m(s,e){const n=r.Cell.fromBase64("te6ccgECGAEABQAAART/APSkE/S88sgLAQIBYgIDA3bQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts8MBIEBQIBWA4PArxwIddJwh+VMCDXCx/eApJbf+AhghBz2r5cuo61MdMfAYIQc9q+XLry4IH6APpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgSbBLbPH/gAYIQ+BPIm7rjAjBwBgcAnsj4QwHMfwHKAFUgWiDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFlgg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYB+gLJ7VQCxIIAwT34QlJQxwXy9IIA1VddvvL0USGh+ENUIFTbPFxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFE1DQgBYtMfAYIQ+BPIm7ry4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UTUWEgOWyFmCEPgTyJtQA8sfAfoCASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFsmCCcnDgFpyWX8GRVXbPIh/+EJwWAOAQgFtbds8FBMUAB4AAAAAdHJhbnNmZXJyZWQByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAFQCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzADWAtD0BDBtAYEh7QGAEPQPb6Hy4IcBgSHtIgKAEPQXyAHI9ADJAcxwAcoAQANZINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskBvO1E0NQB+GPSAAGORvpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAH6AFUgbBPg+CjXCwqDCbry4IkYAYr6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgSAtEB2zwZAAJwry3bvg==");let t=r.beginCell();t.storeRef(a),t.storeUint(0,1),P({$$type:"TokenChild_init_args",parent:s,owner:e})(t);const A=t.endCell();return{code:n,data:A}}const F={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},20537:{message:"Sibling only"},49469:{message:"Access denied"},54404:{message:"Parent only"},54615:{message:"Insufficient balance"}};class g{constructor(e,n){d(this,"address");d(this,"init");d(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"Deploy",header:2490013878,fields:[]},{name:"DeployOk",header:2952335191,fields:[]},{name:"Metadata",header:null,fields:[]},{name:"Transfer",header:1943715420,fields:[]},{name:"InternalAddTokens",header:4162046107,fields:[]}],errors:F});this.address=e,this.init=n}static async init(e,n){return await m(e,n)}static async fromInit(e,n){const a=await m(e,n),t=r.contractAddress(0,a);return new g(t,a)}static fromAddress(e){return new g(e)}async send(e,n,a,t){let A=null;if(t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="Transfer"&&(A=r.beginCell().store(Y(t)).endCell()),t&&typeof t=="object"&&!(t instanceof r.Slice)&&t.$$type==="InternalAddTokens"&&(A=r.beginCell().store(N(t)).endCell()),A===null)throw new Error("Invalid message type");await e.internal(n,{...a,body:A})}async getBalance(e){let n=new r.TupleBuilder;return(await e.get("balance",n.build())).stack.readBigNumber()}}function X(s,e,n){let a;p(s,y,o=>n(6,a=o));let t,A,c,i,C,u;return D(y,a={markdown:J,tactCode:S,deploy:async()=>{t=await v.Blockchain.create();const o=await t.treasury("deployer");A=o.getSender();const l=await t.treasury("another");c=l.getSender(),i=t.openContract(await I.fromInit()),C=t.openContract(await g.fromInit(i.address,A.address)),u=t.openContract(await g.fromInit(i.address,c.address));const h={[o.address.toString()]:"deployer",[l.address.toString()]:"user2",[i.address.toString()]:"TokenParent",[C.address.toString()]:"TokenChild(deployer)",[u.address.toString()]:"TokenChild(user2)"};return[[i,C,u],h,[await i.send(o.getSender(),{value:r.toNano(1)},{$$type:"Deploy",queryId:0n})]]},messages:{"Transfer{100,user2} (from deployer)":async()=>{const o=await i.getChildAddress(A.address);return[await t.openContract(await g.fromAddress(o)).send(A,{value:r.toNano(1)},{$$type:"Transfer",amount:r.toNano(100),to:c.address})]},"Transfer{100,deployer} (from user2)":async()=>{const o=await i.getChildAddress(c.address);return[await t.openContract(await g.fromAddress(o)).send(c,{value:r.toNano(1)},{$$type:"Transfer",amount:r.toNano(100),to:A.address})]}},getters:{metadata:async()=>await i.getMetadata(),"balance(childAddress(deployer))":async()=>{const o=await i.getChildAddress(A.address);return await t.openContract(await g.fromAddress(o)).getBalance()},"balance(childAddress(user2))":async()=>{const o=await i.getChildAddress(c.address);return await t.openContract(await g.fromAddress(o)).getBalance()}},prev:B(import.meta.url).prev,next:B(import.meta.url).next},a),[]}class U extends E{constructor(e){super(),b(this,e,X,null,L,{})}}export{U as default}; diff --git a/docs/_app/immutable/entry/(examples)-07-jetton-standard-page.svelte.21b6de71.js b/docs/_app/immutable/entry/(examples)-07-jetton-standard-page.svelte.21b6de71.js new file mode 100644 index 0000000..b66fe8c --- /dev/null +++ b/docs/_app/immutable/entry/(examples)-07-jetton-standard-page.svelte.21b6de71.js @@ -0,0 +1,391 @@ +var nv=Object.defineProperty;var rv=(e,t,n)=>t in e?nv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yt=(e,t,n)=>(rv(e,typeof t!="symbol"?t+"":t,n),n);import{aa as J,a9 as mn,S as av,i as iv,s as ov,I as uv,ac as cv}from"../chunks/index.9fe14626.js";import{d as U,c as W,b as lt,r as yi,g as Ru,s as $u}from"../chunks/store.476c3091.js";import{d as lv}from"../chunks/index.c056099e.js";const sv=`# Jetton Token - Fungible Tokens + +This is a general Jetton implementation example from zero to one. Although we didn't devote much space to detailing Jetton Content, remember, there are two ways to implement Jetton Token Data, as outlined in [TEP-64](https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md). + +## Infinitely Scalable Balance Map + +In this example, we launch the Jetton Root Token which introduces the \`Jetton\` trait below, having a limitation of \`max_supply\` upon deployment. + +The minting process has two different methods: + +1. Send the text message "Mint: 100" to mint the token. +2. Send the \`Mint\` message with the \`amount\` to mint the token. + +### Close the Mint Function + +In this example, we set the functionality for turn-off the minting process. The string text message with \`Owner: MintClose\` method is used to close the minting process. The method is only enable to the owner of the contract. + +## Transfer + +Notice that the Jetton Token standard also implements the \`Transfer\` method below. The \`Transfer\` method is the most important method in the Jetton Token Standard, allowing you to transfer the token to another account. + +Excess gas from every operation is refunded to the original sender. + +
+
+ Info: TEP-74 is the Jetton Token Standard. Detail can check here + +
+`,fv=`import "@stdlib/ownable"; + +message Mint { + amount: Int; + receiver: Address; +} + +contract SampleJetton with Jetton { + totalSupply: Int as coins; + owner: Address; + content: Cell; + mintable: Bool; + + max_supply: Int as coins; + + init(owner: Address, content: Cell, max_supply: Int) { + self.totalSupply = 0; + self.owner = owner; + self.mintable = true; + self.content = content; + + self.max_supply = max_supply; // Initial Setting for max_supply + } + + receive(msg: Mint) { + let ctx: Context = context(); + require(ctx.sender == self.owner, "Not Owner"); + require(self.mintable, "Can't Mint Anymore"); + self.mint(msg.receiver, msg.amount, self.owner); // (to, amount, response_destination) + } + + receive("Mint: 100") { // Public Minting + let ctx: Context = context(); + require(self.mintable, "Can't Mint Anymore"); + self.mint(ctx.sender, 100, self.owner); + } + + receive("Owner: MintClose") { + let ctx: Context = context(); + require(ctx.sender == self.owner, "Not Owner"); + self.mintable = false; + } +} + +struct JettonData { + totalSupply: Int; + mintable: Bool; + owner: Address; + content: Cell; + walletCode: Cell; +} + +// ============================================================================================================ // +@interface("org.ton.jetton.master") +trait Jetton with Ownable { + + totalSupply: Int; // Already set initially + mintable: Bool; + owner: Address; + content: Cell; + + max_supply: Int; // This is not in the TEP-74 interface + + receive(msg: TokenUpdateContent) { + self.requireOwner(); // Allow changing content only by owner + self.content = msg.content; // Update content + } + + receive(msg: TokenBurnNotification) { + self.requireWallet(msg.owner); // Check wallet + self.totalSupply = self.totalSupply - msg.amount; // Update supply + + if (msg.response_destination != null) { // Cashback + send(SendParameters{ + to: msg.response_destination!!, + value: 0, + bounce: false, + mode: SendRemainingValue + SendIgnoreErrors, + body: TokenExcesses{ + queryId: msg.queryId + }.toCell() + }); + } + } + + // @to The Address receive the Jetton token after minting + // @amount The amount of Jetton token being minted + // @response_destination The previous owner address + fun mint(to: Address, amount: Int, response_destination: Address) { + require(self.totalSupply + amount <= self.max_supply, "The total supply will be overlapping."); + self.totalSupply = self.totalSupply + amount; // Update total supply + + let winit: StateInit = self.getJettonWalletInit(to); // Create message + send(SendParameters{ + to: contractAddress(winit), + value: 0, + bounce: false, + mode: SendRemainingValue, + body: TokenTransferInternal{ + queryId: 0, + amount: amount, + from: myAddress(), + response_destination: response_destination, + forward_ton_amount: 0, + forward_payload: emptySlice() + }.toCell(), + code: winit.code, + data: winit.data + }); + } + + fun requireWallet(owner: Address) { + let ctx: Context = context(); + let winit: StateInit = self.getJettonWalletInit(owner); + require(contractAddress(winit) == ctx.sender, "Invalid sender"); + } + + virtual fun getJettonWalletInit(address: Address): StateInit { + return initOf JettonDefaultWallet(myAddress(), address); + } + + // ====== Get Methods ====== // + get fun get_jetton_data(): JettonData { + let code: Cell = self.getJettonWalletInit(myAddress()).code; + return JettonData{ + totalSupply: self.totalSupply, + mintable: self.mintable, + owner: self.owner, + content: self.content, + walletCode: code + }; + } + + get fun get_wallet_address(owner: Address): Address { + let winit: StateInit = self.getJettonWalletInit(owner); + return contractAddress(winit); + } +} +// ============================================================ // +@interface("org.ton.jetton.wallet") +contract JettonDefaultWallet { + const minTonsForStorage: Int = ton("0.01"); + const gasConsumption: Int = ton("0.01"); + + balance: Int; + owner: Address; + master: Address; + + init(master: Address, owner: Address) { + self.balance = 0; + self.owner = owner; + self.master = master; + } + + receive(msg: TokenTransfer) { // 0xf8a7ea5 + let ctx: Context = context(); // Check sender + require(ctx.sender == self.owner, "Invalid sender"); + + // Gas checks + let fwdFee: Int = ctx.readForwardFee() + ctx.readForwardFee(); + let final: Int = 2 * self.gasConsumption + self.minTonsForStorage + fwdFee; + require(ctx.value > min(final, ton("0.01")), "Invalid value!!"); + + // Update balance + self.balance = self.balance - msg.amount; + require(self.balance >= 0, "Invalid balance"); + + let init: StateInit = initOf JettonDefaultWallet(self.master, msg.destination); + let walletAddress: Address = contractAddress(init); + send(SendParameters{ + to: walletAddress, + value: 0, + mode: SendRemainingValue, + bounce: false, + body: TokenTransferInternal{ + queryId: msg.queryId, + amount: msg.amount, + from: self.owner, + response_destination: msg.response_destination, + forward_ton_amount: msg.forward_ton_amount, + forward_payload: msg.forward_payload + }.toCell(), + code: init.code, + data: init.data + }); + } + + receive(msg: TokenTransferInternal) { // 0x178d4519 + let ctx: Context = context(); + + if (ctx.sender != self.master) { + let sinit: StateInit = initOf JettonDefaultWallet(self.master, msg.from); + require(contractAddress(sinit) == ctx.sender, "Invalid sender!"); + } + + // Update balance + self.balance = self.balance + msg.amount; + require(self.balance >= 0, "Invalid balance"); + + // Get value for gas + let msgValue: Int = self.msgValue(ctx.value); + let fwdFee: Int = ctx.readForwardFee(); + msgValue = msgValue - msg.forward_ton_amount - fwdFee; + + // 0x7362d09c - notify the new owner of JettonToken that the transfer is complete + if (msg.forward_ton_amount > 0) { + send(SendParameters{ + to: self.owner, + value: msg.forward_ton_amount, + mode: SendPayGasSeparately + SendIgnoreErrors, + bounce: false, + body: TokenNotification { + queryId: msg.queryId, + amount: msg.amount, + from: msg.from, + forward_payload: msg.forward_payload + }.toCell() + }); + } + + // 0xd53276db -- Cashback to the original Sender + if (msg.response_destination != null) { + send(SendParameters { + to: msg.response_destination, + value: msgValue, + bounce: false, + body: TokenExcesses { + queryId: msg.queryId + }.toCell(), + mode: SendIgnoreErrors + }); + } + } + + receive(msg: TokenBurn) { + let ctx: Context = context(); + require(ctx.sender == self.owner, "Invalid sender"); // Check sender + + self.balance = self.balance - msg.amount; // Update balance + require(self.balance >= 0, "Invalid balance"); + + let fwdFee: Int = ctx.readForwardFee(); // Gas checks + require(ctx.value > fwdFee + 2 * self.gasConsumption + self.minTonsForStorage, "Invalid value - Burn"); + + // Burn tokens + send(SendParameters{ + to: self.master, + value: 0, + mode: SendRemainingValue, + bounce: true, + body: TokenBurnNotification{ + queryId: msg.queryId, + amount: msg.amount, + owner: self.owner, + response_destination: self.owner + }.toCell() + }); + } + + get fun msgValue(value: Int): Int { + let msgValue: Int = value; + let tonBalanceBeforeMsg: Int = myBalance() - msgValue; + let storageFee: Int = self.minTonsForStorage - min(tonBalanceBeforeMsg, self.minTonsForStorage); + msgValue = msgValue - (storageFee + self.gasConsumption); + return msgValue; + } + + bounced(src: bounced) { + self.balance = self.balance + src.amount; + } + + bounced(src: bounced) { + self.balance = self.balance + src.amount; + } + + get fun get_wallet_data(): JettonWalletData { + return JettonWalletData{ + balance: self.balance, + owner: self.owner, + master: self.master, + walletCode: (initOf JettonDefaultWallet(self.master, self.owner)).code + }; + } +} + +struct JettonWalletData { + balance: Int; + owner: Address; + master: Address; + walletCode: Cell; +} + +message(0xf8a7ea5) TokenTransfer { + queryId: Int as uint64; + amount: Int as coins; + destination: Address; + response_destination: Address; + custom_payload: Cell?; + forward_ton_amount: Int as coins; + forward_payload: Slice as remaining; // Comment Text message when Transfer the jetton +} + +message(0x178d4519) TokenTransferInternal { + queryId: Int as uint64; + amount: Int as coins; + from: Address; + response_destination: Address; + forward_ton_amount: Int as coins; + forward_payload: Slice as remaining; // Comment Text message when Transfer the jetton +} + +message(0x7362d09c) TokenNotification { + queryId: Int as uint64; + amount: Int as coins; + from: Address; + forward_payload: Slice as remaining; // Comment Text message when Transfer the jetton +} + +message(0x595f07bc) TokenBurn { + queryId: Int as uint64; + amount: Int as coins; + owner: Address; + response_destination: Address; +} + +message(0x7bdd97de) TokenBurnNotification { + queryId: Int as uint64; + amount: Int as coins; + owner: Address; + response_destination: Address?; +} + +message(0xd53276db) TokenExcesses { + queryId: Int as uint64; +} + +message TokenUpdateContent { + content: Cell; +}`;function dv(e){return t=>{let n=t;n.storeUint(4235234258,32),n.storeInt(e.amount,257),n.storeAddress(e.receiver)}}function hv(e){let t=e.readBigNumber(),n=e.readBoolean(),r=e.readAddress(),a=e.readCell(),i=e.readCell();return{$$type:"JettonData",totalSupply:t,mintable:n,owner:r,content:a,walletCode:i}}function vv(e){return t=>{let n=t;n.storeUint(2078119902,32),n.storeUint(e.queryId,64),n.storeCoins(e.amount),n.storeAddress(e.owner),n.storeAddress(e.response_destination)}}function pv(e){return t=>{let n=t;n.storeUint(2937889386,32),n.storeRef(e.content)}}function gv(e){return t=>{let n=t;n.storeAddress(e.owner),n.storeRef(e.content),n.storeInt(e.max_supply,257)}}async function Wu(e,t,n){const r=U.Cell.fromBase64("te6ccgECIgEABtkAART/APSkE/S88sgLAQIBYgIDAurQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVFNs88uCCyPhDAcx/AcoAVUBQVPoCWCDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFswSygAB+gLJ7VQaBAIBIBARAvTtou37AZIwf+BwIddJwh+VMCDXCx/eIIIQ/HCL0rqO0TDTHwGCEPxwi9K68uCBgQEB1wD6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIEmwS+EFvJBAjXwMmgQ6WAscF8vSBSOwk8vRRFds8f+AgghCvHKJqugsFA16OmzDTHwGCEK8comq68uCB1AExVUDbPDIQNEMAf+AgghB73ZfeuuMCwACRMOMNcAYHCAAS+EJSQMcF8uCEAcQw0x8BghB73ZfeuvLggdM/+gD6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAfpAIdcLAcMAjh0BINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiJIxbeIUQzBsFAkB+vkBIILw/L65pICWZHdIBjnHzqSleKpqETspA7JtAbw4RmPs7va6jpcw+EFvJBAjXwOBSOwj8vSAZCXbPH/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Rby9FUDQAAS+EJSQMcF8uCEA/SBGvJTgqAlu/L0UXGgVUHbPFxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiHBwgEAi+CghyMnQEDUQTxAjAhEQAshVUNs8yUZQEEsQOkC6EEYQRUA/PAEI2zxAND0ByshxAcoBUAcBygBwAcoCUAUg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxZQA/oCcAHKaCNus5F/kyRus+KXMzMBcAHKAOMNIW6znH8BygABIG7y0IABzJUxcAHKAOLJAfsAPgCYfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzACqghAXjUUZUAfLHxXLP1AD+gIBINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFgH6AgHPFgEO+EP4KFjbPEEA2gLQ9AQwbQGCANivAYAQ9A9vofLghwGCANivIgKAEPQXyAHI9ADJAcxwAcoAQANZINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskB4O1E0NQB+GPSAAGOK/oA+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHU0gD6AFVAbBXg+CjXCwqDCbry4In6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIAdSBAQHXAFUgA9FY2zxDAApwVSB/AZ/VNjk=");let i=U.beginCell();i.storeRef(a),i.storeUint(0,1),gv({$$type:"SampleJetton_init_args",owner:e,content:t,max_supply:n})(i);const o=i.endCell();return{code:r,data:o}}const yv={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},3734:{message:"Not Owner"},4159:{message:"Invalid value!!"},4429:{message:"Invalid sender"},6898:{message:"The total supply will be overlapping."},18668:{message:"Can't Mint Anymore"},42708:{message:"Invalid sender!"},43422:{message:"Invalid value - Burn"},62972:{message:"Invalid balance"}},mv=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Mint",header:4235234258,fields:[{name:"amount",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"receiver",type:{kind:"simple",type:"address",optional:!1}}]},{name:"JettonData",header:null,fields:[{name:"totalSupply",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mintable",type:{kind:"simple",type:"bool",optional:!1}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"content",type:{kind:"simple",type:"cell",optional:!1}},{name:"walletCode",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"JettonWalletData",header:null,fields:[{name:"balance",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"master",type:{kind:"simple",type:"address",optional:!1}},{name:"walletCode",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"TokenTransfer",header:260734629,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"destination",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}},{name:"custom_payload",type:{kind:"simple",type:"cell",optional:!0}},{name:"forward_ton_amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenTransferInternal",header:395134233,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"from",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}},{name:"forward_ton_amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenNotification",header:1935855772,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"from",type:{kind:"simple",type:"address",optional:!1}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenBurn",header:1499400124,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TokenBurnNotification",header:2078119902,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!0}}]},{name:"TokenExcesses",header:3576854235,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"TokenUpdateContent",header:2937889386,fields:[{name:"content",type:{kind:"simple",type:"cell",optional:!1}}]}],Av=[{name:"get_jetton_data",arguments:[],returnType:{kind:"simple",type:"JettonData",optional:!1}},{name:"get_wallet_address",arguments:[{name:"owner",type:{kind:"simple",type:"address",optional:!1}}],returnType:{kind:"simple",type:"address",optional:!1}},{name:"owner",arguments:[],returnType:{kind:"simple",type:"address",optional:!1}}],wv=[{receiver:"internal",message:{kind:"typed",type:"Mint"}},{receiver:"internal",message:{kind:"text",text:"Mint: 100"}},{receiver:"internal",message:{kind:"text",text:"Owner: MintClose"}},{receiver:"internal",message:{kind:"typed",type:"TokenUpdateContent"}},{receiver:"internal",message:{kind:"typed",type:"TokenBurnNotification"}}];class hr{constructor(t,n){yt(this,"address");yt(this,"init");yt(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Mint",header:4235234258,fields:[]},{name:"JettonData",header:null,fields:[]},{name:"JettonWalletData",header:null,fields:[]},{name:"TokenTransfer",header:260734629,fields:[]},{name:"TokenTransferInternal",header:395134233,fields:[]},{name:"TokenNotification",header:1935855772,fields:[]},{name:"TokenBurn",header:1499400124,fields:[]},{name:"TokenBurnNotification",header:2078119902,fields:[]},{name:"TokenExcesses",header:3576854235,fields:[]},{name:"TokenUpdateContent",header:2937889386,fields:[]}],types:mv,getters:Av,receivers:wv,errors:yv});this.address=t,this.init=n}static async init(t,n,r){return await Wu(t,n,r)}static async fromInit(t,n,r){const a=await Wu(t,n,r),i=U.contractAddress(0,a);return new hr(i,a)}static fromAddress(t){return new hr(t)}async send(t,n,r,a){let i=null;if(a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="Mint"&&(i=U.beginCell().store(dv(a)).endCell()),a==="Mint: 100"&&(i=U.beginCell().storeUint(0,32).storeStringTail(a).endCell()),a==="Owner: MintClose"&&(i=U.beginCell().storeUint(0,32).storeStringTail(a).endCell()),a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="TokenUpdateContent"&&(i=U.beginCell().store(pv(a)).endCell()),a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="TokenBurnNotification"&&(i=U.beginCell().store(vv(a)).endCell()),i===null)throw new Error("Invalid message type");await t.internal(n,{...r,body:i})}async getGetJettonData(t){let n=new U.TupleBuilder,r=(await t.get("get_jetton_data",n.build())).stack;return hv(r)}async getGetWalletAddress(t,n){let r=new U.TupleBuilder;return r.writeAddress(n),(await t.get("get_wallet_address",r.build())).stack.readAddress()}async getOwner(t){let n=new U.TupleBuilder;return(await t.get("owner",n.build())).stack.readAddress()}}function bv(e){let t=e.readBigNumber(),n=e.readAddress(),r=e.readAddress(),a=e.readCell();return{$$type:"JettonWalletData",balance:t,owner:n,master:r,walletCode:a}}function Iv(e){return t=>{let n=t;n.storeUint(260734629,32),n.storeUint(e.queryId,64),n.storeCoins(e.amount),n.storeAddress(e.destination),n.storeAddress(e.response_destination),e.custom_payload!==null&&e.custom_payload!==void 0?n.storeBit(!0).storeRef(e.custom_payload):n.storeBit(!1),n.storeCoins(e.forward_ton_amount),n.storeBuilder(e.forward_payload.asBuilder())}}function Cv(e){return t=>{let n=t;n.storeUint(395134233,32),n.storeUint(e.queryId,64),n.storeCoins(e.amount),n.storeAddress(e.from),n.storeAddress(e.response_destination),n.storeCoins(e.forward_ton_amount),n.storeBuilder(e.forward_payload.asBuilder())}}function Ev(e){return t=>{let n=t;n.storeUint(1499400124,32),n.storeUint(e.queryId,64),n.storeCoins(e.amount),n.storeAddress(e.owner),n.storeAddress(e.response_destination)}}function _v(e){return t=>{let n=t;n.storeAddress(e.master),n.storeAddress(e.owner)}}async function Lu(e,t){const n=U.Cell.fromBase64("te6ccgECIgEACDYAART/APSkE/S88sgLAQIBYgIDA3rQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCHgQFAgEgFBUC7gGOW4Ag1yFwIddJwh+VMCDXCx/eIIIQF41FGbqOGjDTHwGCEBeNRRm68uCB0z/6AFlsEjEToAJ/4IIQe92X3rqOGdMfAYIQe92X3rry4IHTP/oAWWwSMROgAn/gMH/gcCHXScIflTAg1wsf3iCCEA+KfqW64wIgBgcApsj4QwHMfwHKAFUgUCOBAQHPAAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIzxYBINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8Wye1UAhAw2zxsF9s8fwgJA+yCEBeNRRm6jwgw2zxsFts8f+CCEFlfB7y6jtjTHwGCEFlfB7y68uCB0z/6APpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBRDMGwU2zx/4DBwDA0OAMbTHwGCEA+KfqW68uCB0z/6APpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHSAAGR1JJtAeL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9vofLghwGCANivIgKAEPQXyAHI9ADJAcxwAcoAQANZINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiM8WASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IjPFskAZGwx+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiDD6ADFx1yH6ADH6ADCnA6sAAMbTHwGCEA+KfqW68uCB0z/6APpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAHSAAGR1JJtAeL6AFFmFhUUQzABwO1E0NQB+GPSAAGOSIEBAdcA+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiAH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIQzBsE+D4KNcLCoMJuvLgiSIBivpAASDXSYEBC7ry4Igg1wsKIIEE/7ry0ImDCbry4IgB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiBIC0QHbPCMABHACSNe1Qw==");let a=U.beginCell();a.storeRef(r),a.storeUint(0,1),_v({$$type:"JettonDefaultWallet_init_args",master:e,owner:t})(a);const i=a.endCell();return{code:n,data:i}}const Bv={2:{message:"Stack undeflow"},3:{message:"Stack overflow"},4:{message:"Integer overflow"},5:{message:"Integer out of expected range"},6:{message:"Invalid opcode"},7:{message:"Type check error"},8:{message:"Cell overflow"},9:{message:"Cell underflow"},10:{message:"Dictionary error"},13:{message:"Out of gas error"},32:{message:"Method ID not found"},34:{message:"Action is invalid or not supported"},37:{message:"Not enough TON"},38:{message:"Not enough extra-currencies"},128:{message:"Null reference exception"},129:{message:"Invalid serialization prefix"},130:{message:"Invalid incoming message"},131:{message:"Constraints error"},132:{message:"Access denied"},133:{message:"Contract stopped"},134:{message:"Invalid argument"},135:{message:"Code of a contract was not found"},136:{message:"Invalid address"},137:{message:"Masterchain support is not enabled for this contract"},3734:{message:"Not Owner"},4159:{message:"Invalid value!!"},4429:{message:"Invalid sender"},6898:{message:"The total supply will be overlapping."},18668:{message:"Can't Mint Anymore"},42708:{message:"Invalid sender!"},43422:{message:"Invalid value - Burn"},62972:{message:"Invalid balance"}},Mv=[{name:"StateInit",header:null,fields:[{name:"code",type:{kind:"simple",type:"cell",optional:!1}},{name:"data",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"Context",header:null,fields:[{name:"bounced",type:{kind:"simple",type:"bool",optional:!1}},{name:"sender",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"raw",type:{kind:"simple",type:"slice",optional:!1}}]},{name:"SendParameters",header:null,fields:[{name:"bounce",type:{kind:"simple",type:"bool",optional:!1}},{name:"to",type:{kind:"simple",type:"address",optional:!1}},{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mode",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"body",type:{kind:"simple",type:"cell",optional:!0}},{name:"code",type:{kind:"simple",type:"cell",optional:!0}},{name:"data",type:{kind:"simple",type:"cell",optional:!0}}]},{name:"ChangeOwner",header:2174598809,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"ChangeOwnerOk",header:846932810,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"newOwner",type:{kind:"simple",type:"address",optional:!1}}]},{name:"Mint",header:4235234258,fields:[{name:"amount",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"receiver",type:{kind:"simple",type:"address",optional:!1}}]},{name:"JettonData",header:null,fields:[{name:"totalSupply",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"mintable",type:{kind:"simple",type:"bool",optional:!1}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"content",type:{kind:"simple",type:"cell",optional:!1}},{name:"walletCode",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"JettonWalletData",header:null,fields:[{name:"balance",type:{kind:"simple",type:"int",optional:!1,format:257}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"master",type:{kind:"simple",type:"address",optional:!1}},{name:"walletCode",type:{kind:"simple",type:"cell",optional:!1}}]},{name:"TokenTransfer",header:260734629,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"destination",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}},{name:"custom_payload",type:{kind:"simple",type:"cell",optional:!0}},{name:"forward_ton_amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenTransferInternal",header:395134233,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"from",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}},{name:"forward_ton_amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenNotification",header:1935855772,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"from",type:{kind:"simple",type:"address",optional:!1}},{name:"forward_payload",type:{kind:"simple",type:"slice",optional:!1,format:"remainder"}}]},{name:"TokenBurn",header:1499400124,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!1}}]},{name:"TokenBurnNotification",header:2078119902,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}},{name:"amount",type:{kind:"simple",type:"uint",optional:!1,format:"coins"}},{name:"owner",type:{kind:"simple",type:"address",optional:!1}},{name:"response_destination",type:{kind:"simple",type:"address",optional:!0}}]},{name:"TokenExcesses",header:3576854235,fields:[{name:"queryId",type:{kind:"simple",type:"uint",optional:!1,format:64}}]},{name:"TokenUpdateContent",header:2937889386,fields:[{name:"content",type:{kind:"simple",type:"cell",optional:!1}}]}],Tv=[{name:"msgValue",arguments:[{name:"value",type:{kind:"simple",type:"int",optional:!1,format:257}}],returnType:{kind:"simple",type:"int",optional:!1,format:257}},{name:"get_wallet_data",arguments:[],returnType:{kind:"simple",type:"JettonWalletData",optional:!1}}],Sv=[{receiver:"internal",message:{kind:"typed",type:"TokenTransfer"}},{receiver:"internal",message:{kind:"typed",type:"TokenTransferInternal"}},{receiver:"internal",message:{kind:"typed",type:"TokenBurn"}}];class mt{constructor(t,n){yt(this,"address");yt(this,"init");yt(this,"abi",{types:[{name:"StateInit",header:null,fields:[]},{name:"Context",header:null,fields:[]},{name:"SendParameters",header:null,fields:[]},{name:"ChangeOwner",header:2174598809,fields:[]},{name:"ChangeOwnerOk",header:846932810,fields:[]},{name:"Mint",header:4235234258,fields:[]},{name:"JettonData",header:null,fields:[]},{name:"JettonWalletData",header:null,fields:[]},{name:"TokenTransfer",header:260734629,fields:[]},{name:"TokenTransferInternal",header:395134233,fields:[]},{name:"TokenNotification",header:1935855772,fields:[]},{name:"TokenBurn",header:1499400124,fields:[]},{name:"TokenBurnNotification",header:2078119902,fields:[]},{name:"TokenExcesses",header:3576854235,fields:[]},{name:"TokenUpdateContent",header:2937889386,fields:[]}],types:Mv,getters:Tv,receivers:Sv,errors:Bv});this.address=t,this.init=n}static async init(t,n){return await Lu(t,n)}static async fromInit(t,n){const r=await Lu(t,n),a=U.contractAddress(0,r);return new mt(a,r)}static fromAddress(t){return new mt(t)}async send(t,n,r,a){let i=null;if(a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="TokenTransfer"&&(i=U.beginCell().store(Iv(a)).endCell()),a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="TokenTransferInternal"&&(i=U.beginCell().store(Cv(a)).endCell()),a&&typeof a=="object"&&!(a instanceof U.Slice)&&a.$$type==="TokenBurn"&&(i=U.beginCell().store(Ev(a)).endCell()),i===null)throw new Error("Invalid message type");await t.internal(n,{...r,body:i})}async getMsgValue(t,n){let r=new U.TupleBuilder;return r.writeNumber(n),(await t.get("msgValue",r.build())).stack.readBigNumber()}async getGetWalletData(t){let n=new U.TupleBuilder,r=(await t.get("get_wallet_data",n.build())).stack;return bv(r)}}var Mc={},vr={},Rv={get exports(){return vr},set exports(e){vr=e}};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */(function(e){var t,n,r,a,i,o,u,c,l,h,f,A,B,C,L,Q,re,ee,G,$,b,E,O;(function(T){var x=typeof W=="object"?W:typeof self=="object"?self:typeof this=="object"?this:{};T(s(x,s(e.exports)));function s(g,y){return g!==x&&(typeof Object.create=="function"?Object.defineProperty(g,"__esModule",{value:!0}):g.__esModule=!0),function(_,S){return g[_]=y?y(_,S):S}}})(function(T){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,g){s.__proto__=g}||function(s,g){for(var y in g)g.hasOwnProperty(y)&&(s[y]=g[y])};t=function(s,g){x(s,g);function y(){this.constructor=s}s.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)},n=Object.assign||function(s){for(var g,y=1,_=arguments.length;y<_;y++){g=arguments[y];for(var S in g)Object.prototype.hasOwnProperty.call(g,S)&&(s[S]=g[S])}return s},r=function(s,g){var y={};for(var _ in s)Object.prototype.hasOwnProperty.call(s,_)&&g.indexOf(_)<0&&(y[_]=s[_]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,_=Object.getOwnPropertySymbols(s);S<_.length;S++)g.indexOf(_[S])<0&&Object.prototype.propertyIsEnumerable.call(s,_[S])&&(y[_[S]]=s[_[S]]);return y},a=function(s,g,y,_){var S=arguments.length,M=S<3?g:_===null?_=Object.getOwnPropertyDescriptor(g,y):_,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(s,g,y,_);else for(var X=s.length-1;X>=0;X--)(P=s[X])&&(M=(S<3?P(M):S>3?P(g,y,M):P(g,y))||M);return S>3&&M&&Object.defineProperty(g,y,M),M},i=function(s,g){return function(y,_){g(y,_,s)}},o=function(s,g){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,g)},u=function(s,g,y,_){function S(M){return M instanceof y?M:new y(function(P){P(M)})}return new(y||(y=Promise))(function(M,P){function X(_e){try{F(_.next(_e))}catch(it){P(it)}}function je(_e){try{F(_.throw(_e))}catch(it){P(it)}}function F(_e){_e.done?M(_e.value):S(_e.value).then(X,je)}F((_=_.apply(s,g||[])).next())})},c=function(s,g){var y={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},_,S,M,P;return P={next:X(0),throw:X(1),return:X(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function X(F){return function(_e){return je([F,_e])}}function je(F){if(_)throw new TypeError("Generator is already executing.");for(;y;)try{if(_=1,S&&(M=F[0]&2?S.return:F[0]?S.throw||((M=S.return)&&M.call(S),0):S.next)&&!(M=M.call(S,F[1])).done)return M;switch(S=0,M&&(F=[F[0]&2,M.value]),F[0]){case 0:case 1:M=F;break;case 4:return y.label++,{value:F[1],done:!1};case 5:y.label++,S=F[1],F=[0];continue;case 7:F=y.ops.pop(),y.trys.pop();continue;default:if(M=y.trys,!(M=M.length>0&&M[M.length-1])&&(F[0]===6||F[0]===2)){y=0;continue}if(F[0]===3&&(!M||F[1]>M[0]&&F[1]=s.length&&(s=void 0),{value:s&&s[_++],done:!s}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(s,g){var y=typeof Symbol=="function"&&s[Symbol.iterator];if(!y)return s;var _=y.call(s),S,M=[],P;try{for(;(g===void 0||g-- >0)&&!(S=_.next()).done;)M.push(S.value)}catch(X){P={error:X}}finally{try{S&&!S.done&&(y=_.return)&&y.call(_)}finally{if(P)throw P.error}}return M},A=function(){for(var s=[],g=0;g1||X(fe,ot)})})}function X(fe,ot){try{je(_[fe](ot))}catch(tn){it(M[0][3],tn)}}function je(fe){fe.value instanceof C?Promise.resolve(fe.value.v).then(F,_e):it(M[0][2],fe)}function F(fe){X("next",fe)}function _e(fe){X("throw",fe)}function it(fe,ot){fe(ot),M.shift(),M.length&&X(M[0][0],M[0][1])}},Q=function(s){var g,y;return g={},_("next"),_("throw",function(S){throw S}),_("return"),g[Symbol.iterator]=function(){return this},g;function _(S,M){g[S]=s[S]?function(P){return(y=!y)?{value:C(s[S](P)),done:S==="return"}:M?M(P):P}:M}},re=function(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var g=s[Symbol.asyncIterator],y;return g?g.call(s):(s=typeof h=="function"?h(s):s[Symbol.iterator](),y={},_("next"),_("throw"),_("return"),y[Symbol.asyncIterator]=function(){return this},y);function _(M){y[M]=s[M]&&function(P){return new Promise(function(X,je){P=s[M](P),S(X,je,P.done,P.value)})}}function S(M,P,X,je){Promise.resolve(je).then(function(F){M({value:F,done:X})},P)}},ee=function(s,g){return Object.defineProperty?Object.defineProperty(s,"raw",{value:g}):s.raw=g,s},G=function(s){if(s&&s.__esModule)return s;var g={};if(s!=null)for(var y in s)Object.hasOwnProperty.call(s,y)&&(g[y]=s[y]);return g.default=s,g},$=function(s){return s&&s.__esModule?s:{default:s}},b=function(s,g){if(!g.has(s))throw new TypeError("attempted to get private field on non-instance");return g.get(s)},E=function(s,g,y){if(!g.has(s))throw new TypeError("attempted to set private field on non-instance");return g.set(s,y),y},T("__extends",t),T("__assign",n),T("__rest",r),T("__decorate",a),T("__param",i),T("__metadata",o),T("__awaiter",u),T("__generator",c),T("__exportStar",l),T("__createBinding",O),T("__values",h),T("__read",f),T("__spread",A),T("__spreadArrays",B),T("__await",C),T("__asyncGenerator",L),T("__asyncDelegator",Q),T("__asyncValues",re),T("__makeTemplateObject",ee),T("__importStar",G),T("__importDefault",$),T("__classPrivateFieldGet",b),T("__classPrivateFieldSet",E)})})(Rv);var rn={},Pe={},Du;function Tc(){return Du||(Du=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.MAX_HASHABLE_LENGTH=Pe.INIT=Pe.KEY=Pe.DIGEST_LENGTH=Pe.BLOCK_SIZE=void 0,Pe.BLOCK_SIZE=64,Pe.DIGEST_LENGTH=32,Pe.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pe.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Pe.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1),Pe}var an={},Ou;function $v(){if(Ou)return an;Ou=1,Object.defineProperty(an,"__esModule",{value:!0}),an.RawSha256=void 0;var e=Tc(),t=function(){function n(){this.state=Int32Array.from(e.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return n.prototype.update=function(r){if(this.finished)throw new Error("Attempted to update an already finished hash.");var a=0,i=r.byteLength;if(this.bytesHashed+=i,this.bytesHashed*8>e.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;i>0;)this.buffer[this.bufferLength++]=r[a++],i--,this.bufferLength===e.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},n.prototype.digest=function(){if(!this.finished){var r=this.bytesHashed*8,a=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(a.setUint8(this.bufferLength++,128),i%e.BLOCK_SIZE>=e.BLOCK_SIZE-8){for(var o=this.bufferLength;o>>24&255,u[o*4+1]=this.state[o]>>>16&255,u[o*4+2]=this.state[o]>>>8&255,u[o*4+3]=this.state[o]>>>0&255;return u},n.prototype.hashBuffer=function(){for(var r=this,a=r.buffer,i=r.state,o=i[0],u=i[1],c=i[2],l=i[3],h=i[4],f=i[5],A=i[6],B=i[7],C=0;C>>17|L<<15)^(L>>>19|L<<13)^L>>>10;L=this.temp[C-15];var re=(L>>>7|L<<25)^(L>>>18|L<<14)^L>>>3;this.temp[C]=(Q+this.temp[C-7]|0)+(re+this.temp[C-16]|0)}var ee=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&f^~h&A)|0)+(B+(e.KEY[C]+this.temp[C]|0)|0)|0,G=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&u^o&c^u&c)|0;B=A,A=f,f=h,h=l+ee|0,l=c,c=u,u=o,o=ee+G|0}i[0]+=o,i[1]+=u,i[2]+=c,i[3]+=l,i[4]+=h,i[5]+=f,i[6]+=A,i[7]+=B},n}();return an.RawSha256=t,an}var Qa={},on={};const Wv=e=>{const t=[];for(let n=0,r=e.length;n>6|192,a&63|128);else if(n+1>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else t.push(a>>12|224,a>>6&63|128,a&63|128)}return Uint8Array.from(t)},Lv=e=>{let t="";for(let n=0,r=e.length;nu.toString(16)).join("%");t+=decodeURIComponent(o)}else t+=String.fromCharCode((a&15)<<12|(e[++n]&63)<<6|e[++n]&63)}return t};function Dv(e){return new TextEncoder().encode(e)}function Ov(e){return new TextDecoder("utf-8").decode(e)}const Uv=e=>typeof TextEncoder=="function"?Dv(e):Wv(e),Pv=e=>typeof TextDecoder=="function"?Ov(e):Lv(e),Qv=Object.freeze(Object.defineProperty({__proto__:null,fromUtf8:Uv,toUtf8:Pv},Symbol.toStringTag,{value:"Module"})),Fv=lt(Qv);var Uu;function Nv(){if(Uu)return on;Uu=1,Object.defineProperty(on,"__esModule",{value:!0}),on.convertToBuffer=void 0;var e=Fv,t=typeof J.Buffer<"u"&&J.Buffer.from?function(r){return J.Buffer.from(r,"utf8")}:e.fromUtf8;function n(r){return r instanceof Uint8Array?r:typeof r=="string"?t(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}return on.convertToBuffer=n,on}var un={},Pu;function kv(){if(Pu)return un;Pu=1,Object.defineProperty(un,"__esModule",{value:!0}),un.isEmptyData=void 0;function e(t){return typeof t=="string"?t.length===0:t.byteLength===0}return un.isEmptyData=e,un}var cn={},Qu;function jv(){if(Qu)return cn;Qu=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.numToUint8=void 0;function e(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}return cn.numToUint8=e,cn}var ln={},Fu;function qv(){if(Fu)return ln;Fu=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.uint32ArrayFrom=void 0;function e(t){if(!Uint32Array.from){for(var n=new Uint32Array(t.length),r=0;rt.BLOCK_SIZE){var c=new n.RawSha256;c.update(u),u=c.digest()}var l=new Uint8Array(t.BLOCK_SIZE);return l.set(u),l}return rn}(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=vr;t.__exportStar(Hv(),e)})(Mc);var pr={},Bn={};function ie(e){return e}function Sc(e){return function(){return e}}var Vv=Sc(null),xv=Sc(void 0);function st(e,t,n,r,a,i,o,u,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return a(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return i(a(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(i(a(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(o(i(a(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(u(o(i(a(r(n(t(e.apply(this,arguments)))))))))}}}function w(e,t,n,r,a,i,o,u,c){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return a(r(n(t(e))));case 6:return i(a(r(n(t(e)))));case 7:return o(i(a(r(n(t(e))))));case 8:return u(o(i(a(r(n(t(e)))))));case 9:return c(u(o(i(a(r(n(t(e))))))));default:{for(var l=arguments[0],h=1;h0},wi=function(e){return e[0]},Yv=function(e){return e.slice(1)},Rc=[],Mr={},ve=Object.prototype.hasOwnProperty,Gv=function(e){return zv([e[0]],e.slice(1),!0)};function Tn(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Sn(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Tr(e){return function(t,n){return function(r){return e.ap(e.map(r,function(a){return function(i){var o;return Object.assign({},a,(o={},o[t]=i,o))}}),n)}}}function Sr(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(a){return function(i){return t.concat(a,i)}}),r)}}}}function Rn(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Rr(e){return function(t){return function(n){return e.map(n,function(r){var a;return a={},a[t]=r,a})}}}function $r(e){return function(t,n){return function(r){return e.map(r,function(a){var i;return Object.assign({},a,(i={},i[t]=n(a),i))})}}}function bi(e){var t=Sr(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function kt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Wr(e){return function(t,n){return function(r){return e.chain(r,function(a){return e.map(n(a),function(i){var o;return Object.assign({},a,(o={},o[t]=i,o))})})}}}var Zv=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};function $c(e){return function(t){return function(n){return e.fromEither(mi(n)?_r(t()):Br(n.value))}}}function ep(e){return function(t,n){return function(r){return e.fromEither(t(r)?Br(r):_r(n(r)))}}}function Wc(e){var t=$c(e);return function(n){var r=t(n);return function(a){return st(a,r)}}}function tp(e,t){var n=Wc(e);return function(r){var a=n(r);return function(i){return function(o){return t.chain(o,a(i))}}}}function Lr(e){return function(t){return st(t,e.fromEither)}}function np(e,t){var n=Lr(e);return function(r){return function(a){return t.chain(a,n(r))}}}function rp(e,t){return st(Lr(e),kt(t))}function ap(e,t){return function(n,r){return function(a){return t.chain(a,function(i){return e.fromEither(n(i)?Br(i):_r(r(i)))})}}}var he=function(e,t){return{left:e,right:t}};function $n(e,t){return function(n){var r=e.traverse(n);return function(a,i){return n.map(r(a,i),t.separate)}}}function Wn(e,t){return function(n){var r=e.traverse(n);return function(a,i){return n.map(r(a,i),t.compact)}}}function ip(e){return function(t){var n=e.wither(t);return function(r){return function(a){return n(a,function(i){return t.map(r(i),function(o){return o?oe(i):ne})})}}}}var Ie=_r,z=Br,Ee=function(e,t){return w(e,Uc(t))},_t=function(e,t){return w(e,Qc(t))},jt=function(e,t){return w(e,Ti(t))},Ln=function(e,t,n){return w(e,Nc(t,n))},Dn=function(e){return function(t,n){var r=kc(e);return w(t,r(n))}},On=function(e,t,n){return w(e,jc(t,n))},Dr=function(e){var t=qc(e);return function(n,r){return w(n,t(r))}},Ii=function(e,t,n){return w(e,Jc(t,n))},Ci=function(e,t){return w(e,Hc(t))},Lc=function(e,t){return w(e,xc(t))},Ei=function(e,t){return w(e,Si(t))},_i=function(e,t){return Zv(t(e),function(n){return R(n)?z(Ie(n.left)):R(n.right)?Ie(t(n.right.left)):z(z(n.right.right))})},ae="Either",op=function(e,t){return{show:function(n){return R(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},up=function(e,t){return{equals:function(n,r){return n===r||(R(n)?R(r)&&e.equals(n.left,r.left):Ri(r)&&t.equals(n.right,r.right))}}},cp=function(e){return{concat:function(t,n){return R(n)?t:R(t)?n:z(e.concat(t.right,n.right))}}},Bi=function(e){var t=Ie(e.empty);return{URI:ae,_E:void 0,compact:function(n){return R(n)?n:n.right._tag==="None"?t:z(n.right.value)},separate:function(n){return R(n)?he(n,n):R(n.right)?he(z(n.right.left),t):he(t,z(n.right.right))}}},Dc=function(e){var t=Ie(e.empty),n=Bi(e),r=n.compact,a=n.separate,i=function(u,c){return R(u)||c(u.right)?u:t},o=function(u,c){return R(u)?he(u,u):c(u.right)?he(t,z(u.right)):he(z(u.right),t)};return{URI:ae,_E:void 0,map:Ee,compact:r,separate:a,filter:i,filterMap:function(u,c){if(R(u))return u;var l=c(u.right);return l._tag==="None"?t:z(l.value)},partition:o,partitionMap:function(u,c){if(R(u))return he(u,u);var l=c(u.right);return R(l)?he(z(l.left),t):he(t,z(l.right))}}},lp=function(e){var t=Dc(e),n=Bi(e);return{URI:ae,_E:void 0,map:Ee,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Dr,sequence:Qn,reduce:Ln,foldMap:Dn,reduceRight:On,wither:Wn(ci,n),wilt:$n(ci,n)}},Or=function(e){return{URI:ae,_E:void 0,map:Ee,ap:function(t,n){return R(t)?R(n)?Ie(e.concat(t.left,n.left)):t:R(n)?n:z(t.right(n.right))},of:Ge}},Oc=function(e){return{URI:ae,_E:void 0,map:Ee,alt:function(t,n){if(Ri(t))return t;var r=n();return R(r)?Ie(e.concat(t.left,r.left)):r}}},Uc=function(e){return function(t){return R(t)?t:z(e(t.right))}},Ur={URI:ae,map:Ee},Ge=z,sp={URI:ae,of:Ge},Pc=function(e){return function(t){return R(t)?t:R(e)?e:z(t.right(e.right))}},Qc=Pc,Un={URI:ae,map:Ee,ap:_t},Fc={URI:ae,map:Ee,ap:_t,of:Ge},Mi=function(e){return function(t){return R(t)?t:e(t.right)}},Ti=Mi,Pn={URI:ae,map:Ee,ap:_t,chain:jt},fp={URI:ae,map:Ee,ap:_t,of:Ge,chain:jt},Nc=function(e,t){return function(n){return R(n)?e:t(e,n.right)}},kc=function(e){return function(t){return function(n){return R(n)?e.empty:t(n.right)}}},jc=function(e,t){return function(n){return R(n)?e:t(n.right,e)}},dp={URI:ae,reduce:Ln,foldMap:Dn,reduceRight:On},qc=function(e){return function(t){return function(n){return R(n)?e.of(Ie(n.left)):e.map(t(n.right),z)}}},Qn=function(e){return function(t){return R(t)?e.of(Ie(t.left)):e.map(t.right,z)}},ci={URI:ae,map:Ee,reduce:Ln,foldMap:Dn,reduceRight:On,traverse:Dr,sequence:Qn},Jc=function(e,t){return function(n){return R(n)?Ie(e(n.left)):z(t(n.right))}},Hc=function(e){return function(t){return R(t)?Ie(e(t.left)):t}},hp={URI:ae,bimap:Ii,mapLeft:Ci},Vc=function(e){return function(t){return R(t)?e():t}},xc=Vc,vp={URI:ae,map:Ee,alt:Lc},Si=function(e){return function(t){return R(t)?t:z(e(t))}},pp={URI:ae,map:Ee,extend:Ei},gp={URI:ae,map:Ee,ap:_t,chain:jt,chainRec:_i},Pr=Ie,yp={URI:ae,map:Ee,ap:_t,of:Ge,chain:jt,throwError:Pr},qt={URI:ae,fromEither:ie},mp=ep(qt),Ap=$c(qt),R=Mn,Ri=Xv,$i=function(e,t){return function(n){return R(n)?e(n.left):t(n.right)}},Kc=$i,zc=$i,wp=zc,Xc=function(e){return function(t){return R(t)?e(t.left):t.right}},bp=Xc,Ip=Rn(Ur),Yc=Tn(Un),Cp=Yc,Gc=Sn(Un),Ep=Gc,Zc=kt(Pn),_p=Zc,el=Mi(ie),Bp=el,Mp=Si(ie),Tp=Wc(qt),Sp=tp(qt,Pn),tl=ap(qt,Pn),Rp=tl,$p=function(e){return R(e)?z(e.left):Ie(e.right)},nl=function(e){return function(t){return R(t)?e(t.left):t}},Wp=nl,rl=function(e){return function(t){return t==null?Ie(e):z(t)}},Qr=function(e,t){try{return z(e())}catch(n){return Ie(t(n))}},Lp=function(e,t){return function(){for(var n=[],r=0;r")}function tg(e,t){return{key:e,type:t}}function He(e,t,n,r){for(var a=e.length,i=Array(a+1),o=0;o")}function ng(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var a=e.length;return new Pi(r,function(i){return Me.is(i)&&e.every(function(o){return n.is(i[o])})},function(i,o){var u=Me.validate(i,o);if(R(u))return u;for(var c=u.right,l={},h=[],f=!1,A=0;A0?Ze(h):Y(f||Object.keys(c).length!==a?l:c)},n.encode===k?k:function(i){for(var o={},u=0;u0?Ze(o):Y(l?i:r)}return qu(t)&&Array.isArray(r)?Y(r):ye(r,a)},e.encode===k&&t.encode===k?k:function(r){for(var a={},i=Object.keys(r),o=i.length,u=0;u")}function ig(e){return e.length>0}var Le={};function pl(e,t){for(var n=[],r=0,a=e;r")),new Dl(t,function(n){return Ot.is(n)&&n.every(e.is)},function(n,r){var a=Ot.validate(n,r);if(R(a))return a;for(var i=a.right,o=i.length,u=i,c=[],l=0;l0?Ze(c):Y(u)},e.encode===k?k:function(n){return n.map(e.encode)},e)}var Ul=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.props=o,u._tag="InterfaceType",u}return t}(V);function di(e,t){t===void 0&&(t=dl(e));var n=Object.keys(e),r=n.map(function(i){return e[i]}),a=n.length;return new Ul(t,function(i){if(Me.is(i)){for(var o=0;o0?Ze(h):Y(l)},An(r)?k:function(i){for(var o=Dt({},i),u=0;u0?Ze(h):Y(l)},An(r)?k:function(i){for(var o=Dt({},i),u=0;u0){var r=n[0],a=n[1],i=a.length,o=function(u){for(var c=0;c0?Ze(o):Y(si(r,i))},e.length===0?k:function(r){return si(r,e.map(function(a){return a.encode(r)}))},e)}var kl=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.types=o,u._tag="TupleType",u}return t}(V);function Eg(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new kl(t,function(r){return Ot.is(r)&&r.length===n&&e.every(function(a,i){return a.is(r[i])})},function(r,a){var i=Ot.validate(r,a);if(R(i))return i;for(var o=i.right,u=o.length>n?o.slice(0,n):o,c=[],l=0;l0?Ze(c):Y(u)},An(e)?k:function(r){return e.map(function(a,i){return a.encode(r[i])})},e)}var jl=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.type=o,u._tag="ReadonlyType",u}return t}(V);function _g(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new jl(t,e.is,e.validate,e.encode,e)}var ql=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.type=o,u._tag="ReadonlyArrayType",u}return t}(V);function Bg(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=Ol(e);return new ql(t,n.is,n.validate,n.encode,e)}var Mg=function(e,t){return Hl(di(e),t)},Jl=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.type=o,u._tag="ExactType",u}return t}(V);function Hl(e,t){t===void 0&&(t=ag(e));var n=fi(e);return new Jl(t,e.is,function(r,a){var i=Me.validate(r,a);if(R(i))return i;var o=e.validate(r,a);return R(o)?o:z(ju(o.right,n))},function(r){return e.encode(ju(r,n))},e)}var Vl=function(e){H(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,a){return n.is(r)?Y(r):ye(r,a)},k)||this;return n._tag="FunctionType",n}return t}(V),Tg=new Vl,xl=function(e){H(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,a){return ye(r,a)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(V),Sg=new xl,Kl=function(e){H(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Y,k)||this;return n._tag="AnyType",n}return t}(V),Rg=new Kl;function Fi(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(fl(t),")")),new Wl(n,function(r){return e.is(r)&&t(r)},function(r,a){var i=e.validate(r,a);if(R(i))return i;var o=i.right;return t(o)?Y(o):ye(o,a)},e.encode,e,t)}var $g=Fi(Oi,Number.isInteger,"Integer"),yr=function(e){H(t,e);function t(n,r,a,i,o,u){var c=e.call(this,n,r,a,i,o)||this;return c.tag=u,c}return t}(Qi),Wg=function(e,t,n){n===void 0&&(n=vl(t));var r=Fl(t,n);return r instanceof yr?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new yr(n,r.is,r.validate,r.encode,t,e))},Lg=function(e,t){return{value:e,context:t}},Dg=function(e){return[{key:"",type:e}]},Og=Me,zl=function(e){H(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,a){return n.is(r)?Y(r):ye(r,a)},k)||this;return n._tag="ObjectType",n}return t}(V),Ug=new zl,Pg=Ql,Qg=function(e){H(t,e);function t(n,r,a,i,o){var u=e.call(this,n,r,a,i)||this;return u.props=o,u._tag="StrictType",u}return t}(V);function Fg(e){return e}function Ng(e){return function(){return e}}const kg=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Tl,AnyDictionaryType:Sl,AnyType:Kl,Array:Ot,ArrayType:Dl,BigIntType:Bl,BooleanType:Ml,Dictionary:Og,DictionaryType:Pi,ExactType:Jl,Function:Tg,FunctionType:Vl,Int:wg,Integer:$g,InterfaceType:Ul,IntersectionType:Nl,KeyofType:$l,LiteralType:Rl,NeverType:xl,NullType:wl,NumberType:_l,ObjectType:zl,PartialType:Pl,ReadonlyArrayType:ql,ReadonlyType:jl,RecursiveType:Ui,RefinementType:Wl,StrictType:Qg,StringType:El,TaggedUnionType:yr,TupleType:kl,Type:V,UndefinedType:bl,UnionType:Qi,UnknownArray:Ot,UnknownRecord:Me,UnknownType:Cl,VoidType:Il,alias:Ng,any:Rg,appendContext:He,array:Ol,bigint:gg,boolean:yg,brand:Ll,clean:Fg,dictionary:Pg,emptyTags:Le,exact:Hl,failure:ye,failures:Ze,getContextEntry:tg,getDefaultContext:Dg,getDomainKeys:Li,getFunctionName:fl,getIndex:Al,getTags:ut,getValidationError:Lg,identity:k,interface:di,intersection:Cg,keyof:Ag,literal:mg,mergeAll:si,never:Sg,null:Ju,nullType:Ju,number:Oi,object:Ug,partial:Ig,readonly:_g,readonlyArray:Bg,record:Ql,recursion:bg,refinement:Fi,strict:Mg,string:Di,success:Y,taggedUnion:Wg,tuple:Eg,type:di,undefined:gr,union:Fl,unknown:pg,void:Hu,voidType:Hu},Symbol.toStringTag,{value:"Module"})),Ni=lt(kg);var Xl={},Ut={},pe={},Bt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(b){return function(){return{meet:function(E,O){return function(T){return b.meet(E(T),O(T))}},join:function(E,O){return function(T){return b.join(E(T),O(T))}},zero:function(){return b.zero},one:function(){return b.one},implies:function(E,O){return function(T){return b.implies(E(T),O(T))}},not:function(E){return function(O){return b.not(E(O))}}}}};e.getBooleanAlgebra=t;var n=function(b){return function(){return{concat:function(E,O){return function(T){return b.concat(E(T),O(T))}}}}};e.getSemigroup=n;var r=function(b){var E=(0,e.getSemigroup)(b);return function(){return{concat:E().concat,empty:function(){return b.empty}}}};e.getMonoid=r;var a=function(b){return{add:function(E,O){return function(T){return b.add(E(T),O(T))}},zero:function(){return b.zero},mul:function(E,O){return function(T){return b.mul(E(T),O(T))}},one:function(){return b.one}}};e.getSemiring=a;var i=function(b){var E=(0,e.getSemiring)(b);return{add:E.add,mul:E.mul,one:E.one,zero:E.zero,sub:function(O,T){return function(x){return b.sub(O(x),T(x))}}}};e.getRing=i;var o=function(b){return function(E){return E(b)}};e.apply=o;function u(b){return b}e.identity=u,e.unsafeCoerce=u;function c(b){return function(){return b}}e.constant=c,e.constTrue=c(!0),e.constFalse=c(!1),e.constNull=c(null),e.constUndefined=c(void 0),e.constVoid=e.constUndefined;function l(b){return function(){for(var E=[],O=0;O1?b(E[1],E[0]):function(T){return b(T)(E[0])}}}e.flip=l;function h(b,E,O,T,x,s,g,y,_){switch(arguments.length){case 1:return b;case 2:return function(){return E(b.apply(this,arguments))};case 3:return function(){return O(E(b.apply(this,arguments)))};case 4:return function(){return T(O(E(b.apply(this,arguments))))};case 5:return function(){return x(T(O(E(b.apply(this,arguments)))))};case 6:return function(){return s(x(T(O(E(b.apply(this,arguments))))))};case 7:return function(){return g(s(x(T(O(E(b.apply(this,arguments)))))))};case 8:return function(){return y(g(s(x(T(O(E(b.apply(this,arguments))))))))};case 9:return function(){return _(y(g(s(x(T(O(E(b.apply(this,arguments)))))))))}}}e.flow=h;function f(){for(var b=[],E=0;E0};N.isNonEmpty=Yg;var Gg=function(e){return e[0]};N.head=Gg;var Zg=function(e){return e.slice(1)};N.tail=Zg;N.emptyReadonlyArray=[];N.emptyRecord={};N.has=Object.prototype.hasOwnProperty;var ey=function(e){return jg([e[0]],e.slice(1),!0)};N.fromReadonlyNonEmptyArray=ey;var ty=W&&W.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),ny=W&&W.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ry=W&&W.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&ty(t,e,n);return ny(t,e),t};Object.defineProperty(pe,"__esModule",{value:!0});pe.sequenceS=pe.sequenceT=pe.getApplySemigroup=pe.apS=pe.apSecond=pe.apFirst=pe.ap=void 0;var ay=Bt,iy=ry(N);function oy(e,t){return function(n){return function(r){return e.ap(e.map(r,function(a){return function(i){return t.ap(a,i)}}),n)}}}pe.ap=oy;function uy(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}pe.apFirst=uy;function cy(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}pe.apSecond=cy;function ly(e){return function(t,n){return function(r){return e.ap(e.map(r,function(a){return function(i){var o;return Object.assign({},a,(o={},o[t]=i,o))}}),n)}}}pe.apS=ly;function sy(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(a){return function(i){return t.concat(a,i)}}),r)}}}}pe.getApplySemigroup=sy;function ki(e,t,n){return function(r){for(var a=Array(n.length+1),i=0;i-1?t:n}},xy=function(e){return{concat:Hy(e)}},Ky=function(e){return{concat:Vy(e)}},zy=function(){return{concat:ie}},rs=function(){return{concat:function(e,t){return t}}},Xy=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r=t.length},Gy=function(e){return function(t){return Xy([e],t,!0)}},Zy=Gy,em=function(e){return function(t){for(var n=[e,t[0]],r=1;r0},kr=function(e,t){return e<0||e>=t.length},Vi=function(e){return function(t){return wn([e],t,!0)}},Pt=Vi,xi=function(e){return function(t){return wn(wn([],t,!0),[e],!1)}},Fn=xi,Ki=function(e,t,n){if(rt(n)){var r=Nn(n);return r.splice(e,0,t),r}return[t]},zi=function(e,t,n){var r=Nn(n);return r[e]=t,r},Xi=function(e){return function(t){if(t.length===1)return Jt(t);for(var n=[ke(t)],r=Ve(t),a=function(c){n.every(function(l){return!e.equals(l,c)})&&n.push(c)},i=0,o=r;in.length?ne:oe(Ki(e,t,n))}},gm=function(e,t){return ys(e,function(){return t})},ys=function(e,t){return function(n){return kr(e,n)?ne:oe(zi(e,t(n[e]),n))}},Jt=Nn,ft=function(e){return[e]},ms=function(e,t,n){for(var r=[n(e[0],t[0])],a=Math.min(e.length,t.length),i=1;i=t.length?[Jt(t),[]]:[w(t.slice(1,n),Pt(ke(t))),t.slice(n)]}},Es=function(e){return eo(Hr(e))},xe=function(e,t){return w(e,co(t))},to=function(e,t){return w(e,lo(t))},kn=function(e,t){return w(e,Rs(t))},no=function(e,t){return w(e,Vr(t))},_s=function(e,t){return w(e,uo(t))},jn=function(e,t,n){return w(e,$s(t,n))},qn=function(e){var t=Is(e);return function(n,r){return w(n,t(r))}},Jn=function(e,t,n){return w(e,Ls(t,n))},ro=function(e){var t=Os(e);return function(n,r){return w(n,t(r))}},Bs=function(e,t){return w(e,Ss(t))},ao=function(e,t,n){return w(e,Ws(t,n))},io=function(e){var t=bs(e);return function(n,r){return w(n,t(r))}},oo=function(e,t,n){return w(e,Ds(t,n))},Ms=function(e){var t=Kr(e);return function(n,r){return w(n,t(r))}},Ts=function(e){return function(t){return w(t,ps(e()))}},Ss=Ts,Rs=function(e){return Vr(function(t){return w(e,co(t))})},Vr=function(e){return Cs(function(t,n){return e(n)})},uo=function(e){return function(t){for(var n=Ve(t),r=[e(t)];rt(n);)r.push(e(n)),n=Ve(n);return r}},mm=uo(ie),Am=Vr(ie),co=function(e){return lo(function(t,n){return e(n)})},lo=function(e){return function(t){for(var n=[e(0,ke(t))],r=1;rt?1:0}};function ks(e,t){return function(n){return n?t.of(void 0):e.zero()}}var uA=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r=0;n--)if(e(t[n]))return oe(t[n]);return ne}}var yA=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(Et(r))return r}return ne}},mA=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return oe(n);return ne}};function qs(e){return function(t,n){if(n===void 0){var r=qs(e);return function(o){return r(t,o)}}for(var a=function(o){return e.equals(o,t)},i=0;i0;){var a=n.shift();Mn(a)?n.unshift.apply(n,e(a.left)):r.push(a.right)}return r}},Ks=function(e){return function(t){var n=e(t),r=[],a=[];function i(l){Mn(l)?e(l.left).forEach(function(h){return r.push(h)}):a.push(l.right)}for(var o=0,u=n;o0;)i(r.shift());return a}};function MA(e){return function(t){return t.every(e)}}var TA=function(e){var t=ls(e);return function(n){return lA(function(){return e.empty},t(n))}},It=function(e){return e.length===0},le=rt,SA=Pt,RA=Vi,Yr=Fn,$A=xi,zs=function(e,t){return e<=0?[]:jr(t)(e)},WA=function(e,t){return zs(e,function(){return t})};function LA(e){return function(t){return e(t)?[t]:[]}}var Xs=function(e){return mi(e)?[]:[e.value]},Ys=function(e){return Mn(e)?[]:[e.right]},Gs=function(e,t){return function(n){return le(n)?t(n):e()}},DA=Gs,Zs=function(e,t){return function(n){return le(n)?t(ke(n),Ve(n)):e()}},ef=Zs,OA=ef,tf=function(e,t){return function(n){return le(n)?t(Vt(n),Ht(n)):e()}},nf=tf,UA=nf,rf=function(e){return function(t){for(var n=[],r=0;r=0;i--)a[i]=t(n[i],a[i+1]);return a}},FA=function(e){return e.length},Hn=kr,NA=js,kA=fA,jA=dA,qA=function(e){return le(e)?oe(Ve(e)):ne},JA=function(e){return le(e)?oe(Vt(e)):ne},HA=function(e){return function(t){return Hn(e,t)?Ce(t):t.slice(0,e)}},VA=function(e){return function(t){return Hn(e,t)?Ce(t):e===0?[]:t.slice(-e)}};function xA(e){return function(t){for(var n=[],r=0,a=t;r=t.length?[]:t.slice(e,t.length)}},XA=function(e){return function(t){return e<=0||It(t)?Ce(t):e>=t.length?[]:t.slice(0,t.length-e)}};function YA(e){return function(t){return t.slice(af(t,e))}}var GA=hA;function ZA(e){return vA(e)}var e0=pA;function t0(e){return gA(e)}var n0=yA,r0=mA,Ce=function(e){return e.slice()},a0=function(e,t){return function(n){return e<0||e>n.length?ne:oe(Ff(e,t,n))}},i0=function(e,t){return of(e,function(){return t})},o0=function(e){return function(t){return Hn(e,t)?ne:oe(kf(e,t))}},of=function(e,t){return function(n){return Hn(e,n)?ne:oe(Nf(e,t(n[e]),n))}},u0=function(e){return It(e)?[]:e.slice().reverse()},c0=function(e){for(var t=[],n=0;n=1&&le(t)?Hr(e)(t):It(t)?[Ce(t),[]]:[[],Ce(t)]}},y0=function(e){var t=Es(e);return function(n){return le(n)?t(n):[]}},m0=function(e){return function(){for(var t=[],n=0;nt?1:0}},gb=function(e){return Object.keys(e).length},nt=function(e){for(var t in e)if(ve.call(e,t))return!1;return!0},Yn=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function vd(e){if(typeof e=="function")return vd(D)(e);var t=Yn(e);return function(n){return function(r){for(var a=[],i=0,o=t(r);i=0;l--){var h=u[l];o=a(h,i[h],o)}return o}}}var mb=function(e,t){var n;return n={},n[e]=t,n};function Ab(e){var t=wd(D)(e);return function(n){return function(r){return t(r,n)}}}function wb(e){var t=uu(D)(e);return function(n){return function(r){return t(r,n)}}}function bb(e){return Ad(D)(e)}function ru(e){return function(t){var n={},r={};for(var a in t)if(ve.call(t,a)){var i=e(a,t[a]);switch(i._tag){case"Left":n[a]=i.left;break;case"Right":r[a]=i.right;break}}return he(n,r)}}function au(e){return function(t){var n={},r={};for(var a in t)if(ve.call(t,a)){var i=t[a];e(a,i)?r[a]=i:n[a]=i}return he(n,r)}}function iu(e){return function(t){var n={};for(var r in t)if(ve.call(t,r)){var a=e(r,t[r]);Et(a)&&(n[r]=a.value)}return n}}function ou(e){return function(t){var n={},r=!1;for(var a in t)if(ve.call(t,a)){var i=t[a];e(a,i)?n[a]=i:r=!0}return r?n:t}}function Ib(e,t){var n=yd(e,t);return function(r){return n(r,ie)}}function yd(e,t){return function(n,r){return t.reduce(n,{},function(a,i){var o=r(i),u=o[0],c=o[1];return a[u]=ve.call(a,u)?e.concat(a[u],c):c,a})}}function Cb(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Eb(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function md(e){return function(t,n){if(n===void 0){var r=md(e);return function(i){return r(t,i)}}for(var a in n)if(e.equals(n[a],t))return!0;return!1}}var _b=function(e){return function(t){return function(n){if(nt(n))return t;if(nt(t))return n;var r={};for(var a in n)Qt(a,t)?r[a]=e.concat(n[a],t[a]):r[a]=n[a];for(var a in t)Qt(a,r)||(r[a]=t[a]);return r}}},Bb=function(e){return function(t){return function(n){if(nt(n)||nt(t))return tu;var r={};for(var a in n)Qt(a,t)&&(r[a]=e.concat(n[a],t[a]));return r}}},Mb=function(e){return function(t){if(nt(t))return e;if(nt(e))return t;var n={};for(var r in t)Qt(r,e)||(n[r]=t[r]);for(var r in e)Qt(r,t)||(n[r]=e[r]);return n}},Tb=function(e,t){return w(e,gd(t))},Sb=function(e,t){return w(e,nu(t))},Rb=function(e){var t=Ar(e);return function(n,r,a){return w(n,t(r,a))}},$b=function(e){return function(t){var n=wr(e)(t);return function(r,a){return w(r,n(a))}}},Wb=function(e){var t=br(e);return function(n,r,a){return w(n,t(r,a))}},Lb=function(e,t){return w(e,bd(t))},Db=function(e,t){return w(e,Id(t))},Ob=function(e,t){return w(e,Cd(t))},Ub=function(e,t){return w(e,Ed(t))},Pb=function(e){var t=In(e);return function(n,r,a){return w(n,t(r,a))}},Qb=function(e){var t=Cn(e);return function(n){var r=t(n);return function(a,i){return w(a,r(i))}}},Fb=function(e){var t=En(e);return function(n,r,a){return w(n,t(r,a))}},Nb=function(e,t){return w(e,ru(t))},kb=function(e,t){return w(e,au(t))},jb=function(e,t){return w(e,iu(t))},qb=function(e,t){return w(e,ou(t))},uu=function(e){var t=wd(e);return function(n){var r=t(n);return function(a,i){return r(a,st(Kv,i))}}},Ad=function(e){var t=uu(e);return function(n){var r=t(n);return function(a){return r(a,ie)}}},wd=function(e){return function(t){var n=Yn(e);return function(r,a){var i=n(r);if(i.length===0)return t.of(tu);for(var o=t.of({}),u=function(f){o=t.ap(t.map(o,function(A){return function(B){var C;return Object.assign({},A,(C={},C[f]=B,C))}}),a(f,r[f]))},c=0,l=i;ce.TYPE_MAX_LEN?s.slice(0,e.TYPE_MAX_LEN-3)+"...":s},L=function(s,g,y,_){return["Expecting "+C(s,_),g===""?"":"at "+g,"but instead got: "+h(y.value),y.message?"("+y.message+")":""].filter(Boolean).join(" ")},Q=function(s,g,y,_){return[`Expecting one of: +`,s.map(function(S){return" "+C(S,_)}).join(` +`),g===""?` +`:` +at `+g+" ","but instead got: "+h(y)].filter(Boolean).join("")},re=function(s){return o.pipe(s,t.findIndex(l),a.chain(function(g){return t.lookup(g+1,s)}))},ee=function(s,g,y){var _=o.pipe(g,t.map(B),t.map(re),t.compact),S=o.pipe(_,t.head,a.map(function(P){return P.actual}),a.getOrElse(function(){})),M=_.map(function(P){var X=P.type;return X.name});return M.length>0?a.some(Q(M,s,S,y)):a.none},G=function(s,g,y){return o.pipe(g,A,a.map(function(_){return L(_.type.name,s,g,y)}))},$=r.groupBy(function(s){return o.pipe(s.context,c.takeUntil(l),f)}),b=function(s,g,y){return r.tail(g).length>0?ee(s,g,y):G(s,r.head(g),y)},E=function(s,g){return G(f(s.context),s,g)};e.formatValidationError=E;var O=function(s,g){return o.pipe(s,$,i.mapWithIndex(function(y,_){return b(y,_,g)}),i.compact,i.toArray,t.map(function(y){y[0];var _=y[1];return _}))};e.formatValidationErrors=O;var T=function(s,g){return o.pipe(s,n.mapLeft(function(y){return e.formatValidationErrors(y,g)}),n.fold(function(y){return y},function(){return[]}))};e.reporter=T;var x={report:e.reporter};e.default=x})(ns);var ga={};Object.defineProperty(ga,"__esModule",{value:!0});ga.InMemoryCache=void 0;class mC{constructor(){this.cache=new Map,this.set=async(t,n,r)=>{r!==null?this.cache.set(t+"$$"+n,r):this.cache.delete(t+"$$"+n)},this.get=async(t,n)=>{let r=this.cache.get(t+"$$"+n);return r!==void 0?r:null}}}ga.InMemoryCache=mC;var AC=function(){function e(n,r){if(typeof n!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array and returns Promise>, but got: "+n+"."));this._batchLoadFn=n,this._maxBatchSize=CC(r),this._batchScheduleFn=EC(r),this._cacheKeyFn=_C(r),this._cacheMap=BC(r),this._batch=null,this.name=MC(r)}var t=e.prototype;return t.load=function(r){if(r==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(r)+"."));var a=bC(this),i=this._cacheMap,o=this._cacheKeyFn(r);if(i){var u=i.get(o);if(u){var c=a.cacheHits||(a.cacheHits=[]);return new Promise(function(h){c.push(function(){h(u)})})}}a.keys.push(r);var l=new Promise(function(h,f){a.callbacks.push({resolve:h,reject:f})});return i&&i.set(o,l),l},t.loadMany=function(r){if(!ph(r))throw new TypeError("The loader.loadMany() function must be called with Array "+("but got: "+r+"."));for(var a=[],i=0;i and returns Promise>, but the function "+("errored synchronously: "+String(r)+".")))}if(!n||typeof n.then!="function")return ja(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did "+("not return a Promise: "+String(n)+".")));n.then(function(r){if(!ph(r))throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did "+("not return a Promise of an Array: "+String(r)+"."));if(r.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(` + +Keys: +`+String(t.keys))+(` + +Values: +`+String(r)));vi(t);for(var a=0;a0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}var TC=AC,Ir={},SC={get exports(){return Ir},set exports(e){Ir=e}},Cr={},RC={get exports(){return Cr},set exports(e){Cr=e}},gh=function(t,n){return function(){for(var a=new Array(arguments.length),i=0;i"u"}function WC(e){return e!==null&&!pi(e)&&e.constructor!==null&&!pi(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function yh(e){return pt.call(e)==="[object ArrayBuffer]"}function LC(e){return pt.call(e)==="[object FormData]"}function DC(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yh(e.buffer),t}function OC(e){return typeof e=="string"}function UC(e){return typeof e=="number"}function mh(e){return e!==null&&typeof e=="object"}function fr(e){if(pt.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function PC(e){return pt.call(e)==="[object Date]"}function QC(e){return pt.call(e)==="[object File]"}function FC(e){return pt.call(e)==="[object Blob]"}function Ah(e){return pt.call(e)==="[object Function]"}function NC(e){return mh(e)&&Ah(e.pipe)}function kC(e){return pt.call(e)==="[object URLSearchParams]"}function jC(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function qC(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function pu(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),vu(e))for(var n=0,r=e.length;n"u"||($t.isArray(c)?l=l+"[]":c=[c],$t.forEach(c,function(f){$t.isDate(f)?f=f.toISOString():$t.isObject(f)&&(f=JSON.stringify(f)),i.push(xu(l)+"="+xu(f))}))}),a=i.join("&")}if(a){var o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t},VC=Ue;function ya(){this.handlers=[]}ya.prototype.use=function(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};ya.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};ya.prototype.forEach=function(t){VC.forEach(this.handlers,function(r){r!==null&&t(r)})};var xC=ya,KC=Ue,zC=function(t,n){KC.forEach(t,function(a,i){i!==n&&i.toUpperCase()===n.toUpperCase()&&(t[n]=a,delete t[i])})},bh=function(t,n,r,a,i){return t.config=n,r&&(t.code=r),t.request=a,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t},qa,Ku;function Ih(){if(Ku)return qa;Ku=1;var e=bh;return qa=function(n,r,a,i,o){var u=new Error(n);return e(u,r,a,i,o)},qa}var Ja,zu;function XC(){if(zu)return Ja;zu=1;var e=Ih();return Ja=function(n,r,a){var i=a.config.validateStatus;!a.status||!i||i(a.status)?n(a):r(e("Request failed with status code "+a.status,a.config,null,a.request,a))},Ja}var Ha,Xu;function YC(){if(Xu)return Ha;Xu=1;var e=Ue;return Ha=e.isStandardBrowserEnv()?function(){return{write:function(r,a,i,o,u,c){var l=[];l.push(r+"="+encodeURIComponent(a)),e.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),e.isString(o)&&l.push("path="+o),e.isString(u)&&l.push("domain="+u),c===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){var a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Ha}var Va,Yu;function GC(){return Yu||(Yu=1,Va=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}),Va}var xa,Gu;function ZC(){return Gu||(Gu=1,xa=function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}),xa}var Ka,Zu;function e1(){if(Zu)return Ka;Zu=1;var e=GC(),t=ZC();return Ka=function(r,a){return r&&!e(a)?t(r,a):a},Ka}var za,ec;function t1(){if(ec)return za;ec=1;var e=Ue,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return za=function(r){var a={},i,o,u;return r&&e.forEach(r.split(` +`),function(l){if(u=l.indexOf(":"),i=e.trim(l.substr(0,u)).toLowerCase(),o=e.trim(l.substr(u+1)),i){if(a[i]&&t.indexOf(i)>=0)return;i==="set-cookie"?a[i]=(a[i]?a[i]:[]).concat([o]):a[i]=a[i]?a[i]+", "+o:o}}),a},za}var Xa,tc;function n1(){if(tc)return Xa;tc=1;var e=Ue;return Xa=e.isStandardBrowserEnv()?function(){var n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),a;function i(o){var u=o;return n&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return a=i(window.location.href),function(u){var c=e.isString(u)?i(u):u;return c.protocol===a.protocol&&c.host===a.host}}():function(){return function(){return!0}}(),Xa}var Ya,nc;function ma(){if(nc)return Ya;nc=1;function e(t){this.message=t}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Ya=e,Ya}var Ga,rc;function ac(){if(rc)return Ga;rc=1;var e=Ue,t=XC(),n=YC(),r=wh,a=e1(),i=t1(),o=n1(),u=Ih(),c=Aa(),l=ma();return Ga=function(f){return new Promise(function(B,C){var L=f.data,Q=f.headers,re=f.responseType,ee;function G(){f.cancelToken&&f.cancelToken.unsubscribe(ee),f.signal&&f.signal.removeEventListener("abort",ee)}e.isFormData(L)&&delete Q["Content-Type"];var $=new XMLHttpRequest;if(f.auth){var b=f.auth.username||"",E=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";Q.Authorization="Basic "+btoa(b+":"+E)}var O=a(f.baseURL,f.url);$.open(f.method.toUpperCase(),r(O,f.params,f.paramsSerializer),!0),$.timeout=f.timeout;function T(){if($){var s="getAllResponseHeaders"in $?i($.getAllResponseHeaders()):null,g=!re||re==="text"||re==="json"?$.responseText:$.response,y={data:g,status:$.status,statusText:$.statusText,headers:s,config:f,request:$};t(function(S){B(S),G()},function(S){C(S),G()},y),$=null}}if("onloadend"in $?$.onloadend=T:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(T)},$.onabort=function(){$&&(C(u("Request aborted",f,"ECONNABORTED",$)),$=null)},$.onerror=function(){C(u("Network Error",f,null,$)),$=null},$.ontimeout=function(){var g=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",y=f.transitional||c.transitional;f.timeoutErrorMessage&&(g=f.timeoutErrorMessage),C(u(g,f,y.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",$)),$=null},e.isStandardBrowserEnv()){var x=(f.withCredentials||o(O))&&f.xsrfCookieName?n.read(f.xsrfCookieName):void 0;x&&(Q[f.xsrfHeaderName]=x)}"setRequestHeader"in $&&e.forEach(Q,function(g,y){typeof L>"u"&&y.toLowerCase()==="content-type"?delete Q[y]:$.setRequestHeader(y,g)}),e.isUndefined(f.withCredentials)||($.withCredentials=!!f.withCredentials),re&&re!=="json"&&($.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&$.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&$.upload&&$.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(ee=function(s){$&&(C(!s||s&&s.type?new l("canceled"):s),$.abort(),$=null)},f.cancelToken&&f.cancelToken.subscribe(ee),f.signal&&(f.signal.aborted?ee():f.signal.addEventListener("abort",ee))),L||(L=null),$.send(L)})},Ga}var Za,ic;function Aa(){if(ic)return Za;ic=1;var e=Ue,t=zC,n=bh,r={"Content-Type":"application/x-www-form-urlencoded"};function a(c,l){!e.isUndefined(c)&&e.isUndefined(c["Content-Type"])&&(c["Content-Type"]=l)}function i(){var c;return(typeof XMLHttpRequest<"u"||typeof mn<"u"&&Object.prototype.toString.call(mn)==="[object process]")&&(c=ac()),c}function o(c,l,h){if(e.isString(c))try{return(l||JSON.parse)(c),e.trim(c)}catch(f){if(f.name!=="SyntaxError")throw f}return(h||JSON.stringify)(c)}var u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:i(),transformRequest:[function(l,h){return t(h,"Accept"),t(h,"Content-Type"),e.isFormData(l)||e.isArrayBuffer(l)||e.isBuffer(l)||e.isStream(l)||e.isFile(l)||e.isBlob(l)?l:e.isArrayBufferView(l)?l.buffer:e.isURLSearchParams(l)?(a(h,"application/x-www-form-urlencoded;charset=utf-8"),l.toString()):e.isObject(l)||h&&h["Content-Type"]==="application/json"?(a(h,"application/json"),o(l)):l}],transformResponse:[function(l){var h=this.transitional||u.transitional,f=h&&h.silentJSONParsing,A=h&&h.forcedJSONParsing,B=!f&&this.responseType==="json";if(B||A&&e.isString(l)&&l.length)try{return JSON.parse(l)}catch(C){if(B)throw C.name==="SyntaxError"?n(C,this,"E_JSON_PARSE"):C}return l}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(l){return l>=200&&l<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],function(l){u.headers[l]={}}),e.forEach(["post","put","patch"],function(l){u.headers[l]=e.merge(r)}),Za=u,Za}var r1=Ue,a1=Aa(),i1=function(t,n,r){var a=this||a1;return r1.forEach(r,function(o){t=o.call(a,t,n)}),t},ei,oc;function Ch(){return oc||(oc=1,ei=function(t){return!!(t&&t.__CANCEL__)}),ei}var uc=Ue,ti=i1,o1=Ch(),u1=Aa(),c1=ma();function ni(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new c1("canceled")}var l1=function(t){ni(t),t.headers=t.headers||{},t.data=ti.call(t,t.data,t.headers,t.transformRequest),t.headers=uc.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),uc.forEach(["delete","get","head","post","put","patch","common"],function(a){delete t.headers[a]});var n=t.adapter||u1.adapter;return n(t).then(function(a){return ni(t),a.data=ti.call(t,a.data,a.headers,t.transformResponse),a},function(a){return o1(a)||(ni(t),a&&a.response&&(a.response.data=ti.call(t,a.response.data,a.response.headers,t.transformResponse))),Promise.reject(a)})},Qe=Ue,Eh=function(t,n){n=n||{};var r={};function a(h,f){return Qe.isPlainObject(h)&&Qe.isPlainObject(f)?Qe.merge(h,f):Qe.isPlainObject(f)?Qe.merge({},f):Qe.isArray(f)?f.slice():f}function i(h){if(Qe.isUndefined(n[h])){if(!Qe.isUndefined(t[h]))return a(void 0,t[h])}else return a(t[h],n[h])}function o(h){if(!Qe.isUndefined(n[h]))return a(void 0,n[h])}function u(h){if(Qe.isUndefined(n[h])){if(!Qe.isUndefined(t[h]))return a(void 0,t[h])}else return a(void 0,n[h])}function c(h){if(h in n)return a(t[h],n[h]);if(h in t)return a(void 0,t[h])}var l={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c};return Qe.forEach(Object.keys(t).concat(Object.keys(n)),function(f){var A=l[f]||i,B=A(f);Qe.isUndefined(B)&&A!==c||(r[f]=B)}),r},ri,cc;function _h(){return cc||(cc=1,ri={version:"0.25.0"}),ri}var s1=_h().version,gu={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){gu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var lc={};gu.transitional=function(t,n,r){function a(i,o){return"[Axios v"+s1+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return function(i,o,u){if(t===!1)throw new Error(a(o," has been removed"+(n?" in "+n:"")));return n&&!lc[o]&&(lc[o]=!0,console.warn(a(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,u):!0}};function f1(e,t,n){if(typeof e!="object")throw new TypeError("options must be an object");for(var r=Object.keys(e),a=r.length;a-- >0;){var i=r[a],o=t[i];if(o){var u=e[i],c=u===void 0||o(u,i,e);if(c!==!0)throw new TypeError("option "+i+" must be "+c);continue}if(n!==!0)throw Error("Unknown option "+i)}}var d1={assertOptions:f1,validators:gu},Bh=Ue,h1=wh,sc=xC,fc=l1,wa=Eh,Mh=d1,Wt=Mh.validators;function ur(e){this.defaults=e,this.interceptors={request:new sc,response:new sc}}ur.prototype.request=function(t,n){if(typeof t=="string"?(n=n||{},n.url=t):n=t||{},!n.url)throw new Error("Provided config url is not valid");n=wa(this.defaults,n),n.method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;r!==void 0&&Mh.assertOptions(r,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1);var a=[],i=!0;this.interceptors.request.forEach(function(B){typeof B.runWhen=="function"&&B.runWhen(n)===!1||(i=i&&B.synchronous,a.unshift(B.fulfilled,B.rejected))});var o=[];this.interceptors.response.forEach(function(B){o.push(B.fulfilled,B.rejected)});var u;if(!i){var c=[fc,void 0];for(Array.prototype.unshift.apply(c,a),c=c.concat(o),u=Promise.resolve(n);c.length;)u=u.then(c.shift(),c.shift());return u}for(var l=n;a.length;){var h=a.shift(),f=a.shift();try{l=h(l)}catch(A){f(A);break}}try{u=fc(l)}catch(A){return Promise.reject(A)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};ur.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=wa(this.defaults,t),h1(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};Bh.forEach(["delete","get","head","options"],function(t){ur.prototype[t]=function(n,r){return this.request(wa(r||{},{method:t,url:n,data:(r||{}).data}))}});Bh.forEach(["post","put","patch"],function(t){ur.prototype[t]=function(n,r,a){return this.request(wa(a||{},{method:t,url:n,data:r}))}});var v1=ur,ai,dc;function p1(){if(dc)return ai;dc=1;var e=ma();function t(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var a=this;this.promise.then(function(i){if(a._listeners){var o,u=a._listeners.length;for(o=0;o=0.48.0","ton-crypto":">=3.2.0"},W1={access:"public",registry:"https://registry.npmjs.org/"},L1="yarn@3.4.1",D1={name:b1,version:I1,repository:C1,author:E1,license:_1,main:B1,files:M1,scripts:T1,devDependencies:S1,dependencies:R1,peerDependencies:$1,publishConfig:W1,"release-it":{github:{release:!0},plugins:{"@release-it/keep-a-changelog":{filename:"CHANGELOG.md"}}},packageManager:L1};var O1=W&&W.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),U1=W&&W.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),P1=W&&W.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&O1(t,e,n);return U1(t,e),t},yu=W&&W.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.HttpApi=void 0;const I=P1(Ni),Sh=Xl,Q1=yu(ns),F1=ga,gc=yu(TC),N1=yu(Ir),k1=D1.version,Nt=I.type({"@type":I.literal("ton.blockIdExt"),workchain:I.number,shard:I.string,seqno:I.number,root_hash:I.string,file_hash:I.string}),j1=I.type({balance:I.union([I.number,I.string]),state:I.union([I.literal("active"),I.literal("uninitialized"),I.literal("frozen")]),data:I.string,code:I.string,last_transaction_id:I.type({"@type":I.literal("internal.transactionId"),lt:I.string,hash:I.string}),block_id:Nt,sync_utime:I.number}),q1=I.type({"@type":I.literal("ok")}),J1=I.type({"@type":I.literal("query.fees"),source_fees:I.type({"@type":I.literal("fees"),in_fwd_fee:I.number,storage_fee:I.number,gas_fee:I.number,fwd_fee:I.number})}),H1=I.type({gas_used:I.number,exit_code:I.number,stack:I.array(I.unknown)}),V1=I.union([I.type({"@type":I.literal("msg.dataRaw"),body:I.string}),I.type({"@type":I.literal("msg.dataText"),text:I.string}),I.type({"@type":I.literal("msg.dataDecryptedText"),text:I.string}),I.type({"@type":I.literal("msg.dataEncryptedText"),text:I.string})]),yc=I.type({source:I.string,destination:I.string,value:I.string,fwd_fee:I.string,ihr_fee:I.string,created_lt:I.string,body_hash:I.string,msg_data:V1}),x1=I.type({data:I.string,utime:I.number,transaction_id:I.type({lt:I.string,hash:I.string}),fee:I.string,storage_fee:I.string,other_fee:I.string,in_msg:I.union([I.undefined,yc]),out_msgs:I.array(yc)}),mc=I.array(x1),K1=I.type({state_root_hash:I.string,last:Nt,init:Nt}),z1=I.type({shards:I.array(Nt)}),X1=I.type({"@type":I.literal("blocks.shortTxId"),mode:I.number,account:I.string,lt:I.string,hash:I.string}),Ac=I.type({id:Nt,req_count:I.number,incomplete:I.boolean,transactions:I.array(X1)});class wc{constructor(t,n,r,a){this.namespace=t,this.cache=n,this.codec=r,this.keyEncoder=a}async get(t){let n=await this.cache.get(this.namespace,this.keyEncoder(t));if(n){let r=this.codec.decode(JSON.parse(n));if((0,Sh.isRight)(r))return r.right}return null}async set(t,n){n!==null?await this.cache.set(this.namespace,this.keyEncoder(t),JSON.stringify(n)):await this.cache.set(this.namespace,this.keyEncoder(t),null)}}class Y1{constructor(t,n){this.endpoint=t,this.cache=new F1.InMemoryCache,this.parameters={timeout:n?.timeout||3e4,apiKey:n?.apiKey},this.shardCache=new wc("ton-shard",this.cache,I.array(Nt),r=>r+""),this.shardLoader=new gc.default(async r=>await Promise.all(r.map(async a=>{const i=await this.shardCache.get(a);if(i)return i;let o=(await this.doCall("shards",{seqno:a},z1)).shards;return await this.shardCache.set(a,o),o}))),this.shardTransactionsCache=new wc("ton-shard-tx",this.cache,Ac,r=>r.workchain+":"+r.shard+":"+r.seqno),this.shardTransactionsLoader=new gc.default(async r=>await Promise.all(r.map(async a=>{const i=await this.shardTransactionsCache.get(a);if(i)return i;let o=await this.doCall("getBlockTransactions",{workchain:a.workchain,seqno:a.seqno,shard:a.shard},Ac);return await this.shardTransactionsCache.set(a,o),o})),{cacheKeyFn:r=>r.workchain+":"+r.shard+":"+r.seqno})}getAddressInformation(t){return this.doCall("getAddressInformation",{address:t.toString()},j1)}async getTransactions(t,n){const r=n.inclusive;delete n.inclusive;let a;n.hash&&(a=J.Buffer.from(n.hash,"base64").toString("hex"));let i=n.limit;n.hash&&n.lt&&r!==!0&&i++;let o=await this.doCall("getTransactions",{address:t.toString(),...n,limit:i,hash:a},mc);return o.length>i&&(o=o.slice(0,i)),n.hash&&n.lt&&r!==!0&&o.shift(),o}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},K1)}async getShards(t){return await this.shardLoader.load(t)}async getBlockTransactions(t,n,r){return await this.shardTransactionsLoader.load({workchain:t,seqno:n,shard:r})}async getTransaction(t,n,r){let a=J.Buffer.from(r,"base64").toString("hex"),o=(await this.doCall("getTransactions",{address:t.toString(),lt:n,hash:a,limit:1},mc)).find(u=>u.transaction_id.lt===n&&u.transaction_id.hash===r);return o||null}async callGetMethod(t,n,r){return await this.doCall("runGetMethod",{address:t.toString(),method:n,stack:G1(r)},H1)}async sendBoc(t){await this.doCall("sendBoc",{boc:t.toString("base64")},q1)}async estimateFee(t,n){return await this.doCall("estimateFee",{address:t.toString(),body:n.body.toBoc().toString("base64"),init_data:n.initData?n.initData.toBoc().toString("base64"):"",init_code:n.initCode?n.initCode.toBoc().toString("base64"):"",ignore_chksig:n.ignoreSignature},J1)}async doCall(t,n,r){let a={"Content-Type":"application/json","X-Ton-Client-Version":k1};this.parameters.apiKey&&(a["X-API-Key"]=this.parameters.apiKey);let i=await N1.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:t,params:n}),{headers:a,timeout:this.parameters.timeout});if(i.status!==200||!i.data.ok)throw Error("Received error: "+JSON.stringify(i.data));let o=r.decode(i.data.result);if((0,Sh.isRight)(o))return o.right;throw Error("Malformed response: "+Q1.default.report(o).join(", "))}}Bn.HttpApi=Y1;function G1(e){let t=[];for(let n of e)if(n.type==="int")t.push(["num",n.value.toString()]);else if(n.type==="cell")t.push(["tvm.Cell",n.cell.toBoc().toString("base64")]);else if(n.type==="slice")t.push(["tvm.Slice",n.cell.toBoc().toString("base64")]);else if(n.type==="builder")t.push(["tvm.Builder",n.cell.toBoc().toString("base64")]);else throw Error("Unsupported stack item type: "+n.type);return t}var ba={},Z1=W&&W.__classPrivateFieldSet||function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},qe=W&&W.__classPrivateFieldGet||function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Se;Object.defineProperty(ba,"__esModule",{value:!0});ba.TonClient=void 0;const eE=Bn,ce=U;class tE{constructor(t){Se.set(this,void 0),this.parameters={endpoint:t.endpoint},Z1(this,Se,new eE.HttpApi(this.parameters.endpoint,{timeout:t.timeout,apiKey:t.apiKey,adapter:t.httpAdapter}),"f")}async getBalance(t){return(await this.getContractState(t)).balance}async runMethod(t,n,r=[]){let a=await qe(this,Se,"f").callGetMethod(t,n,r);if(a.exit_code!==0)throw Error("Unable to execute get method. Got exit_code: "+a.exit_code);return{gas_used:a.gas_used,stack:bc(a.stack)}}async callGetMethod(t,n,r=[]){return this.runMethod(t,n,r)}async runMethodWithError(t,n,r=[]){let a=await qe(this,Se,"f").callGetMethod(t,n,r);return{gas_used:a.gas_used,stack:bc(a.stack),exit_code:a.exit_code}}async callGetMethodWithError(t,n,r=[]){return this.runMethodWithError(t,n,r)}async getTransactions(t,n){let r=await qe(this,Se,"f").getTransactions(t,n),a=[];for(let i of r)a.push((0,ce.loadTransaction)(ce.Cell.fromBoc(J.Buffer.from(i.data,"base64"))[0].beginParse()));return a}async getTransaction(t,n,r){let a=await qe(this,Se,"f").getTransaction(t,n,r);return a?(0,ce.loadTransaction)(ce.Cell.fromBoc(J.Buffer.from(a.data,"base64"))[0].beginParse()):null}async getMasterchainInfo(){let t=await qe(this,Se,"f").getMasterchainInfo();return{workchain:t.init.workchain,shard:t.last.shard,initSeqno:t.init.seqno,latestSeqno:t.last.seqno}}async getWorkchainShards(t){return(await qe(this,Se,"f").getShards(t)).map(r=>({workchain:r.workchain,shard:r.shard,seqno:r.seqno}))}async getShardTransactions(t,n,r){let a=await qe(this,Se,"f").getBlockTransactions(t,n,r);if(a.incomplete)throw Error("Unsupported");return a.transactions.map(i=>({account:ce.Address.parseRaw(i.account),lt:i.lt,hash:i.hash}))}async sendMessage(t){const n=(0,ce.beginCell)().store((0,ce.storeMessage)(t)).endCell().toBoc();await qe(this,Se,"f").sendBoc(n)}async sendFile(t){await qe(this,Se,"f").sendBoc(t)}async estimateExternalMessageFee(t,n){return await qe(this,Se,"f").estimateFee(t,{body:n.body,initCode:n.initCode,initData:n.initData,ignoreSignature:n.ignoreSignature})}async sendExternalMessage(t,n){if(await this.isContractDeployed(t.address)||!t.init){const r=(0,ce.external)({to:t.address,body:n});await this.sendMessage(r)}else{const r=(0,ce.external)({to:t.address,init:{code:t.init.code,data:t.init.data},body:n});await this.sendMessage(r)}}async isContractDeployed(t){return(await this.getContractState(t)).state==="active"}async getContractState(t){let n=await qe(this,Se,"f").getAddressInformation(t),r=BigInt(n.balance),a=n.state;return{balance:r,state:a,code:n.code!==""?J.Buffer.from(n.code,"base64"):null,data:n.data!==""?J.Buffer.from(n.data,"base64"):null,lastTransaction:n.last_transaction_id.lt!=="0"?{lt:n.last_transaction_id.lt,hash:n.last_transaction_id.hash}:null,blockId:{workchain:n.block_id.workchain,shard:n.block_id.shard,seqno:n.block_id.seqno},timestampt:n.sync_utime}}open(t){return(0,ce.openContract)(t,n=>Ic(this,n.address,n.init))}provider(t,n){return Ic(this,t,n)}}ba.TonClient=tE;Se=new WeakMap;function bc(e){let t=[];for(let n of e)if(n[0]==="num"){let r=n[1];r.startsWith("-")?t.push({type:"int",value:-BigInt(r.slice(1))}):t.push({type:"int",value:BigInt(r)})}else if(n[0]==="null")t.push({type:"null"});else if(n[0]==="cell")t.push({type:"cell",cell:ce.Cell.fromBoc(J.Buffer.from(n[1].bytes,"base64"))[0]});else if(n[0]==="slice")t.push({type:"slice",cell:ce.Cell.fromBoc(J.Buffer.from(n[1].bytes,"base64"))[0]});else if(n[0]==="builder")t.push({type:"builder",cell:ce.Cell.fromBoc(J.Buffer.from(n[1].bytes,"base64"))[0]});else throw Error("Unsupported stack item type: "+n[0]);return new ce.TupleReader(t)}function Ic(e,t,n){return{async getState(){let r=await e.getContractState(t),a=r.balance,i=r.lastTransaction?{lt:BigInt(r.lastTransaction.lt),hash:J.Buffer.from(r.lastTransaction.hash,"base64")}:null,o;if(r.state==="active")o={type:"active",code:r.code?r.code:null,data:r.data?r.data:null};else if(r.state==="uninitialized")o={type:"uninit"};else if(r.state==="frozen")o={type:"frozen",stateHash:J.Buffer.alloc(0)};else throw Error("Unsupported state");return{balance:a,last:i,state:o}},async get(r,a){return{stack:(await e.callGetMethod(t,r,a)).stack}},async external(r){let a=null;n&&!await e.isContractDeployed(t)&&(a=n);const i=(0,ce.external)({to:t,init:a?{code:a.code,data:a.data}:null,body:r});let o=(0,ce.beginCell)().store((0,ce.storeMessage)(i)).endCell().toBoc();await e.sendFile(o)},async internal(r,a){let i=null;n&&!await e.isContractDeployed(t)&&(i=n);let o=!0;a.bounce!==null&&a.bounce!==void 0&&(o=a.bounce);let u;typeof a.value=="string"?u=(0,ce.toNano)(a.value):u=a.value;let c=null;typeof a.body=="string"?c=(0,ce.comment)(a.body):a.body&&(c=a.body),await r.send({to:t,value:u,bounce:o,sendMode:a.sendMode,init:i,body:c})}}}var Ia={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.toUrlSafe=void 0;function nE(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e}Ca.toUrlSafe=nE;var rE=W&&W.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),aE=W&&W.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),iE=W&&W.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&rE(t,e,n);return aE(t,e),t},ui=W&&W.__classPrivateFieldSet||function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},q=W&&W.__classPrivateFieldGet||function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},oE=W&&W.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Re,$e,We;Object.defineProperty(Ia,"__esModule",{value:!0});Ia.TonClient4=void 0;const Je=oE(Ir),v=iE(Ni),we=U,Cc=Ca;class uE{constructor(t){Re.set(this,void 0),$e.set(this,void 0),We.set(this,void 0),ui(this,Re,t.endpoint,"f"),ui(this,$e,t.timeout||5e3,"f"),ui(this,We,t.httpAdapter,"f")}async getLastBlock(){let t=await Je.default.get(q(this,Re,"f")+"/block/latest",{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!cE.is(t.data))throw Error("Mailformed response");return t.data}async getBlock(t){let n=await Je.default.get(q(this,Re,"f")+"/block/"+t,{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!Ec.is(n.data))throw Error("Mailformed response");if(!n.data.exist)throw Error("Block is out of scope");return n.data.block}async getBlockByUtime(t){let n=await Je.default.get(q(this,Re,"f")+"/block/utime/"+t,{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!Ec.is(n.data))throw Error("Mailformed response");if(!n.data.exist)throw Error("Block is out of scope");return n.data.block}async getAccount(t,n){let r=await Je.default.get(q(this,Re,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0}),{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!lE.is(r.data))throw Error("Mailformed response");return r.data}async getAccountLite(t,n){let r=await Je.default.get(q(this,Re,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/lite",{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!sE.is(r.data))throw Error("Mailformed response");return r.data}async isContractDeployed(t,n){return(await this.getAccountLite(t,n)).account.state.type==="active"}async isAccountChanged(t,n,r){let a=await Je.default.get(q(this,Re,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/changed/"+r.toString(10),{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!fE.is(a.data))throw Error("Mailformed response");return a.data}async getTransaction(t,n,r){const a=n.toString({urlSafe:!0}),i=`/block/${t}/${a}/tx/${r.toString(10)}`,o=await Je.default.get(new URL(i,q(this,Re,"f")).href,{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!gE.is(o.data))throw Error("Mailformed response");const u=we.Cell.fromBoc(J.Buffer.from(o.data.boc,"base64"))[0];return{tx:(0,we.loadTransaction)(u.beginParse()),...o.data}}async getAccountTransactions(t,n,r){let a=await Je.default.get(q(this,Re,"f")+"/account/"+t.toString({urlSafe:!0})+"/tx/"+n.toString(10)+"/"+(0,Cc.toUrlSafe)(r.toString("base64")),{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!pE.is(a.data))throw Error("Mailformed response");let i=a.data,o=[],u=we.Cell.fromBoc(J.Buffer.from(i.boc,"base64"));for(let c=0;c0&&(r="/"+[...n].sort().join(","));let a=await Je.default.get(q(this,Re,"f")+"/block/"+t+"/config"+r,{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!hE.is(a.data))throw Error("Mailformed response");return a.data}async runMethod(t,n,r,a){let i=a&&a.length>0?"/"+(0,Cc.toUrlSafe)((0,we.serializeTuple)(a).toBoc({idx:!1,crc32:!1}).toString("base64")):"",o=q(this,Re,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/run/"+r+i,u=await Je.default.get(o,{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!dE.is(u.data))throw Error("Mailformed response");let c=u.data.resultRaw?(0,we.parseTuple)(we.Cell.fromBoc(J.Buffer.from(u.data.resultRaw,"base64"))[0]):[];return{exitCode:u.data.exitCode,result:c,resultRaw:u.data.resultRaw,block:u.data.block,shardBlock:u.data.shardBlock,reader:new we.TupleReader(c)}}async sendMessage(t){let n=await Je.default.post(q(this,Re,"f")+"/send",{boc:t.toString("base64")},{adapter:q(this,We,"f"),timeout:q(this,$e,"f")});if(!vE.is(n.data))throw Error("Mailformed response");return{status:n.data.status}}open(t){return(0,we.openContract)(t,n=>lr(this,null,n.address,n.init))}openAt(t,n){return(0,we.openContract)(n,r=>lr(this,t,r.address,r.init))}provider(t,n){return lr(this,null,t,n||null)}providerAt(t,n,r){return lr(this,t,n,r||null)}}Ia.TonClient4=uE;Re=new WeakMap,$e=new WeakMap,We=new WeakMap;function lr(e,t,n,r){return{async getState(){let a=t;a===null&&(a=(await e.getLastBlock()).last.seqno);let i=await e.getAccount(a,n),o=i.account.last?{lt:BigInt(i.account.last.lt),hash:J.Buffer.from(i.account.last.hash,"base64")}:null,u;if(i.account.state.type==="active")u={type:"active",code:i.account.state.code?J.Buffer.from(i.account.state.code,"base64"):null,data:i.account.state.data?J.Buffer.from(i.account.state.data,"base64"):null};else if(i.account.state.type==="uninit")u={type:"uninit"};else if(i.account.state.type==="frozen")u={type:"frozen",stateHash:J.Buffer.from(i.account.state.stateHash,"base64")};else throw Error("Unsupported state");return{balance:BigInt(i.account.balance.coins),last:o,state:u}},async get(a,i){let o=t;o===null&&(o=(await e.getLastBlock()).last.seqno);let u=await e.runMethod(o,n,a,i);if(u.exitCode!==0&&u.exitCode!==1)throw Error("Exit code: "+u.exitCode);return{stack:new we.TupleReader(u.result)}},async external(a){let i=await e.getLastBlock(),o=null;r&&(await e.getAccountLite(i.last.seqno,n)).account.state.type!=="active"&&(o=r);const u=(0,we.external)({to:n,init:o?{code:o.code,data:o.data}:null,body:a});let c=(0,we.beginCell)().store((0,we.storeMessage)(u)).endCell().toBoc();await e.sendMessage(c)},async internal(a,i){let o=await e.getLastBlock(),u=null;r&&(await e.getAccountLite(o.last.seqno,n)).account.state.type!=="active"&&(u=r);let c=!0;i.bounce!==null&&i.bounce!==void 0&&(c=i.bounce);let l;typeof i.value=="string"?l=(0,we.toNano)(i.value):l=i.value;let h=null;typeof i.body=="string"?h=(0,we.comment)(i.body):i.body&&(h=i.body),await a.send({to:n,value:l,bounce:c,sendMode:i.sendMode,init:u,body:h})}}}const cE=v.type({last:v.type({seqno:v.number,shard:v.string,workchain:v.number,fileHash:v.string,rootHash:v.string}),init:v.type({fileHash:v.string,rootHash:v.string}),stateRootHash:v.string,now:v.number}),Ec=v.union([v.type({exist:v.literal(!1)}),v.type({exist:v.literal(!0),block:v.type({shards:v.array(v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string,transactions:v.array(v.type({account:v.string,hash:v.string,lt:v.string}))}))})})]),Rh=v.type({lastPaid:v.number,duePayment:v.union([v.null,v.string]),used:v.type({bits:v.number,cells:v.number,publicCells:v.number})}),lE=v.type({account:v.type({state:v.union([v.type({type:v.literal("uninit")}),v.type({type:v.literal("active"),code:v.union([v.string,v.null]),data:v.union([v.string,v.null])}),v.type({type:v.literal("frozen"),stateHash:v.string})]),balance:v.type({coins:v.string}),last:v.union([v.null,v.type({lt:v.string,hash:v.string})]),storageStat:v.union([v.null,Rh])}),block:v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string})}),sE=v.type({account:v.type({state:v.union([v.type({type:v.literal("uninit")}),v.type({type:v.literal("active"),codeHash:v.string,dataHash:v.string}),v.type({type:v.literal("frozen"),stateHash:v.string})]),balance:v.type({coins:v.string}),last:v.union([v.null,v.type({lt:v.string,hash:v.string})]),storageStat:v.union([v.null,Rh])})}),fE=v.type({changed:v.boolean,block:v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string})}),dE=v.type({exitCode:v.number,resultRaw:v.union([v.string,v.null]),block:v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string}),shardBlock:v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string})}),hE=v.type({config:v.type({cell:v.string,address:v.string,globalBalance:v.type({coins:v.string})})}),vE=v.type({status:v.number}),pE=v.type({blocks:v.array(v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string,fileHash:v.string})),boc:v.string}),gE=v.type({block:v.type({workchain:v.number,seqno:v.number,shard:v.string,rootHash:v.string}),boc:v.string,proof:v.string});var Ea={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.createWalletTransferV4=ge.createWalletTransferV3=ge.createWalletTransferV2=ge.createWalletTransferV1=void 0;const be=U,_a=yi();function yE(e){let t=(0,be.beginCell)().storeUint(e.seqno,32);e.message&&(t.storeUint(e.sendMode,8),t.storeRef((0,be.beginCell)().store((0,be.storeMessageRelaxed)(e.message))));let n=(0,_a.sign)(t.endCell().hash(),e.secretKey);return(0,be.beginCell)().storeBuffer(n).storeBuilder(t).endCell()}ge.createWalletTransferV1=yE;function mE(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,be.beginCell)().storeUint(e.seqno,32);if(e.seqno===0)for(let a=0;a<32;a++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);for(let a of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,be.beginCell)().store((0,be.storeMessageRelaxed)(a)));let n=(0,_a.sign)(t.endCell().hash(),e.secretKey);return(0,be.beginCell)().storeBuffer(n).storeBuilder(t).endCell()}ge.createWalletTransferV2=mE;function AE(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,be.beginCell)().storeUint(e.walletId,32);if(e.seqno===0)for(let a=0;a<32;a++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32);for(let a of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,be.beginCell)().store((0,be.storeMessageRelaxed)(a)));let n=(0,_a.sign)(t.endCell().hash(),e.secretKey);return(0,be.beginCell)().storeBuffer(n).storeBuilder(t).endCell()}ge.createWalletTransferV3=AE;function wE(e){if(e.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let t=(0,be.beginCell)().storeUint(e.walletId,32);if(e.seqno===0)for(let a=0;a<32;a++)t.storeBit(1);else t.storeUint(e.timeout||Math.floor(Date.now()/1e3)+60,32);t.storeUint(e.seqno,32),t.storeUint(0,8);for(let a of e.messages)t.storeUint(e.sendMode,8),t.storeRef((0,be.beginCell)().store((0,be.storeMessageRelaxed)(a)));let n=(0,_a.sign)(t.endCell().hash(),e.secretKey);return(0,be.beginCell)().storeBuffer(n).storeBuilder(t).endCell()}ge.createWalletTransferV4=wE;Object.defineProperty(Ea,"__esModule",{value:!0});Ea.WalletContractV1R1=void 0;const Lt=U,bE=ge;class mu{constructor(t,n){this.workchain=t,this.publicKey=n;let r=Lt.Cell.fromBoc(J.Buffer.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],a=(0,Lt.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:a},this.address=(0,Lt.contractAddress)(t,{code:r,data:a})}static create(t){return new mu(t.workchain,t.publicKey)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){let n=await t.getState();return n.state.type==="active"?Lt.Cell.fromBoc(n.state.data)[0].beginParse().loadUint(32):0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=Lt.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,bE.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,message:(0,Lt.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,i)}}}}Ea.WalletContractV1R1=mu;var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.WalletContractV1R2=void 0;const sn=U,IE=ge;class Au{constructor(t,n){this.workchain=t,this.publicKey=n;let r=sn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],a=(0,sn.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:a},this.address=(0,sn.contractAddress)(t,{code:r,data:a})}static create(t){return new Au(t.workchain,t.publicKey)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=sn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,IE.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,message:(0,sn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,i)}}}}Ba.WalletContractV1R2=Au;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.WalletContractV1R3=void 0;const fn=U,CE=ge;class wu{constructor(t,n){this.workchain=t,this.publicKey=n;let r=fn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],a=(0,fn.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:a},this.address=(0,fn.contractAddress)(t,{code:r,data:a})}static create(t){return new wu(t.workchain,t.publicKey)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=fn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,CE.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,message:(0,fn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,i)}}}}Ma.WalletContractV1R3=wu;var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.WalletContractV2R1=void 0;const dn=U,EE=ge;class bu{constructor(t,n){this.workchain=t,this.publicKey=n;let r=dn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],a=(0,dn.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:a},this.address=(0,dn.contractAddress)(t,{code:r,data:a})}static create(t){return new bu(t.workchain,t.publicKey)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=dn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,EE.createWalletTransferV2)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,messages:[(0,dn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,i)}}}}Ta.WalletContractV2R1=bu;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.WalletContractV2R2=void 0;const hn=U,_E=ge;class Iu{constructor(t,n){this.workchain=t,this.publicKey=n;let r=hn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],a=(0,hn.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:a},this.address=(0,hn.contractAddress)(t,{code:r,data:a})}static create(t){return new Iu(t.workchain,t.publicKey)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=hn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,_E.createWalletTransferV2)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,messages:[(0,hn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,i)}}}}Sa.WalletContractV2R2=Iu;var Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});Ra.WalletContractV3R1=void 0;const vn=U,BE=ge;class Cu{constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let a=vn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],i=(0,vn.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(n).endCell();this.init={code:a,data:i},this.address=(0,vn.contractAddress)(t,{code:a,data:i})}static create(t){return new Cu(t.workchain,t.publicKey,t.walletId)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=vn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,BE.createWalletTransferV3)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout,walletId:this.walletId})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,messages:[(0,vn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,i)}}}}Ra.WalletContractV3R1=Cu;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.WalletContractV3R2=void 0;const pn=U,ME=ge;class Eu{constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let a=pn.Cell.fromBoc(J.Buffer.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],i=(0,pn.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(n).endCell();this.init={code:a,data:i},this.address=(0,pn.contractAddress)(t,{code:a,data:i})}static create(t){return new Eu(t.workchain,t.publicKey,t.walletId)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=pn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,ME.createWalletTransferV3)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout,walletId:this.walletId})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,messages:[(0,pn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,i)}}}}$a.WalletContractV3R2=Eu;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});Wa.WalletContractV4=void 0;const gn=U,TE=ge;class _u{constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let a=gn.Cell.fromBoc(J.Buffer.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],i=(0,gn.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:a,data:i},this.address=(0,gn.contractAddress)(t,{code:a,data:i})}static create(t){return new _u(t.workchain,t.publicKey,t.walletId)}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=gn.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,TE.createWalletTransferV4)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout,walletId:this.walletId})}sender(t,n){return{send:async r=>{let a=await this.getSeqno(t),i=this.createTransfer({seqno:a,secretKey:n,sendMode:r.sendMode,messages:[(0,gn.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,i)}}}}Wa.WalletContractV4=_u;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.JettonMaster=void 0;const SE=U;class Bu{constructor(t){this.address=t}static create(t){return new Bu(t)}async getWalletAddress(t,n){return(await t.get("get_wallet_address",[{type:"slice",cell:(0,SE.beginCell)().storeAddress(n).endCell()}])).stack.readAddress()}async getJettonData(t){let n=await t.get("get_jetton_data",[]),r=n.stack.readBigNumber(),a=n.stack.readBoolean(),i=n.stack.readAddress(),o=n.stack.readCell(),u=n.stack.readCell();return{totalSupply:r,mintable:a,adminAddress:i,content:o,walletCode:u}}}La.JettonMaster=Bu;var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.JettonWallet=void 0;class Mu{constructor(t){this.address=t}static create(t){return new Mu(t)}async getBalance(t){return(await t.getState()).state.type!=="active"?0n:(await t.get("get_wallet_data",[])).stack.readBigNumber()}}Da.JettonWallet=Mu;var cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.MultisigOrder=void 0;const _c=yi(),sr=U;class Er{constructor(t){this.signatures={},this.payload=t}static fromCell(t){let n=t.beginParse(),r=n.loadMaybeRef()?.beginParse();const a=n.asCell();let i=new Er(a);if(r){for(;r.remainingBits>0;){const o=r.loadBuffer(64),u=r.loadUint(8);i.signatures[u]=o,r.remainingRefs>0?r=r.loadRef().asSlice():r.skip(1)}r.endParse()}return i}static fromPayload(t){return new Er(t)}addSignature(t,n,r){const a=this.payload.hash();if(!(0,_c.signVerify)(a,n,r.owners.get(t).slice(0,-1)))throw Error("invalid signature");this.signatures[t]=n}sign(t,n){const r=this.payload.hash();return this.signatures[t]=(0,_c.sign)(r,n),r}unionSignatures(t){this.signatures=Object.assign({},this.signatures,t.signatures)}clearSignatures(){this.signatures={}}toCell(t){let n=(0,sr.beginCell)().storeBit(0);for(const r in this.signatures){const a=this.signatures[r];n=(0,sr.beginCell)().storeBit(1).storeRef((0,sr.beginCell)().storeBuffer(a).storeUint(parseInt(r),8).storeBuilder(n).endCell())}return(0,sr.beginCell)().storeUint(t,8).storeBuilder(n).storeBuilder(this.payload.asBuilder()).endCell()}}cr.MultisigOrder=Er;var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.MultisigOrderBuilder=void 0;const yn=U,RE=cr;class $E{constructor(t,n){this.messages=(0,yn.beginCell)(),this.queryId=0n,this.walletId=t,this.queryOffset=n||7200}addMessage(t,n){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(n,8),this.messages.storeRef((0,yn.beginCell)().store((0,yn.storeMessageRelaxed)(t)).endCell())}clearMessages(){this.messages=(0,yn.beginCell)()}build(){return RE.MultisigOrder.fromPayload((0,yn.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const t=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=t<<32n}}Oa.MultisigOrderBuilder=$E;var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.MultisigWallet=void 0;const Bc=yi(),Ne=U,WE=Ne.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class Tu{constructor(t,n,r,a,i){this.provider=null,this.owners=Ne.Dictionary.empty(),this.workchain=n,this.walletId=r,this.k=a;for(let o=0;o{const t=new Mc.Sha256;return t.update(e),J.Buffer.from(t.digestSync())},PE=e=>BigInt(`0x${UE(e).toString("hex")}`);function QE(e){return FE(e,OE).reduceRight((r,a,i)=>{if(i===0&&r.storeInt(DE,8),r.storeBuffer(a),i>0){const o=r.endCell();return pr.beginCell().storeRef(o)}else return r},pr.beginCell()).endCell()}function FE(e,t){let n=[];for(;e.byteLength>0;)n.push(e.slice(0,t)),e=e.slice(t);return n}function NE(e){let t=U.Dictionary.empty(U.Dictionary.Keys.BigUint(256),U.Dictionary.Values.Cell());return Object.entries(e).forEach(([n,r])=>{t.set(PE(n),QE(J.Buffer.from(r,"utf8")))}),pr.beginCell().storeInt(LE,8).storeDict(t).endCell()}function kE(){return NE({name:"Test Token Name",description:"This is description of Test Jetton Token in Tact-lang",symbol:"TTN",image:"https://avatars.githubusercontent.com/u/104382459?s=200&v=4"})}function jE(e,t,n){let r;uv(e,$u,h=>n(6,r=h));let a,i,o,u,c,l;return cv($u,r={markdown:sv,tactCode:fv,deploy:async()=>{a=await lv.Blockchain.create();const h=await a.treasury("deployer");i=h.getSender();const f=await a.treasury("another");o=f.getSender();const A=await kE();u=a.openContract(await hr.fromInit(h.address,A,21000000000000n)),c=a.openContract(await mt.fromInit(u.address,i.address)),l=a.openContract(await mt.fromInit(u.address,o.address));const B={[h.address.toString()]:"deployer",[f.address.toString()]:"user2",[u.address.toString()]:"JettonRoot",[c.address.toString()]:"JettonWallet(deployer)",[l.address.toString()]:"JettonWallet(user2)"};return[[u,c,l],B,[await u.send(h.getSender(),{value:U.toNano(1)},"Mint: 100")]]},messages:{"Mint: 100":async()=>[await u.send(i,{value:U.toNano(1)},"Mint: 100")],"Mint: 100(user2)":async()=>[await u.send(o,{value:U.toNano(1)},"Mint: 100")],"Owner: MintClose(admin)":async()=>[await u.send(i,{value:U.toNano(1)},"Owner: MintClose")]},getters:{CirculatingSupply:async()=>(await u.getGetJettonData()).totalSupply,"balance(JettonWallet(deployer))":async()=>{const h=await u.getGetWalletAddress(i.address);return(await a.openContract(await mt.fromAddress(h)).getGetWalletData()).balance},"balance(JettonWallet(user2))":async()=>{const h=await u.getGetWalletAddress(o.address);return(await a.openContract(await mt.fromAddress(h)).getGetWalletData()).balance},mintable:async()=>(await u.getGetJettonData()).mintable},prev:Ru(import.meta.url).prev,next:Ru(import.meta.url).next},r),[]}class xE extends av{constructor(t){super(),iv(this,t,jE,null,ov,{})}}export{xE as default}; diff --git a/docs/_app/immutable/entry/(examples)-layout.svelte.322916d1.js b/docs/_app/immutable/entry/(examples)-layout.svelte.01f6cb21.js similarity index 95% rename from docs/_app/immutable/entry/(examples)-layout.svelte.322916d1.js rename to docs/_app/immutable/entry/(examples)-layout.svelte.01f6cb21.js index 2b15891..7434d5c 100644 --- a/docs/_app/immutable/entry/(examples)-layout.svelte.322916d1.js +++ b/docs/_app/immutable/entry/(examples)-layout.svelte.01f6cb21.js @@ -1,4 +1,4 @@ -import{S as qe,i as Ue,s as He,k as ne,l as re,m as D,h as E,n as A,J as Bt,K as at,b as X,H as M,L as Nt,C as Ie,M as gr,I as mr,D as Me,a as ue,c as pe,N as Qe,E as $e,F as De,G as We,g as H,d as Z,O as tn,P as Xr,Q as Zr,y as ye,z as xe,A as we,B as ve,e as Ee,R as nn,T as rn,U as Qr,V as Yr,W as Jr,X as se,Y as ie,Z as ut,_ as jt,x as hn,$ as sn,a0 as Kr,v as Be,f as Ce,a1 as Ct,a2 as br,a3 as pt,a4 as _r,w as vt,o as kr,t as es,a5 as ts,a6 as ns,a7 as Ot,a8 as ze,q as be,r as _e,a9 as Et,aa as rs,p as Y,u as Ve,ab as Mt}from"../chunks/index.9fe14626.js";import{c as yr,s as dn,a as ss,d as gn}from"../chunks/store.d3ab02ad.js";import{w as wr}from"../chunks/index.1c761ed5.js";import{m as is}from"../chunks/app.cf8f4105.js";const vr={name:"SplitterContext"};function os(t){let e,n,r,s;return{c(){e=ne("div"),n=ne("div"),this.h()},l(i){e=re(i,"DIV",{class:!0,tabindex:!0});var o=D(e);n=re(o,"DIV",{class:!0,style:!0}),D(n).forEach(E),o.forEach(E),this.h()},h(){A(n,"class","line svelte-7pb3g9"),A(n,"style",t[3]),A(e,"class",r=Bt(t[2])+" svelte-7pb3g9"),A(e,"tabindex","0"),at(()=>t[13].call(e))},m(i,o){X(i,e,o),M(e,n),s=Nt(e,t[13].bind(e))},p(i,[o]){o&8&&A(n,"style",i[3]),o&4&&r!==(r=Bt(i[2])+" svelte-7pb3g9")&&A(e,"class",r)},i:Ie,o:Ie,d(i){i&&E(e),s()}}}function as(t,e,n){let r,s,i,o,a,u,c,{color:f="silver"}=e,{hoverColor:p="gray"}=e,{dragColor:h="black"}=e,L=gr(vr);mr(t,L,m=>n(12,c=m));let b,T;function x(){b=this.clientWidth,T=this.clientHeight,n(0,b),n(1,T)}return t.$$set=m=>{"color"in m&&n(5,f=m.color),"hoverColor"in m&&n(6,p=m.hoverColor),"dragColor"in m&&n(7,h=m.dragColor)},t.$$.update=()=>{t.$$.dirty&4096&&n(10,r=c.dragging),t.$$.dirty&4096&&n(8,s=c.horizontal),t.$$.dirty&259&&n(11,i=s?T:b),t.$$.dirty&3296&&n(9,o={"--splitter-line-margin":`${Math.max(0,Math.floor(i/2)-1)}px`,"--splitter-line-size":`${i%2===0?2:3}px`,"--splitter-line-color":r?h:f,"--splitter-line-hover-color":r?h:p}),t.$$.dirty&512&&n(3,a=Object.entries(o).map(([m,y])=>`${m}:${y}`).join(";")),t.$$.dirty&256&&n(2,u=s?"splitter horizontal":"splitter vertical")},[b,T,u,a,L,f,p,h,s,o,r,i,c,x]}class on extends qe{constructor(e){super(),Ue(this,e,as,os,He,{color:5,hoverColor:6,dragColor:7})}}const ls=t=>({}),mn=t=>({}),cs=t=>({}),bn=t=>({}),us=t=>({}),_n=t=>({});function ps(t){let e,n;return e=new on({}),{c(){ye(e.$$.fragment)},l(r){xe(e.$$.fragment,r)},m(r,s){we(e,r,s),n=!0},i(r){n||(H(e.$$.fragment,r),n=!0)},o(r){Z(e.$$.fragment,r),n=!1},d(r){ve(e,r)}}}function fs(t){let e,n,r,s,i,o,a,u,c,f,p,h,L,b;const T=t[33].primary,x=Me(T,t,t[32],_n),m=t[33].splitter,y=Me(m,t,t[32],bn),v=y||ps(),N=t[33].secondary,_=Me(N,t,t[32],mn);return{c(){e=ne("div"),n=ne("div"),x&&x.c(),s=ue(),i=ne("div"),v&&v.c(),a=ue(),u=ne("div"),_&&_.c(),this.h()},l(l){e=re(l,"DIV",{class:!0,style:!0});var g=D(e);n=re(g,"DIV",{class:!0});var w=D(n);x&&x.l(w),w.forEach(E),s=pe(g),i=re(g,"DIV",{class:!0});var d=D(i);v&&v.l(d),d.forEach(E),a=pe(g),u=re(g,"DIV",{class:!0});var S=D(u);_&&_.l(S),S.forEach(E),g.forEach(E),this.h()},h(){A(n,"class","primary svelte-9dft0e"),at(()=>t[34].call(n)),A(i,"class","splitter svelte-9dft0e"),at(()=>t[35].call(i)),A(u,"class","secondary svelte-9dft0e"),at(()=>t[36].call(u)),A(e,"class",f=Bt(t[8])+" svelte-9dft0e"),A(e,"style",t[9]),at(()=>t[37].call(e))},m(l,g){X(l,e,g),M(e,n),x&&x.m(n,null),r=Nt(n,t[34].bind(n)),M(e,s),M(e,i),v&&v.m(i,null),o=Nt(i,t[35].bind(i)),M(e,a),M(e,u),_&&_.m(u,null),c=Nt(u,t[36].bind(u)),p=Nt(e,t[37].bind(e)),h=!0,L||(b=[Qe(i,"pointerdown",t[10]),Qe(i,"pointermove",t[11]),Qe(i,"pointerup",t[12]),Qe(i,"dblclick",t[13]),Qe(i,"keydown",t[14])],L=!0)},p(l,g){x&&x.p&&(!h||g[1]&2)&&$e(x,T,l,l[32],h?We(T,l[32],g,us):De(l[32]),_n),y&&y.p&&(!h||g[1]&2)&&$e(y,m,l,l[32],h?We(m,l[32],g,cs):De(l[32]),bn),_&&_.p&&(!h||g[1]&2)&&$e(_,N,l,l[32],h?We(N,l[32],g,ls):De(l[32]),mn),(!h||g[0]&256&&f!==(f=Bt(l[8])+" svelte-9dft0e"))&&A(e,"class",f),(!h||g[0]&512)&&A(e,"style",l[9])},i(l){h||(H(x,l),H(v,l),H(_,l),h=!0)},o(l){Z(x,l),Z(v,l),Z(_,l),h=!1},d(l){l&&E(e),x&&x.d(l),r(),v&&v.d(l),o(),_&&_.d(l),c(),p(),L=!1,tn(b)}}}function hs(t,e,n){let r,s,i,o,a,u,c,f,p,{$$slots:h={},$$scope:L}=e,{horizontal:b=!1}=e,{initialPrimarySize:T="50%"}=e,{minPrimarySize:x="0"}=e,{minSecondarySize:m="0"}=e,{splitterSize:y="7px"}=e,{resetOnDoubleClick:v=!0}=e,N,_,l,g,w,d,S,k;const j=Q=>Math.max(0,Math.min(Q,100));let I,z,$,O=!1;const le=()=>a,R=Q=>{n(23,I=j(Q))},G=wr({horizontal:b,dragging:O});Xr(vr,G);const P=Zr(),C=Q=>{Q.currentTarget.setPointerCapture(Q.pointerId),z=b?Q.clientY:Q.clientX,$=s,n(24,O=!0)},V=Q=>{if(Q.currentTarget.hasPointerCapture(Q.pointerId)){const Ne=b?Q.clientY:Q.clientX;let Xe=$+(Ne-z);Xe=Math.max(0,Math.min(Xe,r));const Oe=Xe/r*100;n(23,I=Oe)}},F=Q=>{Q.currentTarget.releasePointerCapture(Q.pointerId),n(24,O=!1)},te=()=>{v&&n(23,I=void 0)},oe=Q=>{const Ne=I||a;if(!Q.ctrlKey&&!Q.shiftKey&&!Q.altKey){switch(Q.code){case"Space":n(23,I=void 0);return}if(b)switch(Q.code){case"ArrowUp":n(23,I=j(Ne-1));return;case"ArrowDown":n(23,I=j(Ne+1));return}else switch(Q.code){case"ArrowLeft":n(23,I=j(Ne-1));return;case"ArrowRight":n(23,I=j(Ne+1));return}}};function ke(){l=this.clientWidth,g=this.clientHeight,n(2,l),n(3,g)}function B(){w=this.clientWidth,d=this.clientHeight,n(4,w),n(5,d)}function he(){S=this.clientWidth,k=this.clientHeight,n(6,S),n(7,k)}function ae(){N=this.clientWidth,_=this.clientHeight,n(0,N),n(1,_)}return t.$$set=Q=>{"horizontal"in Q&&n(15,b=Q.horizontal),"initialPrimarySize"in Q&&n(16,T=Q.initialPrimarySize),"minPrimarySize"in Q&&n(17,x=Q.minPrimarySize),"minSecondarySize"in Q&&n(18,m=Q.minSecondarySize),"splitterSize"in Q&&n(19,y=Q.splitterSize),"resetOnDoubleClick"in Q&&n(20,v=Q.resetOnDoubleClick),"$$scope"in Q&&n(32,L=Q.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32771&&n(26,r=b?_:N),t.$$.dirty[0]&32780&&n(27,s=b?g:l),t.$$.dirty[0]&32816&&n(31,i=b?d:w),t.$$.dirty[0]&32960&&n(30,o=b?k:S),t.$$.dirty[0]&201326592|t.$$.dirty[1]&1&&n(25,a=j(Math.ceil((s-i)/(r-i)*100))),t.$$.dirty[0]&16809984&&G.set({horizontal:b,dragging:O}),t.$$.dirty[0]&1258291200|t.$$.dirty[1]&1&&P("changed",{percent:a,primarySize:s,splitterSize:i,secondarySize:o,dragging:O}),t.$$.dirty[0]&8454144&&n(29,u=I!==void 0?`${I}%`:T),t.$$.dirty[0]&537788416&&n(28,c={"--primary-size":`${u}`,"--min-primary-size":`${x}`,"--min-secondary-size":`${m}`,"--splitter-size":`${y}`}),t.$$.dirty[0]&268435456&&n(9,f=Object.entries(c).map(([Q,Ne])=>`${Q}:${Ne}`).join(";")),t.$$.dirty[0]&32768&&n(8,p=b?"split horizontal":"split vertical")},[N,_,l,g,w,d,S,k,p,f,C,V,F,te,oe,b,T,x,m,y,v,le,R,I,O,a,r,s,c,u,o,i,L,h,ke,B,he,ae]}class xr extends qe{constructor(e){super(),Ue(this,e,hs,fs,He,{horizontal:15,initialPrimarySize:16,minPrimarySize:17,minSecondarySize:18,splitterSize:19,resetOnDoubleClick:20,getPercent:21,setPercent:22},null,[-1,-1])}get getPercent(){return this.$$.ctx[21]}get setPercent(){return this.$$.ctx[22]}}function kn(t){let e,n=wn(t[1],t[2])+"",r;return{c(){e=new nn(!1),r=Ee(),this.h()},l(s){e=rn(s,!1),r=Ee(),this.h()},h(){e.a=r},m(s,i){e.m(n,s,i),X(s,r,i)},p(s,i){i&6&&n!==(n=wn(s[1],s[2])+"")&&e.p(n)},d(s){s&&E(r),s&&e.d()}}}function ds(t){let e,n=t[0]&&kn(t);return{c(){n&&n.c(),e=Ee()},l(r){n&&n.l(r),e=Ee()},m(r,s){n&&n.m(r,s),X(r,e,s)},p(r,[s]){r[0]?n?n.p(r,s):(n=kn(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:Ie,o:Ie,d(r){n&&n.d(r),r&&E(e)}}}function gs(t,e,n){let{observable:r=!1}=e,{component:s}=e,{code:i}=e;return t.$$set=o=>{"observable"in o&&n(0,r=o.observable),"component"in o&&n(1,s=o.component),"code"in o&&n(2,i=o.code)},[r,s,i]}let ms=class extends qe{constructor(e){super(),Ue(this,e,gs,ds,He,{observable:0,component:1,code:2})}};const bs=ms,_s=()=>typeof window<"u",an=_s(),ks=".modal-header{padding: 2px 16px;background-color: #339af0;color: white;}.modal-body{padding: 2px 16px;}.modal-footer{padding: 2px 16px;background-color: #339af0;color: white;}.modal-content{position: relative;background-color: #fefefe;margin: auto;padding: 0;border: 1px solid #888;width: 80%;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);animation-name: animateTop;animation-duration: 0.4s;}@keyframes animateTop {from {top: -300px; opacity: 0}to {top: 0; opacity: 1}}",Sr=an?document.createElement("style"):void 0;if(an){const t=Sr;t.textContent=ks,t.id="svelteui-inject"}function yn(t,e,n){return an&&document.head.appendChild(Sr),` +import{S as qe,i as Ue,s as He,k as ne,l as re,m as D,h as E,n as A,J as Bt,K as at,b as X,H as M,L as Nt,C as Ie,M as gr,I as mr,D as Me,a as ue,c as pe,N as Qe,E as $e,F as De,G as We,g as H,d as Z,O as tn,P as Xr,Q as Zr,y as ye,z as xe,A as we,B as ve,e as Ee,R as nn,T as rn,U as Qr,V as Yr,W as Jr,X as se,Y as ie,Z as ut,_ as jt,x as hn,$ as sn,a0 as Kr,v as Be,f as Ce,a1 as Ct,a2 as br,a3 as pt,a4 as _r,w as vt,o as kr,t as es,a5 as ts,a6 as ns,a7 as Ot,a8 as ze,q as be,r as _e,a9 as Et,aa as rs,p as Y,u as Ve,ab as Mt}from"../chunks/index.9fe14626.js";import{c as yr,s as dn,a as ss,d as gn}from"../chunks/store.476c3091.js";import{w as wr}from"../chunks/index.1c761ed5.js";import{m as is}from"../chunks/app.cf8f4105.js";const vr={name:"SplitterContext"};function os(t){let e,n,r,s;return{c(){e=ne("div"),n=ne("div"),this.h()},l(i){e=re(i,"DIV",{class:!0,tabindex:!0});var o=D(e);n=re(o,"DIV",{class:!0,style:!0}),D(n).forEach(E),o.forEach(E),this.h()},h(){A(n,"class","line svelte-7pb3g9"),A(n,"style",t[3]),A(e,"class",r=Bt(t[2])+" svelte-7pb3g9"),A(e,"tabindex","0"),at(()=>t[13].call(e))},m(i,o){X(i,e,o),M(e,n),s=Nt(e,t[13].bind(e))},p(i,[o]){o&8&&A(n,"style",i[3]),o&4&&r!==(r=Bt(i[2])+" svelte-7pb3g9")&&A(e,"class",r)},i:Ie,o:Ie,d(i){i&&E(e),s()}}}function as(t,e,n){let r,s,i,o,a,u,c,{color:f="silver"}=e,{hoverColor:p="gray"}=e,{dragColor:h="black"}=e,L=gr(vr);mr(t,L,m=>n(12,c=m));let b,T;function x(){b=this.clientWidth,T=this.clientHeight,n(0,b),n(1,T)}return t.$$set=m=>{"color"in m&&n(5,f=m.color),"hoverColor"in m&&n(6,p=m.hoverColor),"dragColor"in m&&n(7,h=m.dragColor)},t.$$.update=()=>{t.$$.dirty&4096&&n(10,r=c.dragging),t.$$.dirty&4096&&n(8,s=c.horizontal),t.$$.dirty&259&&n(11,i=s?T:b),t.$$.dirty&3296&&n(9,o={"--splitter-line-margin":`${Math.max(0,Math.floor(i/2)-1)}px`,"--splitter-line-size":`${i%2===0?2:3}px`,"--splitter-line-color":r?h:f,"--splitter-line-hover-color":r?h:p}),t.$$.dirty&512&&n(3,a=Object.entries(o).map(([m,y])=>`${m}:${y}`).join(";")),t.$$.dirty&256&&n(2,u=s?"splitter horizontal":"splitter vertical")},[b,T,u,a,L,f,p,h,s,o,r,i,c,x]}class on extends qe{constructor(e){super(),Ue(this,e,as,os,He,{color:5,hoverColor:6,dragColor:7})}}const ls=t=>({}),mn=t=>({}),cs=t=>({}),bn=t=>({}),us=t=>({}),_n=t=>({});function ps(t){let e,n;return e=new on({}),{c(){ye(e.$$.fragment)},l(r){xe(e.$$.fragment,r)},m(r,s){we(e,r,s),n=!0},i(r){n||(H(e.$$.fragment,r),n=!0)},o(r){Z(e.$$.fragment,r),n=!1},d(r){ve(e,r)}}}function fs(t){let e,n,r,s,i,o,a,u,c,f,p,h,L,b;const T=t[33].primary,x=Me(T,t,t[32],_n),m=t[33].splitter,y=Me(m,t,t[32],bn),v=y||ps(),N=t[33].secondary,_=Me(N,t,t[32],mn);return{c(){e=ne("div"),n=ne("div"),x&&x.c(),s=ue(),i=ne("div"),v&&v.c(),a=ue(),u=ne("div"),_&&_.c(),this.h()},l(l){e=re(l,"DIV",{class:!0,style:!0});var g=D(e);n=re(g,"DIV",{class:!0});var w=D(n);x&&x.l(w),w.forEach(E),s=pe(g),i=re(g,"DIV",{class:!0});var d=D(i);v&&v.l(d),d.forEach(E),a=pe(g),u=re(g,"DIV",{class:!0});var S=D(u);_&&_.l(S),S.forEach(E),g.forEach(E),this.h()},h(){A(n,"class","primary svelte-9dft0e"),at(()=>t[34].call(n)),A(i,"class","splitter svelte-9dft0e"),at(()=>t[35].call(i)),A(u,"class","secondary svelte-9dft0e"),at(()=>t[36].call(u)),A(e,"class",f=Bt(t[8])+" svelte-9dft0e"),A(e,"style",t[9]),at(()=>t[37].call(e))},m(l,g){X(l,e,g),M(e,n),x&&x.m(n,null),r=Nt(n,t[34].bind(n)),M(e,s),M(e,i),v&&v.m(i,null),o=Nt(i,t[35].bind(i)),M(e,a),M(e,u),_&&_.m(u,null),c=Nt(u,t[36].bind(u)),p=Nt(e,t[37].bind(e)),h=!0,L||(b=[Qe(i,"pointerdown",t[10]),Qe(i,"pointermove",t[11]),Qe(i,"pointerup",t[12]),Qe(i,"dblclick",t[13]),Qe(i,"keydown",t[14])],L=!0)},p(l,g){x&&x.p&&(!h||g[1]&2)&&$e(x,T,l,l[32],h?We(T,l[32],g,us):De(l[32]),_n),y&&y.p&&(!h||g[1]&2)&&$e(y,m,l,l[32],h?We(m,l[32],g,cs):De(l[32]),bn),_&&_.p&&(!h||g[1]&2)&&$e(_,N,l,l[32],h?We(N,l[32],g,ls):De(l[32]),mn),(!h||g[0]&256&&f!==(f=Bt(l[8])+" svelte-9dft0e"))&&A(e,"class",f),(!h||g[0]&512)&&A(e,"style",l[9])},i(l){h||(H(x,l),H(v,l),H(_,l),h=!0)},o(l){Z(x,l),Z(v,l),Z(_,l),h=!1},d(l){l&&E(e),x&&x.d(l),r(),v&&v.d(l),o(),_&&_.d(l),c(),p(),L=!1,tn(b)}}}function hs(t,e,n){let r,s,i,o,a,u,c,f,p,{$$slots:h={},$$scope:L}=e,{horizontal:b=!1}=e,{initialPrimarySize:T="50%"}=e,{minPrimarySize:x="0"}=e,{minSecondarySize:m="0"}=e,{splitterSize:y="7px"}=e,{resetOnDoubleClick:v=!0}=e,N,_,l,g,w,d,S,k;const j=Q=>Math.max(0,Math.min(Q,100));let I,z,$,O=!1;const le=()=>a,R=Q=>{n(23,I=j(Q))},G=wr({horizontal:b,dragging:O});Xr(vr,G);const P=Zr(),C=Q=>{Q.currentTarget.setPointerCapture(Q.pointerId),z=b?Q.clientY:Q.clientX,$=s,n(24,O=!0)},V=Q=>{if(Q.currentTarget.hasPointerCapture(Q.pointerId)){const Ne=b?Q.clientY:Q.clientX;let Xe=$+(Ne-z);Xe=Math.max(0,Math.min(Xe,r));const Oe=Xe/r*100;n(23,I=Oe)}},F=Q=>{Q.currentTarget.releasePointerCapture(Q.pointerId),n(24,O=!1)},te=()=>{v&&n(23,I=void 0)},oe=Q=>{const Ne=I||a;if(!Q.ctrlKey&&!Q.shiftKey&&!Q.altKey){switch(Q.code){case"Space":n(23,I=void 0);return}if(b)switch(Q.code){case"ArrowUp":n(23,I=j(Ne-1));return;case"ArrowDown":n(23,I=j(Ne+1));return}else switch(Q.code){case"ArrowLeft":n(23,I=j(Ne-1));return;case"ArrowRight":n(23,I=j(Ne+1));return}}};function ke(){l=this.clientWidth,g=this.clientHeight,n(2,l),n(3,g)}function B(){w=this.clientWidth,d=this.clientHeight,n(4,w),n(5,d)}function he(){S=this.clientWidth,k=this.clientHeight,n(6,S),n(7,k)}function ae(){N=this.clientWidth,_=this.clientHeight,n(0,N),n(1,_)}return t.$$set=Q=>{"horizontal"in Q&&n(15,b=Q.horizontal),"initialPrimarySize"in Q&&n(16,T=Q.initialPrimarySize),"minPrimarySize"in Q&&n(17,x=Q.minPrimarySize),"minSecondarySize"in Q&&n(18,m=Q.minSecondarySize),"splitterSize"in Q&&n(19,y=Q.splitterSize),"resetOnDoubleClick"in Q&&n(20,v=Q.resetOnDoubleClick),"$$scope"in Q&&n(32,L=Q.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32771&&n(26,r=b?_:N),t.$$.dirty[0]&32780&&n(27,s=b?g:l),t.$$.dirty[0]&32816&&n(31,i=b?d:w),t.$$.dirty[0]&32960&&n(30,o=b?k:S),t.$$.dirty[0]&201326592|t.$$.dirty[1]&1&&n(25,a=j(Math.ceil((s-i)/(r-i)*100))),t.$$.dirty[0]&16809984&&G.set({horizontal:b,dragging:O}),t.$$.dirty[0]&1258291200|t.$$.dirty[1]&1&&P("changed",{percent:a,primarySize:s,splitterSize:i,secondarySize:o,dragging:O}),t.$$.dirty[0]&8454144&&n(29,u=I!==void 0?`${I}%`:T),t.$$.dirty[0]&537788416&&n(28,c={"--primary-size":`${u}`,"--min-primary-size":`${x}`,"--min-secondary-size":`${m}`,"--splitter-size":`${y}`}),t.$$.dirty[0]&268435456&&n(9,f=Object.entries(c).map(([Q,Ne])=>`${Q}:${Ne}`).join(";")),t.$$.dirty[0]&32768&&n(8,p=b?"split horizontal":"split vertical")},[N,_,l,g,w,d,S,k,p,f,C,V,F,te,oe,b,T,x,m,y,v,le,R,I,O,a,r,s,c,u,o,i,L,h,ke,B,he,ae]}class xr extends qe{constructor(e){super(),Ue(this,e,hs,fs,He,{horizontal:15,initialPrimarySize:16,minPrimarySize:17,minSecondarySize:18,splitterSize:19,resetOnDoubleClick:20,getPercent:21,setPercent:22},null,[-1,-1])}get getPercent(){return this.$$.ctx[21]}get setPercent(){return this.$$.ctx[22]}}function kn(t){let e,n=wn(t[1],t[2])+"",r;return{c(){e=new nn(!1),r=Ee(),this.h()},l(s){e=rn(s,!1),r=Ee(),this.h()},h(){e.a=r},m(s,i){e.m(n,s,i),X(s,r,i)},p(s,i){i&6&&n!==(n=wn(s[1],s[2])+"")&&e.p(n)},d(s){s&&E(r),s&&e.d()}}}function ds(t){let e,n=t[0]&&kn(t);return{c(){n&&n.c(),e=Ee()},l(r){n&&n.l(r),e=Ee()},m(r,s){n&&n.m(r,s),X(r,e,s)},p(r,[s]){r[0]?n?n.p(r,s):(n=kn(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:Ie,o:Ie,d(r){n&&n.d(r),r&&E(e)}}}function gs(t,e,n){let{observable:r=!1}=e,{component:s}=e,{code:i}=e;return t.$$set=o=>{"observable"in o&&n(0,r=o.observable),"component"in o&&n(1,s=o.component),"code"in o&&n(2,i=o.code)},[r,s,i]}let ms=class extends qe{constructor(e){super(),Ue(this,e,gs,ds,He,{observable:0,component:1,code:2})}};const bs=ms,_s=()=>typeof window<"u",an=_s(),ks=".modal-header{padding: 2px 16px;background-color: #339af0;color: white;}.modal-body{padding: 2px 16px;}.modal-footer{padding: 2px 16px;background-color: #339af0;color: white;}.modal-content{position: relative;background-color: #fefefe;margin: auto;padding: 0;border: 1px solid #888;width: 80%;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);animation-name: animateTop;animation-duration: 0.4s;}@keyframes animateTop {from {top: -300px; opacity: 0}to {top: 0; opacity: 1}}",Sr=an?document.createElement("style"):void 0;if(an){const t=Sr;t.textContent=ks,t.id="svelteui-inject"}function yn(t,e,n){return an&&document.head.appendChild(Sr),`