SelectAd
Ask AI
SelectAd returns the JSON of the winning campaign for the given viewer level, chosen by weighted auction (higher bid_per_view = proportionally more weight). Returns "null" if no eligible campaign exists.
NOTE: uses time.Now().UnixNano() % totalWeight as deterministic pseudo-random. Not cryptographic — sufficient for ad placement.
Command
gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g138gdmwj6heduu3st796lw6qqdwylgaxf7ty5gz/ads2.SelectAd()"
Result