-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
3,803 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
we-node-client-domain/src/main/kotlin/com/wavesenterprise/sdk/node/domain/PermitDataEntry.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...-mapper/src/main/kotlin/com/wavesenterprise/sdk/node/client/grpc/mapper/TransferMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.wavesenterprise.sdk.node.client.grpc.mapper | ||
|
||
import com.wavesenterprise.sdk.node.client.grpc.mapper.GrpcTypesMapper.byteArray | ||
import com.wavesenterprise.sdk.node.domain.Address | ||
import com.wavesenterprise.sdk.node.domain.Amount | ||
import com.wavesenterprise.sdk.node.domain.Transfer | ||
import com.wavesenterprise.transaction.protobuf.Transfer as ProtoTransfer | ||
|
||
object TransferMapper { | ||
|
||
@JvmStatic | ||
fun ProtoTransfer.domain(): Transfer = | ||
domainInternal(this) | ||
|
||
@JvmStatic | ||
internal fun domainInternal(protoTransfer: ProtoTransfer): Transfer = | ||
Transfer( | ||
recipient = Address(protoTransfer.recipient.byteArray()), | ||
amount = Amount(protoTransfer.amount), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...src/main/kotlin/com/wavesenterprise/sdk/node/client/grpc/mapper/tx/CreateAliasTxMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
package com.wavesenterprise.sdk.node.client.grpc.mapper.tx | ||
|
||
import com.wavesenterprise.sdk.node.client.grpc.mapper.GrpcTypesMapper.byteArray | ||
import com.wavesenterprise.sdk.node.domain.Address | ||
import com.wavesenterprise.sdk.node.domain.Alias | ||
import com.wavesenterprise.sdk.node.domain.Fee | ||
import com.wavesenterprise.sdk.node.domain.FeeAssetId | ||
import com.wavesenterprise.sdk.node.domain.PublicKey | ||
import com.wavesenterprise.sdk.node.domain.Signature | ||
import com.wavesenterprise.sdk.node.domain.Timestamp | ||
import com.wavesenterprise.sdk.node.domain.TxId | ||
import com.wavesenterprise.sdk.node.domain.TxVersion | ||
import com.wavesenterprise.sdk.node.domain.tx.CreateAliasTx | ||
import com.wavesenterprise.transaction.protobuf.CreateAliasTransaction | ||
import com.wavesenterprise.transaction.protobuf.feeAssetIdOrNull | ||
|
||
object CreateAliasTxMapper { | ||
|
||
fun dtoInternal(tx: CreateAliasTx): CreateAliasTransaction { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
@JvmStatic | ||
fun CreateAliasTransaction.domain(version: TxVersion): CreateAliasTx = | ||
domainInternal(this, version) | ||
|
||
@JvmStatic | ||
internal fun domainInternal(tx: CreateAliasTransaction, version: TxVersion): CreateAliasTx = | ||
CreateAliasTx( | ||
id = TxId(tx.id.byteArray()), | ||
senderPublicKey = PublicKey(tx.senderPublicKey.toByteArray()), | ||
alias = Alias(tx.alias.toString()), | ||
fee = Fee(tx.fee), | ||
timestamp = Timestamp.fromUtcTimestamp(tx.timestamp), | ||
feeAssetId = tx.feeAssetIdOrNull?.let { FeeAssetId.fromByteArray(it.value.toByteArray()) }, | ||
proofs = tx.proofsList?.map { Signature(it.byteArray()) }, | ||
senderAddress = Address(tx.senderAddress.toByteArray()), | ||
version = version, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...mapper/src/main/kotlin/com/wavesenterprise/sdk/node/client/grpc/mapper/tx/DataTxMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
package com.wavesenterprise.sdk.node.client.grpc.mapper.tx | ||
|
||
import com.wavesenterprise.sdk.node.client.grpc.mapper.DataEntryMapper.domain | ||
import com.wavesenterprise.sdk.node.client.grpc.mapper.GrpcTypesMapper.byteArray | ||
import com.wavesenterprise.sdk.node.domain.Address | ||
import com.wavesenterprise.sdk.node.domain.Fee | ||
import com.wavesenterprise.sdk.node.domain.FeeAssetId | ||
import com.wavesenterprise.sdk.node.domain.PublicKey | ||
import com.wavesenterprise.sdk.node.domain.Signature | ||
import com.wavesenterprise.sdk.node.domain.Timestamp | ||
import com.wavesenterprise.sdk.node.domain.TxId | ||
import com.wavesenterprise.sdk.node.domain.TxVersion | ||
import com.wavesenterprise.sdk.node.domain.tx.DataTx | ||
import com.wavesenterprise.transaction.protobuf.DataTransaction | ||
import com.wavesenterprise.transaction.protobuf.feeAssetIdOrNull | ||
|
||
object DataTxMapper { | ||
|
||
fun dtoInternal(tx: DataTx): DataTransaction { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
@JvmStatic | ||
fun DataTransaction.domain(version: TxVersion): DataTx = | ||
domainInternal(this, version) | ||
|
||
@JvmStatic | ||
internal fun domainInternal(tx: DataTransaction, version: TxVersion): DataTx = | ||
DataTx( | ||
id = TxId(tx.id.byteArray()), | ||
senderPublicKey = PublicKey(tx.senderPublicKey.byteArray()), | ||
authorPublicKey = PublicKey(tx.authorPublicKey.byteArray()), | ||
data = tx.dataList.map { it.domain() }, | ||
fee = Fee(tx.fee), | ||
feeAssetId = tx.feeAssetIdOrNull?.let { | ||
FeeAssetId( | ||
txId = TxId(it.value.byteArray()) | ||
) | ||
}, | ||
timestamp = Timestamp(tx.timestamp), | ||
proofs = tx.proofsList?.map { Signature(it.byteArray()) }, | ||
senderAddress = Address(tx.senderAddress.byteArray()), | ||
authorAddress = Address(tx.authorPublicKey.byteArray()), | ||
version = version, | ||
) | ||
} |
Oops, something went wrong.