'use client'
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var utils = require('@dynamic-labs/utils');
require('@dynamic-labs-sdk/client/core');
require('@dynamic-labs/sdk-api-core');
require('../../../../../../client/client.cjs');
require('react');
require('@dynamic-labs-sdk/client');
require('../../../../../../config/ApiEndpoint.cjs');
require('@dynamic-labs/iconic');
require('@dynamic-labs/wallet-connector-core');
require('react/jsx-runtime');
require('../../../../../../context/ViewContext/ViewContext.cjs');
require('../../../../../../shared/logger.cjs');
require('@dynamic-labs/wallet-book');
require('../../../../../../utils/constants/colors.cjs');
require('../../../../../../utils/constants/values.cjs');
require('../../../../../../shared/consts/index.cjs');
require('../../../../../../../../_virtual/_tslib.cjs');
require('@dynamic-labs/multi-wallet');
require('react-international-phone');
require('../../../../../../store/state/nonce/nonce.cjs');
require('@dynamic-labs/locale');
require('../../../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../../../../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../../../../../../events/dynamicEvents.cjs');
var getProjectSettings = require('../../../../../../client/extension/projectSettings/getProjectSettings/getProjectSettings.cjs');

const getPromptAmountParams = ({ wallet, }) => {
    var _a, _b, _c, _d, _e, _f, _g;
    const walletChain = wallet.connector.connectedChain;
    const chainSettings = (_e = (_d = (_c = (_b = (_a = getProjectSettings.getProjectSettings()) === null || _a === void 0 ? void 0 : _a.sdk.funding) === null || _b === void 0 ? void 0 : _b.externalWallets) === null || _c === void 0 ? void 0 : _c.defaultSettings) === null || _d === void 0 ? void 0 : _d.chainSettings) === null || _e === void 0 ? void 0 : _e.find(({ chain }) => chain === walletChain);
    // This is always supposed to be present, otherwise there's some backend error
    if (!((_f = chainSettings === null || chainSettings === void 0 ? void 0 : chainSettings.token) === null || _f === void 0 ? void 0 : _f.value) || !((_g = chainSettings === null || chainSettings === void 0 ? void 0 : chainSettings.token) === null || _g === void 0 ? void 0 : _g.rule))
        throw new utils.DynamicError(`No wallet funding chain settings found for chain ${walletChain}`);
    return {
        token: {
            rule: chainSettings.token.rule,
            value: chainSettings.token.value,
        },
        wallet,
    };
};

exports.getPromptAmountParams = getPromptAmountParams;
