assets

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: GPL-3.0 Imports: 4 Imported by: 2

README

assets 区块链资产适配指引

assets包下的各个子模块是实现区块链资产适配器。

资产适配器使用说明


// 注册适配器
assets.RegAssets(bitcoin.Symbol, bitcoin.NewWalletManager())

// 注册适配器,并加载配置文件
absFile := filepath.Join(configFilePath, symbol+".ini")
c, _ := config.NewConfig("ini", absFile)
assets.RegAssets(bitcoin.Symbol, bitcoin.NewWalletManager(), c)

// 获取资产适配器对象
adapter := assets.GetAssets(symbol)
if adapter == nil {
    return nil, fmt.Errorf("assets: %s is not support", symbol)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAssets

func GetAssets(symbol string) interface{}

GetAssets 根据币种类型获取已注册的管理者

func RegAssets

func RegAssets(name string, manager interface{}, config ...config.Configer)

RegAssets 注册资产 @param name 资产别名 @param manager 资产适配器或管理器 @param config 加载配置 资产适配器实现了openwallet.AssetsConfig,可以传入配置接口完成预加载配置 usage: RegAssets(cardano.Symbol, &cardano.WalletManager{}, c) RegAssets(bytom.Symbol, &bytom.WalletManager{}, c)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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