portal.delegations API. This enables approving token spending, revoking approvals, checking delegation status, and transferring tokens as a delegate on both EVM and Solana chains.
Overview
The delegations functionality allows you to:- Approve other addresses to spend tokens on behalf of your wallet
- Revoke existing delegations to remove spending permissions
- Check status of active delegations and balances
- Transfer tokens as a delegate from another address
Prerequisites
Before using delegation operations, ensure you have:- A properly initialized Portal client
- An active wallet with tokens on the target network (see Create a wallet)
- Understanding of token delegations concepts
High-Level Methods
UseapproveAndSubmit, revokeAndSubmit, and transferAndSubmit when you want one call for the whole flow: build the delegation transaction(s), then sign and broadcast each one in order and collect the resulting hashes. Portal installs a working signer on portal.delegations for you, so the common case needs no configuration at all.
Signatures
Portal has already installed a signer:
Configuring the signer
A signer signs and broadcasts one transaction and returns its hash:DelegationTransaction covers both ecosystems:
Portal installs a default signer that routes .evm transactions to eth_sendTransaction and .solana transactions to sol_signAndSendTransaction, so this works with zero setup:
setSignAndSendTransaction(_:) to replace the signer for the instance, or DelegationSubmitOptions.signAndSendTransaction to override it for a single call. The precedence is per-call option → instance signer → Portal default.
Options and progress
DelegationSubmitOptions is the second argument to each submit method:
DelegationSubmitProgress carries:
DelegationSubmitStep has exactly two cases — signing and submitted. There is no confirming or confirmed step, because nothing is awaited on-chain.
Return value
DelegationSubmitResult carries only the hashes:
There is no status field, and no partial-success concept: a hash is present because the network accepted the transaction, and nothing beyond that has been checked.
Example (approve and submit)
This builds the same approval as EVM Approval below, but signs and broadcasts it for you.switch over progress.step is exhaustive with no default: — there really are only two steps.
Example (revoke and submit)
SameRevokeDelegationRequest as EVM Revoke below, submitted end to end.
Example (transfer as a delegate)
SameTransferFromRequest as EVM Transfer From below. Your wallet must already be an approved delegate for fromAddress.
Example (custom signer)
Replace the default signer when you need to do something it does not, such as attaching asignatureApprovalMemo to every delegation transaction. evmTransaction and solanaTransaction each return nil for the other case, so you can branch without a full switch:
Errors
The submit methods throwDelegationsError in addition to the network and decoding errors the low-level methods can throw.
DelegationsProtocol gained setSignAndSendTransaction, approveAndSubmit, revokeAndSubmit, and transferAndSubmit in 7.3.0. Calling code is unaffected, but anything that implements the protocol — a hand-rolled test mock, for example — needs all four before it will compile.Low-level methods
The sections below are the manual path:approve, revoke, transferFrom, and getStatus return unsigned transactions and leave signing and broadcasting to you. Use them when you need to inspect, modify, batch, or route the transactions yourself. Otherwise prefer the high-level methods above.
Approving Delegations
Useapprove to grant another address permission to spend tokens on your behalf. This method works for both EVM and Solana chains.
EVM Approval
Solana Approval
Checking Delegation Status
UsegetStatus to check current delegations and token balances for a specific delegate address.
EVM Status Check
Solana Status Check
Revoking Delegations
Userevoke to remove spending permissions from a delegate address.
EVM Revoke
Solana Revoke
Transferring as a Delegate
UsetransferFrom to transfer tokens from another address that has delegated spending permission to you.
EVM Transfer From
Solana Transfer From
Delegation Roles:
fromAddress is the token owner who approved the delegation. Your wallet (the delegate) signs the transaction to transfer tokens from the owner to the toAddress recipient.Supported Networks
Delegations work on all Portal-supported EVM and Solana chains:- EVM: Ethereum, Polygon, Base, Arbitrum, Optimism, Monad, and all other EVM-compatible chains
- Solana: Solana Mainnet and Devnet
Next Steps
- Read the reference pages for approveAndSubmit, revokeAndSubmit, transferAndSubmit, and setSignAndSendTransaction
- Learn about signing transactions
- Explore Portal API methods
- Review delegation concepts
- Check out wallet lifecycle management