moonstream-to / web3

Moonstream game engine for blockchain games. Lootboxes, crafting, dropper, mini games that will enrich your game economy
20 stars 10 forks source link

Engine Dropper Api improvments #128

Open Andrei-Dolgolev opened 2 years ago

Andrei-Dolgolev commented 2 years ago

Current state:

1) Client request all terminus address and admin_pool_id wich exists in blockchain.

https://dropper.moonstream.to/drops/terminus?blockchain=polygon

[
    {
        "terminus_address": "0x062BEc5e84289Da2CD6147E0e4DA402B33B8f796",
        "terminus_pool_id": 0,
        "blockchain": "polygon"
    }...
]

2) Client check if user has balanceOf that tokens(from blockchain in terminus address). And cache that information. 3) Client request drops/terminus/claims?blockchain=&terminus_pool_id=&terminus_address= endpoint and for each of combinations cache it and render to user all drops wich return thth endpoint.

After refactor:

contracts: 1) Get contracts endpoint play/contracts?blockchain=&contract_interface=Dropper it's return: extend option: if is_admin=True in query parameters then return only contracts to which user has admin access.

            id=result.id,
            blockchain=result.blockchain,
            address=result.address,
            title=result.title,
            description=result.description,
            image_uri=result.image_uri,

drops: 1) Whenever get admin/drops?blockchain=&contract=&claimNumber= and that return all drops wich user can edit in that dropper contract. 2) admin/drops/{dropper_claim_id}/claimants

peersky commented 2 years ago

https://www.figma.com/file/XPYXQTN5TTwzMGTg3d7gkr/Drops-workflow?node-id=0%3A1

peersky commented 2 years ago
image
peersky commented 2 years ago

Based on sync meetup:

play/contracts also has query by contractType (Dropper, Terminus, etc etc) and contractVersion (v0, v1, etc, etc)