-
Notifications
You must be signed in to change notification settings - Fork 247
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
feat_: share and parse transaction deep link #5959
base: develop
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
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.
Is this going to be supported by status-web?
@@ -45,11 +45,21 @@ type ContactURLData struct { | |||
PublicKey string `json:"publicKey"` | |||
} | |||
|
|||
type TransactionURLData struct { | |||
TxType int `json:"txType"` |
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 think tx
is redundant here, it's all about the transaction?
TxType int `json:"txType"` | |
type int `json:"type"` |
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 100% agree with you. The reason why I set it to txType to prevent any issues of type
keyword that might happen on any layer.
While it might be redundant, I wanted to clearly point it is about transaction not url type or something like that.
@@ -302,6 +314,77 @@ func (m *Messenger) prepareEncodedCommunityChannelData(community *communities.Co | |||
return encodedData, shortKey, nil | |||
} | |||
|
|||
func (m *Messenger) ShareTransactionURL(request *requests.TransactionShareURL) (string, error) { |
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.
So to build the transaction URL, I need to know all details about it?
But most probably all of the details about the transaction are already somewhere in our database, can we just pass the transaction hash here and status-go will collect all required data?
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.
This feature creates link from the modal, not existing transaction. It is to request the payment by setting proper fields.
Please note that not all the fields are required.
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.
It is to request the payment
wait, so there's no transaction yet? Should we call this transactionRequest
then?
I can simply imagine a URL to the actual transaction 🤔
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## develop #5959 +/- ##
===========================================
+ Coverage 47.21% 47.45% +0.23%
===========================================
Files 832 835 +3
Lines 137644 137789 +145
===========================================
+ Hits 64985 65381 +396
+ Misses 65175 64633 -542
- Partials 7484 7775 +291
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Nice work. Just one question
if r.TxType < 0 { | ||
return ErrInvalidTransactionType | ||
} | ||
|
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.
Should we also validate that the address is not empty for example?
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.
Not really. It might be changed by design team, but right now, deep link can be created without recipient. For example Swap doesn't have recipient.
I don't see the reason why I couldn't share tx setup for specific token, it is much easier than copy pasting name.
Task status-im/status-desktop#16412
User stories https://www.notion.so/Transaction-deep-link-10d8f96fb65c803c85fed5f4440ad439
Status-desktop change: status-im/status-desktop#16543
Changes:
Added generation of parsing of deep link for transactions
Updated unit tests