跳转到内容

标准库概述

有些库(也称为标准库或 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 编码为cellcreateOffchainContent()
@stdlib/deploy统一的部署机制。Deployable, FactoryDeployable
@stdlib/dns解析 DNS 名称。DNSResolver, dnsInternalVerify()
@stdlib/ownable所有权管理的trait。Ownable, OwnableTransferable
@stdlib/stoppable允许合约停止的 Traits。 需要 @stdlib/ownableStoppable, Resumable