portal_flutter 0.1.0-alpha.13 copy "portal_flutter: ^0.1.0-alpha.13" to clipboard
portal_flutter: ^0.1.0-alpha.13 copied to clipboard

Flutter SDK for Portal - Stablecoin wallet infrastructure

portal_flutter #

Flutter SDK for Portal — Stablecoin wallet infrastructure.

This is a federated plugin. Platform implementations live in the portal_flutter_android and portal_flutter_ios packages and are pulled in automatically when you depend on portal_flutter.

Installation #

dependencies:
  portal_flutter: ^0.1.0-alpha.8

Request tracing #

Every request the Portal SDKs make carries an X-Portal-Trace-Id header so a wallet operation can be correlated with Portal's backend logs. The native SDKs generate one automatically, and multi-step flows share a single ID end-to-end.

To supply your own — a checkout ID, a support ticket reference, anything you already track — pass traceId to any of the methods that accept it:

final traceId = generateTraceId(); // lowercase UUID v4

final list = await portal.evmAccountType.buildAuthorizationList(
  chainId: 'eip155:11155111',
  traceId: traceId,
);
final signature = await portal.rawSign(
  chainId: 'eip155:11155111',
  message: list.data.hash,
  traceId: traceId,
);
await portal.evmAccountType.build7702UpgradeTx(
  chainId: 'eip155:11155111',
  signature: signature,
  traceId: traceId,
);

Passing the same value to each step correlates them as one operation. Omit traceId and the native SDK generates one per request, exactly as before. portalTraceIdHeader is exported if you need the header name itself.

Where traceId is accepted #

sendAsset, request, signMessage, signTypedData, sendTransaction, rawSign, buildEip155Transaction, buildSolanaTransaction, updateShareStatus, and evmAccountType.buildAuthorizationList / evmAccountType.build7702UpgradeTx.

Where it is not #

These methods take no traceId because the native iOS and Android SDKs do not accept one. Requests are still traced — the SDK just owns the ID.

  • MPC operationscreateWallet, backupWallet, recoverWallet, ejectPrivateKeys, and evmAccountType.upgradeTo7702 each generate one trace ID internally and share it across every underlying request. To control the ID for a 7702 upgrade, drive it manually with the three-step flow above.
  • evmAccountType.getStatus — routed through a native Portal-level wrapper that takes no trace ID.
  • Delegations, Blockaid / Hypernative scans, LiFi and 0x trading, yield, getAssets / getBalances / getTransactions / getNftAssets / evaluateTransaction — no trace ID support in the native SDKs yet.

Trace IDs are write-only: there is no API to read back an ID the native SDK generated, so keep the value you pass in if you need it later. Blank strings are treated as absent.

Platform difference #

Android attaches the header only to Portal-owned hosts, while iOS attaches it to every request the SDK builds, including third-party RPC providers. This is native SDK behavior and is not changed by the Flutter layer.

Resources #

0
likes
150
points
583
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for Portal - Stablecoin wallet infrastructure

Homepage

License

MIT (license)

Dependencies

flutter, plugin_platform_interface, portal_flutter_android, portal_flutter_ios

More

Packages that depend on portal_flutter

Packages that implement portal_flutter