Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

rooms package

Overview

Package rooms is the on-chain trade window.

Two parties share a room. Each one puts assets on their own side: native coins (GNOT and any other bank denom), GRC20 tokens from the registry at gno.land/r/nt/grc20reg/v0, and GRC721 NFTs from collections registered with this realm (see RegisterCollection). The realm holds the deposits.

Every change to the room raises its version. A party locks the room by naming the exact version they reviewed, so a lock can never apply to contents the party has not seen. When both sides hold a lock on the current version, the second lock swaps everything in the same transaction: the maker's side goes to the taker and the taker's side goes to the maker.

Until that moment each party can withdraw their own deposits, and either party can cancel the room, which returns every deposit to its owner. An expired room can no longer settle; its deposits stay withdrawable, and anyone may cancel it to send them home.

A maker can also turn a room into an offer (see Offer): their side plus an exact list of what they want in return. The first account allowed to take the other seat that puts in exactly that list completes the trade in one transaction (see Fill).

On settlement the realm keeps a service fee on coins and tokens (see fee.gno); NFTs, withdrawals and cancellations pay nothing.

Function

WithdrawNFT

func WithdrawNFT(cur realm, roomID uint64, collectionKey string, tokenID string)
Ask AI Claude ChatGPT

WithdrawNFT returns one NFT from the caller's side to the caller. Same rules as WithdrawCoins: it works while the room is open, also after it has expired or while the realm is paused.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-tradewindow001/rooms" -func "WithdrawNFT" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-tradewindow001/rooms" -func "WithdrawNFT" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/nym-tradewindow001/rooms, for example a function call with arguments.