Documentation
¶
Index ¶
- Variables
- func BackupConfigJSON(confPath string)
- func BackupWallet()
- func BackupWalletJSON(confPath string)
- func DLSubJSONData() error
- func DlBootstrap()
- func GenerateDEXP2PAccount() error
- func GenerateDEXP2PWallet() (kmdutil.IguanaWallet, error)
- func GetFreePort() (int, error)
- func GetFreePorts(count int) ([]int, error)
- func GetHandle(pubkey string) (string, string, bool)
- func ImportTAddrPrivKey(toChain string) error
- func ImportZAddrPrivKey(toChain string) error
- func IntToString(n int32) string
- func IsLower(s string) bool
- func MatchedAuthorized(pubkey string) (bool, error)
- func ShurliRootDir() string
- func ShurliStartMsg()
- func StartWallet(chain string, cmdParams []string) error
- func StrToAppType(chain []ConfigCoins) []kmdgo.AppType
- func SwapLogFilter(logString, answer string) (string, error)
- func TxIDFromOpID(coin, opid string) (string, error)
- func UpdateDEXP2PAccount(data SubAtomicConfig) error
- type ConfigChains
- type ConfigCoins
- type DEXHandle
- type OrderData
- type SubAtomicConfig
- type SwapHistory
- type SwapStatus
- type SwapsHistory
- type WInfo
- type ZFrom
Constants ¶
This section is empty.
Variables ¶
var ( // Log ... Log *log.Logger // ShrliLogFile stores the stdout/stderr output log ShrliLogFile = "./shurli.log" )
var DexP2pChain string = "SHURLI0"
DexP2pChain which shurli queries for DEXP2P API
Functions ¶
func BackupConfigJSON ¶
func BackupConfigJSON(confPath string)
BackupConfigJSON take backup of existing config.json file and store it with filename + timestamp
func BackupWallet ¶
func BackupWallet()
BackupWallet allows taking a dump or backup of the wallet.dat file
func BackupWalletJSON ¶
func BackupWalletJSON(confPath string)
BackupWalletJSON take backup of existing wallet.json file and store it with filename + timestamp
func DLSubJSONData ¶
func DLSubJSONData() error
DLSubJSONData downloads the latest updated subatomic.json file data and saves it to "assets/subatomic.json" file in subatomicgo app
func DlBootstrap ¶
func DlBootstrap()
DlBootstrap download, extract and replace/update bootstrap blockchain files for a specified wallet
func GenerateDEXP2PAccount ¶
func GenerateDEXP2PAccount() error
GenerateDEXP2PAccount generate the transaparent address and shielded address
func GenerateDEXP2PWallet ¶
func GenerateDEXP2PWallet() (kmdutil.IguanaWallet, error)
GenerateDEXP2PWallet ...
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func GetFreePorts ¶
GetFreePorts asks the kernel for free open ports that are ready to use.
func ImportTAddrPrivKey ¶
ImportTAddrPrivKey import private key of DEXP2P transparent address to specified wallet
func ImportZAddrPrivKey ¶
ImportZAddrPrivKey import private key of DEXP2P shielded address to specified wallet
func MatchedAuthorized ¶
MatchedAuthorized checks the pubkey against the subatomic.json file's authorized pubkey list. If the searched pubkey is present in that list, it returns true, otherwise false.
func StartWallet ¶
StartWallet launches Komodo-Ocean-QT with the specified Wallet
func StrToAppType ¶
func StrToAppType(chain []ConfigCoins) []kmdgo.AppType
StrToAppType converts and returns slice of string as slice of kmdgo.AppType
func SwapLogFilter ¶
SwapLogFilter returns JSON processed data for submitted log string
func TxIDFromOpID ¶
TxIDFromOpID returns TxID for provided opid and coin
func UpdateDEXP2PAccount ¶
func UpdateDEXP2PAccount(data SubAtomicConfig) error
UpdateDEXP2PAccount allow users to update config.json file with user specified DEXP2P params details
Types ¶
type ConfigChains ¶
type ConfigChains struct { Chains []ConfigCoins `json:"chains"` Explorers map[string]string `json:"explorers"` }
ConfigChains holds the list of chains and it's other details like explorers links etc.
type ConfigCoins ¶
type ConfigCoins struct { Coin string `json:"coin"` Ticker string `json:"ticker"` Name string `json:"name"` Shielded bool `json:"shielded"` }
ConfigCoins type holds the values of coin information
func GetCoinConfInfo ¶
func GetCoinConfInfo(coin string) ConfigCoins
GetCoinConfInfo returns single coin info from config.json cofiguration list
type DEXHandle ¶
DEXHandle stores data to get authorised/unauthorised hanldes from all broadcasting traders
func DEXHandles ¶
func DEXHandles() []DEXHandle
DEXHandles returns public address's public Key, DEX CC specific public key, and handle data set picked from: - DEX_list handles API - subatomic.json file taken from the source code of komodo code The purpose of this function is to return the data about authorised and unauthorised handles and show that in orderbook or orderlist in the GUI application.
type OrderData ¶
type OrderData struct { Price string `json:"price"` MaxVolume string `json:"max_volume"` DexPubkey string `json:"dex_pubkey"` Base string `json:"base"` ZBase bool `json:"zbase"` Rel string `json:"rel"` ZRel bool `json:"zrel"` OrderID int64 `json:"orderid"` TimestampStr string `json:"timestampstr"` Timestamp string `json:"timestamp"` Handle string `json:"handle"` Pubkey string `json:"pubkey"` Authorized bool `json:"authorized"` BaseBal float64 `json:"basebal"` ZBaseBal float64 `json:"zbasebal"` RelBal float64 `json:"relbal"` ZRelBal float64 `json:"zrelbal"` BaseIcon string `json:"baseicon"` RelIcon string `json:"relicon"` }
OrderData type is used to get formated data to display on Orderbook page
func OrderBookList ¶
OrderBookList returns processed data for Orderbook page
type SubAtomicConfig ¶
type SubAtomicConfig struct { Chains []ConfigCoins `json:"chains,omitempty"` SubatomicExe string `json:"subatomic_exe"` SubatomicDir string `json:"subatomic_dir"` DexNSPV string `json:"dex_nSPV"` DexAddnode string `json:"dex_addnode"` DexPubkey string `json:"dex_pubkey"` DexHandle string `json:"dex_handle"` DexRecvZAddr string `json:"dex_recvzaddr"` DexRecvTAddr string `json:"dex_recvtaddr"` Explorers map[string]string `json:"explorers,omitempty"` }
SubAtomicConfig holds the app's confugration settings
func SubAtomicConfInfo ¶
func SubAtomicConfInfo() SubAtomicConfig
SubAtomicConfInfo returns application's config params
type SwapHistory ¶
type SwapHistory struct { SwapID string `json:"swapid"` TimeStamp string `json:"timestamp"` Base string `json:"base"` Rel string `json:"rel"` BaseAmount float64 `json:"baseamount"` RelAmount float64 `json:"relamount"` BaseTxID string `json:"basetxid"` RelTxID string `json:"reltxid"` Status string `json:"status"` BobID string `json:"bobid"` BobPubkey string `json:"bobpubkey"` BobAuthorized bool `json:"bobauthorized"` OrderIDTimeStamp string `json:"orderidtimestamp"` OrderPrice float64 `json:"orderprice"` OrderMaxVolume float64 `json:"ordermaxvolume"` BaseIcon string `json:"baseicon"` RelIcon string `json:"relicon"` BaseExplorer string `json:"baseexplorer"` RelExplorer string `json:"relexplorer"` ZBase bool `json:"zbase"` ZRel bool `json:"zrel"` SwapLog []SwapStatus `json:"swaplog,omitempty"` }
SwapHistory type stores the single object from Swaps logs history
type SwapStatus ¶
type SwapStatus struct { State string `json:"state,omitempty"` StateID string `json:"state_id,omitempty"` Status string `json:"status,omitempty"` StateHash string `json:"state_hash,omitempty"` BaseTxID string `json:"base_txid,omitempty"` RelTxID string `json:"rel_txid,omitempty"` SwapID string `json:"swap_id,omitempty"` SendToAddr string `json:"sendtoaddr,omitempty"` RecvAddr string `json:"recvaddr,omitempty"` Base string `json:"base,omitempty"` Rel string `json:"rel,omitempty"` BaseAmount float64 `json:"base_amount,omitempty"` RelAmount float64 `json:"rel_amount,omitempty"` SwapFullData string `json:"swap_full_data,omitempty"` }
SwapStatus defines the data type to store filtered data and push to application in JSON format for UI side rendering.
type SwapsHistory ¶
type SwapsHistory []SwapHistory
SwapsHistory type is used as collection of SwapHistory objects
func (SwapsHistory) SwapsHistory ¶
func (history SwapsHistory) SwapsHistory() (SwapsHistory, error)
SwapsHistory returns processed slice of swaplogs in JSON format
type WInfo ¶
type WInfo struct { Name string Ticker string Icon string Status string Balance float64 ZBalance float64 Blocks int Synced bool Shielded bool TValidAddr bool ZValidAddr bool }
WInfo type stores data to display on Wallet info screen
func WalletInfo ¶
WalletInfo method returns processed data to display on Dashboard