PEKSino - Betting Logic

avatar
(Edited)

I’ve been pretty quiet lately because I got hit with a brutal flu that put me down for a few weeks, and at the same time I’ve been packing to move since my lease isn’t being renewed. Between being sick and dealing with the logistics of relocating, I haven’t had the bandwidth to post everything I’ve been working on. That said, development hasn’t stopped. I’m actively organizing the next phase, including exploring decentralized betting platforms beyond Hive Engine and potentially integrating other DEXs down the line. The workload on this kind of infrastructure is massive, so right now the focus is getting things structured correctly before expanding further. More updates soon.

// betting_logic.js
// Handles placing a bet using Hive Keychain and notifies the backend for bet logging
// Usage: placeBet(casinoUser, 'peakecoin.matic', amount, 'Game memo', callback)

function placeBet(from, to, amount, memo, callback) {
    if (!window.hive_keychain) {
        alert('Hive Keychain extension is required.');
        if (callback) callback({success: false, error: 'No Keychain'});
        return;
    }
    window.hive_keychain.requestCustomJson(
        from,
        'ssc-mainnet-hive',
        'Active',
        JSON.stringify({
            contractName: 'tokens',
            contractAction: 'transfer',
            contractPayload: {
                symbol: 'PEK',
                to: to,
                quantity: String(amount),
                memo: memo || ''
            }
        }),
        'Place PEK Bet',
        function(response) {
            if (callback) callback(response);
            if (response.success) {
                alert('Bet placed! TXID: ' + response.result.id);
                // Notify backend for bet logging
                logBetToBackend(from, to, amount, memo, response.result.id);
            } else {
                alert('Bet failed or was rejected.');
            }
        }
    );
}

// Optional: log bet to backend for audit/provable fairness
function logBetToBackend(from, to, amount, memo, txid) {
    fetch('http://74.208.146.37/peksino/log_bet', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
            from: from,
            to: to,
            amount: amount,
            memo: memo,
            txid: txid
        })
    });
}

🪙 PeakeCoin Ecosystem

💱 PeakeCoin USDT Bridge (Hive ↔ Polygon/MATIC)
Bridge SWAP.USDT from Hive Engine to USDT on Polygon (MATIC).
Whitelist access, documentation, and bridge status updates:
👉 https://geocities.ws/peakecoin


⚙️ HiveP.I.M.P. — PeakeCoin Intelligent Market Protector
Operated by @hivepimp, P.I.M.P. stabilizes PEK markets and supports liquidity on Hive Engine.
Community liquidity participation strengthens long-term market health.
📈 Open-source code, bots, and documentation:
👉 https://github.com/paulmoon410


🎰 PeakeSino — The PeakeCoin Casino (Beta)
Blockchain-powered games using PEK as the native in-game currency.
Built on Hive with a focus on provable fairness and community-driven growth.
🃏 Play the beta games here:
👉 https://geocities.ws/peakecoin/pek_casino/beta_games/index.html


🙏 Acknowledgements

Thanks to and please follow:
@enginewitty @ecoinstant @neoxian @txracer @thecrazygm @holdonia @aggroed

For their continued support, guidance, and help expanding the PeakeCoin ecosystem.




0
0
0.000
0 comments