forked from LooksRare/sdk-v2
-
Notifications
You must be signed in to change notification settings - Fork 1
Safe integration for creating marketplace listings #35
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
Merged
pheuberger
merged 8 commits into
hypercerts-org:main
from
pheuberger:listing-safe-integration
May 17, 2025
Merged
Safe integration for creating marketplace listings #35
pheuberger
merged 8 commits into
hypercerts-org:main
from
pheuberger:listing-safe-integration
May 17, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
997b366
to
eb41f3e
Compare
eb41f3e
to
76fb5c3
Compare
Jipperism
requested changes
Apr 8, 2025
Jipperism
reviewed
Apr 8, 2025
The TSDoc around bundleApprovalsForSafe() was missing a parameter and not very descriptive what it did.
Without this patch users of this SDK have no way to create marketplace listings from a Safe. This new function signs a maker order and uploads it to the Safe transaction service. There it can be executed by the other signers.
The function doesn't need these fields to compute validity. This only complicates things at the call-site. We should apply the Law of Demeter here.
Without this patch there's only the option to send both approval transactions in a bundle. This can be a problem when the Safe has one of the approvals but not both. Surely this is an edge case, but it did happen during development. The problem, here, is that the approval of the transfer manager will reject if it's already done. This could lead to users being stuck.
This function builds the Safe-specific payload to the API that only contains the chain id and message hash.
ab01a2c
to
54d572e
Compare
Jipperism
approved these changes
May 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support to create marketplace listings using a Safe.
It introduces a new class
SafeMessages
that deals with constructing, signing and uploading Safe messages to the Safe Transaction Service.On the exchange client it introduces a new function
signMakerOrderSafe()
that's supposed to be called by the users of this SDK.