public class Handler extends Object
| Constructor and Description |
|---|
Handler(String apiUrl,
Serializer serializer)
Handler constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getTxDataState(String chainID,
Date nonceTime,
TxData txData)
returns the sorted and marshaled json representation of a TxData ready to be signed.
|
TxWrappers |
retrieveCertificates(String id,
int page,
int txPerPage)
fetches the API and returns a tx wrappers or throws an error.
|
KeyV1[] |
retrieveCompanyKeys(String companyBcid,
int page,
int txPerPage)
fetches the API and returns the list of keyV1 for a company or throws an error.
|
TxWrapper |
retrieveLastCertificate(String id)
fetches the API and returns a tx wrapper or throws an error.
|
TxWrappers |
retrieveSecrets(String id,
int page,
int txPerPage)
fetches the API and returns a tx wrappers or throws an error.
|
TxWrappers |
retrieveTxs(String txCategory,
String id,
int page,
int txPerPage)
fetches the API and returns a tx wrappers or throws an error.
|
TxStatus |
sendTx(Tx tx)
accepts a tx and sends it to the Api to return a tx status or throws an error.
|
Tx |
signTx(PrivateKey privateKey,
String chainID,
Date nonceTime,
TxData txData)
signs a tx data and returns a new tx ready to be sent.
|
public Handler(String apiUrl, Serializer serializer)
apiUrl - serializer - public TxStatus sendTx(Tx tx) throws IOException, ApiException
tx - IOExceptionApiExceptionpublic TxWrapper retrieveLastCertificate(String id) throws IOException, ApiException
id - IOExceptionApiExceptionpublic TxWrappers retrieveCertificates(String id, int page, int txPerPage) throws IOException, ApiException
id - page - txPerPage - IOExceptionApiExceptionpublic TxWrappers retrieveSecrets(String id, int page, int txPerPage) throws IOException, ApiException
txPerPage - page - id - IOExceptionApiExceptionpublic TxWrappers retrieveTxs(String txCategory, String id, int page, int txPerPage) throws IOException, ApiException
id - page - txPerPage - txCategory - IOExceptionApiExceptionpublic KeyV1[] retrieveCompanyKeys(String companyBcid, int page, int txPerPage) throws IOException, ApiException
txPerPage - page - companyBcid - IOExceptionApiExceptionpublic Tx signTx(PrivateKey privateKey, String chainID, Date nonceTime, TxData txData) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException
chainID - nonceTime - privateKey - txData - NoSuchAlgorithmExceptionInvalidKeyExceptionSignatureExceptionCopyright © 2020 Transchain. All rights reserved.