Reputation: 373
I need to call some other module functions (Those already published modules in aptos blockchain) in my move module.
Upvotes: 1
Views: 548
Reputation: 36
The dependencies section of your Move.toml allows you to specify packages, such as the Sui package, which needs a pointer to the correct github repository and branch:
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }
And then you would import that package and module into your module like so:
module my_package::my_module {
use sui::object::{Self, ID, UID};
}
Where sui
is the imported package, object is the imported module
, ID
, and UID
are structs in the module, and Self
allows you to reference the module functions (e.g. object::new()
)
Upvotes: 2