ic-canister-kit 0.3.21

An ic canister package
Documentation
[package]
name = "ic-canister-kit"
version = "0.3.21"
edition = "2021"
license = "Apache-2.0"
readme = "README.md"
include = ["src", "Cargo.toml", "LICENSE", "README.md"]
description = "An ic canister package"
authors = ["Anubis Awooo"]
repository = "https://github.com/AnubisAwooo/ic-canister-kit"

# [lib]
# path = "src/lib.rs"
# crate-type = ["cdylib"]

[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1

[features]
default = ["without_nft"]

# 和身份相关的
identity = ["candid", "ic-cdk", "sha2", "crc32fast", "hex"] # 身份相关

# 和罐子相关的
canister_cycles = ["candid", "serde"] # 罐子余额
canister_status = ["identity"] # 罐子状态
canister_create = ["identity"] # 罐子创建
canister_settings = ["identity"] # 罐子设置
canister_codes = ["identity"] # 罐子代码
canister_deploy = [
    "canister_status",
    "canister_create",
    "canister_codes",
] # 罐子部署
canister_call = ["identity"] # 罐子调用
canister_candid = ["canister_call"] # 罐子Candid
canister_managed = [
    "canister_cycles",
    "canister_status",
    "canister_codes",
    "canister_deploy",
] # 管理罐子

# 和数字相关的
number_random = ["ic-cdk"]                       # 随机数
number_mix = ["number_random", "sha2", "base32"] # 混合数字

# 代币相关
token_ledger = ["identity", "serde"] # Ledger 标准
token_icrc1 = ["identity", "serde"]  # ICRC1 标准

# 时间相关
times = ["ic-cdk"]                             # 时间相关
times_schedulable = ["times", "ic-cdk-timers"] # 时间相关

# 通用工具
common_pages = []          # 分页查询
common_result = ["candid"] # 结果类型

# http
http = ["candid", "serde", "serde_json"] # http 相关

# 持久化
stable = ["candid"]
stable_initial = ["stable"] # 初始化
stable_upgrade = ["stable"] # 升级
stable_maintainable = ["stable"] # 维护
stable_permissable = ["stable", "canister_call", "times_schedulable"] # 权限
stable_recordable = [
    "stable",
    "times_schedulable",
    "common_pages",
    "canister_call",
] # 日志记录
stable_notifiable = ["stable", "times"] # 通知信息
stable_uploads = ["stable"] # 分片上传
stable_hashmap = ["stable"] # HashMap

# NFT相关
nft = ["identity"]   # NFT
nft_ext = ["nft"]    # NFT EXT 标准
nft_ticket = ["nft"] # NFT 是否具有门票功能
nft_limit = ["nft"]  # NFT 是否限制指定时间的功能
nft_traits = ["nft"] # NFT 的属性记录

# candid 类型
candid_type = []

all = [
    "identity",
    "canister_cycles",
    "canister_status",
    "canister_create",
    "canister_settings",
    "canister_codes",
    "canister_deploy",
    "canister_call",
    "canister_candid",
    "canister_managed",
    "number_random",
    "number_mix",
    "token_ledger",
    "token_icrc1",
    "times",
    "times_schedulable",
    "common_pages",
    "common_result",
    "http",
    "stable",
    "stable_initial",
    "stable_upgrade",
    "stable_maintainable",
    "stable_permissable",
    "stable_recordable",
    "stable_notifiable",
    "stable_uploads",
    "stable_hashmap",
    "nft",
    "nft_ext",
    "nft_ticket",
    "nft_limit",
    "nft_traits",
    "candid_type",
]

without_nft = [
    "identity",
    "canister_cycles",
    "canister_status",
    "canister_create",
    "canister_settings",
    "canister_codes",
    "canister_deploy",
    "canister_call",
    "canister_candid",
    "canister_managed",
    "number_random",
    "number_mix",
    "token_ledger",
    "token_icrc1",
    "times",
    "times_schedulable",
    "common_pages",
    "common_result",
    "http",
    "stable",
    "stable_initial",
    "stable_upgrade",
    "stable_maintainable",
    "stable_permissable",
    "stable_recordable",
    "stable_notifiable",
    "stable_uploads",
    "stable_hashmap",
    "candid_type",
]

[dependencies]
candid = { version = "0.9.3", optional = true }
ic-cdk = { version = "0.11.3", optional = true }
ic-cdk-timers = { version = "0.5.1", optional = true } # 定时器

sha2 = { version = "0.10.6", optional = true }     # hash
crc32fast = { version = "1.3.2", optional = true } # 循环校验
hex = { version = "0.4.3", optional = true }       # 16进制

base32 = { version = "0.4.0", optional = true } # base32 加密解密

serde = { version = "1", optional = true, features = ["derive"] } # 序列化/反序列化框架
serde_json = { version = "1.0.95", optional = true }              # json

# ic-kit = "0.4.8"
# cap-sdk = "0.2.4"
# cap-sdk-core = "0.2.3"