sonr

package
v0.7.3-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Method = types.DIDMethod("sonr")

Variables

This section is empty.

Functions

func BroadcastCosmosTx

func BroadcastCosmosTx(rawTx []byte) (*txtypes.BroadcastTxResponse, error)

BroadcastTx broadcasts a transaction on the Sonr blockchain network

func BuildTxBody

func BuildTxBody(msgs ...sdk.Msg) (*txtypes.TxBody, error)

BuildTxBody builds a transaction from the given inputs.

func EncodeCosmosTx

func EncodeCosmosTx(tx *txtypes.Tx) ([]byte, error)

The `EncodeTx` 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

func GetAuthInfo(anySigner types.AnySignerEntity, gas sdk.Coins) (*txtypes.AuthInfo, error)

GetAuthInfo creates an AuthInfo instance for this account with the specified gas amount.

func GetSignDoc

func GetSignDoc(txBody *txtypes.TxBody, authInfo *txtypes.AuthInfo) (*txtypes.SignDoc, error)

GetSignDoc builds a SignDoc from the given inputs.

func SerializeRawTx

func SerializeRawTx(body *txtypes.TxBody, authInfo *txtypes.AuthInfo, sig []byte) ([]byte, error)

SerializeRawTx is a helper function to create a raw raw transaction and Marshal it to bytes

func SignCosmosTx

func SignCosmosTx(anySigner types.AnySignerEntity, msgs ...sdk.Msg) ([]byte, error)

SignCosmosTx signs a transaction with the given inputs.

func SignDocWithKSS

func SignDocWithKSS(anySigner types.AnySignerEntity, signDoc *txtypes.SignDoc) ([]byte, error)

SignDocWithKSS signs a SignDoc with the given KeyshareSet.

Types

type SonrAccount

type SonrAccount struct {
	Method types.DIDMethod
	ID     types.DIDIdentifier
	// contains filtered or unexported fields
}

The `SonrAccount` 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) (*SonrAccount, error)

NewSonrAccount creates a new Sonr Wallet Actor DID

func ResolveAccount

func ResolveAccount(didString string, key types.DIDSecretKey) (*SonrAccount, error)

ResolveAccount resolves a Sonr Wallet Actor DID

func (*SonrAccount) Address

func (a *SonrAccount) Address() string

Address returns the address of the account

func (*SonrAccount) Info

func (a *SonrAccount) Info() *crypto.AccountData

Info returns the account data

func (*SonrAccount) PublicKey

func (a *SonrAccount) PublicKey() (*crypto.Secp256k1PubKey, error)

PublicKey returns the public key of the account

func (*SonrAccount) SendTx

func (a *SonrAccount) SendTx(msgs ...sdk.Msg) (*sdk.TxResponse, error)

SendTx sends a transaction

func (*SonrAccount) Sign

func (a *SonrAccount) Sign(msg []byte) ([]byte, error)

Sign signs a message with the account

func (*SonrAccount) Type

func (a *SonrAccount) Type() string

Type returns the type of the account

func (*SonrAccount) Verify

func (a *SonrAccount) Verify(msg []byte, sig []byte) (bool, error)

Verify verifies a signature

Jump to

Keyboard shortcuts

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