"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importStar(require("react"));
var commons_1 = require("@universal-login/commons");
var sdk_1 = require("@universal-login/sdk");
var TopUp_1 = require("../TopUp/TopUp");
function OnboardingTopUp(props) {
    commons_1.ensure(props.walletService.state.kind === 'Future', sdk_1.InvalidWalletState, 'Future', props.walletService.state.kind);
    var wallet = props.walletService.state.wallet;
    react_1.useEffect(function () {
        wallet.waitForBalance()
            .then(function () { return props.walletService.initDeploy(); })
            .catch(console.error);
    }, []);
    return (react_1.default.createElement(TopUp_1.TopUp, __assign({}, props)));
}
exports.OnboardingTopUp = OnboardingTopUp;
//# sourceMappingURL=OnboardingTopUp.js.map