Documentation ¶
Index ¶
- Variables
- func BuildCreateMetaNodeMsg(p2pPubKey fwcryptotypes.PubKey, depositAmount txclienttypes.Coin, ...) (*registerv1.MsgCreateMetaNode, error)
- func BuildCreateResourceNodeMsg(nodeType msgtypes.NodeType, p2pPubKey fwcryptotypes.PubKey, ...) (*registerv1.MsgCreateResourceNode, error)
- func BuildFileUploadMsg(fileHash string, from fwtypes.WalletAddress, ...) *sdsv1.MsgFileUpload
- func BuildKickMetaNodeVoteMsg(targetNetworkAddress fwtypes.P2PAddress, opinion bool, ...) *registerv1.MsgKickMetaNodeVote
- func BuildMetaNodeRegistrationVoteMsg(candidateNetworkAddress fwtypes.P2PAddress, ...) *registerv1.MsgMetaNodeRegistrationVote
- func BuildPrepayMsg(senderAddress fwtypes.WalletAddress, beneficiaryAddress fwtypes.WalletAddress, ...) *sdsv1.MsgPrepay
- func BuildRemoveMetaNodeMsg(nodeAddress fwtypes.P2PAddress, ownerAddress fwtypes.WalletAddress) *registerv1.MsgRemoveMetaNode
- func BuildRemoveResourceNodeMsg(nodeAddress fwtypes.P2PAddress, ownerAddress fwtypes.WalletAddress) *registerv1.MsgRemoveResourceNode
- func BuildSendMsg(senderAddress fwtypes.WalletAddress, toAddress fwtypes.WalletAddress, ...) *bankv1beta1.MsgSend
- func BuildSlashingResourceNodeMsg(spP2pAddress []fwtypes.P2PAddress, spWalletAddress []fwtypes.WalletAddress, ...) *potv1.MsgSlashingResourceNode
- func BuildTxBytes(txConfig TxConfig, unsignedTx *txv1beta1.Tx, chainId string, ...) ([]byte, error)
- func BuildUpdateEffectiveDepositMsg(spP2pAddress []fwtypes.P2PAddress, spWalletAddress []fwtypes.WalletAddress, ...) *registerv1.MsgUpdateEffectiveDeposit
- func BuildUpdateMetaNodeDepositMsg(networkAddr fwtypes.P2PAddress, ownerAddr fwtypes.WalletAddress, ...) *registerv1.MsgUpdateMetaNodeDeposit
- func BuildUpdateResourceNodeDepositMsg(networkAddr fwtypes.P2PAddress, ownerAddr fwtypes.WalletAddress, ...) *registerv1.MsgUpdateResourceNodeDeposit
- func BuildUpdateResourceNodeMsg(networkAddress fwtypes.P2PAddress, ...) *registerv1.MsgUpdateResourceNode
- func BuildVolumeReportMsg(traffic []*txclienttypes.Traffic, reporterAddress fwtypes.P2PAddress, ...) (*potv1.MsgVolumeReport, []byte, error)
- func BuildWithdrawMsg(amount txclienttypes.Coin, senderAddress fwtypes.WalletAddress, ...) *potv1.MsgWithdraw
- func CreateAndSimulateMultiMsgTx(msgs []*anypb.Any, txFee types.TxFee, memo string, ...) ([]byte, error)
- func CreateAndSimulateTx(msg *anypb.Any, txFee types.TxFee, memo string, ...) ([]byte, error)
- func DirectSignBytes(bodyBytes, authInfoBytes []byte, chainID string, accnum uint64) ([]byte, error)
- func SetSignatures(tx *txv1beta1.Tx, signatures ...signing.SignatureV2) (*txv1beta1.Tx, error)
- func SignWithPrivKey(signMode signingv1beta1.SignMode, signerData authsigning.SignerData, ...) (txsigning.SignatureV2, error)
- type TxConfig
Constants ¶
This section is empty.
Variables ¶
var DefaultSignModes = []signingv1beta1.SignMode{ signingv1beta1.SignMode_SIGN_MODE_DIRECT, }
DefaultSignModes are the default sign modes enabled for protobuf transactions.
Functions ¶
func BuildCreateMetaNodeMsg ¶
func BuildCreateMetaNodeMsg(p2pPubKey fwcryptotypes.PubKey, depositAmount txclienttypes.Coin, ownerAddress fwtypes.WalletAddress, beneficiaryAddress fwtypes.WalletAddress) (*registerv1.MsgCreateMetaNode, error)
func BuildCreateResourceNodeMsg ¶
func BuildCreateResourceNodeMsg(nodeType msgtypes.NodeType, p2pPubKey fwcryptotypes.PubKey, depositAmount txclienttypes.Coin, ownerAddress, beneficiaryAddress fwtypes.WalletAddress) (*registerv1.MsgCreateResourceNode, error)
func BuildFileUploadMsg ¶
func BuildFileUploadMsg(fileHash string, from fwtypes.WalletAddress, reporterAddress fwtypes.P2PAddress, uploaderAddress fwtypes.WalletAddress) *sdsv1.MsgFileUpload
func BuildKickMetaNodeVoteMsg ¶
func BuildKickMetaNodeVoteMsg(targetNetworkAddress fwtypes.P2PAddress, opinion bool, voterNetworkAddress fwtypes.P2PAddress, voterOwnerAddress fwtypes.WalletAddress) *registerv1.MsgKickMetaNodeVote
func BuildMetaNodeRegistrationVoteMsg ¶
func BuildMetaNodeRegistrationVoteMsg(candidateNetworkAddress fwtypes.P2PAddress, candidateOwnerAddress fwtypes.WalletAddress, voterNetworkAddress fwtypes.P2PAddress, voterOwnerAddress fwtypes.WalletAddress, voteOpinion bool, ) *registerv1.MsgMetaNodeRegistrationVote
func BuildPrepayMsg ¶
func BuildPrepayMsg(senderAddress fwtypes.WalletAddress, beneficiaryAddress fwtypes.WalletAddress, amount txclienttypes.Coin, ) *sdsv1.MsgPrepay
func BuildRemoveMetaNodeMsg ¶
func BuildRemoveMetaNodeMsg(nodeAddress fwtypes.P2PAddress, ownerAddress fwtypes.WalletAddress, ) *registerv1.MsgRemoveMetaNode
func BuildRemoveResourceNodeMsg ¶
func BuildRemoveResourceNodeMsg(nodeAddress fwtypes.P2PAddress, ownerAddress fwtypes.WalletAddress, ) *registerv1.MsgRemoveResourceNode
func BuildSendMsg ¶
func BuildSendMsg(senderAddress fwtypes.WalletAddress, toAddress fwtypes.WalletAddress, amount txclienttypes.Coin) *bankv1beta1.MsgSend
func BuildSlashingResourceNodeMsg ¶
func BuildSlashingResourceNodeMsg(spP2pAddress []fwtypes.P2PAddress, spWalletAddress []fwtypes.WalletAddress, ppP2pAddress fwtypes.P2PAddress, ppWalletAddress fwtypes.WalletAddress, slashingAmount *big.Int, suspend bool, ) *potv1.MsgSlashingResourceNode
func BuildTxBytes ¶
func BuildUpdateEffectiveDepositMsg ¶
func BuildUpdateEffectiveDepositMsg(spP2pAddress []fwtypes.P2PAddress, spWalletAddress []fwtypes.WalletAddress, ppP2pAddress fwtypes.P2PAddress, newEffectiveDeposit *big.Int) *registerv1.MsgUpdateEffectiveDeposit
func BuildUpdateMetaNodeDepositMsg ¶
func BuildUpdateMetaNodeDepositMsg(networkAddr fwtypes.P2PAddress, ownerAddr fwtypes.WalletAddress, depositDelta txclienttypes.Coin) *registerv1.MsgUpdateMetaNodeDeposit
func BuildUpdateResourceNodeDepositMsg ¶
func BuildUpdateResourceNodeDepositMsg(networkAddr fwtypes.P2PAddress, ownerAddr fwtypes.WalletAddress, depositDelta txclienttypes.Coin) *registerv1.MsgUpdateResourceNodeDeposit
func BuildUpdateResourceNodeMsg ¶
func BuildUpdateResourceNodeMsg(networkAddress fwtypes.P2PAddress, ownerAddress, beneficiaryAddress fwtypes.WalletAddress, description *registerv1.Description, nodeType uint32) *registerv1.MsgUpdateResourceNode
func BuildVolumeReportMsg ¶
func BuildVolumeReportMsg(traffic []*txclienttypes.Traffic, reporterAddress fwtypes.P2PAddress, reporterOwnerAddress fwtypes.WalletAddress, epoch uint64, reportReference string, blsTxDataHash, blsSignature []byte, blsPubKeys [][]byte) (*potv1.MsgVolumeReport, []byte, error)
func BuildWithdrawMsg ¶
func BuildWithdrawMsg(amount txclienttypes.Coin, senderAddress fwtypes.WalletAddress, targetAddress fwtypes.WalletAddress, ) *potv1.MsgWithdraw
func CreateAndSimulateTx ¶
func DirectSignBytes ¶
func DirectSignBytes(bodyBytes, authInfoBytes []byte, chainID string, accnum uint64) ([]byte, error)
DirectSignBytes returns the SIGN_MODE_DIRECT sign bytes for the provided TxBody bytes, AuthInfo bytes, chain ID, account number and sequence.
func SetSignatures ¶
func SignWithPrivKey ¶
func SignWithPrivKey( signMode signingv1beta1.SignMode, signerData authsigning.SignerData, tx *txv1beta1.Tx, priv fwcryptotypes.PrivKey, txConfig TxConfig, accSeq uint64, ) (txsigning.SignatureV2, error)
SignWithPrivKey signs a given tx with the given private key, and returns the corresponding SignatureV2 if the signing is successful.
Types ¶
type TxConfig ¶
type TxConfig interface {
SignModeHandler() signing.SignModeHandler
}
TxConfig defines an interface a client can utilize to generate an application-defined concrete transaction type. The type returned must implement TxBuilder.
func NewTxConfig ¶
func NewTxConfig(enabledSignModes []signingv1beta1.SignMode) TxConfig
NewTxConfig returns a new protobuf TxConfig using the provided ProtoCodec and sign modes. The first enabled sign mode will become the default sign mode. NOTE: Use NewTxConfigWithHandler to provide a custom signing handler in case the sign mode is not supported by default (eg: SignMode_SIGN_MODE_EIP_191).
func NewTxConfigWithHandler ¶
func NewTxConfigWithHandler(handler authsigning.SignModeHandler) TxConfig
NewTxConfig returns a new protobuf TxConfig using the provided ProtoCodec and signing handler.