core

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 13 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEntityNotFound = errors.New("entity not found")

Functions

func GetNftMetaData

func GetNftMetaData(nftMetaUrl string) ([]byte, error)

Types

type Account

type Account struct {
	AccountAddress    tongo.AccountID
	Status            string
	TonBalance        int64
	ExtraBalances     map[uint32]decimal.Decimal
	LastTransactionLt uint64
	Code              []byte
	Data              []byte
	FrozenHash        *tongo.Bits256
	Storage           StorageInfo
	Interfaces        []string
	LastActivityTime  int64
	GetMethods        []string
}

Account holds low-level details about a particular account taken directly from the blockchain.

func ConvertToAccount

func ConvertToAccount(accountId tongo.AccountID, acc tlb.Account) (*Account, error)

type AccountInfo

type AccountInfo struct {
	Account      Account
	MemoRequired *bool
	Name         *string
	Icon         *string
	IsScam       *bool
}

AccountInfo extends Account type to hold additional human-friendly information about a particular account.

type Auction

type Auction struct {
	Bids   int64
	Date   int64
	Domain string
	Owner  tongo.AccountID
	Price  int64
}

type BlockExtra

type BlockExtra struct {
	RandSeed  tongo.Bits256
	CreatedBy tongo.Bits256
	// InMsgDescrLength is a length of the inbound message queue of a block.
	InMsgDescrLength int
	// OutMsgDescrLength is a length of the outbound message queue of a block.
	OutMsgDescrLength int
}

type BlockHeader

type BlockHeader struct {
	tongo.BlockIDExt
	MasterRef              *tongo.BlockIDExt
	PrevBlocks             []tongo.BlockIDExt
	StartLt                int64
	EndLt                  int64
	GlobalId               int32
	MinRefMcSeqno          int32
	CatchainSeqno          int32
	PrevKeyBlockSeqno      int32
	ValidatorListHashShort int32
	GenUtime               uint32
	Version                uint32
	VertSeqno              uint32
	WantMerge              bool
	WantSplit              bool
	AfterMerge             bool
	AfterSplit             bool
	BeforeSplit            bool
	IsKeyBlock             bool
	// GenSoftware describes software that created this particular block.
	// It is up to the software to include this piece of information.
	GenSoftware *GenSoftware
	BlockExtra  BlockExtra
}

BlockHeader contains information extracted from a block.

func ConvertToBlockHeader

func ConvertToBlockHeader(id tongo.BlockIDExt, block *tlb.Block) (*BlockHeader, error)

type BouncePhaseType

type BouncePhaseType string
const (
	BounceNegFunds BouncePhaseType = "TrPhaseBounceNegfunds"
	BounceNoFunds  BouncePhaseType = "TrPhaseBounceNofunds "
	BounceOk       BouncePhaseType = "TrPhaseBounceOk"
)

type DecodedMessageBody

type DecodedMessageBody struct {
	Operation string
	Value     any
}

DecodedMessageBody contains a message body decoded by tongo.abi package.

type DnsExpiring

type DnsExpiring struct {
	ExpiringAt int64
	Name       string
	DnsItem    *NftItem
}

type Filter

type Filter[T any] struct {
	Value  T
	IsZero bool
}

type GenSoftware

type GenSoftware struct {
	Version      uint32
	Capabilities uint64
}

GenSoftware describes version and capabilities of software that created a blockchain block.

type JettonWallet

type JettonWallet struct {
	// Address of a jetton wallet.
	Address      tongo.AccountID
	Balance      decimal.Decimal
	OwnerAddress *tongo.AccountID
	// JettonAddress of a jetton master.
	JettonAddress tongo.AccountID
	Code          []byte
}

type LiquidPool

type LiquidPool struct {
	Address         tongo.AccountID
	TotalAmount     int64
	VerifiedSources bool
}

type Message

type Message struct {
	MessageID
	IhrDisabled bool
	Bounce      bool
	Bounced     bool
	Value       int64
	FwdFee      int64
	IhrFee      int64
	ImportFee   int64
	Init        []byte
	Body        []byte
	CreatedAt   uint32
	// OpCode is the first 32 bits of a message body indicating a possible operation.
	OpCode      *uint32
	DecodedBody *DecodedMessageBody
}

func ConvertMessage

func ConvertMessage(message tlb.Message, txLT uint64) (Message, error)

func (Message) IsEmission

func (m Message) IsEmission() bool

type MessageID

type MessageID struct {
	CreatedLt   uint64
	Source      *tongo.AccountID
	Destination *tongo.AccountID
}

func (MessageID) IsExternal

func (m MessageID) IsExternal() bool

type NftCollection

type NftCollection struct {
	Address           tongo.AccountID
	NextItemIndex     uint64
	OwnerAddress      *tongo.AccountID
	ContentLayout     int
	CollectionContent []byte
	Metadata          map[string]interface{}
}

type NftItem

type NftItem struct {
	Address           tongo.AccountID
	Index             decimal.Decimal
	CollectionAddress *tongo.AccountID
	OwnerAddress      *tongo.AccountID
	Verified          bool
	Transferable      bool
	DNS               *string
	Sale              *NftSaleInfo
	Metadata          map[string]interface{}
}

type NftSaleInfo

type NftSaleInfo struct {
	Contract    tongo.AccountID
	Marketplace tongo.AccountID
	Nft         tongo.AccountID
	Seller      *tongo.AccountID
	Price       struct {
		Token  *tongo.AccountID
		Amount uint64
	}
	MarketplaceFee uint64
	RoyaltyAddress *tongo.AccountID
	RoyaltyAmount  uint64
}

type StateUpdate

type StateUpdate struct {
	OldHash tongo.Bits256
	NewHash tongo.Bits256
}

type StorageInfo

type StorageInfo struct {
	UsedCells       big.Int
	UsedBits        big.Int
	UsedPublicCells big.Int
	LastPaid        uint32
	DuePayment      int64
}

StorageInfo is taken from TLB storage_stat:StorageInfo.

type StorageProvider

type StorageProvider struct {
	Address            tongo.AccountID
	AcceptNewContracts bool
	//  RatePerMbDay specifies the cost of storage in nanoTON per megabyte per day.
	RatePerMbDay int64
	// MaxSpan specifies how often the provider provides proofs of Bag storage.
	MaxSpan int64
	// MinimalFileSize specifies min Bag size in bytes.
	MinimalFileSize int64
	// MaximalFileSize specifies max Bag size in bytes.
	MaximalFileSize int64
}

StorageProvider is a smart contract that accepts storage requests and manages payments from clients.

type TFPool

type TFPool struct {
	Address           tongo.AccountID
	TotalAmount       int64
	MinNominatorStake int64
	ValidatorShare    uint32
	StakeAt           uint32
	Nominators        int
	MaxNominators     int
	VerifiedSources   bool
}

type Trace

type Trace struct {
	// Transaction is slightly modified.
	// For example, we have kept only external outbound messages in OutMsgs.
	Transaction
	AccountInterfaces []abi.ContractInterface
	Children          []*Trace
	AdditionalInfo    map[string]interface{}
}

func (*Trace) InProgress

func (t *Trace) InProgress() bool

type Transaction

type Transaction struct {
	TransactionID
	Type       TransactionType
	Success    bool
	Utime      int64
	InMsg      *Message
	OutMsgs    []Message
	BlockID    tongo.BlockID
	OrigStatus tlb.AccountStatus
	EndStatus  tlb.AccountStatus

	PrevTransHash tongo.Bits256
	PrevTransLt   uint64

	StateHashUpdate tlb.HashUpdate
	ComputePhase    *TxComputePhase
	StoragePhase    *TxStoragePhase
	CreditPhase     *TxCreditPhase
	ActionPhase     *TxActionPhase
	BouncePhase     *TxBouncePhase

	Aborted   bool
	Destroyed bool

	// StorageFee collected during the Storage Phase.
	StorageFee int64
	// TotalFee is the original total_fee of a transaction directly from the blockchain.
	TotalFee int64
}

func ConvertTransaction

func ConvertTransaction(workchain int32, tx tongo.Transaction) (*Transaction, error)

func ExtractTransactions

func ExtractTransactions(id tongo.BlockIDExt, block *tlb.Block) ([]*Transaction, error)

type TransactionID

type TransactionID struct {
	Hash    tongo.Bits256
	Lt      uint64
	Account tongo.AccountID
}

type TransactionType

type TransactionType string

TransactionType stands for transaction kind from [4.2.4] from the TON whitepaper.

const (
	OrdinaryTx     TransactionType = "TransOrd"
	TickTockTx     TransactionType = "TransTickTock"
	SplitPrepareTx TransactionType = "TransSplitPrepare"
	SplitInstallTx TransactionType = "TransSplitInstall"
	MergePrepareTx TransactionType = "TransMergePrepare"
	MergeInstallTx TransactionType = "TransMergeInstall"
	StorageTx      TransactionType = "TransStorage"
)

type TxAccStatusChange

type TxAccStatusChange = tlb.AccStatusChange

type TxActionPhase

type TxActionPhase struct {
	Success        bool
	TotalActions   uint16
	SkippedActions uint16
	FwdFees        uint64
	TotalFees      uint64
}

type TxBouncePhase

type TxBouncePhase struct {
	Type BouncePhaseType
}

type TxComputePhase

type TxComputePhase struct {
	Skipped    bool
	SkipReason TxComputeSkipReason
	Success    bool
	GasFees    uint64
	GasUsed    big.Int
	VmSteps    uint32
	ExitCode   int32
}

type TxComputeSkipReason

type TxComputeSkipReason = tlb.ComputeSkipReason

type TxCreditPhase

type TxCreditPhase struct {
	DueFeesCollected uint64
	CreditGrams      uint64
}

type TxStoragePhase

type TxStoragePhase struct {
	StorageFeesCollected uint64
	StorageFeesDue       *uint64
	StatusChange         TxAccStatusChange
}

type WhalesNominator

type WhalesNominator struct {
	Pool                  tongo.AccountID
	Member                tongo.AccountID
	MemberBalance         int64
	MemberPendingDeposit  int64
	MemberPendingWithdraw int64
	MemberWithdraw        int64
}

Jump to

Keyboard shortcuts

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