@@ -22,7 +22,7 @@ func IsLiteral(prim string) bool {
2222}
2323
2424// IsContract -
25- func IsContract (address string ) bool {
25+ func IsContractLazy (address string ) bool {
2626 return len (address ) == 36 && strings .HasPrefix (address , "KT" )
2727}
2828
@@ -31,29 +31,51 @@ func IsAddressLazy(address string) bool {
3131 return len (address ) == 36 && (strings .HasPrefix (address , "KT" ) || strings .HasPrefix (address , "tz" ))
3232}
3333
34+ // IsRollupAddressLazy -
35+ func IsRollupAddressLazy (address string ) bool {
36+ return len (address ) == 37 && strings .HasPrefix (address , "txr" )
37+ }
38+
39+ // IsRollupAddressLazy -
40+ func IsSmartRollupAddressLazy (address string ) bool {
41+ return len (address ) == 36 && strings .HasPrefix (address , "sr1" )
42+ }
43+
3444var (
35- addressRegex = regexp .MustCompile ("(tz|KT)[0-9A-Za-z]{34}" )
36- operationHashRegex = regexp .MustCompile ("(o)[0-9A-Za-z]{50}" )
37- bigMapKeyHashRegex = regexp .MustCompile ("(expr)[0-9A-Za-z]{50}" )
45+ addressRegex = regexp .MustCompile ("(tz|KT|txr|sr)[0-9A-Za-z]{34}" )
46+ contractRegex = regexp .MustCompile ("(KT1)[0-9A-Za-z]{33}" )
3847 bakerHashRegex = regexp .MustCompile ("(SG1)[0-9A-Za-z]{33}" )
48+ operationRegex = regexp .MustCompile ("^o[1-9A-HJ-NP-Za-km-z]{50}$" )
49+ smartRollupRegex = regexp .MustCompile ("(sr)[0-9A-Za-z]{34}" )
50+ bigMapKeyHashRegex = regexp .MustCompile ("(expr)[0-9A-Za-z]{50}" )
3951)
4052
4153// IsAddress -
4254func IsAddress (str string ) bool {
4355 return addressRegex .MatchString (str )
4456}
4557
58+ // IsContract -
59+ func IsContract (str string ) bool {
60+ return contractRegex .MatchString (str )
61+ }
62+
63+ // IsBakerHash -
64+ func IsBakerHash (str string ) bool {
65+ return bakerHashRegex .MatchString (str )
66+ }
67+
4668// IsOperationHash -
4769func IsOperationHash (str string ) bool {
48- return operationHashRegex .MatchString (str )
70+ return operationRegex .MatchString (str )
71+ }
72+
73+ // IsSmartRollupHash -
74+ func IsSmartRollupHash (str string ) bool {
75+ return smartRollupRegex .MatchString (str )
4976}
5077
5178// IsBigMapKeyHash -
5279func IsBigMapKeyHash (str string ) bool {
5380 return bigMapKeyHashRegex .MatchString (str )
5481}
55-
56- // IsBakerHash -
57- func IsBakerHash (str string ) bool {
58- return bakerHashRegex .MatchString (str )
59- }
0 commit comments