@celo/contractkit
Version:
Celo's ContractKit to interact with Celo network
39 lines • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CeloTokenWrapper = void 0;
require("bignumber.js");
const BaseWrapper_1 = require("./BaseWrapper");
const Erc20Wrapper_1 = require("./Erc20Wrapper");
/**
* Contract for Celo native currency that adheres to the ICeloToken and IERC20 interfaces.
*/
class CeloTokenWrapper extends Erc20Wrapper_1.Erc20Wrapper {
constructor() {
super(...arguments);
/**
* Returns the name of the token.
* @returns Name of the token.
*/
this.name = (0, BaseWrapper_1.proxyCall)(this.contract.methods.name);
/**
* Returns the three letter symbol of the token.
* @returns Symbol of the token.
*/
this.symbol = (0, BaseWrapper_1.proxyCall)(this.contract.methods.symbol);
/**
* Returns the number of decimals used in the token.
* @returns Number of decimals.
*/
this.decimals = (0, BaseWrapper_1.proxyCall)(this.contract.methods.decimals, undefined, BaseWrapper_1.valueToInt);
/**
* Transfers the token from one address to another with a comment.
* @param to The address to transfer the token to.
* @param value The amount of the token to transfer.
* @param comment The transfer comment
* @return True if the transaction succeeds.
*/
this.transferWithComment = (0, BaseWrapper_1.proxySend)(this.connection, this.contract.methods.transferWithComment);
}
}
exports.CeloTokenWrapper = CeloTokenWrapper;
//# sourceMappingURL=CeloTokenWrapper.js.map