Documentation
¶
Index ¶
- Constants
- Variables
- func AppFilePath() (string, string)
- func KeyFilePath() (string, string)
- func NewDefaultApp(home string, appFilePath string, config Config) error
- func SaveAppFile(appFilePath string, appType *App) error
- type App
- type Channels
- type Config
- type ContractInfo
- type Contracts
- type ContractsOption
- type SwaggerOption
- type TargetChain
- type XnsContext
- func (x *XnsContext) GetApp() App
- func (x *XnsContext) GetChannels() Channels
- func (x *XnsContext) GetViper() *viper.Viper
- func (x *XnsContext) GetXplaClient() provider.XplaClient
- func (x *XnsContext) WithApp(filePath string) error
- func (x *XnsContext) WithChannels() *XnsContext
- func (x *XnsContext) WithViper(viper *viper.Viper) *XnsContext
- func (x *XnsContext) WithXplaClient(xplaClient provider.XplaClient) *XnsContext
- type XnsError
- type XnsGateway
Constants ¶
View Source
const ( ErrMsgInvalidDataType = "invalid data type of the message" ErrMsgDuplicateExpire = "invalid duplicated expire type" )
Variables ¶
View Source
var ( Success = new(0, "success") ErrInit = new(101, "error initialize") ErrParseConfig = new(102, "error parsing config.yaml file") ErrParseApp = new(103, "error parsing app file") ErrContract = new(104, "error contract") ErrKey = new(105, "error key") ErrHaveNoAddress = new(106, "error no contract address") ErrBroadcast = new(107, "error broadcast") ErrTx = new(108, "error create transaction") ErrQuery = new(109, "error query") ErrNewMsg = new(110, "error generate new message") ErrParseData = new(111, "error parse data") ErrGW = new(112, "error gateway") ErrHttpServer = new(113, "error HTTP server") ErrInvalidRequest = new(114, "error invalid request") )
View Source
var ( DefaultAppName = "xns" DefaultHome = filepath.Join(os.Getenv("HOME"), ".xns") DefaultAppPath = "config" DefaultAppFilePath = "app.yaml" DefaultKeyPath = "key" DefaultKeyFilePath = "xns_gateway_key.pem" DefaultConfigPath = "./config.yaml" DefaultContractWasmDir = "./contract/artifacts" XnsBaseContract = "xns_base-aarch64.wasm" NftRegistrarContract = "nft_registrar-aarch64.wasm" RegistrarContract = "registrar-aarch64.wasm" ControllerContract = "controller-aarch64.wasm" ResolverContract = "resolver-aarch64.wasm" ZeroAmount = "0" )
View Source
var ( XnsContracts = []string{ XnsBaseContract, NftRegistrarContract, RegistrarContract, ControllerContract, ResolverContract, } )
Functions ¶
func AppFilePath ¶
func KeyFilePath ¶
func SaveAppFile ¶
Types ¶
type App ¶
func ReadAppFile ¶
type Config ¶
type Config struct {
XnsGateway XnsGateway `yaml:"xns_gateway" json:"xns_gateway"`
TargetChain TargetChain `yaml:"target_chain" json:"target_chain"`
ContractsOption ContractsOption `yaml:"contracts_option" json:"contracts_option"`
SwaggerOption SwaggerOption `yaml:"swagger_option" json:"swagger_option"`
}
type ContractInfo ¶
type Contracts ¶
type Contracts struct {
BaseContract struct {
CodeID string `yaml:"code_id" json:"code_id"`
} `yaml:"base_contract,omitempty" json:"base_contract,omitempty"`
NftRegistrarContract ContractInfo `yaml:"nft_registrar_contract,omitempty" json:"nft_registrar_contract,omitempty"`
RegistrarContract ContractInfo `yaml:"registrar_contract,omitempty" json:"registrar_contract,omitempty"`
ControllerContract ContractInfo `yaml:"controller_contract,omitempty" json:"controller_contract,omitempty"`
ResolverContract ContractInfo `yaml:"resolver_contract,omitempty" json:"resolver_contract,omitempty"`
}
type ContractsOption ¶
type ContractsOption struct {
NftRegistrar struct {
Name string `yaml:"name" json:"name"`
Symbol string `yaml:"symbol" json:"symbol"`
} `yaml:"nft_registrar" json:"nft_registrar"`
Controller struct {
TopPrice string `yaml:"top_price" json:"top_price"`
MiddlePrice string `yaml:"middle_price" json:"middle_price"`
LowPrice string `yaml:"low_price" json:"low_price"`
MinRegisterDuration string `yaml:"min_register_duration" json:"min_register_duration"`
MaxFreeDomainRegisterDuration string `yaml:"max_free_domain_register_duration" json:"max_free_domain_register_duration"`
TopDomain string `yaml:"top_domain" json:"top_domain"`
} `yaml:"controller" json:"controller"`
}
type SwaggerOption ¶
type SwaggerOption struct {
ServerHostIp string `yaml:"server_host_ip"`
}
type TargetChain ¶
type XnsContext ¶
type XnsContext struct {
// contains filtered or unexported fields
}
func NewXnsContext ¶
func NewXnsContext() *XnsContext
func (*XnsContext) GetApp ¶
func (x *XnsContext) GetApp() App
func (*XnsContext) GetChannels ¶
func (x *XnsContext) GetChannels() Channels
func (*XnsContext) GetViper ¶
func (x *XnsContext) GetViper() *viper.Viper
func (*XnsContext) GetXplaClient ¶
func (x *XnsContext) GetXplaClient() provider.XplaClient
func (*XnsContext) WithApp ¶
func (x *XnsContext) WithApp(filePath string) error
func (*XnsContext) WithChannels ¶
func (x *XnsContext) WithChannels() *XnsContext
func (*XnsContext) WithViper ¶
func (x *XnsContext) WithViper(viper *viper.Viper) *XnsContext
func (*XnsContext) WithXplaClient ¶
func (x *XnsContext) WithXplaClient(xplaClient provider.XplaClient) *XnsContext
type XnsGateway ¶
Click to show internal directories.
Click to hide internal directories.