-
Notifications
You must be signed in to change notification settings - Fork 39
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
Flow Swift SDK milestone-1, 2, 3, 4 #63
Conversation
@lmcmz can I ask you to open a PR on your repo so I can give some comments or feedback, if there is no PR I can't comment. The first general comment is about the documentation. I will provide you with a documentation template that you can use to fill out with swift code examples, this way the docs will be fully written without a lot of effort from your side. However it is highly recommended to document at least the client API functions so a specification can be autogenerated and a tool like jazzy can be used to generate specifications as a reference for others. |
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 is a great library with a great design. I don't have any major problems besides the documentation issues I have explained above and some minor questions/feedback, that I will share here.
Since there isn't a PR open I will paste links to the source.
https://github.com/zed-io/flow-swift/blob/main/Sources/Flow/Models/FlowTransaction.swift#L341
Should this be moved from models to a network layer? I think that would make sense because then the models would be API agnostic, whereas now they have implementation details for the grpc API.
https://github.com/zed-io/flow-swift/blob/main/Sources/Flow/Models/FlowTransaction.swift#L199
Shouldn't this actually be checking for equality == instead of >=? If the transaction goes to executed phase it shouldn't be pending. Similar question to some other comparison here.
https://github.com/zed-io/flow-swift/blob/main/Sources/Flow/Models/FlowId.swift#L43
maybe a bit confusing the first argument is in ms since the second is in seconds (subjective and minor).
Again great library and these are mostly minor things so I think after the docs are updated according to the examples I will sent it's good to go 🚀
Hi @sideninja Sorry for late reply. First of all, thanks for your feedback! Those are really great. 😻 As for the 3 questions you list above, let me give what I think: https://github.com/zed-io/flow-swift/blob/main/Sources/Flow/Models/FlowTransaction.swift#L341
https://github.com/zed-io/flow-swift/blob/main/Sources/Flow/Models/FlowTransaction.swift#L199 For those code, I was refer to fcl-js library. I guess it will be better to keep it consistent .
|
Hi, no worries. I was reading through the SDK and I must say it's really well written so I didn't really find lots of things to improve. Great work. |
Thanks a lot @sideninja , we have started investigating jazzy as you mentioned. It looks amazing. We will try to get it done in this week. 😋 |
Great, glad you like it, feel free to use any alternatives tho and you don't need to go overboard with specs if all API methods have specs that's sufficient. |
@lmcmz doing some more reading of the source code I think I've found a non-trivial issue. Transaction signing is done by using the sign method which is a great approach (I even think I will also adopt in Go SDK) as it hides the implementation complexity of signing payload vs signing envelope, BUT, user should be able to also do those two steps separately if they decide so. Imagine multiple party signatures where signing is done in multiple steps, although you can argue you can still just expose the sign method to support multiple invocation with different signers as arguments (and I even think that is a great argument) the fact is the current implementation of the sign method doesn't allow that if I'm not mistaken. |
Hi @lmcmz here is documentation template you should use for documenting your SDK https://github.com/onflow/sdks/tree/main/templates/documentation |
Hi @sideninja , Good point, you are right. The current implementation doesn't have the ability to separate those two steps. I will make a fix for it. But yeah, this SDK is lacking in usage in other projects. It needs more feedback to make it more accessible and easy to use in real business scenarios. By the way, we have deployed the jazzy here. We will add more documents to it. 😝 |
|
@lmcmz after the docs are done this is good to go in my opinion. |
merge in the PR per Gregor's comment |
Flow-Swift-SDK - Milestone 1, 2, 3, 4
This PR is for issue #20.
SDK repo
https://github.com/zed-io/flow-swift
Current Status
The flow-swift-SDK has completed all the essential part with test cases and example code. Some documentation has been added in the repo, we will add more documentation in the future. Moreover, we have created other swift SDK, which target for dapp and wallet app usage, fcl-swift and flow-wallet-kit which are dependent on flow-swift. However, those two SDKs are still working in progress.
Blocks:
Collections:
Events:
Scripts:
Accounts:
Transactions:
Milestones
Authors include: