PHP WebShell

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

Просмотр файла: GoldTokenWrapper.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.GoldTokenWrapper = void 0;
require("bignumber.js");
var BaseWrapper_1 = require("./BaseWrapper");
var CeloTokenWrapper_1 = require("./CeloTokenWrapper");
/**
 * ERC-20 contract for Celo native currency.
 */
var GoldTokenWrapper = /** @class */ (function (_super) {
    __extends(GoldTokenWrapper, _super);
    function GoldTokenWrapper() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**
         * Increases the allowance of another user.
         * @param spender The address which is being approved to spend CELO.
         * @param value The increment of the amount of CELO approved to the spender.
         * @returns true if success.
         */
        _this.increaseAllowance = (0, BaseWrapper_1.proxySend)(_this.connection, _this.contract.methods.increaseAllowance, (0, BaseWrapper_1.tupleParser)(BaseWrapper_1.stringIdentity, BaseWrapper_1.valueToString));
        /**
         * Decreases the allowance of another user.
         * @param spender The address which is being approved to spend CELO.
         * @param value The decrement of the amount of CELO approved to the spender.
         * @returns true if success.
         */
        _this.decreaseAllowance = (0, BaseWrapper_1.proxySend)(_this.connection, _this.contract.methods.decreaseAllowance);
        /**
         * Gets the balance of the specified address.
         * WARNING: The actual call to the Gold contract of the balanceOf:
         * `balanceOf = proxyCall(this.contract.methods.balanceOf, undefined, valueToBigNumber)`
         * has issues with web3. Keep the one calling getBalance
         * @param owner The address to query the balance of.
         * @return The balance of the specified address.
         */
        _this.balanceOf = function (account) {
            return _this.connection.web3.eth.getBalance(account).then(BaseWrapper_1.valueToBigNumber);
        };
        return _this;
    }
    return GoldTokenWrapper;
}(CeloTokenWrapper_1.CeloTokenWrapper));
exports.GoldTokenWrapper = GoldTokenWrapper;
//# sourceMappingURL=GoldTokenWrapper.js.map

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


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