package
2.6.0
Repository: https://github.com/blocktree/openwallet.git
Documentation: pkg.go.dev

# 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)
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

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