-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mine diamonds template #69
base: main
Are you sure you want to change the base?
Conversation
|
||
### user_valid_minted_assets | ||
|
||
Gets array of ERC1155 token of specified `user` that have been minted in a valid way -- meaning the `amount` and `assetTokenId`/`userTokenId` combination matches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matejos I guess this endpoint also includes transferred and brought tokens (not only minted ones)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the wording isn't the best, it's supposed to mean ERC1155 tokens (assets) that have been minted validly
- meaning their userTokenId
and amount
matches with the userTokenId
and amount
combination on the game side. This endpoint returns such ERC1155 tokens that are valid representations of the game event.
inputData.payload.seller.toLowerCase(), | ||
Number(inputData.payload.assetAmount), | ||
Number(inputData.payload.assetId), | ||
Number(inputData.payload.orderId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matejos Is there a reason why we let the user/frontend send the OrderID?
I see you have a ON CONFLICT(orderId) DO NOTHING;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using, for example a serial id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I said nothing, this comes from the orderbook contract events
case 'orderCreated': | ||
return orderCreated(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all stf inputs that come from contract events, we need to filter them - as a user could submit a input with the same signature 👁️
case 'orderCreated': | |
return orderCreated(input); | |
case 'orderCreated': | |
if (inputData.realAddress !== SCHEDULED_DATA_ADDRESS) { | |
console.log(`WARNING: Scheduled Events can only be called from paima-engine. Called by ${JSON.stringify(inputData)}`); | |
return []; | |
} | |
return orderCreated(input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, added!
No description provided.