buildTransfer
fun buildTransfer(state: ZswapLocalState, seed: ByteArray, recipientCoinPk: String, recipientEncPk: String, tokenType: String, amount: BigInteger, networkId: String, ttlMs: Long, dustTxHex: String? = null): TransferResult?
Build a shielded transfer: select coins → spend → create output → build offer → build transaction.
This is the main entry point for simple transfers. Advanced callers (ConnectedAPI, agents) can use the lower-level primitives directly.
Return
TransferResult or null on failure
Parameters
state
ZswapLocalState with available coins
seed
32-byte zswap seed (m/44'/2400'/0'/3/0)
recipientCoinPk
Recipient's coin public key (64-char hex)
recipientEncPk
Recipient's encryption public key (64-char hex)
tokenType
Token type hex (all zeros for NIGHT)
amount
Transfer amount (micro-units)
networkId
Network identifier ("undeployed", "preprod", "preview")
ttlMs
Transaction TTL in milliseconds since epoch
dustTxHex
Optional pre-built dust transaction hex