iOS Hero surface
iOS SDK: Hero surface
Swift app code calls sdk.hero for product operations. The client evaluates policy, invokes the bridge, and returns DvmOp<Receipt> — the app never touches the MPC protocol directly.
Hero on iOS routes through DvmClient. It evaluates policy first, constructs an operation id, calls the bridge, and binds the policy receipt into the returned receipt context. DvmMobileNode is used as the bridge when the device holds a share; Hero handles that routing internally.
The Hero surface covers wallet creation and transfers; the remaining operation classes route through Expert namespaces.
Swift Hero API
Use Hero in view models and app services that execute approved actions. The SDK handles policy evaluation, idempotency, and the operation lifecycle. The view model stores a receipt, not a native response. Transfer requires user presence, so the progress stream will emit .waitingForUserPresence before the signing step.
let bridge = try RustJsonDvmMobileBridge.dynamicLibrary(
path: "@bundle/Frameworks/libmpc_node.dylib"
)
let sdk = try await DvmClient.open(
.duo(appGroup: "group.com.example.app"),
bridge: bridge,
policyProvider: MyPolicyProvider()
)
// Wallet creation
let walletOp = try await sdk.hero.createEvmWallet(
label: "Treasury",
idempotencyKey: "wallet-main-2026"
)
let walletReceipt = try await walletOp.awaitReceipt()
// Transfer with user-presence step
let transferOp = try await sdk.hero.transfer(
wallet: walletReceipt.walletId,
asset: "ETH",
recipient: recipientAddress,
amount: "0.1",
idempotencyKey: "wire-2026-0142"
)
for await progress in transferOp.progress {
if case .waitingForUserPresence = progress {
try await biometricChallenge.complete()
}
}
let receipt = try await transferOp.awaitReceipt()