nervos

package
v0.0.1-gowrapper-dev Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_Nervos_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Cell

type Cell struct {

	// The unspent output
	OutPoint *OutPoint `protobuf:"bytes,1,opt,name=out_point,json=outPoint,proto3" json:"out_point,omitempty"`
	// Amount of the cell
	Capacity uint64 `protobuf:"varint,2,opt,name=capacity,proto3" json:"capacity,omitempty"`
	// Lock script
	Lock *Script `protobuf:"bytes,3,opt,name=lock,proto3" json:"lock,omitempty"`
	// Type script
	Type *Script `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	// Data
	Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// Optional block number
	BlockNumber uint64 `protobuf:"varint,6,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`
	// Optional block hash
	BlockHash []byte `protobuf:"bytes,7,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	// Optional since the cell is available to spend
	Since uint64 `protobuf:"varint,8,opt,name=since,proto3" json:"since,omitempty"`
	// Optional input type data to be included in witness
	InputType []byte `protobuf:"bytes,9,opt,name=input_type,json=inputType,proto3" json:"input_type,omitempty"`
	// Optional output type data to be included in witness
	OutputType []byte `protobuf:"bytes,10,opt,name=output_type,json=outputType,proto3" json:"output_type,omitempty"`
	// contains filtered or unexported fields
}

An unspent cell output, that can serve as input to a transaction

func (*Cell) Descriptor deprecated

func (*Cell) Descriptor() ([]byte, []int)

Deprecated: Use Cell.ProtoReflect.Descriptor instead.

func (*Cell) GetBlockHash

func (x *Cell) GetBlockHash() []byte

func (*Cell) GetBlockNumber

func (x *Cell) GetBlockNumber() uint64

func (*Cell) GetCapacity

func (x *Cell) GetCapacity() uint64

func (*Cell) GetData

func (x *Cell) GetData() []byte

func (*Cell) GetInputType

func (x *Cell) GetInputType() []byte

func (*Cell) GetLock

func (x *Cell) GetLock() *Script

func (*Cell) GetOutPoint

func (x *Cell) GetOutPoint() *OutPoint

func (*Cell) GetOutputType

func (x *Cell) GetOutputType() []byte

func (*Cell) GetSince

func (x *Cell) GetSince() uint64

func (*Cell) GetType

func (x *Cell) GetType() *Script

func (*Cell) ProtoMessage

func (*Cell) ProtoMessage()

func (*Cell) ProtoReflect

func (x *Cell) ProtoReflect() protoreflect.Message

func (*Cell) Reset

func (x *Cell) Reset()

func (*Cell) String

func (x *Cell) String() string

type CellDep

type CellDep struct {

	// Prevents the transaction to be mined before an absolute or relative time
	DepType string `protobuf:"bytes,1,opt,name=dep_type,json=depType,proto3" json:"dep_type,omitempty"`
	// Reference to the previous transaction's output.
	OutPoint *OutPoint `protobuf:"bytes,2,opt,name=out_point,json=outPoint,proto3" json:"out_point,omitempty"`
	// contains filtered or unexported fields
}

Nervos cell dep.

func (*CellDep) Descriptor deprecated

func (*CellDep) Descriptor() ([]byte, []int)

Deprecated: Use CellDep.ProtoReflect.Descriptor instead.

func (*CellDep) GetDepType

func (x *CellDep) GetDepType() string

func (*CellDep) GetOutPoint

func (x *CellDep) GetOutPoint() *OutPoint

func (*CellDep) ProtoMessage

func (*CellDep) ProtoMessage()

func (*CellDep) ProtoReflect

func (x *CellDep) ProtoReflect() protoreflect.Message

func (*CellDep) Reset

func (x *CellDep) Reset()

func (*CellDep) String

func (x *CellDep) String() string

type CellOutput

type CellOutput struct {

	// Transaction amount.
	Capacity uint64 `protobuf:"varint,1,opt,name=capacity,proto3" json:"capacity,omitempty"`
	// Lock script
	Lock *Script `protobuf:"bytes,2,opt,name=lock,proto3" json:"lock,omitempty"`
	// Type script
	Type *Script `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

Nervos cell output.

func (*CellOutput) Descriptor deprecated

func (*CellOutput) Descriptor() ([]byte, []int)

Deprecated: Use CellOutput.ProtoReflect.Descriptor instead.

func (*CellOutput) GetCapacity

func (x *CellOutput) GetCapacity() uint64

func (*CellOutput) GetLock

func (x *CellOutput) GetLock() *Script

func (*CellOutput) GetType

func (x *CellOutput) GetType() *Script

func (*CellOutput) ProtoMessage

func (*CellOutput) ProtoMessage()

func (*CellOutput) ProtoReflect

func (x *CellOutput) ProtoReflect() protoreflect.Message

func (*CellOutput) Reset

func (x *CellOutput) Reset()

func (*CellOutput) String

func (x *CellOutput) String() string

type DaoDeposit

type DaoDeposit struct {

	// Recipient's address.
	ToAddress string `protobuf:"bytes,1,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`
	// Change address.
	ChangeAddress string `protobuf:"bytes,2,opt,name=change_address,json=changeAddress,proto3" json:"change_address,omitempty"`
	// Amount to deposit.
	Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

Deposit

func (*DaoDeposit) Descriptor deprecated

func (*DaoDeposit) Descriptor() ([]byte, []int)

Deprecated: Use DaoDeposit.ProtoReflect.Descriptor instead.

func (*DaoDeposit) GetAmount

func (x *DaoDeposit) GetAmount() uint64

func (*DaoDeposit) GetChangeAddress

func (x *DaoDeposit) GetChangeAddress() string

func (*DaoDeposit) GetToAddress

func (x *DaoDeposit) GetToAddress() string

func (*DaoDeposit) ProtoMessage

func (*DaoDeposit) ProtoMessage()

func (*DaoDeposit) ProtoReflect

func (x *DaoDeposit) ProtoReflect() protoreflect.Message

func (*DaoDeposit) Reset

func (x *DaoDeposit) Reset()

func (*DaoDeposit) String

func (x *DaoDeposit) String() string

type DaoWithdrawPhase1

type DaoWithdrawPhase1 struct {

	// Deposit cell
	DepositCell *Cell `protobuf:"bytes,1,opt,name=deposit_cell,json=depositCell,proto3" json:"deposit_cell,omitempty"`
	// Change address.
	ChangeAddress string `protobuf:"bytes,2,opt,name=change_address,json=changeAddress,proto3" json:"change_address,omitempty"`
	// contains filtered or unexported fields
}

func (*DaoWithdrawPhase1) Descriptor deprecated

func (*DaoWithdrawPhase1) Descriptor() ([]byte, []int)

Deprecated: Use DaoWithdrawPhase1.ProtoReflect.Descriptor instead.

func (*DaoWithdrawPhase1) GetChangeAddress

func (x *DaoWithdrawPhase1) GetChangeAddress() string

func (*DaoWithdrawPhase1) GetDepositCell

func (x *DaoWithdrawPhase1) GetDepositCell() *Cell

func (*DaoWithdrawPhase1) ProtoMessage

func (*DaoWithdrawPhase1) ProtoMessage()

func (*DaoWithdrawPhase1) ProtoReflect

func (x *DaoWithdrawPhase1) ProtoReflect() protoreflect.Message

func (*DaoWithdrawPhase1) Reset

func (x *DaoWithdrawPhase1) Reset()

func (*DaoWithdrawPhase1) String

func (x *DaoWithdrawPhase1) String() string

type DaoWithdrawPhase2

type DaoWithdrawPhase2 struct {

	// Deposit cell
	DepositCell *Cell `protobuf:"bytes,1,opt,name=deposit_cell,json=depositCell,proto3" json:"deposit_cell,omitempty"`
	// Withdrawing cell
	WithdrawingCell *Cell `protobuf:"bytes,2,opt,name=withdrawing_cell,json=withdrawingCell,proto3" json:"withdrawing_cell,omitempty"`
	// Amount
	Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*DaoWithdrawPhase2) Descriptor deprecated

func (*DaoWithdrawPhase2) Descriptor() ([]byte, []int)

Deprecated: Use DaoWithdrawPhase2.ProtoReflect.Descriptor instead.

func (*DaoWithdrawPhase2) GetAmount

func (x *DaoWithdrawPhase2) GetAmount() uint64

func (*DaoWithdrawPhase2) GetDepositCell

func (x *DaoWithdrawPhase2) GetDepositCell() *Cell

func (*DaoWithdrawPhase2) GetWithdrawingCell

func (x *DaoWithdrawPhase2) GetWithdrawingCell() *Cell

func (*DaoWithdrawPhase2) ProtoMessage

func (*DaoWithdrawPhase2) ProtoMessage()

func (*DaoWithdrawPhase2) ProtoReflect

func (x *DaoWithdrawPhase2) ProtoReflect() protoreflect.Message

func (*DaoWithdrawPhase2) Reset

func (x *DaoWithdrawPhase2) Reset()

func (*DaoWithdrawPhase2) String

func (x *DaoWithdrawPhase2) String() string

type NativeTransfer

type NativeTransfer struct {

	// Recipient's address.
	ToAddress string `protobuf:"bytes,1,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`
	// Change address.
	ChangeAddress string `protobuf:"bytes,2,opt,name=change_address,json=changeAddress,proto3" json:"change_address,omitempty"`
	// Amount to send.
	Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
	// If sending max amount.
	UseMaxAmount bool `protobuf:"varint,4,opt,name=use_max_amount,json=useMaxAmount,proto3" json:"use_max_amount,omitempty"`
	// contains filtered or unexported fields
}

Transfer of native asset

func (*NativeTransfer) Descriptor deprecated

func (*NativeTransfer) Descriptor() ([]byte, []int)

Deprecated: Use NativeTransfer.ProtoReflect.Descriptor instead.

func (*NativeTransfer) GetAmount

func (x *NativeTransfer) GetAmount() uint64

func (*NativeTransfer) GetChangeAddress

func (x *NativeTransfer) GetChangeAddress() string

func (*NativeTransfer) GetToAddress

func (x *NativeTransfer) GetToAddress() string

func (*NativeTransfer) GetUseMaxAmount

func (x *NativeTransfer) GetUseMaxAmount() bool

func (*NativeTransfer) ProtoMessage

func (*NativeTransfer) ProtoMessage()

func (*NativeTransfer) ProtoReflect

func (x *NativeTransfer) ProtoReflect() protoreflect.Message

func (*NativeTransfer) Reset

func (x *NativeTransfer) Reset()

func (*NativeTransfer) String

func (x *NativeTransfer) String() string

type OutPoint

type OutPoint struct {

	// The hash of the referenced transaction.
	TxHash []byte `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"`
	// The index of the specific output in the transaction.
	Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

Nervos transaction out-point reference.

func (*OutPoint) Descriptor deprecated

func (*OutPoint) Descriptor() ([]byte, []int)

Deprecated: Use OutPoint.ProtoReflect.Descriptor instead.

func (*OutPoint) GetIndex

func (x *OutPoint) GetIndex() uint32

func (*OutPoint) GetTxHash

func (x *OutPoint) GetTxHash() []byte

func (*OutPoint) ProtoMessage

func (*OutPoint) ProtoMessage()

func (*OutPoint) ProtoReflect

func (x *OutPoint) ProtoReflect() protoreflect.Message

func (*OutPoint) Reset

func (x *OutPoint) Reset()

func (*OutPoint) String

func (x *OutPoint) String() string

type Script

type Script struct {

	// Code hash
	CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"`
	// Hash type
	HashType string `protobuf:"bytes,2,opt,name=hash_type,json=hashType,proto3" json:"hash_type,omitempty"`
	// args
	Args []byte `protobuf:"bytes,3,opt,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

Nervos script

func (*Script) Descriptor deprecated

func (*Script) Descriptor() ([]byte, []int)

Deprecated: Use Script.ProtoReflect.Descriptor instead.

func (*Script) GetArgs

func (x *Script) GetArgs() []byte

func (*Script) GetCodeHash

func (x *Script) GetCodeHash() []byte

func (*Script) GetHashType

func (x *Script) GetHashType() string

func (*Script) ProtoMessage

func (*Script) ProtoMessage()

func (*Script) ProtoReflect

func (x *Script) ProtoReflect() protoreflect.Message

func (*Script) Reset

func (x *Script) Reset()

func (*Script) String

func (x *Script) String() string

type SigningInput

type SigningInput struct {

	// Transaction fee per byte.
	ByteFee uint64 `protobuf:"varint,1,opt,name=byte_fee,json=byteFee,proto3" json:"byte_fee,omitempty"`
	// The available secret private keys used for signing (32 bytes each).
	PrivateKey [][]byte `protobuf:"bytes,2,rep,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	// Available unspent cell outputs.
	Cell []*Cell `protobuf:"bytes,3,rep,name=cell,proto3" json:"cell,omitempty"`
	// Optional transaction plan
	Plan *TransactionPlan `protobuf:"bytes,4,opt,name=plan,proto3" json:"plan,omitempty"`
	// The payload transfer
	//
	// Types that are valid to be assigned to OperationOneof:
	//
	//	*SigningInput_NativeTransfer
	//	*SigningInput_SudtTransfer
	//	*SigningInput_DaoDeposit
	//	*SigningInput_DaoWithdrawPhase1
	//	*SigningInput_DaoWithdrawPhase2
	OperationOneof isSigningInput_OperationOneof `protobuf_oneof:"operation_oneof"`
	// contains filtered or unexported fields
}

Input data necessary to create a signed transaction.

func (*SigningInput) Descriptor deprecated

func (*SigningInput) Descriptor() ([]byte, []int)

Deprecated: Use SigningInput.ProtoReflect.Descriptor instead.

func (*SigningInput) GetByteFee

func (x *SigningInput) GetByteFee() uint64

func (*SigningInput) GetCell

func (x *SigningInput) GetCell() []*Cell

func (*SigningInput) GetDaoDeposit

func (x *SigningInput) GetDaoDeposit() *DaoDeposit

func (*SigningInput) GetDaoWithdrawPhase1

func (x *SigningInput) GetDaoWithdrawPhase1() *DaoWithdrawPhase1

func (*SigningInput) GetDaoWithdrawPhase2

func (x *SigningInput) GetDaoWithdrawPhase2() *DaoWithdrawPhase2

func (*SigningInput) GetNativeTransfer

func (x *SigningInput) GetNativeTransfer() *NativeTransfer

func (*SigningInput) GetOperationOneof

func (x *SigningInput) GetOperationOneof() isSigningInput_OperationOneof

func (*SigningInput) GetPlan

func (x *SigningInput) GetPlan() *TransactionPlan

func (*SigningInput) GetPrivateKey

func (x *SigningInput) GetPrivateKey() [][]byte

func (*SigningInput) GetSudtTransfer

func (x *SigningInput) GetSudtTransfer() *SudtTransfer

func (*SigningInput) ProtoMessage

func (*SigningInput) ProtoMessage()

func (*SigningInput) ProtoReflect

func (x *SigningInput) ProtoReflect() protoreflect.Message

func (*SigningInput) Reset

func (x *SigningInput) Reset()

func (*SigningInput) String

func (x *SigningInput) String() string

type SigningInput_DaoDeposit

type SigningInput_DaoDeposit struct {
	DaoDeposit *DaoDeposit `protobuf:"bytes,7,opt,name=dao_deposit,json=daoDeposit,proto3,oneof"`
}

type SigningInput_DaoWithdrawPhase1

type SigningInput_DaoWithdrawPhase1 struct {
	DaoWithdrawPhase1 *DaoWithdrawPhase1 `protobuf:"bytes,8,opt,name=dao_withdraw_phase1,json=daoWithdrawPhase1,proto3,oneof"`
}

type SigningInput_DaoWithdrawPhase2

type SigningInput_DaoWithdrawPhase2 struct {
	DaoWithdrawPhase2 *DaoWithdrawPhase2 `protobuf:"bytes,9,opt,name=dao_withdraw_phase2,json=daoWithdrawPhase2,proto3,oneof"`
}

type SigningInput_NativeTransfer

type SigningInput_NativeTransfer struct {
	NativeTransfer *NativeTransfer `protobuf:"bytes,5,opt,name=native_transfer,json=nativeTransfer,proto3,oneof"`
}

type SigningInput_SudtTransfer

type SigningInput_SudtTransfer struct {
	SudtTransfer *SudtTransfer `protobuf:"bytes,6,opt,name=sudt_transfer,json=sudtTransfer,proto3,oneof"`
}

type SigningOutput

type SigningOutput struct {

	// Resulting transaction. Note that the amount may be different than the requested amount to account for fees and available funds.
	TransactionJson string `protobuf:"bytes,1,opt,name=transaction_json,json=transactionJson,proto3" json:"transaction_json,omitempty"`
	// Transaction id
	TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// Optional error
	Error common.SigningError `protobuf:"varint,3,opt,name=error,proto3,enum=TW.Common.Proto.SigningError" json:"error,omitempty"`
	// contains filtered or unexported fields
}

Result containing the signed and encoded transaction.

func (*SigningOutput) Descriptor deprecated

func (*SigningOutput) Descriptor() ([]byte, []int)

Deprecated: Use SigningOutput.ProtoReflect.Descriptor instead.

func (*SigningOutput) GetError

func (x *SigningOutput) GetError() common.SigningError

func (*SigningOutput) GetTransactionId

func (x *SigningOutput) GetTransactionId() string

func (*SigningOutput) GetTransactionJson

func (x *SigningOutput) GetTransactionJson() string

func (*SigningOutput) ProtoMessage

func (*SigningOutput) ProtoMessage()

func (*SigningOutput) ProtoReflect

func (x *SigningOutput) ProtoReflect() protoreflect.Message

func (*SigningOutput) Reset

func (x *SigningOutput) Reset()

func (*SigningOutput) String

func (x *SigningOutput) String() string

type SudtTransfer

type SudtTransfer struct {

	// Recipient's address.
	ToAddress string `protobuf:"bytes,1,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"`
	// Change address.
	ChangeAddress string `protobuf:"bytes,2,opt,name=change_address,json=changeAddress,proto3" json:"change_address,omitempty"`
	// SUDT (Simple User Defined Token) address
	SudtAddress []byte `protobuf:"bytes,3,opt,name=sudt_address,json=sudtAddress,proto3" json:"sudt_address,omitempty"`
	// Amount to send.
	Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"`
	// If sending max amount.
	UseMaxAmount bool `protobuf:"varint,5,opt,name=use_max_amount,json=useMaxAmount,proto3" json:"use_max_amount,omitempty"`
	// contains filtered or unexported fields
}

Token transfer (SUDT)

func (*SudtTransfer) Descriptor deprecated

func (*SudtTransfer) Descriptor() ([]byte, []int)

Deprecated: Use SudtTransfer.ProtoReflect.Descriptor instead.

func (*SudtTransfer) GetAmount

func (x *SudtTransfer) GetAmount() string

func (*SudtTransfer) GetChangeAddress

func (x *SudtTransfer) GetChangeAddress() string

func (*SudtTransfer) GetSudtAddress

func (x *SudtTransfer) GetSudtAddress() []byte

func (*SudtTransfer) GetToAddress

func (x *SudtTransfer) GetToAddress() string

func (*SudtTransfer) GetUseMaxAmount

func (x *SudtTransfer) GetUseMaxAmount() bool

func (*SudtTransfer) ProtoMessage

func (*SudtTransfer) ProtoMessage()

func (*SudtTransfer) ProtoReflect

func (x *SudtTransfer) ProtoReflect() protoreflect.Message

func (*SudtTransfer) Reset

func (x *SudtTransfer) Reset()

func (*SudtTransfer) String

func (x *SudtTransfer) String() string

type TransactionPlan

type TransactionPlan struct {

	// A list of cell deps.
	CellDeps []*CellDep `protobuf:"bytes,1,rep,name=cell_deps,json=cellDeps,proto3" json:"cell_deps,omitempty"`
	// A list of header deps.
	HeaderDeps [][]byte `protobuf:"bytes,2,rep,name=header_deps,json=headerDeps,proto3" json:"header_deps,omitempty"`
	// A list of 1 or more selected cells for this transaction
	SelectedCells []*Cell `protobuf:"bytes,3,rep,name=selected_cells,json=selectedCells,proto3" json:"selected_cells,omitempty"`
	// A list of 1 or more outputs by this transaction
	Outputs []*CellOutput `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// A list of outputs data.
	OutputsData [][]byte `protobuf:"bytes,5,rep,name=outputs_data,json=outputsData,proto3" json:"outputs_data,omitempty"`
	// Optional error
	Error common.SigningError `protobuf:"varint,6,opt,name=error,proto3,enum=TW.Common.Proto.SigningError" json:"error,omitempty"`
	// contains filtered or unexported fields
}

Nervos transaction plan

func (*TransactionPlan) Descriptor deprecated

func (*TransactionPlan) Descriptor() ([]byte, []int)

Deprecated: Use TransactionPlan.ProtoReflect.Descriptor instead.

func (*TransactionPlan) GetCellDeps

func (x *TransactionPlan) GetCellDeps() []*CellDep

func (*TransactionPlan) GetError

func (x *TransactionPlan) GetError() common.SigningError

func (*TransactionPlan) GetHeaderDeps

func (x *TransactionPlan) GetHeaderDeps() [][]byte

func (*TransactionPlan) GetOutputs

func (x *TransactionPlan) GetOutputs() []*CellOutput

func (*TransactionPlan) GetOutputsData

func (x *TransactionPlan) GetOutputsData() [][]byte

func (*TransactionPlan) GetSelectedCells

func (x *TransactionPlan) GetSelectedCells() []*Cell

func (*TransactionPlan) ProtoMessage

func (*TransactionPlan) ProtoMessage()

func (*TransactionPlan) ProtoReflect

func (x *TransactionPlan) ProtoReflect() protoreflect.Message

func (*TransactionPlan) Reset

func (x *TransactionPlan) Reset()

func (*TransactionPlan) String

func (x *TransactionPlan) String() string

Jump to

Keyboard shortcuts

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