Transaction Relay (TX)

Create Blockchain Transactions

Transfer native currency (ETH, MATIC), call contract functions, and deploy contracts.


Sending transactions is available via HTTP API. Tx Relay can handle all types of transactions such as contract deployment, contract functions, and transferring ether.

Creating transactions transfer event

Make a POST request to /transactions in order to send native currency (ETH, MATIC). The request will return the transaction id which may be used to query its status.


const response = await fetch('https://api.utiliti.ai/transactions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ chain_id: 80001, // Polygon Mumbai type: 'TRANSFER', from_address: '0xC96524bbeB102d9246ED6a4A07909c7f1Dd2AF8e', to_address: '0x5ee648Bc911676ad1fC500e36F138DeE967D1FEC', params: { value: 1, // transfer amount }, gas_limit: 21000, gas_strategy: 'FAST', // "SLOW" | "MEDIUM" | "FAST" }), })

Calling contract functions

Making a function call to a contract is simple.

Make a POST request to /transactions for calling contract functions. The query will return the transaction id which may be used to query its status.


const response = await fetch('https://api.utiliti.ai/transactions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ chain_id: 80001, // Polygon Mumbai from_address: '0xC96524bbeB102d9246ED6a4A07909c7f1Dd2AF8e', to_address: '0xb7ed1cd744352047dde87cc2ffb1e486ba8780f9', type: 'CONTRACT_FUNCTION', contract_function_name: 'approve', params: { spender: '0xfaFF85CAe0C8E460B1103D393D42e74bf099F775', amount: 1, }, abi: '<CONTRACT_ABI>', gas_limit: 200000, gas_strategy: 'FAST', // "SLOW" | "MEDIUM" | "FAST" }), })

Mint an NFT from Identity wallet example


const response = await fetch('https://api.utiliti.ai/transactions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ chain_id: 5, // Ethereum Goerli type: 'CONTRACT_FUNCTION', from_address: '0x23c96144969a9d7c802a96cbf0d539210d176b38', // Identity Wallet Address to_address: '0x62d100283c2af67452e91cf4d5bad4f2cc9a5947', // NFT Contract Address params: { // Contract Parameters to: '0x57a3cdee5886f8f0508f6c0e77c8ec4e74b0238a', tokenId: 7, }, contract_function_name: 'safeMint', // Name of contract function to invoke abi: '<CONTRACT_ABI>', gas_limit: 200000, gas_strategy: 'FAST', }), })

Deploy Smart Contracts (Beta)

Your Identity Wallet can be used to deploy and verify smart contracts. Currently, imports are only supported for some OpenZeppelin contracts.


const response = await fetch('https://api.utiliti.ai/transactions', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ chain_id: 5, // Ethereum Goerli type: 'CONTRACT_DEPLOY', from_address: '0x23c96144969a9d7c802a96cbf0d539210d176b38', // Identity Wallet Address params: { // Contract Parameters name: 'UtilitiDemo', }, contract: '<CONTRACT_SOURCE_CODE>', gas_limit: 200000, gas_strategy: 'FAST', }), })