2020-11-09 10:05:29 -03:00
|
|
|
package libwallet
|
|
|
|
|
2021-11-12 19:06:13 -03:00
|
|
|
import (
|
|
|
|
"runtime/debug"
|
|
|
|
)
|
|
|
|
|
2020-11-09 10:05:29 -03:00
|
|
|
// Listener is an interface implemented by the apps to receive notifications
|
|
|
|
// of data changes from the libwallet code. Each change is reported with a
|
|
|
|
// string tag identifying the type of change.
|
|
|
|
type Listener interface {
|
|
|
|
OnDataChanged(tag string)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Config defines the global libwallet configuration.
|
|
|
|
type Config struct {
|
|
|
|
DataDir string
|
|
|
|
Listener Listener
|
|
|
|
}
|
|
|
|
|
|
|
|
var cfg *Config
|
|
|
|
|
|
|
|
// Init configures the libwallet
|
|
|
|
func Init(c *Config) {
|
2021-11-12 19:06:13 -03:00
|
|
|
debug.SetTraceback("crash")
|
2020-11-09 10:05:29 -03:00
|
|
|
cfg = c
|
|
|
|
}
|