Client
The FT4 Client provides the interface through which applications interact with the blockchain. It facilitates operations such as querying assets, signing transactions, transferring assets, and performing cross-chain transfers.
To set up the FT4 client with TypeScript, install the necessary packages using npm install @chromia/ft4. Initialize the client by creating a connection to the Postchain network, and use it to interact with the blockchain (e.g., querying assets).
FT4 supports Single-Signature (SingleSig) and Multi-Signature (MultiSig) auth descriptors, allowing customizable permissions and rules for secure access control in decentralized applications.
FT4 enables non-interactive signing with disposable keys. These keys can be managed via the login function, with care needed when assigning sensitive auth flags. Keys can be stored with different keystore options and cleared on logout for security.
FT4's KeyStore interface manages cryptographic keys for signing transactions. It includes implementations for Ethereum-compatible keys (EvmKeyStore) and FT4-specific keys (FtKeyStore), supporting in-memory, session, and local storage options.
To transfer assets with FT4, use the Chromia CLI with the ft4.transfer command or the Postchain client library to initiate a transfer using a session. Ensure proper setup of assets, accounts, and key pairs before transferring.
Use the orchestrator for cross-chain asset transfers, ensuring multichain configuration and ICCF module inclusion. Transfer assets between source and target chains with proper error handling and asset registration.