帖子
分享您的知识。
答案
124p30p69
Jul 9 2025, 21:04你目前正在使用deepbook::clob::place_limit_order
属于该协议旧版本的已弃用的 DeepBook 函数 (). 要切换到DeepBook V3,你需要在中更新依赖项Move.toml
以指向正确版本的DeepBook软件包,并将所有旧的函数调用替换为新的兼容v3的API. DeepBook V3 引入了更新的模块和函数名称,这意味着使用 V3 不仅仅是更新 git 引用,还涉及在 Move 代码中调用更新的逻辑.
为了确保你使用的是 DeepBook V3,请在Move.toml
文件中像这样更新你的依赖关系:
[dependencies]
DeepBook = { git = "https://github.com/MystenLabs/deepbook-v3.git", rev = "main" }
或者,如果 DeepBook V3 现在是 Sui 框架主存储库的一部分,则应指向正确的子目录并提交,其中包含 V3. 例如:
[dependencies]
DeepBook = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/deepbook", rev = "framework/mainnet" }
更新依赖项后,运行:
sui move build
然后,在你的 Move 模块中,将过时的调用(例如deepbook::clob::place_limit_order
替换为 DeepBook V3 提供的更新函数). 你可以在 DeepBook GitHub 存储库 或 Sui 框架存储库 中找到最新的函数名称和使用模式.
务必仔细检查更新的结构定义或新的交易模式. 如果需要,使用这样的交易区块在前端调用更新后的函数:
const tx = new TransactionBlock();
tx.moveCall({
target: '0xDeepBookPackage::v3_module::place_limit_order_v3',
arguments: [
tx.object('0xPool'),
tx.pure(1000), // price
tx.pure(50), // quantity
tx.pure(true), // is_bid
tx.pure(expiryTime), // expiration
tx.pure(0), // restriction
tx.object('0xClock'), // clock reference
],
});
查看最新的 DeepBook 文档或源代码以验证参数类型和目标函数名称. 如需持续更新,请访问 https://docs.sui.io 或在 DeepBook 存储库中跟踪问题和更新.
0
评论
你知道答案吗?
请登录并分享。
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
394帖子554答案

奖励活动七月
- ... SUIMeaning.Sui+22
- ... SUI0xduckmove+17
- ... SUIMoonBags+11
- ... SUIHaGiang+10
- ... SUI
- ... SUIAliabee+5
- ... SUIBekky+5