Transactions
Build and sign transactions on Quai Network.
Overview
Transactions are a fundamental piece of Quai Network. Every state-changing operation within the network requires a signed transaction.
The Quais SDK provides utilities for building and signing transactions, with support for all 3 types of transactions.
Quai Transactions
EVM like transactions processed on the Quai Ledger
Qi Transactions
UTXO style transactions processed on the Qi Ledger
External Transactions
Either a Quai or Qi transaction moving from one zone chain to another
Usage
In practice, developers will only ever need to compose Quai or Qi transactions. External transactions are created and routed automatically by the network, given the sender and reciever addresses of a given transaction.
Quai Transaction
The QuaiTransactionRequest type is used to build all types of Quai transactions. They can be signed and broadcasted to the network using a Wallet, QuaiHDWallet, or Signer.
Quai transactions are signed using ECDSA signatures.
const tx: QuaiTransactionRequest = {
to: '0x0012345678901234567890123456789012345678',
value: parseQuai('1.0'),
data: '0x',
}
await wallet.sendTransaction(tx)
Qi Transaction
The QiTransactionRequest type is used to build Qi UTXO transactions. These transactions can be signed and broadcasted to the network using a QiHDWallet.
Qi transactions are signed using MuSig signatures.
Qi transactions are still being developed. They are currently supported by the SDK, but are subject to change.
const tx: QiTransactionRequest = {
txInputs: [...],
txOutputs: [...],
}
await QiHDWallet.sendTransaction(tx)
Was this page helpful?