totra

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoanContracts = map[common.Address]string{
	common.HexToAddress("0x5660E206496808F7b5cDB8C56A696a96AE5E9b23"): "NFTfi",
	common.HexToAddress("0x0E258c84Df0f8728ae4A6426EA5FD163Eb6b9D1B"): "NFT Loan Ticket V2",
	common.HexToAddress("0xbD85BF4C970b91984e6A2b8Ba9C577A58A8C20f9"): "Borrower Note Ticket",
}

Functions

This section is empty.

Types

type HistoryTokenTransaction

type HistoryTokenTransaction struct {
	ReceivedAt           time.Time               `json:"time"`
	AmountPaid           *big.Int                `json:"amount_paid"`
	FmtTokensTransferred []string                `json:"fmt_tokens_transferred"`
	Collection           *collections.Collection `json:"collection"`

	TokenTransaction *TokenTransaction `json:"-"`
}

HistoryTokenTransaction is the representation of a token transaction in the history.

type TokenTransaction

type TokenTransaction struct {
	// the original tx
	Tx *types.Transaction `json:"tx"`

	// the receipt containing the logs
	TxReceipt *types.Receipt `json:"tx_receipt"`

	// action performed by the tx
	Action TxType `json:"action"`

	// the sender of the tx
	From common.Address `json:"from"`

	// the amount of eth/weth transferred in the tx
	AmountPaid *big.Int `json:"amount_paid"`

	Marketplace *marketplace.MarketPlace `json:"marketplace"`

	// token transfers parsed from the tx logs
	Transfers []*TokenTransfer `json:"transfers"`

	TotalTokens int64 `json:"total_tokens"`

	ReceivedAt time.Time `json:"received_at"`

	DoNotPrint bool `json:"do_not_print"`
	// contains filtered or unexported fields
}

func NewTokenTransaction

func NewTokenTransaction(tx *types.Transaction, receipt *types.Receipt, providerPool *provider.Pool) *TokenTransaction

func (*TokenTransaction) AsHistoryTokenTransaction

func (ttx *TokenTransaction) AsHistoryTokenTransaction(collection *collections.Collection, fmtTokensTransferred []string) *HistoryTokenTransaction

func (*TokenTransaction) GetNFTReceiverAddresses

func (ttx *TokenTransaction) GetNFTReceiverAddresses() []common.Address

func (*TokenTransaction) GetNFTReceivers

func (ttx *TokenTransaction) GetNFTReceivers() map[common.Address][]*TokenTransfer

func (*TokenTransaction) GetNFTSenderAddresses

func (ttx *TokenTransaction) GetNFTSenderAddresses() []common.Address

func (*TokenTransaction) GetNFTSenderAndReceiverAddresses

func (ttx *TokenTransaction) GetNFTSenderAndReceiverAddresses() []common.Address

func (*TokenTransaction) GetNFTSenders

func (ttx *TokenTransaction) GetNFTSenders() map[common.Address][]*TokenTransfer

func (*TokenTransaction) GetNonZeroNFTSenders added in v0.5.1

func (ttx *TokenTransaction) GetNonZeroNFTSenders() map[common.Address][]*TokenTransfer

func (*TokenTransaction) GetPrice

func (ttx *TokenTransaction) GetPrice() *price.Price

func (*TokenTransaction) GetTransfersByContract

func (ttx *TokenTransaction) GetTransfersByContract() map[common.Address][]*TokenTransfer

func (*TokenTransaction) IsAirdrop

func (ttx *TokenTransaction) IsAirdrop() bool

func (*TokenTransaction) IsBurn

func (ttx *TokenTransaction) IsBurn() bool

func (*TokenTransaction) IsListing

func (ttx *TokenTransaction) IsListing() bool

func (*TokenTransaction) IsLoan

func (ttx *TokenTransaction) IsLoan() bool

func (*TokenTransaction) IsMint

func (ttx *TokenTransaction) IsMint() bool

func (*TokenTransaction) IsMovingNFTs

func (ttx *TokenTransaction) IsMovingNFTs() bool

func (*TokenTransaction) IsReBurn

func (ttx *TokenTransaction) IsReBurn() bool

func (*TokenTransaction) IsTransfer

func (ttx *TokenTransaction) IsTransfer() bool

type TokenTransfer

type TokenTransfer struct {
	// sender of a token || erc721: topic[1] | erc1155: topic[2]
	From common.Address `json:"from"`

	// recipient of a token || erc721: topic[2] | erc1155: topic[3]
	To common.Address `json:"to"`

	// type of the token || erc721: topic[0] == Transfer | erc1155: topic[0] == TransferSingle
	Standard standard.Standard `json:"type"`

	// number of tokens transferred || erc721: 1 | erc1155: data[value]
	AmountTokens *big.Int `json:"amount"`

	// the amount of eth/weth transferred in the same tx to the sender of the nft
	AmountEtherReturned *big.Int `json:"amount_ether_returned"`

	Token *token.Token `json:"token"`
}

type TxType

type TxType int64
const (
	Unknown TxType = iota
	Sale
	Mint
	Transfer
	Listing
	Purchase
	Burn
	ReBurn
	Airdrop
	Loan
)

func (TxType) ActionName

func (et TxType) ActionName() string

func (TxType) Icon

func (et TxType) Icon() string

func (TxType) String

func (et TxType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL