Skip to content

Call a Contract Method

Once your contract is registered, you can interact with it by calling a method that changes state. This guide shows you how to send a transaction to a deployed contract using FSCO’s API.

Before you begin, ensure:

  • You have uploaded the contract ABI
  • The deployment is registered
  • You know the deploymentId and method name
  • You have a wallet to sign and send the transaction
POST /v2/contract/deployment/{id}/call

Request Parameters

{
"walletId": "your-wallet-id",
"method": "transfer",
"params": ["0xreceiver", "1000000000000000000"]
}

The request requires:

  • walletId: The FSCO wallet ID that will sign and send the transaction
  • method: The name of the method to call (must exist in the ABI)
  • params: An array of arguments in the same order as the method signature

Example Request

call-method.sh
curl -X POST https://api.fsco.io/v2/contract/deployment/{{deploymentId}}/call \
-H "Authorization: Bearer $FSCO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletId": "{{walletId}}",
"methodName": "transfer",
"paramCollection": ["0xreceiver", "1000000000000000000"],
"isShared": false
}'

Response

response.json
{
"queryId": "uuid-string"
}
  • Ensure the wallet has sufficient native tokens to cover gas
  • Use a separate guide if you only want to query a method without changing state
  • The transaction will be broadcast to the chain immediately