-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from tonkeeper/jetton_spam_detector
create jetton spam detector
- Loading branch information
Showing
9 changed files
with
64 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package core | ||
|
||
type AttachedAccount struct { | ||
Name string | ||
Image string | ||
Name string | ||
Symbol string | ||
Image string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package spam | ||
|
||
import ( | ||
rules "github.com/tonkeeper/scam_backoffice_rules" | ||
"github.com/tonkeeper/tongo" | ||
) | ||
|
||
type SpamFilter struct { | ||
Rules rules.Rules | ||
JettonEvaluate *rules.JettonEvaluate | ||
} | ||
|
||
func NewSpamFilter() *SpamFilter { | ||
return &SpamFilter{ | ||
Rules: rules.GetDefaultRules(), | ||
JettonEvaluate: rules.NewJettonEvaluate(), | ||
} | ||
} | ||
|
||
func (s *SpamFilter) GetRules() rules.Rules { | ||
return s.Rules | ||
} | ||
|
||
func (s *SpamFilter) CheckJettonAction(address tongo.AccountID, symbol string) rules.TypeOfAction { | ||
return s.JettonEvaluate.SearchAction(address, symbol) | ||
} |