You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wire iOS managed identity top-up from asset lock + converge the 3 top-up paths (v4.1-dev) #4092
Converge identity top-up from an asset lock onto a single managed path used by both iOS and Android, and wire it on iOS (currently unimplemented). Land it as a standalone PR against v4.1-dev so the shared, iOS-affecting change is reviewed on its own rather than buried inside the large Kotlin-SDK PR (#3999).
Background — three fragmented paths today
There are currently three ways to top up an identity from a Core asset lock, at different layers, and none is shared:
The DPP-SDK primitive is IS-only (registration has both ..._with_instant_lockand..._with_chain_lock; top-up only ever got the IS variant) and pushes all asset-lock creation / funding / proof acquisition onto the caller. The managed library orchestrator is the correct "from asset lock" abstraction.
The good news — most of the work already exists upstream
The managed orchestrator IdentityWallet::top_up_identity_with_funding is already in v4.1-dev (packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:388). It does the full lifecycle: build/resolve the asset lock, IS→CL fallback, retries, persist balance.
iOS already uses the registration twinplatform_wallet_register_identity_with_funding_signer (packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/ManagedPlatformWallet.swift:3598), so the managed-funding-signer pattern is proven on iOS.
Working today only via the two-step route: fund a platform address from an asset lock (topUpAddressFromAssetLock) → topUpIdentityFromAddresses (Addresses.swift:1263, live at AddressQueriesView.swift:2628).
resumeIdentityWithAssetLock (ManagedPlatformWallet.swift:3656) is registration-resume, not top-up.
Wire iOS: a Swift ManagedPlatformWallet.topUpIdentityWithFunding(...) mirroring the existing registerIdentityWithFunding, and implement the executeIdentityTopUp stub (or a dedicated Top-Up-from-Core view) to call it. Add Swift SDK + example-app UI.
Tests: mirror the registration-with-funding coverage (unit + the example-app flow); assert the target identity's credit balance rises by ~the funded amount, with IS→CL fallback exercised.
Decide whether to retire the now-redundant IS-only dash_sdk_identity_topup_with_instant_lock (unwired on iOS) or keep it as a documented low-level primitive.
platform_wallet_top_up_identity_with_funding_signer exists in v4.1-dev and delegates to top_up_identity_with_funding (no reimplementation).
iOS can top up an existing identity directly from a Core asset lock in one managed call (create lock from wallet balance, IS→CL fallback), via a wired UI — executeIdentityTopUp no longer notImplemented.
Both iOS and Android use the same FFI export for managed Core-funded identity top-up.
Tests cover the happy path + IS→CL fallback; existing two-step address route still works.
Retire-or-keep decision recorded for dash_sdk_identity_topup_with_instant_lock.
Summary
Converge identity top-up from an asset lock onto a single managed path used by both iOS and Android, and wire it on iOS (currently unimplemented). Land it as a standalone PR against
v4.1-devso the shared, iOS-affecting change is reviewed on its own rather than buried inside the large Kotlin-SDK PR (#3999).Background — three fragmented paths today
There are currently three ways to top up an identity from a Core asset lock, at different layers, and none is shared:
dash_sdk_identity_topup_with_instant_lock(+_and_wait)rs-sdk-ffi/src/identity/topup.rs)instantLock+tx+outputIndex)platform_wallet_top_up_identity_with_funding_signerFromWalletBalance, IS→CL fallback7a1d04792f)platform_wallet_topup_identity_with_existing_asset_lock_signerFromExistingAssetLockfeat/dip15-dashpay-invitations(#4041)The DPP-SDK primitive is IS-only (registration has both
..._with_instant_lockand..._with_chain_lock; top-up only ever got the IS variant) and pushes all asset-lock creation / funding / proof acquisition onto the caller. The managed library orchestrator is the correct "from asset lock" abstraction.The good news — most of the work already exists upstream
IdentityWallet::top_up_identity_with_fundingis already inv4.1-dev(packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:388). It does the full lifecycle: build/resolve the asset lock, IS→CL fallback, retries, persist balance.platform_wallet_register_identity_with_funding_signer(packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/ManagedPlatformWallet.swift:3598), so the managed-funding-signer pattern is proven on iOS.packages/rs-platform-wallet-ffi/src/identity_top_up.rs, calls.top_up_identity_with_funding(AssetLockFunding::FromWalletBalance { … })) — no reimplementation.Current iOS state
topUpIdentity()→identityTopUp()→dash_sdk_identity_topup_with_instant_lockhas zero callers; the example-app catalog handlerexecuteIdentityTopUp(packages/swift-sdk/SwiftExampleApp/.../Views/TransitionDetailView.swift:611) is anotImplementedstub (has been since feat(sdk): epic: rs-sdk-ffi and ios support #2756; old UI leaned out in refactor(swift-sdk): lean down stale app and SDK layers #3539 / chore(swift-sdk): swift and unified sdk generation rewrite #3401).topUpAddressFromAssetLock) →topUpIdentityFromAddresses(Addresses.swift:1263, live atAddressQueriesView.swift:2628).resumeIdentityWithAssetLock(ManagedPlatformWallet.swift:3656) is registration-resume, not top-up.Proposed work (standalone PR against
v4.1-dev)platform_wallet_top_up_identity_with_funding_signertov4.1-dev(extract the ~110-line wrapper from feat(sdk): add Kotlin SDK and KotlinExampleApp (Android port of SwiftExampleApp) #3999'sidentity_top_up.rs; the orchestrator it wraps is already upstream).ManagedPlatformWallet.topUpIdentityWithFunding(...)mirroring the existingregisterIdentityWithFunding, and implement theexecuteIdentityTopUpstub (or a dedicated Top-Up-from-Core view) to call it. Add Swift SDK + example-app UI.dash_sdk_identity_topup_with_instant_lock(unwired on iOS) or keep it as a documented low-level primitive.Sequencing with PR #3999 (important)
v4.1-dev, rebase feat(sdk): add Kotlin SDK and KotlinExampleApp (Android port of SwiftExampleApp) #3999 and remove its duplicate copy of the export (identity_top_up.rs+110) — keep only feat(sdk): add Kotlin SDK and KotlinExampleApp (Android port of SwiftExampleApp) #3999's Android JNI/Kotlin wiring. The v4.1-dev PR owns the canonical export; otherwise the rebase produces a duplicate/conflict.Acceptance criteria
platform_wallet_top_up_identity_with_funding_signerexists inv4.1-devand delegates totop_up_identity_with_funding(no reimplementation).executeIdentityTopUpno longernotImplemented.dash_sdk_identity_topup_with_instant_lock.References
packages/rs-platform-wallet/src/wallet/identity/network/registration.rs:388(top_up_identity_with_funding)packages/rs-platform-wallet-ffi/src/identity_top_up.rs(platform_wallet_top_up_identity_with_funding_signer, commit7a1d04792f)packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/ManagedPlatformWallet.swift:3598packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/TransitionDetailView.swift:611packages/rs-sdk-ffi/src/identity/topup.rs(dash_sdk_identity_topup_with_instant_lock)FromExistingAssetLockreclaim variant)