Skip to main content
Call read and write functions on deployed contracts and retrieve transaction receipts.

Methods

readCallFunction()

Call a read-only function on a deployed contract. Signature:
readCallFunction(
  networkId: string,
  contractAddress: string,
  request: ReadCallFunctionRequest,
  requestOptions?: RequestOptions
): Promise<ReadCallFunctionResponse>
Parameters:
ParameterTypeRequiredDescription
networkIdstringYesNetwork ID (UUID from getNetworks())
contractAddressstringYesContract address
request.abiFunctionobjectYesABI function object
Example Request:
const result = await client.contractInteractions.readCallFunction('your-network-id', '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', {
  abiFunction: {
    name: 'balanceOf',
    type: 'function',
    inputs: [
      { name: 'owner', type: 'address' }
    ],
    outputs: [
      { name: '', type: 'uint256' }
    ]
  }
});
Example Response:
{
  data: {
    result: {
      data: {
        result: {
          // Decoded function result
        },
        functionName: 'balanceOf',
        contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
        network: 'ETH',
        encodedData: '0x1234567890abcdef...'
      },
      success: true,
      status: 200
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.result.data.resultobjectNoDecoded function result
data.result.data.functionNamestringNoFunction name that was called
data.result.data.contractAddressstringNoContract address
data.result.data.networkstringNoNetwork
data.result.data.encodedDatastringNoEncoded function call data
data.result.successbooleanNoWhether the call was successful
data.result.statusnumberNoHTTP status code
console.log('Function result:', result.data.result?.data?.result);

writeCallFunction()

Call a write function on a deployed contract. Returns a workflow ID for async processing. Signature:
writeCallFunction(
  networkId: string,
  contractAddress: string,
  request: WriteCallFunctionRequest,
  requestOptions?: RequestOptions
): Promise<WriteCallFunctionResponse>
Parameters:
ParameterTypeRequiredDescription
networkIdstringYesNetwork ID (UUID from getNetworks())
contractAddressstringYesContract address
request.addressIdstringYesAddress ID for signing
request.clientSharestringYesClient share for signing
request.abiFunctionobjectYesABI function object
request.amountstringNoAmount to send with transaction
request.feeLevelstringNoTransaction fee level
Example Request:
const result = await client.contractInteractions.writeCallFunction('your-network-id', '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', {
  addressId: 'address-id',
  clientShare: 'your-client-share',
  abiFunction: {
    name: 'transfer',
    type: 'function',
    inputs: [
      { name: 'to', type: 'address' },
      { name: 'amount', type: 'uint256' }
    ],
    outputs: []
  },
  amount: '0',
  feeLevel: 'standard'
});
Example Response:
{
  data: {
    workflowResult: {
      workflowId: 'workflow-id-here',
      operationId: 'write-call-id-here',
      status: 'started',
      message: 'Write call workflow started'
    }
  }
}
Response Fields:
FieldTypeRequiredDescription
data.workflowResult.workflowIdstringYesWorkflow ID for tracking function call
data.workflowResult.operationIdstringYesOperation ID (e.g. writeCallId)
data.workflowResult.status'started' | 'already_running'YesWorkflow status
data.workflowResult.messagestringYesHuman-readable status message
console.log('Workflow ID:', result.data.workflowResult.workflowId);

getTransactionReceipt()

Get transaction receipt for a transaction hash. Signature:
getTransactionReceipt(
  networkId: string,
  txId: string,
  requestOptions?: RequestOptions
): Promise<TransactionReceiptResponse>
Parameters:
ParameterTypeRequiredDescription
networkIdstringYesNetwork ID (UUID from getNetworks())
txIdstringYesTransaction hash
Example:
const receipt = await client.contractInteractions.getTransactionReceipt(
  'your-network-id',
  '0x1234567890abcdef...'
);

console.log('Status:', receipt.data.receipt?.status);
console.log('Block Number:', receipt.data.receipt?.blockNumber);
console.log('Gas Used:', receipt.data.receipt?.gasUsed);

getDeployedContractAbi()

Get contract ABI for a deployed contract. Signature:
getDeployedContractAbi(
  networkId: string,
  contractAddress: string,
  requestOptions?: RequestOptions
): Promise<ContractAbiResponse>
Example:
const abi = await client.contractInteractions.getDeployedContractAbi(
  'your-network-id',
  '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
);

console.log('ABI:', abi.data.contractAbi?.abi);