Skip to content

Add in-app account transaction history - #69

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

Add in-app account transaction history#69
Jim8y wants to merge 14 commits into
neoorder:masterfrom
Jim8y:codex/rpc-transaction-history

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route Wallet > History to an in-app account transaction history page.
  • Load the latest 50 account transactions from the OneGate Explorer indexer.
  • Fall back to N3Index when the OneGate source is unavailable or returns no rows.
  • Display transaction status, fees, sender, time, block height, and transaction hash without persisting history locally.

Validation

  • Android build passed.
  • iOS simulator build passed.
  • Android API 36 emulator: a watch-only account for NN8tbpgAx8zm5BNJZEqvi71Rj2Z8LX2RHh displayed current transaction rows.
  • iPhone 17 Pro / iOS 26.5: the same watch-only account displayed current transaction rows.
  • The test wallet contained no private key and could not sign transactions.

Data behavior

  • OneGate Explorer: GetRawTransactionByAddress, Limit=50, Skip=0.
  • N3Index fallback: /accounts/{address}/transactions?limit=50&offset=0.
  • No unbounded NEP-17 or NEP-11 transfer query is used.

Scope

This PR only replaces the external history link with bounded, read-only, in-app account history.

@Jim8y

Jim8y commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Current head: 690e176

Revalidated with the active watch-only account NN8tbpgAx8zm5BNJZEqvi71Rj2Z8LX2RHh. The wallet file contained the public account only, with no private key.

  • Android API 36: current rows displayed with status, fee, sender, time, block height, and hash.
  • iPhone 17 Pro / iOS 26.5: the same account displayed current rows.
  • Both platform builds passed.
  • Screenshots are external assets and are not committed to the repository.
Android iOS
Android active transaction history iOS active transaction history

@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.

@Jim8y
Jim8y marked this pull request as draft July 13, 2026 17:10
…on-history

# Conflicts:
#	OneGateApp/Properties/Strings.Designer.cs
@Jim8y Jim8y changed the title Add RPC-backed transaction history Add in-app account transaction history Jul 13, 2026
@Jim8y
Jim8y marked this pull request as ready for review July 13, 2026 18:24
@Jim8y

Jim8y commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in e14036b.

Root cause:

  • GetRawTransactionByAddress and N3Index /transactions return transactions signed by the account, not every transaction related to it.
  • NRGokxo5xDuRUiPvYtfeUkPay1NYS8LBMd has 1 signed transaction but 4 NEP-17 transfer transactions: 1 outgoing and 3 incoming. The previous implementation therefore displayed only the outgoing transaction.

Changes:

  • Merge bounded latest-50 signed transactions with bounded latest-50 OneGate NEP-17 and NEP-11 transfer results.
  • Use bounded N3Index transaction/transfer endpoints when the corresponding OneGate source is unavailable.
  • Deduplicate by transaction hash while preserving transfer counterparties and richer transaction metadata.
  • Keep unknown execution state unavailable instead of reporting it as successful.

Verification:

  • OneGate Explorer returns 1 signed transaction and 4 NEP-17 transfer records for Erik's account; N3Index independently returns the same 4 transfer hashes.
  • Android API 36: the transaction history UI displays 4 distinct rows; app process remained running and the crash buffer was empty.
  • iOS 26.5: the accessibility hierarchy reports 4 transaction rows; app process remained running with no new crash report.
  • Android and iOS simulator builds passed. The only build warnings are the existing SQLitePCLRaw NU1903 advisories.
Android iOS
Android transaction history for Erik's account iOS transaction history for Erik's account

The screenshots are external GitHub assets and are not committed to the repository.

@Jim8y

Jim8y commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Addressed Erik's loading and Unavailable feedback in 6995afb.

Root cause:

  • The page waited for every history source before finishing the first render.
  • Indexed fallback records do not always include fee, execution state, or counterparty metadata, so missing optional values were rendered as Unavailable.

Changes:

  • Prefetch the two bounded transfer sources while the Wallet page is visible and reuse the request set for 30 seconds.
  • Progressively merge all five bounded history sources as each response arrives, deduplicate by transaction hash, and keep the latest 50 rows.
  • Keep a 10-second ceiling per source; pull-to-refresh bypasses the cache.
  • Hide optional metadata when a source does not provide it. Only explicit HALT or FAULT states are shown as success or failure.

Validation with NRGokxo5xDuRUiPvYtfeUkPay1NYS8LBMd:

  • Android API 36: 4 records displayed, no Unavailable, app remained stable.
  • iOS 26.5: 4 records displayed, no 不可用, app remained stable.
  • On both platforms, all four rows were visible in the first clean capture within two seconds after opening History following a two-second Wallet-page prefetch window.
  • Android and iOS simulator builds passed.
  • Screenshots are external release assets and are not committed to the repository.
Android iOS
Android transaction history loading fix iOS transaction history loading fix

@Jim8y

Jim8y commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

@erikzhang Ready for re-review.

Updated the branch to current master in 43ad613 and repeated the full user path with the test account NRGokxo5xDuRUiPvYtfeUkPay1NYS8LBMd on both simulators using a watch-only wallet; no private key was required.

Verified source data:

  • OneGate explorer API: 1 signed transaction and 4 NEP-17 transfers.
  • N3Index fallback: 1 signed transaction and 4 transfers.
  • After deduplication by transaction hash, the UI shows 4 distinct records: 0xa700…4b386c, 0x0108…cbd1b8, 0xd8d0…a29cb2, and 0xcbbe…66088d.

Runtime validation:

  • Android 16 / API 36: all 4 records were visible by the 2.5-second capture; pull-to-refresh kept existing rows visible and completed without a crash.
  • iPhone 17 / iOS 26.5: all 4 records were visible by the 2.5-second capture; pull-to-refresh completed and restored fees and success states.
  • No Unavailable/不可用 placeholder is used by the transaction-history UI. Missing optional data is omitted, and HALT/FAULT is rendered only when known.
  • Android and iOS Debug builds passed with 0 errors. The existing iOS duplicate-asset warnings are outside this PR and are addressed separately by Remove duplicate iOS asset inclusion #98.
  • Screenshots remain external to the repository.
Android: 4 records iOS: 4 records
Android four records iOS four records
Android refresh iOS refresh complete
Android refresh iOS refresh complete

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