Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

game13 source realm

Functions 57

func ActivateGnomePass

crossing Action
1func ActivateGnomePass(cur realm, durationDays int64)
source

ActivateGnomePass purchases a Gnome Pass for the caller. GNOT payment must be attached to the call (send field of MsgCall). The caller sends GNOT along with the transaction; this function verifies the amount. The GNOT stays in the realm and can be withdrawn by admin via WithdrawFunds(). Admin-only calls skip the payment check for testing.

func BanAddress

crossing Action
1func BanAddress(cur realm, targetAddr string, reason string, durationSecs int64)
source

BanAddress bans a player address. durationSecs=0 means permanent.

func BlacklistStatus

Action
1func BlacklistStatus(addr string) string
source

BlacklistStatus returns the ban status of an address as a JSON string.

func ClaimAndMint

crossing Action
1func ClaimAndMint(cur realm, coinsJson string)
source

ClaimAndMint records mined coins AND immediately credits them to balances. The caller pays their own gas (~0.03 GNOT). No treasury involvement. Replaces the two-step ClaimMine → mintPending flow for new players. Phase 6: treasury burn-rate fix — at 100 players using ClaimAndMint, the treasury pays ~0 GNOT/day (down from ~12 GNOT/day with the old two-step flow).

func ClaimMine

crossing Action
1func ClaimMine(cur realm, coinsJson string)
source

ClaimMine records mined coins into pending mints for the caller. coinsJson format: [["coinId","amount"],...]

func ClaimPvpTimeout

crossing Action
1func ClaimPvpTimeout(cur realm, lobbyId string)
source

ClaimPvpTimeout allows a lobby participant to claim a timeout win. Only the creator or challenger may call this. Phase 6: refunds the escrowed wager to all parties who contributed.

func ClearPendingMints

crossing Action
1func ClearPendingMints(cur realm, playerAddr string, coinsJson string)
source

ClearPendingMints is called by the treasury server after successful GRC20 minting. Removes pending balance and credits the player's spendable balances tree.

func CreatePvpLobby

crossing Action
1func CreatePvpLobby(cur realm, game string, coinId string, betAmount string) string
source

CreatePvpLobby creates a new PvP lobby and escrows the creator's wager from balances. Phase 6: wager > 0 deducts from balances and records the escrow in pvpWagers.

func CreateTask

crossing Action
1func CreateTask(cur realm, taskId string, desc string)
source

CreateTask registers a new task on-chain.

func GnomePassCount

crossing Action
1func GnomePassCount(cur realm) int
source

GnomePassCount returns the total number of addresses with an active pass (admin-only).

func GnomePassExpiry

Action
1func GnomePassExpiry(addr string) int64
source

GnomePassExpiry returns the unix timestamp when the pass expires (0 = no pass).

func HasActivePass

Action
1func HasActivePass(addr string) bool
source

HasActivePass returns true if the address has an active (non-expired) pass.

func JoinPvpLobby

crossing Action
1func JoinPvpLobby(cur realm, lobbyId string)
source

JoinPvpLobby joins an existing PvP lobby and escrows the challenger's matching wager. Phase 6: deducts challenger's matching wager from balances and updates pvpWagers.

func PlaceCasinoBet

crossing Action
1func PlaceCasinoBet(cur realm, roundId string, game string, coinId string, betAmount string, choice string, clientSeed string)
source

func RevealPvpMove

crossing Action
1func RevealPvpMove(cur realm, lobbyId string, choice string, salt string)
source

RevealPvpMove requires both players to have committed before either can reveal. Phase 6: when both players have revealed, determines the RPS winner and pays out 2× wager minus 2% rake to the winner. Draw = full refund to both players. pvpWagers.Remove is called after payout to prevent double-payouts.

func SetMinter

crossing Action
1func SetMinter(cur realm, newMinter string)
source

SetMinter registers the authorized minter realm address so it can call ClearPendingMints. Called once after minter5 is deployed.

func Transfer

crossing Action
1func Transfer(cur realm, coinId string, toAddr string, amountStr string)
source

Transfer sends coinId coins from the caller to toAddr directly on-chain. Both addresses must have interacted with the game realm at least once.

func WithdrawFunds

crossing Action
1func WithdrawFunds(cur realm)
source

WithdrawFunds is disabled on Onyx testnet (chain/banker not available). On mainnet, re-enable with banker.NewBanker(banker.BankerTypeRealmSend, cur).

Dependencies

Source Files 2