Skip to content

First transaction ​

A transaction changes state and pays gas in T-RAIN. A read does not.

You need an account with T-RAIN. Create a wallet or add the network in MetaMask, then request T-RAIN.

From UTN Wallet ​

  1. Open Send T-RAIN.
  2. Enter the destination under To (0x and 40 hex characters). It cannot be this account.
  3. Enter an Amount. Max fills the amount the account can pay after the fee.
  4. Press Review.
  5. Confirm with your passkey.

The page shows Network fee before you confirm. For a passkey account the relay submits the transaction and the account refunds that fee in the same transaction. You do not type a gas price.

The wallet then shows the transaction hash. Open it in UTN Scan.

From a page ​

Load the wallet script and send from a click, not from page load. Browsers block the wallet window unless the call follows a user action.

html
<script src="https://wallet.utn.network/sdk/utn-wallet.js"></script>
<button type="button" id="send">Send</button>
<script type="module">
  document.getElementById("send").onclick = async () => {
    const [account] = await window.utn.request({ method: "eth_requestAccounts" });
    const hash = await window.utn.request({
      method: "eth_sendTransaction",
      params: [{
        from: account,
        to: "0xDESTINATION",
        value: "0x38d7ea4c68000",
        data: "0x",
      }],
    });
    console.log(hash);
  };
</script>

0x38d7ea4c68000 is 0.001 T-RAIN. The user confirms in the wallet. hash is the transaction hash.

Wait for the receipt:

bash
curl -s https://rpc.utn.network \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0xYOUR_TX_HASH"]}'

result is null until the transaction is in a block. Then status is 0x1 when it succeeded.

Connecting a site in more detail is Connect a site. Calling a contract is Deploy with Foundry and Hardhat.

Testnet coin T-RAIN · chain 20261003