'use client'
import { DynamicError } from '@dynamic-labs/utils';
import '@dynamic-labs-sdk/client/core';
import '@dynamic-labs/sdk-api-core';
import '../../../../../../client/client.js';
import 'react';
import '@dynamic-labs-sdk/client';
import '../../../../../../config/ApiEndpoint.js';
import '@dynamic-labs/iconic';
import '@dynamic-labs/wallet-connector-core';
import 'react/jsx-runtime';
import '../../../../../../context/ViewContext/ViewContext.js';
import '../../../../../../shared/logger.js';
import '@dynamic-labs/wallet-book';
import '../../../../../../utils/constants/colors.js';
import '../../../../../../utils/constants/values.js';
import '../../../../../../shared/consts/index.js';
import '../../../../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import 'react-international-phone';
import '../../../../../../store/state/nonce/nonce.js';
import '@dynamic-labs/locale';
import '../../../../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../../../../../../events/dynamicEvents.js';
import { getProjectSettings } from '../../../../../../client/extension/projectSettings/getProjectSettings/getProjectSettings.js';

const getPromptAmountParams = ({ wallet, }) => {
    var _a, _b, _c, _d, _e, _f, _g;
    const walletChain = wallet.connector.connectedChain;
    const chainSettings = (_e = (_d = (_c = (_b = (_a = 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 DynamicError(`No wallet funding chain settings found for chain ${walletChain}`);
    return {
        token: {
            rule: chainSettings.token.rule,
            value: chainSettings.token.value,
        },
        wallet,
    };
};

export { getPromptAmountParams };
