Skip to content

Add Trails Actions iOS example#25

Open
tolgahan-arikan wants to merge 4 commits into
masterfrom
add-trails-actions-ios-example
Open

Add Trails Actions iOS example#25
tolgahan-arikan wants to merge 4 commits into
masterfrom
add-trails-actions-ios-example

Conversation

@tolgahan-arikan
Copy link
Copy Markdown
Contributor

Summary

  • Adds a standalone iOS SwiftUI trails-actions example app.
  • Includes the generated Trails API Swift client from 0xsequence/trails-api, generated locally with ../gen-swift.
  • Verifies the generated client by loading Earn pools from GetEarnPools in the simulator.
  • Sets this up as prep work for a Swift example with functionality similar to ../typescript-sdk/examples/trails-actions, while using the Trails API directly because the 0xtrails/actions composition layer exists only in TypeScript today.

Suggested API path for next flows

  • POL -> USDC swap on Polygon: use QuoteIntent with Polygon as origin and destination, POL/native as the origin token, Polygon USDC as the destination token, and .exactInput, then continue with CommitIntent and ExecuteIntent once wallet signing/submission is wired in.
  • USDC deposit on Polygon: use YieldGetMarkets to find an enterable Polygon USDC market, then YieldCreateEnterAction with CreateYieldActionRequest(earnMarketId:userWalletAddress:args:); submit the returned unsigned transactions through the wallet layer.
  • Swap + deposit: first select the USDC earn market with YieldGetMarkets; longer term, either quote a POL -> USDC QuoteIntent whose destination call targets the earn deposit call data or add a small Swift encoder equivalent to TypeScript resolveActionsToCalls for wrap, swap, and earn deposit. Until that exists, use the API-only two-step path: QuoteIntent/CommitIntent/ExecuteIntent, then YieldCreateEnterAction.

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 build
  • Installed and launched on the iPhone 17 simulator; verified the app displayed Earn API loaded with 94 pools returned.
  • swift test
  • Ran generated/example output path scan; no local machine paths were found.

@tolgahan-arikan tolgahan-arikan requested a review from a team May 25, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants