mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
22 lines
455 B
Go
22 lines
455 B
Go
package machine
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/formancehq/stack/libs/core/accounts"
|
|
)
|
|
|
|
type AccountAddress string
|
|
|
|
func (AccountAddress) GetType() Type { return TypeAccount }
|
|
func (a AccountAddress) String() string {
|
|
return fmt.Sprintf("@%v", string(a))
|
|
}
|
|
|
|
func ValidateAccountAddress(acc AccountAddress) error {
|
|
if !accounts.Regexp.MatchString(string(acc)) {
|
|
return fmt.Errorf("accounts should respect pattern %s", accounts.Pattern)
|
|
}
|
|
return nil
|
|
}
|