Documentation ¶
Index ¶
- Constants
- func BroadcastCosmosTx(rawTx []byte) (*txtypes.BroadcastTxResponse, error)
- func BuildTxBody(msgs ...sdk.Msg) (*txtypes.TxBody, error)
- func EncodeCosmosTx(tx *txtypes.Tx) ([]byte, error)
- func GetAuthInfo(anySigner types.AnySignerEntity, gas sdk.Coins) (*txtypes.AuthInfo, error)
- func GetSignDoc(txBody *txtypes.TxBody, authInfo *txtypes.AuthInfo) (*txtypes.SignDoc, error)
- func SerializeRawTx(body *txtypes.TxBody, authInfo *txtypes.AuthInfo, sig []byte) ([]byte, error)
- func SignCosmosTx(anySigner types.AnySignerEntity, msgs ...sdk.Msg) ([]byte, error)
- func SignDocWithKSS(anySigner types.AnySignerEntity, signDoc *txtypes.SignDoc) ([]byte, error)
- type Account
- func (a *Account) Address() string
- func (a *Account) Info() *crypto.AccountData
- func (a *Account) PublicKey() (*crypto.Secp256k1PubKey, error)
- func (a *Account) SendTx(msgs ...sdk.Msg) (*sdk.TxResponse, error)
- func (a *Account) Sign(msg []byte) ([]byte, error)
- func (a *Account) Type() string
- func (a *Account) Verify(msg []byte, sig []byte) (bool, error)
Constants ¶
const Method = types.DIDMethod("sonr")
Method is the DID method for Sonr Wallet Actor DIDs
Variables ¶
This section is empty.
Functions ¶
func BroadcastCosmosTx ¶
func BroadcastCosmosTx(rawTx []byte) (*txtypes.BroadcastTxResponse, error)
BroadcastCosmosTx broadcasts a transaction on the Sonr blockchain network
func BuildTxBody ¶
BuildTxBody builds a transaction from the given inputs.
func EncodeCosmosTx ¶
EncodeCosmosTx function is a method of the `LocalContext` struct. It takes a transaction (`tx`) as input and returns the encoded transaction bytes as output.
func GetAuthInfo ¶
GetAuthInfo creates an AuthInfo instance for this account with the specified gas amount.
func GetSignDoc ¶
GetSignDoc builds a SignDoc from the given inputs.
func SerializeRawTx ¶
SerializeRawTx is a helper function to create a raw raw transaction and Marshal it to bytes
func SignCosmosTx ¶
SignCosmosTx signs a transaction with the given inputs.
func SignDocWithKSS ¶
SignDocWithKSS signs a SignDoc with the given KeyshareSet.
Types ¶
type Account ¶ added in v0.7.3
type Account struct { Method types.DIDMethod ID types.DIDIdentifier // contains filtered or unexported fields }
Account struct is defining a custom data type in Go. It represents a Sonr Wallet Actor DID (Decentralized Identifier) account. It has several fields including `Method`, `ID`, `Resources`, `acc`, and `pks`. These fields store information related to the Sonr account, such as the DID method, identifier, associated resources, and cryptographic keys.
func NewSonrAccount ¶
func NewSonrAccount(key types.DIDSecretKey) (*Account, error)
NewSonrAccount creates a new Sonr Wallet Actor DID
func ResolveAccount ¶
func ResolveAccount(didString string, key types.DIDSecretKey) (*Account, error)
ResolveAccount resolves a Sonr Wallet Actor DID
func (*Account) Info ¶ added in v0.7.3
func (a *Account) Info() *crypto.AccountData
Info returns the account data
func (*Account) PublicKey ¶ added in v0.7.3
func (a *Account) PublicKey() (*crypto.Secp256k1PubKey, error)
PublicKey returns the public key of the account