Documentation ¶
Index ¶
- Constants
- Variables
- type AccountData
- type AccountRepository
- type AccountState
- type AccountStatus
- type Block
- type BlockID
- type BlockRepository
- type ContractInterface
- type ContractOperation
- type ContractRepository
- type FTMasterData
- type FTWalletData
- type LatestAccountState
- type Message
- type MessagePayload
- type MessageRepository
- type MessageType
- type NFTCollectionData
- type NFTContentData
- type NFTEditable
- type NFTItemData
- type NFTRoyaltyData
- type Transaction
- type TransactionRepository
Constants ¶
View Source
const ( Uninit = AccountStatus(tlb.AccountStatusUninit) Active = AccountStatus(tlb.AccountStatusActive) Frozen = AccountStatus(tlb.AccountStatusFrozen) NonExist = AccountStatus(tlb.AccountStatusNonExist) )
View Source
const ( Internal = MessageType(tlb.MsgTypeInternal) ExternalIn = MessageType(tlb.MsgTypeExternalIn) ExternalOut = MessageType(tlb.MsgTypeExternalOut) )
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrInvalidArg = errors.New("invalid arguments") )
Functions ¶
This section is empty.
Types ¶
type AccountData ¶
type AccountData struct { ch.CHModel `ch:"account_data,partition:types" json:"-"` bun.BaseModel `bun:"table:account_data" json:"-"` Address addr.Address `ch:"type:String,pk" bun:"type:bytea,pk,notnull" json:"address"` LastTxLT uint64 `ch:",pk" bun:",pk,notnull" json:"last_tx_lt"` LastTxHash []byte `bun:"type:bytea,notnull,unique" json:"last_tx_hash"` Balance *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"balance"` Types []abi.ContractName `ch:"type:Array(String)" bun:"type:text[],array" json:"types"` WalletSeqNo uint64 `json:"wallet_seq_no,omitempty"` // common fields for FT and NFT OwnerAddress *addr.Address `ch:"type:String" bun:"type:bytea" json:"owner_address,omitempty"` // universal column for many contracts MinterAddress *addr.Address `ch:"type:String" bun:"type:bytea" json:"minter_address,omitempty"` NFTCollectionData NFTRoyaltyData NFTContentData NFTItemData NFTEditable FTMasterData FTWalletData Errors []string `json:"error,omitempty"` UpdatedAt time.Time `bun:"type:timestamp without time zone,notnull" json:"updated_at"` }
type AccountRepository ¶
type AccountState ¶
type AccountState struct { ch.CHModel `ch:"account_states,partition:status" json:"-"` bun.BaseModel `bun:"table:account_states" json:"-"` Address addr.Address `ch:"type:String,pk" bun:"type:bytea,pk,notnull" json:"address"` IsActive bool `json:"is_active"` Status AccountStatus `ch:",lc" bun:"type:account_status" json:"status"` // TODO: ch enum Balance *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"balance"` LastTxLT uint64 `ch:",pk" bun:"type:bigint,pk,notnull" json:"last_tx_lt"` LastTxHash []byte `bun:"type:bytea,unique,notnull" json:"last_tx_hash"` StateData *AccountData `ch:"-" bun:"rel:belongs-to,join:address=address,join:last_tx_lt=last_tx_lt" json:"state_data,omitempty"` StateHash []byte `bun:"type:bytea" json:"state_hash,omitempty"` // only if account is frozen Code []byte `bun:"type:bytea" json:"code,omitempty"` CodeHash []byte `bun:"type:bytea" json:"code_hash,omitempty"` Data []byte `bun:"type:bytea" json:"data,omitempty"` DataHash []byte `bun:"type:bytea" json:"data_hash,omitempty"` GetMethodHashes []int32 `ch:"type:Array(UInt32)" bun:"type:integer[]" json:"get_method_hashes"` UpdatedAt time.Time `bun:"type:timestamp without time zone,notnull" json:"updated_at"` }
type AccountStatus ¶
type AccountStatus string
type Block ¶
type Block struct { ch.CHModel `ch:"block_info,partition:workchain" json:"-"` bun.BaseModel `bun:"table:block_info" json:"-"` Workchain int32 `ch:",pk" bun:",pk,notnull" json:"workchain"` Shard int64 `ch:",pk" bun:",pk,notnull" json:"shard"` SeqNo uint32 `ch:",pk" bun:",pk,notnull" json:"seq_no"` FileHash []byte `bun:"type:bytea,unique,notnull" json:"file_hash"` RootHash []byte `bun:"type:bytea,unique,notnull" json:"root_hash"` MasterID *BlockID `ch:"-" bun:"embed:master_" json:"master,omitempty"` Shards []*Block `` /* 131-byte string literal not displayed */ Transactions []*Transaction `ch:"-" bun:"rel:has-many,join:workchain=block_workchain,join:shard=block_shard,join:seq_no=block_seq_no" json:"transactions"` }
type BlockRepository ¶
type ContractInterface ¶
type ContractInterface struct { ch.CHModel `ch:"contract_interfaces" json:"-"` bun.BaseModel `bun:"table:contract_interfaces" json:"-"` Name abi.ContractName `bun:",pk" json:"name"` Addresses []*addr.Address `bun:"type:bytea[],unique" json:"addresses"` Code []byte `bun:"type:bytea,unique" json:"code"` GetMethodsDesc []abi.GetMethodDesc `bun:"type:text" json:"get_methods_descriptors"` GetMethodHashes []int32 `bun:"type:integer[]" json:"get_method_hashes"` }
type ContractOperation ¶
type ContractOperation struct { ch.CHModel `ch:"contract_operations" json:"-"` bun.BaseModel `bun:"table:contract_operations" json:"-"` Name string `json:"name"` ContractName abi.ContractName `bun:",pk" json:"contract_name"` Outgoing bool `bun:",pk" json:"outgoing"` // if operation is going from contract OperationID uint32 `bun:",pk" json:"operation_id"` Schema abi.OperationDesc `bun:"type:jsonb" json:"schema"` }
type ContractRepository ¶
type ContractRepository interface { AddInterface(context.Context, *ContractInterface) error AddOperation(context.Context, *ContractOperation) error DelInterface(ctx context.Context, name string) error GetInterfaces(context.Context) ([]*ContractInterface, error) GetOperations(context.Context) ([]*ContractOperation, error) GetOperationByID(context.Context, []abi.ContractName, bool, uint32) (*ContractOperation, error) }
type FTMasterData ¶
type FTWalletData ¶
type LatestAccountState ¶
type LatestAccountState struct { bun.BaseModel `bun:"table:latest_account_states" json:"-"` Address addr.Address `bun:"type:bytea,pk,notnull" json:"address"` LastTxLT uint64 `bun:"type:bigint,notnull" json:"last_tx_lt"` AccountState *AccountState `bun:"rel:has-one,join:address=address,join:last_tx_lt=last_tx_lt" json:"account"` }
type Message ¶
type Message struct { ch.CHModel `ch:"messages,partition:toYYYYMM(created_at)" json:"-"` bun.BaseModel `bun:"table:messages" json:"-"` Type MessageType `ch:",lc" bun:"type:message_type,notnull" json:"type"` // TODO: ch enum Hash []byte `ch:",pk" bun:"type:bytea,pk,notnull" json:"hash"` SrcAddress addr.Address `ch:"type:String" bun:"type:bytea,nullzero" json:"src_address,omitempty"` DstAddress addr.Address `ch:"type:String" bun:"type:bytea,nullzero" json:"dst_address,omitempty"` // SourceTx initiates outgoing message. // For external incoming messages SourceTx == nil. SourceTxHash []byte `bun:"type:bytea" json:"source_tx_hash,omitempty"` SourceTxLT uint64 `json:"source_tx_lt,omitempty"` Source *Transaction `ch:"-" bun:"-" json:"source,omitempty"` // TODO: join it Bounce bool `bun:",notnull" json:"bounce"` Bounced bool `bun:",notnull" json:"bounced"` Amount *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"amount,omitempty"` IHRDisabled bool `bun:",notnull" json:"ihr_disabled"` IHRFee *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"ihr_fee"` FwdFee *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"fwd_fee"` Body []byte `bun:"type:bytea" json:"body"` BodyHash []byte `bun:"type:bytea" json:"body_hash"` OperationID uint32 `json:"operation_id,omitempty"` TransferComment string `json:"transfer_comment,omitempty"` Payload *MessagePayload `ch:"-" bun:"rel:belongs-to,join:hash=hash,join:created_lt=created_lt" json:"payload,omitempty"` StateInitCode []byte `bun:"type:bytea" json:"state_init_code,omitempty"` StateInitData []byte `bun:"type:bytea" json:"state_init_data,omitempty"` CreatedAt time.Time `bun:"type:timestamp without time zone,notnull" json:"created_at"` CreatedLT uint64 `bun:",notnull" json:"created_lt"` Known bool `ch:"-" bun:"-" json:"-"` }
type MessagePayload ¶
type MessagePayload struct { ch.CHModel `ch:"message_payloads,partition:toYYYYMM(created_at)" json:"-"` bun.BaseModel `bun:"table:message_payloads" json:"-"` Type MessageType `ch:",lc" bun:"type:message_type,notnull" json:"type"` Hash []byte `ch:",pk" bun:"type:bytea,pk,notnull" json:"hash"` SrcAddress addr.Address `ch:"type:String" bun:"type:bytea,nullzero" json:"src_address,omitempty"` SrcContract abi.ContractName `ch:",lc" json:"src_contract,omitempty"` DstAddress addr.Address `ch:"type:String" bun:"type:bytea,nullzero" json:"dst_address,omitempty"` DstContract abi.ContractName `ch:",lc" json:"dst_contract,omitempty"` Amount *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"amount,omitempty"` BodyHash []byte `bun:"type:bytea,notnull" json:"body_hash"` OperationID uint32 `bun:",notnull" json:"operation_id"` OperationName string `ch:",lc" bun:",notnull" json:"operation_name"` DataJSON json.RawMessage `ch:"-" bun:"type:jsonb" json:"data"` // TODO: https://github.com/uptrace/go-clickhouse/issues/22 // can be used to show all jetton or nft item transfers MinterAddress *addr.Address `ch:"type:String" bun:"type:bytea" json:"minter_address,omitempty"` CreatedAt time.Time `bun:"type:timestamp without time zone,notnull" json:"created_at"` CreatedLT uint64 `bun:",notnull" json:"created_lt"` Error string `json:"error,omitempty"` }
type MessageRepository ¶
type MessageType ¶
type MessageType string
type NFTCollectionData ¶
type NFTContentData ¶
type NFTContentData struct { ContentURI string `ch:"type:String" json:"content_uri,omitempty"` ContentName string `ch:"type:String" json:"content_name,omitempty"` ContentDescription string `ch:"type:String" json:"content_description,omitempty"` ContentImage string `ch:"type:String" json:"content_image,omitempty"` ContentImageData []byte `ch:"type:String" json:"content_image_data,omitempty"` }
type NFTEditable ¶ added in v0.2.1
type NFTItemData ¶
type NFTRoyaltyData ¶
type NFTRoyaltyData struct { RoyaltyAddress *addr.Address `ch:"type:String" bun:"type:bytea" json:"royalty_address,omitempty"` RoyaltyFactor uint16 `ch:"type:UInt16" bun:"type:integer" json:"royalty_factor,omitempty"` RoyaltyBase uint16 `ch:"type:UInt16" bun:"type:integer" json:"royalty_base,omitempty"` }
type Transaction ¶
type Transaction struct { ch.CHModel `ch:"transactions,partition:toYYYYMM(created_at)" json:"-"` bun.BaseModel `bun:"table:transactions" json:"-"` Address addr.Address `ch:"type:String,pk" bun:"type:bytea,notnull" json:"address"` Hash []byte `ch:",pk" bun:"type:bytea,pk,notnull" json:"hash"` Account *AccountState `ch:"-" bun:"rel:has-one,join:address=address,join:created_lt=last_tx_lt" json:"account"` BlockWorkchain int32 `bun:",notnull" json:"block_workchain"` BlockShard int64 `bun:",notnull" json:"block_shard"` BlockSeqNo uint32 `bun:",notnull" json:"block_seq_no"` PrevTxHash []byte `bun:"type:bytea" json:"prev_tx_hash,omitempty"` PrevTxLT uint64 `json:"prev_tx_lt,omitempty"` InMsgHash []byte `json:"in_msg_hash"` InMsg *Message `ch:"-" bun:"rel:belongs-to,join:in_msg_hash=hash" json:"in_msg"` InAmount *bunbig.Int `ch:"type:UInt256" bun:"type:numeric,notnull" json:"in_amount"` OutMsg []*Message `ch:"-" bun:"rel:has-many,join:address=src_address,join:created_lt=source_tx_lt" json:"out_msg,omitempty"` OutMsgCount uint16 `bun:",notnull" json:"out_msg_count"` OutAmount *bunbig.Int `ch:"type:UInt256" bun:"type:numeric,notnull" json:"out_amount"` TotalFees *bunbig.Int `ch:"type:UInt256" bun:"type:numeric" json:"total_fees"` Description []byte `bun:"type:bytea,notnull" json:"description_boc,omitempty"` DescriptionLoaded any `ch:"-" bun:"-" json:"description,omitempty"` ResultCode int32 `ch:"type:Int32" bun:",notnull" json:"result_code"` OrigStatus AccountStatus `ch:",lc" bun:"type:account_status,notnull" json:"orig_status"` EndStatus AccountStatus `ch:",lc" bun:"type:account_status,notnull" json:"end_status"` CreatedAt time.Time `bun:"type:timestamp without time zone,notnull" json:"created_at"` CreatedLT uint64 `bun:",notnull" json:"created_lt"` }
func (*Transaction) LoadDescription ¶ added in v0.2.1
func (tx *Transaction) LoadDescription() error
type TransactionRepository ¶
Click to show internal directories.
Click to hide internal directories.