-
Notifications
You must be signed in to change notification settings - Fork 21
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
Smart contract sdk support #508
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
54be3f3
Merge pull request #500 from xmtp/np/update-beta-with-main
nplasterer 4d9d018
bump the pod
nplasterer af4486b
Merge branch 'main' of https://github.com/xmtp/xmtp-react-native into…
nplasterer 6383b9c
Merge pull request #507 from xmtp/np/merge-main-beta
nplasterer 27e5aec
Merge branch 'beta' of https://github.com/xmtp/xmtp-react-native into…
nplasterer 8c6a186
add chainId and isSmartContractWallet fields
nplasterer 37b9271
add interface for signer
nplasterer 268e461
pass the fields to the signer
nplasterer 2c72d55
get the create the build
nplasterer 6bb9427
Update signer
rygine 1fa7b37
Update swift
rygine a10db52
cherry pick all the commits from the other PR
nplasterer f47bcc7
make this cleaner
nplasterer 3dd9161
get on the latest version of the backend
nplasterer 5100167
Android side
nplasterer 9249818
allow block number to be null
nplasterer e00a62e
latest libxmtp
nplasterer c1ebdf2
update android and the methods
nplasterer f8a820c
try and get the iOS side matching
nplasterer 1094e05
Merge branch 'main' of https://github.com/xmtp/xmtp-react-native into…
nplasterer 3d8063d
point to the potential future gradle
nplasterer ed81adf
fix: optional field follows non-optional
peterferguson 711f55f
Merge branch 'np/smart-contract-sdk-support' into sca-patch
peterferguson 70461f4
fix chainId ternary
peterferguson 1febd29
sig should be a string
peterferguson e7454f0
Merge pull request #515 from peterferguson/pf/np/smart-contract-sdk-s…
nplasterer 4fc885c
change to wallet type and import latest libxmtp
nplasterer a6ca322
Merge branch 'np/smart-contract-sdk-support' of https://github.com/xm…
nplasterer 1ccaec4
bad merge
nplasterer 8ac19bb
do the ios side
nplasterer dc4de41
int instead of uint
nplasterer fd6e6d1
fix the signer
nplasterer b42a54b
get iOS compiling correctyl
nplasterer 93bd230
Merge branch 'main' of https://github.com/xmtp/xmtp-react-native into…
nplasterer bf43701
add back limit
nplasterer 230db03
fix: ios type <-> walletType field name mismatch
peterferguson 74c82dd
Merge pull request #516 from peterferguson/pf/np/smart-contract-sdk-s…
nplasterer 7d6d62d
feat: Smart Contract Wallet Support
nplasterer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 don't think we need the block number to be stored on the signer. That should get resolved at the time of signing, not on instantiation, since the block number keeps incrementing.
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.
We store it on the
SigningKey
so it only gets passed in from theSigningKey
which means we only have it when the signing key is present which is only when something is being signed. Unfortunately with the bridge this is how it has to be passed. But this and the below shouldn't be exposed to users so it should be an internal matter.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.
OK. I can approve the PR. Still feels wrong to get that block number even one second before we actually sign the message, since it's going to be older than the block the signature was actually generated on.
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.
Hmmm okay maybe we need to rethink how I have this setup inside the other sdks as well. 🤔
As they all work the same with the block number as part of the signingKey https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/SigningKey.kt#L31-L34 But maybe it should be passed as a param to create instead?
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.
Ideally it would get pulled from the chain at the same time you are signing the message.
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.
Another way of thinking about it would be to have a
getBlockNumber
method that is only implemented on SCWs, which we could call from our SDKs when we are gathering a smart contract signature.