37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package client
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
|
|
"github.com/cosmos/cosmos-sdk/x/auth/signing"
|
|
)
|
|
|
|
type (
|
|
// TxGenerator defines an interface a client can utilize to generate an
|
|
// application-defined concrete transaction type. The type returned must
|
|
// implement TxBuilder.
|
|
TxGenerator interface {
|
|
NewTxBuilder() TxBuilder
|
|
SignModeHandler() signing.SignModeHandler
|
|
|
|
TxEncoder() sdk.TxEncoder
|
|
TxDecoder() sdk.TxDecoder
|
|
TxJSONEncoder() sdk.TxEncoder
|
|
TxJSONDecoder() sdk.TxDecoder
|
|
}
|
|
|
|
// TxBuilder defines an interface which an application-defined concrete transaction
|
|
// type must implement. Namely, it must be able to set messages, generate
|
|
// signatures, and provide canonical bytes to sign over. The transaction must
|
|
// also know how to encode itself.
|
|
TxBuilder interface {
|
|
GetTx() signing.SigFeeMemoTx
|
|
|
|
SetMsgs(msgs ...sdk.Msg) error
|
|
SetSignatures(signatures ...signingtypes.SignatureV2) error
|
|
SetMemo(memo string)
|
|
SetFeeAmount(amount sdk.Coins)
|
|
SetGasLimit(limit uint64)
|
|
}
|
|
)
|