No blockchain knowledge required. No gas fees for your players. Just drop in our SDK and start accepting TRUECASH instantly — in any web game, Unity WebGL export, or React app.
One script tag — that's all. Works with any HTML page, React, Vue, or Unity WebGL export.
<!-- Add before your closing </body> tag -->
<script src="https://market.truecash.io/sdk/truecash-sdk.js"></script>
Create one SDK instance. Call connect() when the player clicks your "Connect Wallet" button.
// Initialize once (e.g. in your game's main.js)
const tc = new TrueCash({ network: 'bsc' });
// Connect player's wallet (call on button click)
const address = await tc.connect();
console.log('Player connected:', address);
// → "Player connected: 0xABCD...1234"
Call pay() when a player buys something. They sign a message in MetaMask — no BNB gas required.
// Player buys a Legendary Sword for 50 TRUECASH
const result = await tc.pay({
to: '0xYourGameWallet...', // your revenue wallet
amount: 50, // TRUECASH tokens
item: 'Legendary Sword' // shown in MetaMask
});
if (result.success) {
unlockSword(); // your game logic here!
console.log('TX:', result.explorerUrl);
}
A full shop screen — copy and paste this into any HTML file.
<!DOCTYPE html>
<html><body>
<button id="connectBtn">Connect Wallet</button>
<button id="buyBtn" disabled>Buy Sword (50 TRUECASH)</button>
<p id="status"></p>
<script src="https://market.truecash.io/sdk/truecash-sdk.js"></script>
<script>
const tc = new TrueCash({ network: 'bsc' });
const status = document.getElementById('status');
document.getElementById('connectBtn').addEventListener('click', async () => {
const addr = await tc.connect();
status.textContent = `Connected: ${addr.slice(0,6)}...`;
document.getElementById('buyBtn').disabled = false;
});
document.getElementById('buyBtn').addEventListener('click', async () => {
status.textContent = 'Waiting for signature...';
const result = await tc.pay({
to: '0xYourGameWallet...',
amount: 50,
item: 'Legendary Sword'
});
status.textContent = result.success
? `⚔️ Sword unlocked! TX: ${result.txHash.slice(0,10)}...`
: 'Payment failed.';
});
</script>
</body></html>
new TrueCash(config)
Creates a new SDK instance. Call once per page.
await tc.connect()
→ Promise<string>
Connects the player's MetaMask wallet. Automatically switches to BSC network. Returns the wallet address.
await tc.pay({ to, amount, item })
→ Promise<Result>
Signs and submits a zero-gas TRUECASH payment via the Paymaster.
await tc.getBalance(address?)
→ Promise<number>
Returns the TRUECASH balance for any address. Defaults to the connected wallet.
tc.onPayment(callback)
Register a callback for successful payments. Chainable: tc.onPayment(fn).onError(fn2)
Any HTML5/JavaScript game. Drop the script tag in, works instantly.
Export your Unity game to WebGL and call the SDK via jslib plugins.
Import and use in any modern frontend framework.
No — that's the whole point. The TrueCash Paymaster covers 100% of gas fees on behalf of your players. They only need TRUECASH tokens in their wallet.
The SDK is free. The Paymaster covers gas costs for your players. You receive 100% of every TRUECASH payment directly to your wallet.
Players can buy TRUECASH in our presale at truecash.io, or on PancakeSwap after the DEX launch. You can link your players directly to the presale page.
Players need at least 2,000 TRUECASH in their wallet to use zero-gas payments. This is an anti-spam measure. The SDK automatically checks this and shows a friendly error if the balance is too low.
Yes! Pass network: 'bsc_testnet' to the constructor and set your own testnet contract addresses in the config.