Add dApp payment request flow - #90
Conversation
|
Companion SDK PR: r3e-network/neo-miniapps-platform#251. |
a32a90a to
5707054
Compare
|
Synced the branch with the latest Validation after the merge:
AndroidiOSThe screenshots are external release assets and are not committed to the repository. This PR remains draft. The remaining gate is a funded end-to-end dApp payment that proves authorization, broadcast, block inclusion, |
|
@erikzhang Before I take this draft further, could you confirm whether a dApp-initiated NEP-17 payment request through the existing NEP-21 bridge is an acceptable direction? I will keep the PR draft and will not expand the SDK/API surface until that direction is confirmed. |
…request # Conflicts: # OneGateApp/Pages/LaunchDAppPage.xaml.dAPI.cs
|
Synced with the latest The final audit found and fixed a remote-debug approval gap: Validation:
AndroidiOSThe screenshots are external release assets and are not committed to the repository. This remains draft for now. The funded success path still needs to prove authorization, broadcast, block inclusion, |
There was a problem hiding this comment.
Pull request overview
Adds a new requestPayment dAPI method that reuses the existing transaction-preview + authorization popup, then confirms inclusion and successful execution (HALT) before reporting success back to the calling dApp. This builds a higher-level “payment request” flow on top of the current transaction pipeline while keeping send unchanged.
Changes:
- Added
requestPaymentto the injected dAPI provider and implemented the RPC handler + confirmation polling. - Extended the existing
SendTransactionPopupto optionally display dApp-provided request details. - Added localized strings for the new payment-request UI across supported languages.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| OneGateApp/Properties/Strings.resx | Adds base (en) strings for payment request UI. |
| OneGateApp/Properties/Strings.Designer.cs | Regenerates strongly-typed accessors for new strings. |
| OneGateApp/Properties/Strings.de.resx | Adds German translations for payment request UI. |
| OneGateApp/Properties/Strings.es.resx | Adds Spanish translations for payment request UI. |
| OneGateApp/Properties/Strings.fr.resx | Adds French translations for payment request UI. |
| OneGateApp/Properties/Strings.id.resx | Adds Indonesian translations for payment request UI. |
| OneGateApp/Properties/Strings.it.resx | Adds Italian translations for payment request UI. |
| OneGateApp/Properties/Strings.ja.resx | Adds Japanese translations for payment request UI. |
| OneGateApp/Properties/Strings.ko.resx | Adds Korean translations for payment request UI. |
| OneGateApp/Properties/Strings.nl.resx | Adds Dutch translations for payment request UI. |
| OneGateApp/Properties/Strings.pt-BR.resx | Adds Brazilian Portuguese translations for payment request UI. |
| OneGateApp/Properties/Strings.ru.resx | Adds Russian translations for payment request UI. |
| OneGateApp/Properties/Strings.tr.resx | Adds Turkish translations for payment request UI. |
| OneGateApp/Properties/Strings.vi.resx | Adds Vietnamese translations for payment request UI. |
| OneGateApp/Properties/Strings.zh-Hans.resx | Adds Simplified Chinese translations for payment request UI. |
| OneGateApp/Properties/Strings.zh-Hant.resx | Adds Traditional Chinese translations for payment request UI. |
| OneGateApp/Pages/LaunchDAppPage.xaml.cs | Exposes requestPayment on the injected provider method list. |
| OneGateApp/Pages/LaunchDAppPage.xaml.dAPI.cs | Implements RequestPayment, customizes the existing send popup, and adds on-chain confirmation logic. |
| OneGateApp/Models/DAppPaymentRequest.cs | Introduces request DTO, validation, timeout mapping, and display detail formatting. |
| OneGateApp/Models/DAppPaymentResult.cs | Introduces result DTO returned to the dApp after confirmation. |
| OneGateApp/Controls/Popups/SendTransactionPopup.xaml.cs | Adds bindable request-details state for the popup. |
| OneGateApp/Controls/Popups/SendTransactionPopup.xaml | Renders request details block when present. |
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.
| DateTime deadline = DateTime.UtcNow + timeout; | ||
| while (DateTime.UtcNow < deadline) | ||
| { | ||
| await Task.Delay(TimeSpan.FromSeconds(3)); |






Summary
Adds a high-level dApp payment request flow on top of the existing dAPI transaction pipeline.
requestPaymentto the injected OneGate dAPI provider.asset,from,to,amount,data,purpose,details, andtimeoutSeconds.getapplicationlogforHALTbefore returning success.sendbehavior unchanged for compatibility.Validation
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:EnableCodeSigning=falsepassed.dotnet restore/build OneGateApp/OneGateApp.csproj -f net10.0-android -c Debug -p:RuntimeIdentifier=android-arm64 ...passed.iPhone 17 Pro.onegate_api36.Notes
The SDK helper is in a companion PR in
r3e-network/neo-miniapps-platform. End-to-end payment confirmation still requires a funded test wallet and a dApp calling the new SDK helper.