Interface BlockchainFacade<TTransaction extends CatbufferType,TDescriptor extends TypedDescriptor,TKeyPair extends KeyPair>

Type Parameters:
TTransaction - Transaction model type.
TDescriptor - Typed transaction-descriptor type.
TKeyPair - Key-pair type.

public interface BlockchainFacade<TTransaction extends CatbufferType,TDescriptor extends TypedDescriptor,TKeyPair extends KeyPair>
BlockchainFacade
Blockchain-agnostic surface shared by SymbolFacade and : build, sign, hash and verify transactions through a single handle. The transaction, typed-descriptor and key-pair types stay chain-specific, so passing another chain's transaction or key pair is a compile error; a key pair enters the wildcard world through the facade (createKeyPair(org.symbol.sdk.CryptoTypes.PrivateKey), bip32NodeToKeyPair(org.symbol.sdk.Bip32.Bip32Node), Account.keyPair()). Each facade also exposes chain-specific methods (e.g. Symbol's embedded-transaction and cosignature helpers) outside this contract.

A facade obtained from FacadeFactory.create(java.lang.String, java.lang.String) is typed BlockchainFacade<?, ?, ?>; the transaction-typed methods are then called from a generic capture-helper method, where the wildcard is fixed to a consistent type:


 BlockchainFacade<?, ?, ?> facade = FacadeFactory.create(chainName, "testnet");
 transfer(facade, json, privateKey);

 static <T extends CatbufferType, D extends TypedDescriptor, K extends KeyPair> void transfer(
        BlockchainFacade<T, D, K> facade, String json, CryptoTypes.PrivateKey privateKey) {
    Account<T, K> account = facade.createAccount(privateKey);
    T transaction = facade.createTransactionFromJson(json, account.publicKey(), 100, 3600);
    CryptoTypes.Signature signature = facade.signTransaction(account.keyPair(), transaction);
    facade.verifyTransaction(transaction, signature);
 }