Add Trails Actions iOS example#25
Open
tolgahan-arikan wants to merge 4 commits into
Open
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
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.
Summary
trails-actionsexample app.0xsequence/trails-api, generated locally with../gen-swift.GetEarnPoolsin the simulator.../typescript-sdk/examples/trails-actions, while using the Trails API directly because the0xtrails/actionscomposition layer exists only in TypeScript today.Suggested API path for next flows
QuoteIntentwith Polygon as origin and destination, POL/native as the origin token, Polygon USDC as the destination token, and.exactInput, then continue withCommitIntentandExecuteIntentonce wallet signing/submission is wired in.YieldGetMarketsto find an enterable Polygon USDC market, thenYieldCreateEnterActionwithCreateYieldActionRequest(earnMarketId:userWalletAddress:args:); submit the returned unsigned transactions through the wallet layer.YieldGetMarkets; longer term, either quote a POL -> USDCQuoteIntentwhose destination call targets the earn deposit call data or add a small Swift encoder equivalent to TypeScriptresolveActionsToCallsfor wrap, swap, and earn deposit. Until that exists, use the API-only two-step path:QuoteIntent/CommitIntent/ExecuteIntent, thenYieldCreateEnterAction.Test Plan
xcodebuild -project Examples/trails-actions/trails-actions.xcodeproj -scheme trails-actions -destination "platform=iOS Simulator,id=7E2BF282-B838-40E1-8A9E-57F17F8A7211" -derivedDataPath /tmp/trails-actions-derived CODE_SIGNING_ALLOWED=NO buildEarn API loadedwith 94 pools returned.swift test