Delegations
Delegations provider implementation.
This class provides access to token delegation capabilities via the Portal API, enabling cross-chain delegation management for both EVM and Solana ecosystems.
Overview
The Delegations provider supports:
Approve: Grant a delegate address permission to transfer tokens on your behalf
Revoke: Remove a delegate's permission to transfer your tokens
Get Status: Query current delegation state, balances, and active delegations
Transfer From: Execute a transfer using previously approved delegated authority
Usage Example
// Approve a delegation
val request = ApproveDelegationRequest(
chain = "eip155:11155111",
token = "USDC",
delegateAddress = "0x...",
amount = "1.0"
)
val result = portal.delegations.approve(request)
result.onSuccess { response ->
// Sign the returned transactions sequentially
response.transactions?.forEach { tx -> /* sign EVM tx */}
response.encodedTransactions?.forEach { tx -> /* sign Solana tx */}
}Functions
Approves a delegation for a specified token on a given chain.
Retrieves the delegation status for a specified token and delegate address.
Revokes a delegation for a specified token on a given chain.
Transfers tokens from one address to another using delegated authority.