use of com.hederahashgraph.api.proto.java.TokenGrantKycTransactionBody in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListener method insertTokenAccountGrantKyc.
private void insertTokenAccountGrantKyc(RecordItem recordItem) {
if (entityProperties.getPersist().isTokens()) {
TokenGrantKycTransactionBody transactionBody = recordItem.getTransactionBody().getTokenGrantKyc();
EntityId tokenId = EntityId.of(transactionBody.getToken());
EntityId accountId = EntityId.of(transactionBody.getAccount());
TokenAccount tokenAccount = new TokenAccount(tokenId, accountId, recordItem.getConsensusTimestamp());
tokenAccount.setKycStatus(TokenKycStatusEnum.GRANTED);
entityListener.onTokenAccount(tokenAccount);
}
}
use of com.hederahashgraph.api.proto.java.TokenGrantKycTransactionBody in project hedera-services by hashgraph.
the class HapiTokenKycGrant method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
var aId = TxnUtils.asId(account, spec);
var tId = TxnUtils.asTokenId(token, spec);
TokenGrantKycTransactionBody opBody = spec.txns().<TokenGrantKycTransactionBody, TokenGrantKycTransactionBody.Builder>body(TokenGrantKycTransactionBody.class, b -> {
b.setAccount(aId);
b.setToken(tId);
});
return b -> b.setTokenGrantKyc(opBody);
}
Aggregations