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.
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.
Changes
Queries and responses on
/contracts/requests
now showcontract_address
Now the caller can specify
contract_id
orcontract_address
as a query parameter.At least one of those parameters should be provided.
registered_contract_id
in response is nowcontract_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 addressThis 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
toPOST /contracts/
This makes the API more RESTful.
POST /contracts/
documentation showscontract_type
as an enumPreviously, 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/contracts/requests
call_requests
using contract ID or contract addressUnique constraint on
registered_contracts
modified to includemoonstream_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 SQLAlso 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.