Documentation Index
Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
Use this file to discover all available pages before exploring further.
Function Signature
Future<PortalFundResult> receiveTestnetAsset({
required String chainId,
required String amount,
required String token,
})
Description
Requests testnet assets for development and testing. This method only works on supported testnet networks.
Parameters
| Parameter | Type | Required | Description |
|---|
chainId | String | Yes | The testnet chain ID in CAIP-2 format |
amount | String | Yes | The amount to request |
token | String | Yes | Token symbol (e.g., "NATIVE", "ETH") |
Returns
PortalFundResult - An object containing:
| Property | Type | Description |
|---|
success | bool | Whether the request was successful |
transactionHash | String? | The transaction hash |
error | String? | Error message if the request failed |
Example
import 'package:portal_flutter/portal_flutter.dart';
final portal = Portal();
// Request testnet ETH on Sepolia
final result = await portal.receiveTestnetAsset(
chainId: 'eip155:11155111', // Sepolia
amount: '0.01',
token: 'NATIVE',
);
if (result.success) {
print('Funded! TX: ${result.transactionHash}');
} else {
print('Failed: ${result.error}');
}
Monad Testnet
final result = await portal.receiveTestnetAsset(
chainId: 'eip155:10143', // Monad Testnet
amount: '0.01',
token: 'NATIVE',
);
Supported Networks
| Network | Chain ID |
|---|
| Sepolia | eip155:11155111 |
| Monad Testnet | eip155:10143 |
Errors
| Code | Description |
|---|
NOT_INITIALIZED | Portal was not initialized |
FAUCET_ERROR | Failed to request testnet assets |
UNSUPPORTED_NETWORK | The network is not supported |