-
Notifications
You must be signed in to change notification settings - Fork 212
feat: add .send() methods to message parameter structs #3056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add .send() methods to message parameter structs #3056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the changes to core-send.mdx have to be reversed + 3 new send functions added there. One moment.
UPD: Done, but I'm still not in favor of changing every usage example in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates documentation examples to use the new .send() method on SendParameters, MessageParameters, and DeployParameters structs instead of the former send() function. Key changes include:
- Replacing send(SendParameters { ... }) with SendParameters { ... }.send()
- Updating multiple Tact language documentation files to reflect this new API call style.
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/zh-cn/cookbook/dexes/stonfi.mdx | Updated swap message examples to use .send() method. |
| docs/src/content/docs/zh-cn/cookbook/dexes/dedust.mdx | Updated message sending examples to use .send() method. |
| docs/src/content/docs/zh-cn/book/send.mdx | Revised send examples to reflect new .send() chaining. |
| docs/src/content/docs/zh-cn/book/security-best-practices.mdx | Modified message sending examples to use .send() method. |
| docs/src/content/docs/zh-cn/book/message-mode.mdx | Adjusted examples to demonstrate the new .send() method usage. |
| docs/src/content/docs/zh-cn/book/maps.mdx | Updated loop message-sending examples with .send(). |
| docs/src/content/docs/zh-cn/book/contracts.mdx | Updated contract message examples to use .send() method. |
| docs/src/content/docs/ref/core-send.mdx | Expanded API documentation to include the .send() method details. |
| docs/src/content/docs/cookbook/single-communication.mdx | Updated internal message sending examples to use .send() method. |
| docs/src/content/docs/cookbook/nfts.mdx | Revised NFT transfer and message examples to use .send() method. |
| docs/src/content/docs/cookbook/jettons.mdx | Updated jetton transfer examples to use .send() method. |
| docs/src/content/docs/book/learn-tact-in-y-minutes.mdx | Updated several messaging examples to chain with .send(). |
| docs/src/content/docs/book/gas-best-practices.mdx | Minor update to reflect .send() method usage in examples. |
…ers-deployparameters-messageparameters' of https://github.com/tact-lang/tact into 3055-we-should-add-extends-send-function-to-sendparameters-deployparameters-messageparameters
…tends-send-function-to-sendparameters-deployparameters-messageparameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hold on, let's revert changes to the documentation in all places but the core-send.
I've previously vaguely expressed my concerns here, but now I am certain — we must not replace older examples with the new code that won't work for users until 1.7 is released, because docs here will be published immediately on merge, unlike Tact 1.7. Furthermore, not all users are on the latest version, and we still have many folks that use versions prior to 1.6.0.
novusnota
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sehr gut.
novusnota
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be actually semantically closer to what's going on with messages under the hood, we might want to rename the .send() to the .queue().
And in the end, perhaps we're looking at having a single msg {} statement instead of all those functions. That statement will compose the message declaratively, and then we'll be able to call .queue() on the resulting message cell, specifying the mode of sending.
Closes #3055