PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/contractkit/lib/wrappers

Просмотр файла: CeloTokenWrapper.js

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CeloTokenWrapper = void 0;
// NOTE: removing this import results in `yarn build` failures in Dockerfiles
// after the move to node 10. This allows types to be inferred without
// referencing '@celo/utils/node_modules/bignumber.js'
require("bignumber.js");
var BaseWrapper_1 = require("./BaseWrapper");
var Erc20Wrapper_1 = require("./Erc20Wrapper");
/**
 * Contract for Celo native currency that adheres to the ICeloToken and IERC20 interfaces.
 */
var CeloTokenWrapper = /** @class */ (function (_super) {
    __extends(CeloTokenWrapper, _super);
    function CeloTokenWrapper() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**
         * 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);
        return _this;
    }
    return CeloTokenWrapper;
}(Erc20Wrapper_1.Erc20Wrapper));
exports.CeloTokenWrapper = CeloTokenWrapper;
//# sourceMappingURL=CeloTokenWrapper.js.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!