Search in sources :

Example 31 with NetworkIdentifier

use of com.radixdlt.api.core.openapitools.model.NetworkIdentifier in project radixdlt by radixdlt.

the class ConstructionBuildFeePayerTest method buildRequestWithFeePayer.

private ConstructionBuildRequest buildRequestWithFeePayer(EntityIdentifier feePayer) {
    var transferAmount = getLiquidAmount().toSubunits().subtract(Amount.ofTokens(1).toSubunits());
    var accountAddress = REAddr.ofPubKeyAccount(self);
    var otherKey = PrivateKeys.ofNumeric(2).getPublicKey();
    var otherAddress = REAddr.ofPubKeyAccount(otherKey);
    return new ConstructionBuildRequest().networkIdentifier(new NetworkIdentifier().network("localnet")).feePayer(feePayer).addOperationGroupsItem(new OperationGroup().addOperationsItem(new Operation().entityIdentifier(coreModelMapper.entityIdentifier(accountAddress)).amount(coreModelMapper.nativeTokenAmount(false, transferAmount))).addOperationsItem(new Operation().entityIdentifier(coreModelMapper.entityIdentifier(otherAddress)).amount(coreModelMapper.nativeTokenAmount(true, transferAmount))));
}
Also used : OperationGroup(com.radixdlt.api.core.openapitools.model.OperationGroup) ConstructionBuildRequest(com.radixdlt.api.core.openapitools.model.ConstructionBuildRequest) NetworkIdentifier(com.radixdlt.api.core.openapitools.model.NetworkIdentifier) Operation(com.radixdlt.api.core.openapitools.model.Operation)

Example 32 with NetworkIdentifier

use of com.radixdlt.api.core.openapitools.model.NetworkIdentifier in project radixdlt by radixdlt.

the class ConstructionBuildMessageTest method buildRequestWithMessage.

private ConstructionBuildRequest buildRequestWithMessage(String message) {
    var transferAmount = UInt256.ONE;
    var accountAddress = REAddr.ofPubKeyAccount(self);
    var otherKey = PrivateKeys.ofNumeric(2).getPublicKey();
    var otherAddress = REAddr.ofPubKeyAccount(otherKey);
    return new ConstructionBuildRequest().message(message).networkIdentifier(new NetworkIdentifier().network("localnet")).feePayer(coreModelMapper.entityIdentifier(accountAddress)).addOperationGroupsItem(new OperationGroup().addOperationsItem(new Operation().entityIdentifier(coreModelMapper.entityIdentifier(accountAddress)).amount(coreModelMapper.nativeTokenAmount(false, transferAmount))).addOperationsItem(new Operation().entityIdentifier(coreModelMapper.entityIdentifier(otherAddress)).amount(coreModelMapper.nativeTokenAmount(true, transferAmount))));
}
Also used : OperationGroup(com.radixdlt.api.core.openapitools.model.OperationGroup) ConstructionBuildRequest(com.radixdlt.api.core.openapitools.model.ConstructionBuildRequest) NetworkIdentifier(com.radixdlt.api.core.openapitools.model.NetworkIdentifier) Operation(com.radixdlt.api.core.openapitools.model.Operation)

Aggregations

NetworkIdentifier (com.radixdlt.api.core.openapitools.model.NetworkIdentifier)32 ApiTest (com.radixdlt.api.ApiTest)29 Test (org.junit.Test)29 EntityRequest (com.radixdlt.api.core.openapitools.model.EntityRequest)11 CommittedTransactionsRequest (com.radixdlt.api.core.openapitools.model.CommittedTransactionsRequest)4 PartialStateIdentifier (com.radixdlt.api.core.openapitools.model.PartialStateIdentifier)4 KeySignRequest (com.radixdlt.api.core.openapitools.model.KeySignRequest)3 Operation (com.radixdlt.api.core.openapitools.model.Operation)3 ConstructionBuildRequest (com.radixdlt.api.core.openapitools.model.ConstructionBuildRequest)2 ConstructionDeriveRequest (com.radixdlt.api.core.openapitools.model.ConstructionDeriveRequest)2 ConstructionFinalizeRequest (com.radixdlt.api.core.openapitools.model.ConstructionFinalizeRequest)2 ConstructionHashRequest (com.radixdlt.api.core.openapitools.model.ConstructionHashRequest)2 ConstructionParseRequest (com.radixdlt.api.core.openapitools.model.ConstructionParseRequest)2 EngineStatusRequest (com.radixdlt.api.core.openapitools.model.EngineStatusRequest)2 EntityIdentifier (com.radixdlt.api.core.openapitools.model.EntityIdentifier)2 MempoolTransactionRequest (com.radixdlt.api.core.openapitools.model.MempoolTransactionRequest)2 OperationGroup (com.radixdlt.api.core.openapitools.model.OperationGroup)2 Signature (com.radixdlt.api.core.openapitools.model.Signature)2 Inject (com.google.inject.Inject)1 ConstructionParseHandler (com.radixdlt.api.core.handlers.ConstructionParseHandler)1