{

        return new Promise(resolve => setTimeout(resolve, ms));
    }

    async function getMaxFeeRate() {
        let fees = await getData("https://mempool.space/" + mempoolNetwork + "api/v1/fees/recommended");
        fees = JSON.parse(fees);
        // if ( !( "minimumFee" in fees ) ) return "error -- site down";
        // var minfee = fees[ "minimumFee" ];
        if (!("fastestFee" in fees)) return "error -- site down";
        let maxfee = fees["fastestFee"];
        return maxfee;
    }

    asy