func GetClientAndInfo(acc string) (*vault.Vault, *vault.AccountInfo, *api.API, error) {
	v := vault.OpenDefaultVault()

	info, err := vault.GetAccount(v, acc)
	if err != nil {
		return nil, nil, nil, errors.New("cannot find account")
	}

	resolver := container.Instance.GetResolveService()
	routingInfo, err := resolver.ResolveRouting(info.RoutingID)
	if err != nil {
		return nil, nil, nil, errors.New("cannot find routing ID for this account")
	}

	client, err := api.NewAuthenticated(*info.Address, info.GetActiveKey().PrivKey, routingInfo.Routing, JwtErrorFunc)
	if err != nil {
		return nil, nil, nil, err
	}

	return v, info, client, nil
}
// GetClientAndInfo is a simple wrapper that will fetch the vault, account info from the given vault and an authenticated
// api client. Since this is used a lot, we created a separate function for this. This will take care of a lot of code
// duplication.
GetClientAndInfo is a simple wrapper that will fetch the vault, account info from the given vault and an authenticated
api client. Since this is used a lot, we created a separate function for this. This will take care of a lot of code
duplication.
// GetClientAndInfo is a simple wrapper that will fetch the vault account info from the given vault and an authenticated // api client . Since this is used a lot we created a separate function for this . This will take care of a lot of code // duplication .
func GetClientAndInfo(acc string) (*vault.Vault, *vault.AccountInfo, *api.API, error) {
	v := vault.OpenDefaultVault()
	info, err := vault.GetAccount(v, acc)
	if err != nil {
		return nil, nil, nil, errors.New("cannot find account")
	}
	resolver := container.Instance.GetResolveService()
	routingInfo, err := resolver.ResolveRouting(info.RoutingID)
	if err != nil {
		return nil, nil, nil, errors.New("cannot find routing ID for this account")
	}
	client, err := api.NewAuthenticated(*info.Address, info.GetActiveKey().PrivKey, routingInfo.Routing, JwtErrorFunc)
	if err != nil {
		return nil, nil, nil, err
	}
	return v, info, client, nil
}
func GetClientAndInfo ( acc string ) ( * vault . Vault , * vault . AccountInfo , * api . API , error ) { v := vault . OpenDefaultVault ( ) info , err := vault . GetAccount ( v , acc ) if err != nil { return nil , nil , nil , errors . New ( " " ) } resolver := container . Instance . GetResolveService ( ) routingInfo , err := resolver . ResolveRouting ( info . RoutingID ) if err != nil { return nil , nil , nil , errors . New ( " " ) } client , err := api . NewAuthenticated ( * info . Address , info . GetActiveKey ( ) . PrivKey , routingInfo . Routing , JwtErrorFunc ) if err != nil { return nil , nil , nil , err } return v , info , client , nil }
GetClientAndInfo is a simple wrapper that will fetch the vault, account info from the given vault and an authenticated
api client.
GetClientAndInfo is a simple wrapper that will fetch the vault account info from the given vault and an authenticated api client .