@@ -232,9 +232,35 @@ To be documented...
232232
233233### Boxes
234234
235- To be documented.. .
235+ The higher-level Boxes interface, introduced in version 2.1.0, along with all low-level Box 'op' calls, are available .
236236
237- > NOTE: Higher level Boxes interface introduce in v2.1.0 is not supported yet, however all low level Box 'op' calls are available.
237+ ``` py
238+ import algopy
239+
240+ # Check and mark the sender's POA claim in the Box by their address
241+ # to prevent duplicates using low-level Box 'op' calls.
242+ _id, has_claimed = algopy.op.Box.get(algopy.Txn.sender.bytes)
243+ assert not has_claimed, " Already claimed POA"
244+ algopy.op.Box.put(algopy.Txn.sender.bytes, algopy.op.itob(minted_asset.id))
245+
246+ # Utilizing the higher-level 'Box' interface for an alternative implementation.
247+ box = algopy.Box(algopy.UInt64, key = algopy.Txn.sender.bytes)
248+ has_claimed = bool (box)
249+ assert not has_claimed, " Already claimed POA"
250+ box.value = minted_asset.id
251+
252+ # Utilizing the higher-level 'BoxRef' interface for an alternative implementation.
253+ box_ref = algopy.BoxRef(key = algopy.Txn.sender.bytes)
254+ has_claimed = bool (box_ref)
255+ assert not has_claimed, " Already claimed POA"
256+ box_ref.put(algopy.op.itob(minted_asset.id))
257+
258+ # Utilizing the higher-level 'BoxMap' interface for an alternative implementation.
259+ box_map = algopy.BoxMap(algopy.Bytes, algopy.UInt64, key_prefix = " box_map" )
260+ has_claimed = algopy.Txn.sender.bytes in self .box_map
261+ assert not has_claimed, " Already claimed POA"
262+ self .box_map[algopy.Txn.sender.bytes] = minted_asset.id
263+ ```
238264
239265## Smart Signatures
240266
0 commit comments