Documentation ¶
Overview ¶
Package keychain is an SDK for building Keychain on the Warden Protocol blockchain.
To learn more about the Warden Protocol, visit https://docs.wardenprotocol.com/.
For an example of an application built using this SDK, see the `wardenkms/` folder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) ConnectionState ¶
func (a *App) ConnectionState() connectivity.State
func (*App) SetKeyRequestHandler ¶
func (a *App) SetKeyRequestHandler(handler KeyRequestHandler)
func (*App) SetSignRequestHandler ¶
func (a *App) SetSignRequestHandler(handler SignRequestHandler)
type Config ¶
type Config struct { Logger *slog.Logger // ChainID is the chain ID of the chain the keychain is running on. ChainID string // GRPCURL is the URL of the gRPC server to connect to. // e.g. "localhost:9090" GRPCURL string // GRPCInsecure is whether to use an insecure connection to the gRPC server. GRPCInsecure bool // KeychainId is the ID of the keychain this instance will fetch requests for. KeychainId uint64 // DerivationPath is the derivation path to use with the Mnemonic to derive this Keychain's party private key. DerivationPath string // Mnemonic is the mnemonic to use to derive this Keychain's party private key. Mnemonic string // BatchTimeout is the time to wait before sending a batch of requests to the blockchain. // Tipically, the batch timeout should be set to the time it takes to produce a block on the blockchain. BatchTimeout time.Duration // BatchSize is the maximum number of requests to batch together before sending them to the blockchain. BatchSize int // GasLimit is the maximum amount of gas to use for each transaction. // The more messages in a batch, the more gas is needed. GasLimit uint64 }
type KeyRequest ¶
type KeyRequest wardentypes.KeyRequest
type KeyRequestHandler ¶
type KeyRequestHandler func(w KeyResponseWriter, req *KeyRequest)
type KeyResponseWriter ¶
type RequestTracker ¶ added in v0.1.1
type RequestTracker struct {
// contains filtered or unexported fields
}
func NewRequestTracker ¶ added in v0.1.1
func NewRequestTracker() *RequestTracker
func (*RequestTracker) Done ¶ added in v0.1.1
func (t *RequestTracker) Done(id uint64)
func (*RequestTracker) Ingested ¶ added in v0.1.1
func (t *RequestTracker) Ingested(id uint64)
func (*RequestTracker) IsNew ¶ added in v0.1.1
func (t *RequestTracker) IsNew(id uint64) bool
type SignRequest ¶
type SignRequest wardentypes.SignRequest
type SignRequestHandler ¶
type SignRequestHandler func(w SignResponseWriter, req *SignRequest)
type SignResponseWriter ¶
type TxWriter ¶ added in v0.1.1
type TxWriter struct { // Limit is the maximum number of messages to batch together. When the limit is reached, the batch is sent. Limit int // BatchTimeout is the maximum time to wait before sending a batch of messages. BatchTimeout time.Duration // Client is the client used to send transactions to the chain. Client *client.TxClient Logger *slog.Logger GasLimit uint64 Fees sdk.Coins // contains filtered or unexported fields }
func NewTxWriter ¶ added in v0.1.1
Click to show internal directories.
Click to hide internal directories.