moduleMyModule{ import 0x0.LibraCoin; // The identity function for coins: takes a LibraCoin.T as input and hands it back public id(c: LibraCoin.T): LibraCoin.T { return move(c);}}
usage: <command> <args>
Use the following commands:
account | a
Account operations
query | q
Query operations
transfer | transferb | t | tb
<sender_account_address>|<sender_account_ref_id> <receiver_account_address>|<receiver_account_ref_id> <number_of_coins> [gas_unit_price_in_micro_libras (default=0)] [max_gas_amount_in_micro_libras (default 100000)] Suffix 'b' is for blocking.
Transfer coins (in libra) from account to another.
dev
Local Move development
help | h
Prints this help
quit | q!
Exit this client
Please, input commands:
libra%
libra% account create
>> Creating/retrieving next account from wallet
Created/retrieved account #0 address 810abcc08dbed34ea15d7eb261b8001da6a62d72acdbf87714dd243a175f9b62
libra% account mintb 0 100
>> Minting coins
waiting ....transaction is stored!
Finished minting!
libra% dev compile 0 <path to my_module.mvir> module
Successfully compiled a program at /var/folders/tq/8gxrrmhx16376zxd5r4h9hhn_x1zq3/T/.tmpigAZCx
libra% dev publish 0 /var/folders/tq/8gxrrmhx16376zxd5r4h9hhn_x1zq3/T/.tmpigAZCx
waiting .....transaction is stored!
no events emitted.
Successfully published module
import 0x0.LibraAccount;
import 0x0.LibraCoin;
import {{sender}}.MyModule;
main(amount: u64) {
let coin: LibraCoin.T;
coin = LibraAccount.withdraw_from_sender(move(amount));
//calls the id procedure defined in our custom module
LibraAccount.deposit(get_txn_sender(), MyModule.id(move(coin)));
return;
}