requestTransaction() lets your application invoke a Soroban smart contract method on behalf of the authenticated user. When you call it, the SDK opens a hosted popup where the user can review the transaction details and approve or reject it. If the user approves, the SocketFi platform signs and submits the transaction using the user’s embedded Stellar wallet and returns a TransactionResult containing the transaction hash. Your application never has direct access to the user’s private key.
Method signature
Parameters
TransactionRequest
required
The transaction request object describing the contract call to execute.
Return value
requestTransaction() returns Promise<TransactionResult>.
boolean
required
true if the transaction was submitted and confirmed on-chain. false if submission failed after the user approved.string
The Stellar transaction hash (XDR transaction ID) for the submitted transaction. Present when
success is true. Use this to look up the transaction in a Stellar block explorer or to confirm finality in your backend.What happens during a transaction request
requestTransaction() requires an active session. If the user has not yet authenticated, call authenticate() first to obtain a session. Attempting a transaction without a valid session will throw a TOKEN_EXPIRED or INVALID_TOKEN error.Examples
Token transfer
Staking
General contract call
Contract call with no arguments
Error handling
Always handle errors fromrequestTransaction(), especially TRANSACTION_REJECTED and USER_CANCELLED, which indicate intentional user actions rather than application faults: