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);
};
import React, { useEffect } from 'react';
import { ensure } from '@universal-login/commons';
import { InvalidWalletState } from '@universal-login/sdk';
import { TopUp } from '../TopUp/TopUp';
export function OnboardingTopUp(props) {
    ensure(props.walletService.state.kind === 'Future', InvalidWalletState, 'Future', props.walletService.state.kind);
    var wallet = props.walletService.state.wallet;
    useEffect(function () {
        wallet.waitForBalance()
            .then(function () { return props.walletService.initDeploy(); })
            .catch(console.error);
    }, []);
    return (React.createElement(TopUp, __assign({}, props)));
}
//# sourceMappingURL=OnboardingTopUp.js.map