标准库概述
有些库(也称为标准库或 stdlibs)与 Tact 编译器捆绑在一起,但不会自动包含到项目中,除非明确指定。
要导入任何标准库,请使用import关键字,然后在 string 中输入该库的名称,像这样:
// This would include everything from @stdlib/deploy into your codebase:import "@stdlib/deploy";标准库列表:
| 库 | 描述 | 常用的 API |
|---|---|---|
@stdlib/config | 配置和选举地址检索。 | getConfigAddress(), getElectorAddress() |
@stdlib/content | 将链下链接(link) strings 编码为cell。 | createOffchainContent() |
@stdlib/deploy | 统一的部署机制。 | Deployable, FactoryDeployable |
@stdlib/dns | 解析 DNS 名称。 | DNSResolver, dnsInternalVerify() |
@stdlib/ownable | 所有权管理的trait。 | Ownable, OwnableTransferable |
@stdlib/stoppable | 允许合约停止的 Traits。 需要 @stdlib/ownable。 | Stoppable, Resumable |