Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: XPD - Do more with your PerlMonks XP

by cavac (Parson)
on Apr 05, 2022 at 11:54 UTC ( [id://11142704]=note: print w/replies, xml ) Need Help??


in reply to Re: XPD - Do more with your PerlMonks XP
in thread XPD - Do more with your PerlMonks XP

  • Yeah, the transactions happen in a background worker. I'm working on a way to update the list when the sale actually happens. But that is still in the early design stages.
  • The "market" list filters out your own items, so you don't accidently buy from yourself. You can filter or sort the "Market" column in "My NFT" to see your listings.
  • The lists (My NFT, Market, etc) are pre-filtered (server side forced filters) lists. So the label at the bottom gets a bit confused. I'll have to fix that some day, but my ListAndEdit module isn't the easiest to maintain. It's super practical and i use it a lot, but over the years of extending it the code has had a bit of a spaghettification problem..

On the bright side, you can use ListAndEdit to just configure complex webmasks without writing code. For example, here is all i needed to implement the whole of "My NFT":

<module> <modname>xpd_user_nft</modname> <pm>ListAndEdit::Main</pm> <options> <db>maindb</db> <pagetitle>My NFT</pagetitle> <webpath>/xpd/nft/mynft</webpath> <table>xpd.nft</table> <primarykey> <item column="nft_id"/> </primarykey> <orderby>creation_time DESC</orderby> <session>sessionsettings</session> <guess_stats>1</guess_stats> <column_filters>1</column_filters> <candelete>0</candelete> <cancreate>0</cancreate> <useserial>0</useserial> <list> <item header="ID" column="nft_id" type="text"/> <item header="Time" column="creation_time" type="date" +/> <item header="Creator" column="creator" type="text"/> <item header="Title" column="title" type="text"/> <item header="Description" column="description" type=" +text"/> <item header="Image" column="image_data_base64" type=" +image"/> <item header="Price" column="sale_price" type="text"/> <item header="Market" column="sell_on_market" type="bo +olean"/> </list> <edit> <item header="ID" column="nft_id" type="display"/> <item header="Time" column="creation_time" type="displ +ay"/> <item header="Creator" column="creator" type="display" +/> <item header="Title" column="title" type="display"/> <item header="Description" column="description" type=" +display"/> <item header="Image" column="image_data_base64" type=" +imagedisplay"/> <item header="Sell on market" column="sell_on_market" +type="checkbox"/> <item header="Price" column="sale_price" type="number" + value_min="0" value_max="1000000" step="1" hasdecimal="0"/> </edit> <restrict> <item column="owner" value="USER"/> </restrict> </options> </module>

The downside is that it takes a couple of big statemachines and a lot on startup validation&preparation code to make that work. For example, it checks against the configured database table and matches if the configured display/edit type is compatible with the column type.

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11142704]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-18 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found