transaction

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() *cobra.Command

Commands set TXGeneratorCommandsInstance that will used by whole commands

func GenerateBasicTransaction

func GenerateBasicTransaction(
	senderAccountAddressHex, senderSeed string,
	version uint32,
	timestamp, fee int64,
	recipientAccountAddressHex,
	message string,
) *model.Transaction

GenerateBasicTransaction return basic transaction based on common transaction field

func GenerateEscrowApprovalTransaction

func GenerateEscrowApprovalTransaction(tx *model.Transaction) *model.Transaction

GenerateEscrowApprovalTransaction set escrow approval body

func GenerateEscrowedTransaction

func GenerateEscrowedTransaction(
	tx *model.Transaction,
) *model.Transaction

GenerateEscrowedTransaction inject escrow. Need:

  1. esApproverAddressHex
  2. Commission
  3. Timeout

Invalid escrow validation when those fields has not set

func GenerateProofOfOwnership

func GenerateProofOfOwnership(
	dbPath, dbname, nodeOwnerAccountAddress, nodeSeed, proofOfOwnershipHex string,
) *model.ProofOfOwnership

GenerateProofOfOwnership generate proof of owner ship for transaction related with node registry

func GenerateSignedTxBytes

func GenerateSignedTxBytes(
	tx *model.Transaction,
	senderSeed string,
	accountTypeInt int32,
	optionalSignParams ...interface{},
) []byte

GenerateSignedTxBytes return signed transaction bytes

func GenerateTxClaimNode

func GenerateTxClaimNode(
	tx *model.Transaction,
	nodePubKey []byte,
	proofOfOwnerShip *model.ProofOfOwnership,
) *model.Transaction

GenerateTxClaimNode return claim node transaction based on provided basic transaction & others specific field for claim node transaction

func GenerateTxFeeVoteCommitment

func GenerateTxFeeVoteCommitment(
	tx *model.Transaction,
	voteHash []byte,
) *model.Transaction

GenerateTxFeeVoteCommitment return fee vote commit vote transaction based on provided basic transaction & others specific field for fee vote commit vote transaction

func GenerateTxFeeVoteRevealPhase

func GenerateTxFeeVoteRevealPhase(tx *model.Transaction, voteInfo *model.FeeVoteInfo, voteInfoSigned []byte) *model.Transaction

func GenerateTxLiquidPayment

func GenerateTxLiquidPayment(tx *model.Transaction, sendAmount int64, completeMinutes uint64) *model.Transaction

GenerateTxLiquidPayment return liquid payment transaction based on provided basic transaction & ammunt

func GenerateTxLiquidPaymentStop

func GenerateTxLiquidPaymentStop(tx *model.Transaction, transactionID int64) *model.Transaction

GenerateTxLiquidPaymentStop return liquid payment stop transaction based on provided basic transaction & ammunt

func GenerateTxRegisterNode

func GenerateTxRegisterNode(
	tx *model.Transaction,
	lockedBalance int64,
	nodePubKey []byte,
	proofOfOwnerShip *model.ProofOfOwnership,
) *model.Transaction

GenerateTxRegisterNode return register node transaction based on provided basic transaction & others specific field for generate register node transaction

func GenerateTxRemoveAccountDataset

func GenerateTxRemoveAccountDataset(
	tx *model.Transaction,
	property, value string,
) *model.Transaction

GenerateTxRemoveAccountDataset return remove account dataset transaction based on provided basic transaction & others specific field for remove account dataset transaction

func GenerateTxRemoveNode

func GenerateTxRemoveNode(tx *model.Transaction, nodePubKey []byte) *model.Transaction

GenerateTxRemoveNode return remove node transaction based on provided basic transaction & others specific field for remove node transaction

func GenerateTxRemoveNodeHDwallet

func GenerateTxRemoveNodeHDwallet(tx *model.Transaction, nodePubKey []byte) *model.Transaction

func GenerateTxSendZBC

func GenerateTxSendZBC(tx *model.Transaction, sendAmount int64) *model.Transaction

GenerateTxSendZBC return send sbc transaction based on provided basic transaction & ammunt

func GenerateTxSetupAccountDataset

func GenerateTxSetupAccountDataset(
	tx *model.Transaction,
	property, value string,
) *model.Transaction

GenerateTxSetupAccountDataset return setup account dataset transaction based on provided basic transaction & others specific field for setup account dataset transaction

func GenerateTxUpdateNode

func GenerateTxUpdateNode(
	tx *model.Transaction,
	lockedBalance int64,
	nodePubKey []byte,
	proofOfOwnerShip *model.ProofOfOwnership,
) *model.Transaction

GenerateTxUpdateNode return update node transaction based on provided basic transaction & others specific field for update register node transaction

func GeneratedMultiSignatureTransaction

func GeneratedMultiSignatureTransaction(
	tx *model.Transaction,
	minSignature uint32,
	nonce int64,
	unsignedTxHex, txHash string,
	addressSignatures map[string]string, addressesHex []string,
) *model.Transaction

GeneratedMultiSignatureTransaction inject escrow. Need:

  1. unsignedTxHex
  2. signatures
  3. multisigInfo: - minSignature - nonce - addressesHex

Invalid escrow validation when those fields has not set

func PrintTx

func PrintTx(signedTxBytes []byte, outputType string)

PrintTx will print out the signed transaction based on provided format

Types

type RunCommand

type RunCommand func(ccmd *cobra.Command, args []string)

RunCommand represent of output function from transaction generator commands

type TXGeneratorCommands

type TXGeneratorCommands struct{}

TXGeneratorCommands represent struct of transaction generator commands

func (*TXGeneratorCommands) ClaimNodeProcess

func (*TXGeneratorCommands) ClaimNodeProcess() RunCommand

ClaimNodeProcess for generate TX ClaimNode type

func (*TXGeneratorCommands) EscrowApprovalProcess

func (*TXGeneratorCommands) EscrowApprovalProcess() RunCommand

EscrowApprovalProcess for generate TX EscrowApproval type

func (*TXGeneratorCommands) LiquidPaymentProcess

func (*TXGeneratorCommands) LiquidPaymentProcess() RunCommand

LiquidPaymentProcess for generate TX LiquidPayment type

func (*TXGeneratorCommands) LiquidPaymentStopProcess

func (*TXGeneratorCommands) LiquidPaymentStopProcess() RunCommand

LiquidPaymentStopProcess for generate TX LiquidPaymentStop type

func (*TXGeneratorCommands) MultiSignatureProcess

func (*TXGeneratorCommands) MultiSignatureProcess() RunCommand

MultiSignatureProcess for generate TX MultiSignature type

func (*TXGeneratorCommands) RegisterNodeProcess

func (*TXGeneratorCommands) RegisterNodeProcess() RunCommand

RegisterNodeProcess for generate TX RegisterNode type

func (*TXGeneratorCommands) RemoveAccountDatasetProcess

func (*TXGeneratorCommands) RemoveAccountDatasetProcess() RunCommand

RemoveAccountDatasetProcess for generate TX RemoveAccountDataset type

func (*TXGeneratorCommands) RemoveNodeProcess

func (*TXGeneratorCommands) RemoveNodeProcess() RunCommand

RemoveNodeProcess for generate TX RemoveNode type

func (*TXGeneratorCommands) SendZBCProcess

func (*TXGeneratorCommands) SendZBCProcess() RunCommand

SendZBCProcess for generate TX SendZBC type

func (*TXGeneratorCommands) SetupAccountDatasetProcess

func (*TXGeneratorCommands) SetupAccountDatasetProcess() RunCommand

SetupAccountDatasetProcess for generate TX SetupAccountDataset type

func (*TXGeneratorCommands) UpdateNodeProcess

func (*TXGeneratorCommands) UpdateNodeProcess() RunCommand

UpdateNodeProcess for generate TX UpdateNode type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL