client

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is able perform remote requests to Tequilapi server

func NewClient

func NewClient(ip string, port int) *Client

NewClient returns a new instance of Client

func (*Client) AuthAuthenticate

func (client *Client) AuthAuthenticate(request contract.AuthRequest) (res contract.AuthResponse, err error)

AuthAuthenticate authenticates user and issues auth token

func (*Client) AuthChangePassword

func (client *Client) AuthChangePassword(request contract.ChangePasswordRequest) error

AuthChangePassword changes user password

func (*Client) AuthLogin

func (client *Client) AuthLogin(request contract.AuthRequest) (res contract.AuthResponse, err error)

AuthLogin authenticates user and sets cookie with issued auth token

func (*Client) AuthLogout

func (client *Client) AuthLogout() error

AuthLogout Clears authentication cookie

func (*Client) BalanceRefresh

func (client *Client) BalanceRefresh(identityAddress string) (b contract.BalanceDTO, err error)

BalanceRefresh forces a balance refresh if possible and returns the latest balance.

func (*Client) Beneficiary

func (client *Client) Beneficiary(address string) (res contract.IdentityBeneficiaryResponse, err error)

Beneficiary gets beneficiary address for the provided identity.

func (*Client) ConnectionCreate

func (client *Client) ConnectionCreate(consumerID, providerID, hermesID, serviceType string, options contract.ConnectOptions) (status contract.ConnectionInfoDTO, err error)

ConnectionCreate initiates a new connection to a host identified by providerID

func (*Client) ConnectionDestroy

func (client *Client) ConnectionDestroy(port int) (err error)

ConnectionDestroy terminates current connection

func (*Client) ConnectionIP

func (client *Client) ConnectionIP() (ip contract.IPDTO, err error)

ConnectionIP returns public ip

func (*Client) ConnectionLocation

func (client *Client) ConnectionLocation() (location contract.LocationDTO, err error)

ConnectionLocation returns current location

func (*Client) ConnectionStatistics

func (client *Client) ConnectionStatistics(sessionID ...string) (statistics contract.ConnectionStatisticsDTO, err error)

ConnectionStatistics returns statistics about current connection

func (*Client) ConnectionStatus

func (client *Client) ConnectionStatus(port int) (status contract.ConnectionInfoDTO, err error)

ConnectionStatus returns connection status

func (*Client) ConnectionTraffic

func (client *Client) ConnectionTraffic(sessionID ...string) (traffic contract.ConnectionTrafficDTO, err error)

ConnectionTraffic returns traffic information about current connection

func (*Client) CurrentIdentity

func (client *Client) CurrentIdentity(identity, passphrase string) (id contract.IdentityRefDTO, err error)

CurrentIdentity unlocks and returns the last used, new or first identity

func (*Client) DecreaseStake

func (client *Client) DecreaseStake(ID identity.Identity, amount *big.Int) error

DecreaseStake requests the decrease of stake via the transactor.

func (*Client) FetchConfig

func (client *Client) FetchConfig() (map[string]interface{}, error)

FetchConfig - fetches current config

func (*Client) GetBeneficiaryAsync

func (client *Client) GetBeneficiaryAsync(identity string) (contract.BeneficiaryAddressRequest, error)

GetBeneficiaryAsync gets locally saved beneficiary address.

func (*Client) GetIdentities

func (client *Client) GetIdentities() (ids []contract.IdentityRefDTO, err error)

GetIdentities returns a list of client identities

func (*Client) GetRegistrationPaymentStatus

func (client *Client) GetRegistrationPaymentStatus(identity string) (contract.RegistrationPaymentResponse, error)

GetRegistrationPaymentStatus returns the registration payment status

func (*Client) GetTransactorFees

func (client *Client) GetTransactorFees() (contract.FeesDTO, error)

GetTransactorFees returns the transactor fees

func (*Client) Healthcheck

func (client *Client) Healthcheck() (healthcheck contract.HealthCheckDTO, err error)

Healthcheck returns a healthcheck info

func (*Client) Identity

func (client *Client) Identity(identityAddress string) (id contract.IdentityDTO, err error)

Identity returns identity status with cached balance

func (*Client) IdentityReferralCode

func (client *Client) IdentityReferralCode(identity string) (contract.ReferralTokenResponse, error)

IdentityReferralCode returns a referral token for the given identity.

func (*Client) IdentityRegistrationStatus

func (client *Client) IdentityRegistrationStatus(address string) (contract.IdentityRegistrationResponse, error)

IdentityRegistrationStatus returns information of identity needed to register it on blockchain

func (*Client) ImportIdentity

func (client *Client) ImportIdentity(blob []byte, passphrase string, setDefault bool) (id contract.IdentityRefDTO, err error)

ImportIdentity sends a request to import a given identity.

func (*Client) MigrateHermes

func (client *Client) MigrateHermes(address string) error

MigrateHermes migrate from old to active Hermes

func (*Client) MigrateHermesStatus

func (client *Client) MigrateHermesStatus(address string) (contract.MigrationStatusResponse, error)

MigrateHermesStatus check status of the migration

func (*Client) NATStatus

func (client *Client) NATStatus() (status contract.NodeStatusResponse, err error)

NATStatus returns status of NAT traversal

func (*Client) NATType

func (client *Client) NATType() (status contract.NATTypeDTO, err error)

NATType returns type of NAT in sense of traversal capabilities

func (*Client) NewIdentity

func (client *Client) NewIdentity(passphrase string) (id contract.IdentityRefDTO, err error)

NewIdentity creates a new client identity

func (*Client) OrderCreate

OrderCreate creates a new order for currency exchange in pilvytis

func (*Client) OrderGet

func (client *Client) OrderGet(address identity.Identity, orderID string) (contract.PaymentOrderResponse, error)

OrderGet returns a single order istance given it's ID.

func (*Client) OrderGetAll

func (client *Client) OrderGetAll(id identity.Identity) ([]contract.PaymentOrderResponse, error)

OrderGetAll returns all order istances for a given identity

func (*Client) OrderInvoice

func (client *Client) OrderInvoice(address identity.Identity, orderID string) ([]byte, error)

OrderInvoice returns a single order istance given it's ID.

func (*Client) OriginLocation

func (client *Client) OriginLocation() (location contract.LocationDTO, err error)

OriginLocation returns original location

func (*Client) PaymentOrderGateways

func (client *Client) PaymentOrderGateways(optionsCurrency exchange.Currency) ([]contract.GatewaysResponse, error)

PaymentOrderGateways returns all possible gateways and their data.

func (*Client) Proposals

func (client *Client) Proposals() ([]contract.ProposalDTO, error)

Proposals returns all available proposals for services

func (*Client) ProposalsByLocationAndService

func (client *Client) ProposalsByLocationAndService(serviceType, locationType, locationCountry string) ([]contract.ProposalDTO, error)

ProposalsByLocationAndService fetches proposals by given service and node location types.

func (*Client) ProposalsByType

func (client *Client) ProposalsByType(serviceType string) ([]contract.ProposalDTO, error)

ProposalsByType fetches proposals by given type

func (*Client) ProposalsByTypeWithWhitelisting

func (client *Client) ProposalsByTypeWithWhitelisting(serviceType string) ([]contract.ProposalDTO, error)

ProposalsByTypeWithWhitelisting fetches proposals by given type with all whitelisting options.

func (*Client) ProposalsNATCompatible

func (client *Client) ProposalsNATCompatible() ([]contract.ProposalDTO, error)

ProposalsNATCompatible returns proposals for services which we can connect to

func (*Client) ProxyIP

func (client *Client) ProxyIP(proxyPort int) (ip contract.IPDTO, err error)

ProxyIP returns public ip of the proxy.

func (*Client) ProxyLocation

func (client *Client) ProxyLocation(proxyPort int) (location contract.LocationDTO, err error)

ProxyLocation returns proxy location.

func (*Client) RegisterIdentity

func (client *Client) RegisterIdentity(address, beneficiary string, token *string) error

RegisterIdentity registers identity

func (*Client) Service

func (client *Client) Service(id string) (service contract.ServiceInfoDTO, err error)

Service returns a service information by the requested id

func (*Client) ServiceStart

func (client *Client) ServiceStart(request contract.ServiceStartRequest) (service contract.ServiceInfoDTO, err error)

ServiceStart starts an instance of the service.

func (*Client) ServiceStop

func (client *Client) ServiceStop(id string) error

ServiceStop stops the running service instance by the requested id.

func (*Client) Services

func (client *Client) Services() (services contract.ServiceListResponse, err error)

Services returns all running services

func (*Client) Sessions

func (client *Client) Sessions() (sessions contract.SessionListResponse, err error)

Sessions returns all sessions from history

func (*Client) SessionsByServiceType

func (client *Client) SessionsByServiceType(serviceType string) (contract.SessionListResponse, error)

SessionsByServiceType returns sessions from history filtered by type

func (*Client) SessionsByStatus

func (client *Client) SessionsByStatus(status string) (contract.SessionListResponse, error)

SessionsByStatus returns sessions from history filtered by their status

func (*Client) SetBeneficiaryAsync

func (client *Client) SetBeneficiaryAsync(identity, ethAddress string) error

SetBeneficiaryAsync store beneficiary address locally for identity.

func (*Client) SetConfig

func (client *Client) SetConfig(data map[string]interface{}) error

SetConfig - set user config.

func (*Client) SetMMNApiKey

func (client *Client) SetMMNApiKey(data contract.MMNApiKeyRequest) error

SetMMNApiKey sets MMN's API key in config and registers node to MMN

func (*Client) Settle

func (client *Client) Settle(providerID identity.Identity, hermesIDs []common.Address, waitForBlockchain bool) error

Settle requests the settling of hermes promises

func (*Client) SettleIntoStake

func (client *Client) SettleIntoStake(providerID, hermesID identity.Identity, waitForBlockchain bool) error

SettleIntoStake requests the settling of accountant promises into a stake increase

func (*Client) SettleWithBeneficiary

func (client *Client) SettleWithBeneficiary(address, beneficiary, hermesID string) error

SettleWithBeneficiary set new beneficiary address for the provided identity.

func (*Client) SettleWithBeneficiaryStatus

func (client *Client) SettleWithBeneficiaryStatus(address string) (res contract.BeneficiaryTxStatus, err error)

SettleWithBeneficiaryStatus set new beneficiary address for the provided identity.

func (*Client) SmartConnectionCreate

func (client *Client) SmartConnectionCreate(consumerID, hermesID, serviceType string, filter contract.ConnectionCreateFilter, options contract.ConnectOptions) (status contract.ConnectionInfoDTO, err error)

SmartConnectionCreate initiates a new connection to a host identified by filter

func (*Client) Stop

func (client *Client) Stop() error

Stop kills mysterium client

func (*Client) Unlock

func (client *Client) Unlock(identity, passphrase string) error

Unlock allows using identity in following commands

func (*Client) UpdateTerms

func (client *Client) UpdateTerms(obj contract.TermsRequest) error

UpdateTerms takes a TermsRequest and sends it as an update for the terms of use.

func (*Client) Withdraw

func (client *Client) Withdraw(providerID identity.Identity, hermesID, beneficiary common.Address, amount *big.Int, fromChainID, toChainID int64) error

Withdraw requests the withdrawal of money from l2 to l1 of hermes promises

func (*Client) WithdrawalHistory

func (client *Client) WithdrawalHistory(address string) (res contract.SettlementListResponse, err error)

WithdrawalHistory returns latest withdrawals for identity

Jump to

Keyboard shortcuts

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