Overview
Starknet deposits are simple to execute because the Layerswap API returns a pre-built array of Starknet calls incall_data. You parse the JSON and pass it directly to the account’s execute method, which handles multicall execution natively.
Prerequisites:
- starknet.js for account interaction and transaction execution
call_data Format
For Starknet,call_data is a JSON-encoded array of call objects. Each call in the array specifies a contract invocation:
transfer or approve + transfer call. For native ETH on Starknet, it’s a direct transfer call on the ETH contract.
Transaction Construction
Execute via Account
Pass the calls array to
account.execute(). Starknet natively supports multicall, so all calls in the array are executed atomically in a single transaction.Full Example (Server-side with Private Key)
Full Example (Browser with starknet.js + Wallet)
When using a browser wallet like ArgentX or Braavos, the wallet injects astarknet object. Use get-starknet to connect: