EOS合约内查询代币余额

2019-06-10 12:12:00
#include <eosiolib/eosio.token.hpp>   // right path to eosio.token.hpp file
void getBalance(account_name owner){
    eosio::token t(N(eosio.token));
    const auto sym_name = eosio::symbol_type(S(4,EOS)).name();
    const auto my_balance = t.get_balance(N(owner), sym_name );
    eosio::print("My balance is ", my_balance);
}

https://eosio.stackexchange.com/questions/375/how-can-i-get-my-contract-currency-balance-with-c-code?rq=1

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »