Skip to content

Add RPC-backed transaction history#69

Open
Jim8y wants to merge 8 commits into
neoorder:masterfrom
Jim8y:codex/rpc-transaction-history
Open

Add RPC-backed transaction history#69
Jim8y wants to merge 8 commits into
neoorder:masterfrom
Jim8y:codex/rpc-transaction-history

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route the wallet Records entry to an in-app transaction history page instead of sending users to the explorer.
  • Load NEP-17 and NEP-11 transfers directly from RPC for the selected wallet address.
  • Resolve token metadata in memory for readable asset/activity rows without adding local transaction storage.

Validation

  • dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:AndroidSdkDirectory=/opt/homebrew/share/android-commandlinetools -p:EmbedAssembliesIntoApk=true
  • dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:CodesignKey=- -p:CodesignProvision=
  • iOS and Android simulator screenshots will be posted in a PR comment before marking ready for review.

Notes

  • Scope is intentionally limited to transaction history navigation and RPC-backed display.
  • The page does not persist transaction history locally; it queries RPC on demand to avoid introducing a new record store.

@Jim8y

Jim8y commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Simulator validation completed for this PR.

Validation run:

  • iOS build passed: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:CodesignKey=- -p:CodesignProvision= (3 existing NU1903 SQLite warnings, 0 errors).
  • Android build passed: RuntimeIdentifiers=android-arm64;android-x64 dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:AndroidSdkDirectory=/opt/homebrew/share/android-commandlinetools -p:EmbedAssembliesIntoApk=true (9 existing NU1903 SQLite warnings, 0 errors).
  • iOS Simulator: installed and launched on iPhone 17 Pro / iOS 26.5, launch returned PID 6358.
  • Android Emulator: installed and launched on emulator-5554, created a temporary local test wallet by private-key import, opened Wallet -> History, and confirmed the RPC-backed empty transaction state rendered. App PID 11549, crash buffer empty.
  • Sensitive mnemonic/private-key setup screens were not uploaded; only non-sensitive screenshots are attached.

Screenshots:

iOS simulator

Android emulator history empty state

@Jim8y Jim8y marked this pull request as ready for review June 22, 2026 02:44
Copilot AI review requested due to automatic review settings June 22, 2026 02:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an in-app, RPC-backed transaction history experience for the wallet, replacing the previous “Records” behavior that navigated users out to an external explorer. It queries NEP-17 and NEP-11 transfers on demand via RPC and resolves token metadata in-memory for display.

Changes:

  • Routed Wallet “Records” tap to a new in-app TransactionHistoryPage (//wallet/transactions) and registered the Shell route.
  • Implemented TransactionHistoryPage (UI + code-behind) to load NEP-17/NEP-11 transfers from RPC and render them as activity rows.
  • Added new localized string keys for empty/error/retry transaction history states across all .resx files and updated Strings.Designer.cs.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
OneGateApp/Properties/Strings.resx Adds transaction history empty/error/retry strings (neutral culture).
OneGateApp/Properties/Strings.de.resx Adds transaction history strings for German locale.
OneGateApp/Properties/Strings.es.resx Adds transaction history strings for Spanish locale.
OneGateApp/Properties/Strings.fr.resx Adds transaction history strings for French locale.
OneGateApp/Properties/Strings.id.resx Adds transaction history strings for Indonesian locale.
OneGateApp/Properties/Strings.it.resx Adds transaction history strings for Italian locale.
OneGateApp/Properties/Strings.ja.resx Adds transaction history strings for Japanese locale.
OneGateApp/Properties/Strings.ko.resx Adds transaction history strings for Korean locale.
OneGateApp/Properties/Strings.nl.resx Adds transaction history strings for Dutch locale.
OneGateApp/Properties/Strings.pt-BR.resx Adds transaction history strings for Brazilian Portuguese locale.
OneGateApp/Properties/Strings.ru.resx Adds transaction history strings for Russian locale.
OneGateApp/Properties/Strings.tr.resx Adds transaction history strings for Turkish locale.
OneGateApp/Properties/Strings.vi.resx Adds transaction history strings for Vietnamese locale.
OneGateApp/Properties/Strings.zh-Hans.resx Adds transaction history strings for Simplified Chinese locale.
OneGateApp/Properties/Strings.zh-Hant.resx Adds transaction history strings for Traditional Chinese locale.
OneGateApp/Properties/Strings.Designer.cs Exposes new TransactionHistory* resource accessors.
OneGateApp/Pages/WalletPage.xaml Changes “Records” tap to navigate in-app to transaction history route.
OneGateApp/AppShell.xaml.cs Registers the new wallet/transactions Shell route.
OneGateApp/Pages/TransactionHistoryPage.xaml Adds UI for list/empty/error/loading states with pull-to-refresh.
OneGateApp/Pages/TransactionHistoryPage.xaml.cs Implements RPC transfer loading, token metadata caching, and row formatting.
OneGateApp/Models/TransactionHistoryItem.cs Adds a simple UI model for transaction history rows.
Files not reviewed (1)
  • OneGateApp/Properties/Strings.Designer.cs: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread OneGateApp/Pages/TransactionHistoryPage.xaml.cs
Comment thread OneGateApp/Pages/TransactionHistoryPage.xaml.cs Outdated
Comment thread OneGateApp/Pages/TransactionHistoryPage.xaml Outdated
Comment thread OneGateApp/Properties/Strings.fr.resx Outdated
Comment thread OneGateApp/Properties/Strings.de.resx Outdated
Comment thread OneGateApp/Properties/Strings.nl.resx Outdated
Comment thread OneGateApp/Properties/Strings.pt-BR.resx Outdated
Comment thread OneGateApp/Properties/Strings.ru.resx Outdated
Comment thread OneGateApp/Properties/Strings.tr.resx Outdated
Comment thread OneGateApp/Properties/Strings.vi.resx Outdated
@Jim8y

Jim8y commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Review feedback fixes pushed in c6ec0fc.

Validation after the update:

  • Android: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -c Debug -p:AndroidSdkDirectory=/opt/homebrew/share/android-commandlinetools -p:JavaSdkDirectory=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home -p:EmbedAssembliesIntoApk=true passed with existing SQLitePCLRaw NU1903 warnings only.
  • Android emulator: installed with adb install --no-incremental, launched on emulator-5554, PID 14362, AndroidRuntime crash buffer empty.
  • iOS: DEVELOPER_DIR=/Applications/Xcode-26.5.0.app/Contents/Developer dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -c Debug -p:RuntimeIdentifier=iossimulator-arm64 -p:CodesignKey=- -p:CodesignProvision= -p:ProvisioningType=automatic passed with existing SQLitePCLRaw NU1903 warnings only.
  • iOS Simulator: installed and launched on iPhone 17 Pro / iOS 26.5, PID 43940.

Screenshots:

iOS simulator

Android emulator

@erikzhang erikzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, but the historical transaction records were not displayed.

Comment thread OneGateApp/Properties/Strings.resx Outdated
@Jim8y

Jim8y commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed Erik's latest review requests in 7d880da.

Changes:

  • Transaction history now queries NEP-17 and NEP-11 transfer history with an explicit all-history time range: 0 through current UTC milliseconds. This avoids the transfer tracker defaulting to a recent-only window and hiding older wallet activity.
  • Updated the empty-state copy to avoid implementation terminology. It now says transfers appear after they are available from the network instead of mentioning an RPC node.
  • Applied the empty-state copy update across all localized resource files.

Validation:

  • Verified the configured RPC endpoint accepts getnep17transfers/getnep11transfers with [address, 0, endTime] and returns the expected address/received/sent shape.
  • git diff --check passed.
  • Localized .resx key parity passed across all 15 resource files.
  • Verified TransactionHistoryEmptyText values no longer mention RPC.
  • Android build passed: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -r android-arm64 ....
  • iOS simulator build passed: dotnet restore/build OneGateApp/OneGateApp.csproj -f net10.0-ios -r iossimulator-arm64 ....

No screenshots were committed to the repository.

@erikzhang

Copy link
Copy Markdown
Contributor

It still doesn't work.

@Jim8y

Jim8y commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up fix pushed in 615ce49.

Root cause:

  • The transfer history query was using startTime = 0 for getnep17transfers / getnep11transfers.
  • On the current public RPC, that returns empty arrays for addresses that do have transfer history.

Fix:

  • Use a non-zero earliest transfer timestamp for both NEP-17 and NEP-11 history queries.

Verification:

  • Address NN8tbpgAx8zm5BNJZEqvi71Rj2Z8LX2RHh now returns 5 NEP-17 received records with the fixed query range.
  • git diff --check passed.
  • Android build passed: net10.0-android, android-arm64.
  • iOS simulator build passed: net10.0-ios, iossimulator-arm64.
  • Android emulator install + launch passed on emulator-5554.
  • iOS simulator install + launch passed on iPhone 17 Pro / iOS 26.5.

Screenshots were captured under /tmp/onegate-pr69-20260705/ and were not committed.

@Jim8y

Jim8y commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Update: switched account history loading to use indexed account transactions before falling back to transfer-only RPC data.

What changed:

  • Primary source: OneGate Explorer JSON-RPC API at https://explorer.onegate.space/api, method GetRawTransactionByAddress, using the wallet script hash.
  • Secondary fallback: N3Index REST API at https://api.n3index.dev/mainnet/accounts/{address}/transactions.
  • Final fallback: existing node RPC getnep17transfers / getnep11transfers path.
  • Added a 6s timeout per indexed source so a slow indexer does not block the page for the default HttpClient timeout.

Why:

  • Standard Neo RPC only exposes NEP-17/NEP-11 transfer history by address.
  • Full account transaction history requires an indexer.
  • Verified NN8tbpgAx8zm5BNJZEqvi71Rj2Z8LX2RHh returns 7,530 account transactions from OneGate Explorer when queried by script hash 0x9fb28bdacfaa7fcc0a4d660d0dc990b0e7d46118.

Validation:

  • git diff --check
  • Android build: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -r android-arm64 ... passed.
  • iOS simulator build: dotnet restore ... -p:TargetFramework=net10.0-ios -r iossimulator-arm64 plus dotnet build ... -f net10.0-ios -r iossimulator-arm64 --no-restore ... passed.
  • iOS simulator install/launch passed on iPhone 17 Pro / iOS 26.5.
  • Android emulator install/launch passed on emulator-5554.

Screenshots captured outside the repo:

  • /tmp/onegate-pr69-indexer-20260705/ios-launch.png
  • /tmp/onegate-pr69-indexer-20260705/android-launch-after.png

Note: build warnings are the existing SQLitePCLRaw NU1903 advisory warnings; no new warnings were introduced by this change.

@Jim8y

Jim8y commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up update pushed in 827bf1e.

Change:

  • Removed the node RPC transfer fallback from transaction history.
  • The page now only uses bounded indexed account history sources:
    • OneGate Explorer: GetRawTransactionByAddress with Limit=50, Skip=0.
    • N3Index fallback: /accounts/{address}/transactions?limit=50&offset=0.
  • No getnep17transfers / getnep11transfers fallback remains, because those RPC methods do not provide a count-based latest-50 query and would require fetching an unbounded time range.

Verification:

  • OneGate Explorer test account response: 50 rows returned, totalCount=7533.
  • N3Index test account response: 50 rows returned, paging limit=50, offset=0.
  • Confirmed TransactionHistoryPage no longer references getnep17transfers, getnep11transfers, or RpcClient.
  • git diff --check passed.
  • Android build passed.
  • iOS simulator build passed.
  • iOS simulator install/launch passed.
  • Android emulator install passed and app process was confirmed running.

Screenshots captured outside the repository:

  • /tmp/onegate-pr69-limit-20260705/ios-launch-after.png
  • /tmp/onegate-pr69-limit-20260705/android-launch-after.png

Note: the existing SQLitePCLRaw NU1903 warnings remain unrelated.

@Jim8y

Jim8y commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Current head already addresses the open transaction-history feedback.

Checked in this pass:

  • ReadString uses typed JsonValue extraction before falling back to scalar formatting.
  • Missing counterparty falls back to Unavailable instead of an asset hash.
  • The unused InvertedBoolConverter resource is not present.
  • TransactionHistory strings are translated across the existing locale files.

No additional commit was needed in this pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants