> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sei.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Your First Transaction on the Sei Giga Testnet

> Create a test account, fund it from the faucet, and send and confirm your first transaction on giga-testnet-1 with viem.

This guide takes you from an empty folder to a confirmed transaction on `giga-testnet-1`. You create a test account, fund it from the faucet, and send 0.01 SEI to yourself with [viem](https://viem.sh). It takes about 10 minutes.

> [!NOTE]
>
> You need Node.js 20 or later. For the network details and other tools, see [Connect to the Giga testnet](https://docs.sei.io/giga/testnet.md).

**1. Set up a project**

```bash theme={"dark"}
mkdir giga-first-tx && cd giga-first-tx
npm init -y
npm install viem
npm install --save-dev tsx
```

**2. Create a test account**

Create `create-account.mts`:

```typescript title="create-account.mts" theme={"dark"}
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';

const privateKey = generatePrivateKey();
console.log(`Private key: ${privateKey}`);
console.log(`Address:     ${privateKeyToAccount(privateKey).address}`);
```

Run it, then put the private key that it prints in an environment variable for this terminal session:

```bash theme={"dark"}
npx tsx create-account.mts
export PRIVATE_KEY=0x...
```

> [!WARNING]
>
> Use this key only on test networks. Anyone who has the key controls the account.

**3. Fund the account**

Open the [Giga testnet faucet](https://faucet.giga-testnet-1.platform.sei.io) and paste the address that the script printed. Complete the human verification when the faucet prompts you, then claim. Each claim sends 100 SEI.

**4. Send a transaction and wait for the receipt**

Create `send.mts`:

```typescript title="send.mts" theme={"dark"}
import { createPublicClient, createWalletClient, defineChain, formatEther, formatGwei, http, parseEther } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';

const seiGigaTestnet = defineChain({
  id: 1330,
  name: 'Sei Giga Testnet',
  nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
  rpcUrls: { default: { http: ['https://rpc.giga-testnet-1.platform.sei.io'] } },
  testnet: true
});

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
// Giga testnet produces several blocks per second, so poll for the receipt often.
const publicClient = createPublicClient({ chain: seiGigaTestnet, transport: http(), pollingInterval: 250 });
const walletClient = createWalletClient({ account, chain: seiGigaTestnet, transport: http() });

const balance = await publicClient.getBalance({ address: account.address });
console.log(`Balance:  ${formatEther(balance)} SEI`);

const hash = await walletClient.sendTransaction({ to: account.address, value: parseEther('0.01') });
console.log(`Sent:     ${hash}`);

const receipt = await publicClient.waitForTransactionReceipt({ hash });
console.log(`Status:   ${receipt.status} in block ${receipt.blockNumber}`);
console.log(`Gas used: ${receipt.gasUsed} at ${formatGwei(receipt.effectiveGasPrice)} gwei`);
```

Run it:

```bash theme={"dark"}
npx tsx send.mts
```

viem takes the priority fee from `eth_maxPriorityFeePerGas`, which returns 1 gwei. The base fee on the Giga testnet is always 0, so the priority fee is the whole gas price, and 1 gwei is the minimum that the node accepts. If you set fees yourself, keep `maxPriorityFeePerGas` at 1 gwei or more.

You are done when you see a `success` status. Your hash and block number differ:

```text theme={"dark"}
Balance:  100 SEI
Sent:     0x8f6c3e0a5b...
Status:   success in block 6974102
Gas used: 21000 at 1 gwei
```

## Send several transactions in a row

On the Giga testnet, `eth_getTransactionCount` with the `pending` tag returns the committed nonce. It does not count transactions that have not reached a block yet. To send several transactions before the first one is confirmed, read the nonce once and count up in your client. Send the transactions in nonce order: the node admits each sender's transactions in order and rejects a gap with `bad nonce`.

```typescript title="send-several.mts" theme={"dark"}
import { createPublicClient, createWalletClient, defineChain, http, parseEther, type Hash } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';

const seiGigaTestnet = defineChain({
  id: 1330,
  name: 'Sei Giga Testnet',
  nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
  rpcUrls: { default: { http: ['https://rpc.giga-testnet-1.platform.sei.io'] } },
  testnet: true
});

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const publicClient = createPublicClient({ chain: seiGigaTestnet, transport: http(), pollingInterval: 250 });
const walletClient = createWalletClient({ account, chain: seiGigaTestnet, transport: http() });

let nonce = await publicClient.getTransactionCount({ address: account.address });
const hashes: Hash[] = [];
for (let i = 0; i < 3; i++) {
  hashes.push(await walletClient.sendTransaction({ to: account.address, value: parseEther('0.001'), nonce: nonce++ }));
}

const receipts = await Promise.all(hashes.map((hash) => publicClient.waitForTransactionReceipt({ hash })));
for (const receipt of receipts) {
  console.log(`${receipt.status} in block ${receipt.blockNumber}`);
}
```

Run it with `npx tsx send-several.mts`. You are done when all three lines say `success`.

## Troubleshooting

| Error | What to do |
| - | - |
| `invalid private key, expected hex or 32 bytes, got string` | `PRIVATE_KEY` must be `0x` followed by 64 hex characters. Some wallets export keys without the `0x` prefix, so add it if it's missing |
| `The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account` | The account has no SEI yet. Claim from the [faucet](https://faucet.giga-testnet-1.platform.sei.io), then run the script again |
| `ethereum transaction effective gas price is below 1000000000` | Your fee settings are below the 1 gwei minimum. Remove them so that viem estimates them, or set `maxPriorityFeePerGas: parseGwei('1')` |
| `bad nonce: got N, want M` | A nonce was reused or skipped. Wait for your earlier receipts, then read the nonce again with `getTransactionCount` |
| `ethereum transaction chain ID does not match 1330` | The transaction was signed for another chain. Use chain ID `1330` |

For every RPC limit and its error, see [RPC limits](https://docs.sei.io/giga/rpc-limits.md).

## Next steps

> [card] [How the Giga testnet differs](https://docs.sei.io/giga/testnet.md#how-the-giga-testnet-differs-from-sei-testnet)
>
> Fees, precompiles, preinstalled contracts, and block fields that differ from Sei Testnet.

> [card] [RPC limits](https://docs.sei.io/giga/rpc-limits.md)
>
> Every cap the Giga testnet RPC enforces, and the error that each one returns.

> [card] [Deploy a contract](https://docs.sei.io/giga/testnet.md#configure-your-tools)
>
> Hardhat and Foundry settings for the Giga testnet.

> [card] [Developer guide](https://docs.sei.io/giga/developers.md)
>
> Finality, fees, and contract patterns that make the most of Giga's parallel execution.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.