sonr

package
v0.7.5-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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

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)

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

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 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) Address added in v0.7.3

func (a *Account) Address() string

Address returns the address of the account

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

func (*Account) SendTx added in v0.7.3

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

SendTx sends a transaction

func (*Account) Sign added in v0.7.3

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

Sign signs a message with the account

func (*Account) Type added in v0.7.3

func (a *Account) Type() string

Type returns the type of the account

func (*Account) Verify added in v0.7.3

func (a *Account) 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