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

Multiple Dropper v0.2.0 API improvements #299

Closed zomglings closed 1 year ago

zomglings commented 1 year ago

Changes

Queries and responses on /contracts/requests now show contract_address

Now the caller can specify contract_id or contract_address as a query parameter.

At least one of those parameters should be provided.

registered_contract_id in response is now contract_id.

The response also contains a contract_address field.

Resolves https://github.com/bugout-dev/engine/issues/283

Create call_requests using contract ID or contract address

This change allows users to create call requests by posting to /contracts/requests with a JSON body which contains a "contract_id" key or a "contract_address" key.

This change also removes the old /contracts/<contract_id>/requests POST endpoint.

Resolves https://github.com/bugout-dev/engine/issues/298

Moved POST /contracts/register to POST /contracts/

This makes the API more RESTful.

POST /contracts/ documentation shows contract_type as an enum

Previously, this parameter of the request body was being displayed as a string.

Resolves https://github.com/bugout-dev/engine/issues/276

Allow users to edit registered contracts

added a PUT /contracts/<contract_id> endpoint, which allows users to modify the title, description, and image URI for a contract. These changes only apply to the Moonstream Engine API.

Resolves https://github.com/bugout-dev/engine/issues/296

Updated waggle to respect new API changes

Unique constraint on registered_contracts modified to include moonstream_user_id

This allows different users to register the same contract under their respective accounts.

Resolves https://github.com/bugout-dev/engine/issues/295

ttl_days is not longer directly inserted into raw SQL

Also fixed a bug on how the list call requests endpoint handled call requests with null expires_at fields - it led to a 500 error before.

Resolves https://github.com/bugout-dev/engine/issues/300

How to test these changes?

Tested manually.

zomglings commented 1 year ago

@bugout-dev check

zomglings commented 1 year ago

Migration complete: https://bugout.dev/app/personal/9faa9429-aaa4-4d0b-a68d-db9fbb65ad71/entries/388dd799-d1a3-4a4e-836a-f54fff36bd2d/