Documentation
¶
Index ¶
- Constants
- Variables
- func CollectActionsAndValueFlow(bubble *Bubble, forAccount *tongo.AccountID) ([]Action, *ValueFlow)
- func FindDepositStake(bubble *Bubble) bool
- func FindExtendedSubscription(bubble *Bubble) bool
- func FindInitialSubscription(bubble *Bubble) bool
- func FindJettonTransfer(bubble *Bubble) bool
- func FindNFTTransfer(bubble *Bubble) bool
- func FindNftPurchase(bubble *Bubble) bool
- func FindRecoverStake(bubble *Bubble) bool
- func MergeAllBubbles(bubble *Bubble, straws []Straw)
- type Account
- type AccountValueFlow
- type Action
- type ActionType
- type ActionsList
- type AuctionBidAction
- type Bubble
- type BubbleDepositStake
- type BubbleJettonTransfer
- type BubbleNftPurchase
- type BubbleNftTransfer
- type BubbleRecoverStake
- type BubbleSubscription
- type BubbleTx
- type ContractDeployAction
- type DepositStakeAction
- type JettonTransferAction
- type Matcher
- type Merge
- type NftAuctionType
- type NftPurchaseAction
- type NftTransferAction
- type Option
- type Options
- type RecoverStakeAction
- type Refund
- type RefundType
- type SmartContractAction
- type Straw
- type SubscriptionAction
- type TonTransferAction
- type UnSubscriptionAction
- type ValueFlow
Constants ¶
View Source
const ( Empty ActionType = "Empty" TonTransfer ActionType = "TonTransfer" SmartContractExec ActionType = "SmartContractExec" NftItemTransfer ActionType = "NftItemTransfer" NftPurchase ActionType = "NftPurchase" JettonTransfer ActionType = "JettonTransfer" ContractDeploy ActionType = "ContractDeploy" Subscription ActionType = "Subscription" UnSubscription ActionType = "UnSubscribe" DepositStake ActionType = "DepositStake" RecoverStake ActionType = "RecoverStake" AuctionBid ActionType = "AuctionBid" AuctionTgInitBid ActionType = "AuctionTgInitBid" RefundDnsTg RefundType = "DNS.tg" RefundDnsTon RefundType = "DNS.ton" RefundGetGems RefundType = "GetGems" RefundUnknown RefundType = "unknown" )
Variables ¶
View Source
var DefaultStraws = []Straw{ FindNFTTransfer, FindJettonTransfer, FindInitialSubscription, FindExtendedSubscription, FindNftPurchase, FindDepositStake, FindRecoverStake, }
View Source
var GetGemsSale = Matcher{ CheckFunc: func(bubble Bubble) bool { txBubble, ok := bubble.Info.(BubbleTx) if !ok { return false } if !txBubble.account.Is(abi.NftSaleGetgems) && !txBubble.account.Is(abi.NftSale) { return false } return true }, Children: []Matcher{ { CheckFunc: func(bubble Bubble) bool { _, ok := bubble.Info.(BubbleNftTransfer) return ok }, }, }, }
Functions ¶
func FindDepositStake ¶ added in v0.1.1
func FindInitialSubscription ¶
func FindJettonTransfer ¶
func FindNFTTransfer ¶
func FindNftPurchase ¶ added in v0.1.0
func FindRecoverStake ¶ added in v0.1.1
func MergeAllBubbles ¶
Types ¶
type AccountValueFlow ¶
AccountValueFlow contains a change of assets for a particular account.
type Action ¶
type Action struct {
TonTransfer *TonTransferAction `json:",omitempty"`
SmartContractExec *SmartContractAction `json:",omitempty"`
NftItemTransfer *NftTransferAction `json:",omitempty"`
NftPurchase *NftPurchaseAction `json:",omitempty"`
JettonTransfer *JettonTransferAction `json:",omitempty"`
ContractDeploy *ContractDeployAction `json:",omitempty"`
Subscription *SubscriptionAction `json:",omitempty"`
UnSubscription *UnSubscriptionAction `json:",omitempty"`
AuctionBid *AuctionBidAction `json:",omitempty"`
DepositStake *DepositStakeAction `json:",omitempty"`
RecoverStake *RecoverStakeAction `json:",omitempty"`
Success bool
Type ActionType
}
func (Action) ContributeToExtra ¶
type ActionType ¶
type ActionType string
type ActionsList ¶
func FindActions ¶
FindActions finds known action patterns in the given trace and returns a list of actions.
type AuctionBidAction ¶
type Bubble ¶
type Bubble struct {
Info actioner
Accounts []tongo.AccountID
Children []*Bubble
ValueFlow *ValueFlow
}
Bubble represents a transaction in the beginning. But we can merge neighbour bubbles together if we find a known action pattern like an NFT Transfer or a SmartContractExecution in a trace.
func ProcessChildren ¶
type BubbleDepositStake ¶ added in v0.1.1
func (BubbleDepositStake) ToAction ¶ added in v0.1.1
func (ds BubbleDepositStake) ToAction() *Action
type BubbleJettonTransfer ¶
type BubbleJettonTransfer struct {
// contains filtered or unexported fields
}
func (BubbleJettonTransfer) ToAction ¶
func (b BubbleJettonTransfer) ToAction() (action *Action)
type BubbleNftPurchase ¶ added in v0.1.0
type BubbleNftPurchase struct {
Success bool
Buyer tongo.AccountID
Seller tongo.AccountID
Nft tongo.AccountID
AuctionType NftAuctionType
Price int64
}
func (BubbleNftPurchase) ToAction ¶ added in v0.1.0
func (b BubbleNftPurchase) ToAction() *Action
type BubbleNftTransfer ¶
type BubbleNftTransfer struct {
// contains filtered or unexported fields
}
func (BubbleNftTransfer) ToAction ¶
func (b BubbleNftTransfer) ToAction() (action *Action)
type BubbleRecoverStake ¶ added in v0.1.1
func (BubbleRecoverStake) ToAction ¶ added in v0.1.1
func (b BubbleRecoverStake) ToAction() *Action
type BubbleSubscription ¶
type BubbleSubscription struct {
Subscription, Subscriber, Beneficiary Account
Amount int64
Success bool
First bool
}
func (BubbleSubscription) ToAction ¶
func (b BubbleSubscription) ToAction() (action *Action)
type ContractDeployAction ¶
type DepositStakeAction ¶ added in v0.1.1
type JettonTransferAction ¶
type NftAuctionType ¶ added in v0.1.0
type NftAuctionType string
const ( GetGemsAuction NftAuctionType = "getgems" BasicAuction NftAuctionType = "basic" )
type NftPurchaseAction ¶ added in v0.1.0
type NftTransferAction ¶
type Option ¶
type Option func(*Options)
func ForAccount ¶
func WithInformationSource ¶ added in v0.1.0
func WithInformationSource(source core.InformationSource) Option
func WithStraws ¶
WithStraws provides functions to find actions in a trace.
type RecoverStakeAction ¶ added in v0.1.1
type Refund ¶
type Refund struct {
Type RefundType
Origin string
}
type RefundType ¶
type RefundType string
type SmartContractAction ¶
type SmartContractAction struct {
TonAttached int64
Executor tongo.AccountID
Contract tongo.AccountID
Operation string
Payload string
}
func (*SmartContractAction) ContributeToExtra ¶
func (a *SmartContractAction) ContributeToExtra(account tongo.AccountID, extra int64) int64
type Straw ¶
Straw extracts information from the given bubble and its children and modifies the bubble if needed. If the bubble is modified this function return true.
type SubscriptionAction ¶
type TonTransferAction ¶
type TonTransferAction struct {
Amount int64
Comment *string
Recipient tongo.AccountID
Sender tongo.AccountID
Refund *Refund
}
func (*TonTransferAction) ContributeToExtra ¶
func (a *TonTransferAction) ContributeToExtra(account tongo.AccountID, extra int64) int64
type UnSubscriptionAction ¶
type ValueFlow ¶
type ValueFlow struct {
Accounts map[tongo.AccountID]*AccountValueFlow
}
ValueFlow contains a change of assets for each account involved in a trace.
func (*ValueFlow) AddJettons ¶
Click to show internal directories.
Click to hide internal directories.