client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// -- Local Blockchain --
	BLOCKCHAIN_REST_LOCAL   = "http://0.0.0.0:26657"
	BLOCKCHAIN_FAUCET_LOCAL = "http://0.0.0.0:4500"
	BLOCKCHAIN_RPC_LOCAL    = "127.0.0.1:9090"

	// -- Dev Blockchain --
	BLOCKCHAIN_FAUCET_DEV = "http://143.198.29.209:8000"
	BLOCKCHAIN_RPC_DEV    = "143.198.29.209:9090"

	// -- Beta Blockchain --
	BLOCKCHAIN_FAUCET_BETA = "http://137.184.190.146:8000"
	BLOCKCHAIN_RPC_BETA    = "137.184.190.146:9090"

	// -- Services --
	IPFS_ADDRESS      = "https://ipfs.sonr.ws"
	IPFS_API_ADDRESS  = "https://api.ipfs.sonr.ws"
	VAULT_API_ADDRESS = "http://164.92.99.233"
)

Variables

This section is empty.

Functions

func DecodeTxResponseData added in v0.3.0

func DecodeTxResponseData(d string, v proto.Unmarshaler) error

Types

type Client added in v0.3.0

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.3.0

func NewClient(t ConnEndpointType) *Client

func (*Client) BroadcastTx added in v0.3.0

func (c *Client) BroadcastTx(txRawBytes []byte) (*txtypes.BroadcastTxResponse, error)

BroadcastTx broadcasts a transaction on the Sonr blockchain network

func (*Client) CheckBalance added in v0.3.0

func (c *Client) CheckBalance(address string) (types.Coins, error)

func (*Client) GetAPIAddress added in v0.3.0

func (c *Client) GetAPIAddress() string

func (*Client) GetFaucetAddress added in v0.3.0

func (c *Client) GetFaucetAddress() string

func (*Client) GetIPFSAddress added in v0.3.1

func (c *Client) GetIPFSAddress() string

func (*Client) GetIPFSApiAddress added in v0.3.1

func (c *Client) GetIPFSApiAddress() string

func (*Client) GetRPCAddress added in v0.3.0

func (c *Client) GetRPCAddress() string

func (*Client) QueryWhatIsByController added in v0.3.0

func (c *Client) QueryWhatIsByController(creator string, did string) (*st.WhatIs, error)

func (*Client) QueryWhoIs added in v0.3.0

func (c *Client) QueryWhoIs(did string) (*rt.WhoIs, error)

func (*Client) QueryWhoIsByAlias added in v0.3.0

func (c *Client) QueryWhoIsByAlias(alias string) (*rt.WhoIs, error)

func (*Client) QueryWhoIsByController added in v0.3.0

func (c *Client) QueryWhoIsByController(controller string) (*rt.WhoIs, error)

func (*Client) RequestFaucet added in v0.3.0

func (c *Client) RequestFaucet(address string) error

RequestFaucet requests a faucet from the Sonr network

func (*Client) SimulateTx added in v0.3.0

func (c *Client) SimulateTx(txRawBytes []byte) (*txtypes.SimulateResponse, error)

SimulateTx simulates a transaction on the Sonr blockchain network

type ConnEndpointType added in v0.3.0

type ConnEndpointType int
const (
	ConnEndpointType_NONE ConnEndpointType = iota
	ConnEndpointType_LOCAL
	ConnEndpointType_DEV
	ConnEndpointType_BETA
)

type Cosmos

type Cosmos struct {
	cosmosclient.Client
	// contains filtered or unexported fields
}

func (*Cosmos) AccountName

func (cc *Cosmos) AccountName() string

AccountName returns the account name as string

func (*Cosmos) Address

func (cc *Cosmos) Address() string

Address returns the account name as string

func (*Cosmos) BroadcastBuyAlias

func (cc *Cosmos) BroadcastBuyAlias(msg *rt.MsgBuyAlias) (*rt.MsgBuyAliasResponse, error)

------- Registry ------- BroadcastBuyAppAlias broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastBuyNameAlias

func (cc *Cosmos) BroadcastBuyNameAlias(msg *rt.MsgBuyAlias) (*rt.MsgBuyAliasResponse, error)

BroadcastBuyNameAlias broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastCreateSchema added in v0.3.0

func (cc *Cosmos) BroadcastCreateSchema(msg *st.MsgCreateSchema) (*st.MsgCreateSchemaResponse, error)

------- Schemas -------

func (*Cosmos) BroadcastCreateWhoIs

func (cc *Cosmos) BroadcastCreateWhoIs(msg *rt.MsgCreateWhoIs) (*rt.MsgCreateWhoIsResponse, error)

BroadcastUpdateApplication broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastDeactivateWhoIs

func (cc *Cosmos) BroadcastDeactivateWhoIs(msg *rt.MsgDeactivateWhoIs) (*rt.MsgDeactivateWhoIsResponse, error)

BroadcastUpdateName broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastSellAlias

func (cc *Cosmos) BroadcastSellAlias(msg *rt.MsgSellAlias) (*rt.MsgSellAliasResponse, error)

BroadcastSellAlias broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastTransferAlias

func (cc *Cosmos) BroadcastTransferAlias(msg *rt.MsgTransferAlias) (*rt.MsgTransferAliasResponse, error)

BroadcastTransferNameAlias broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateWhoIs

func (cc *Cosmos) BroadcastUpdateWhoIs(msg *rt.MsgUpdateWhoIs) (*rt.MsgUpdateWhoIsResponse, error)

BroadcastUpdateApplication broadcasts a transaction to the blockchain

func (*Cosmos) NameExists

func (cc *Cosmos) NameExists(name string) bool

NameExists checks if a name exists on the blockchain

func (*Cosmos) QueryAllWhoIs

func (cc *Cosmos) QueryAllWhoIs() ([]rt.WhoIs, error)

QueryAllWhoIs returns all DIDDocuments registered on the blockchain

func (*Cosmos) QuerySchema added in v0.3.0

func (cc *Cosmos) QuerySchema(creator string, schemaDID string) (*st.QuerySchemaResponse, error)

func (*Cosmos) QueryWhatIsAll added in v0.3.0

func (cc *Cosmos) QueryWhatIsAll(queryReq *st.QueryAllWhatIsRequest) (*st.QueryAllWhatIsResponse, error)

func (*Cosmos) QueryWhoIs

func (cc *Cosmos) QueryWhoIs(did string) (*rt.WhoIs, error)

QueryWhoIs returns a DIDDocument for the given name registered on the blockchain

func (*Cosmos) QueryWhoIsAlias

func (cc *Cosmos) QueryWhoIsAlias(alias string) (*rt.WhoIs, error)

QueryWhoIsAlias returns a DIDDocument for the given alias registered on the blockchain

func (*Cosmos) QueryWhoIsController

func (cc *Cosmos) QueryWhoIsController(controller string) (*rt.WhoIs, error)

QueryWhoIsController returns the controller for the given name registered on the blockchain

Jump to

Keyboard shortcuts

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