Documentation ¶
Index ¶
Constants ¶
View Source
const ( TxTableName = "klay_transfers" KctTransferTableName = "kct_transfers" RevertedTxTableName = "reverted_transactions" MetadataTableName = "fetcher_metadata" ContractTableName = "contract" KctFtMetadataTableName = "kct_ft_metadata" KctNftMetadataTableName = "kct_nft_metadata" )
View Source
const (
DBRetryInterval = 1 * time.Second
)
View Source
const DefaultDBPort = "3306"
Variables ¶
View Source
var ( // KIP 13: Interface Query Standard - https://kips.klaytn.com/KIPs/kip-13 IKIP13Id = [4]byte{0x01, 0xff, 0xc9, 0xa7} InvalidId = [4]byte{0xff, 0xff, 0xff, 0xff} // KIP 7: Fungible Token Standard - https://kips.klaytn.com/KIPs/kip-7 IKIP7Id = [4]byte{0x65, 0x78, 0x73, 0x71} IKIP7MetadataId = [4]byte{0xa2, 0x19, 0xa0, 0x25} // KIP 17: Non-fungible Token Standard - https://kips.klaytn.com/KIPs/kip-17 IKIP17Id = [4]byte{0x80, 0xac, 0x58, 0xcd} IKIP17MetadataId = [4]byte{0x5b, 0x5e, 0x13, 0x9f} )
View Source
var DefaultKASConfig = &KASConfig{ DBPort: DefaultDBPort, CacheUse: false, }
View Source
var TxFilteringTypes = map[types.TxType]bool{ types.TxTypeLegacyTransaction: true, types.TxTypeValueTransfer: true, types.TxTypeFeeDelegatedValueTransfer: true, types.TxTypeFeeDelegatedValueTransferWithRatio: true, types.TxTypeValueTransferMemo: true, types.TxTypeFeeDelegatedValueTransferMemo: true, types.TxTypeFeeDelegatedValueTransferMemoWithRatio: true, types.TxTypeSmartContractDeploy: true, types.TxTypeFeeDelegatedSmartContractDeploy: true, types.TxTypeFeeDelegatedSmartContractDeployWithRatio: true, types.TxTypeSmartContractExecution: true, types.TxTypeFeeDelegatedSmartContractExecution: true, types.TxTypeFeeDelegatedSmartContractExecutionWithRatio: true, }
TxFilteringTypes filters types which are only stored in KAS database.
Functions ¶
func NewRepository ¶
Types ¶
type BlockchainAPI ¶
type BlockchainAPI interface { GetCode(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (hexutil.Bytes, error) Call(ctx context.Context, args api.CallArgs, blockNr rpc.BlockNumber) (hexutil.Bytes, error) }
BlockchainAPI interface is for testing purpose.
type Contract ¶
type FT ¶
type FT struct { Id int `gorm:"column:id;type:INT AUTO_INCREMENT;PRIMARY_KEY"` Address []byte `gorm:"column:address;type:VARBINARY(20);UNIQUE_INDEX;NOT NULL"` Name string `gorm:"column:name;type:VARCHAR(30)"` Symbol string `gorm:"column:symbol;type:VARCHAR(20)"` Decimal int `gorm:"column:decimal;type:TINYINT"` TotalSupply string `gorm:"column:totalSupply;type:VARCHAR(80)"` SiteUrl string `gorm:"column:siteUrl;type:VARCHAR(200)"` IconUrl string `gorm:"column:iconUrl;type:VARCHAR(200)"` Disable bool `gorm:"column:disable;type:TINYINT(1);DEFAULT:0"` Type int `gorm:"column:type;type:TINYINT;DEFAULT:0"` Status int `gorm:"column:status;type:TINYINT;DEFAULT:0"` ErrorLog string `gorm:"column:errorLog;type:VARCHAR(255);"` CreatedAt *time.Time `gorm:"column:createdAt;type:DATETIME;DEFAULT:NULL"` UpdatedAt *time.Time `gorm:"column:updatedAt;type:DATETIME;DEFAULT:NULL"` DeletedAt *time.Time `gorm:"column:deletedAt;type:DATETIME;DEFAULT:NULL"` }
type FetcherMetadata ¶
type FetcherMetadata struct { Key string `gorm:"column:key;type:VARCHAR(30);PRIMARY_KEY"` Value int64 `gorm:"column:value;type:BIGINT"` }
func (FetcherMetadata) TableName ¶
func (FetcherMetadata) TableName() string
type KCTTransfer ¶
type KCTTransfer struct { ContractAddress []byte `gorm:"column:contractAddress;type:VARBINARY(20);INDEX:ttFromCompIdx,ttToCompIdx;NOT NULL"` From []byte `gorm:"column:fromAddr;type:VARBINARY(20);INDEX:ttFromCompIdx,ttFromIdx"` To []byte `gorm:"column:toAddr;type:VARBINARY(20);INDEX:ttToCompIdx,ttToIdx"` TransactionLogId int64 `gorm:"column:transactionLogId;type:BIGINT;PRIMARY_KEY;INDEX:ttFromCompIdx,ttToCompIdx"` Value string `gorm:"column:value;type:VARCHAR(80)"` TransactionHash []byte `gorm:"column:transactionHash;type:VARBINARY(32);INDEX:ttHashIdx;NOT NULL"` Timestamp int64 `gorm:"column:timestamp;type:INT(11)"` }
func (KCTTransfer) TableName ¶
func (KCTTransfer) TableName() string
type NFT ¶
type NFT struct { Id int `gorm:"column:id;type:INT AUTO_INCREMENT;PRIMARY_KEY"` Address []byte `gorm:"column:address;type:VARBINARY(20);UNIQUE_INDEX;NOT NULL"` Name string `gorm:"column:name;type:VARCHAR(30)"` Symbol string `gorm:"column:symbol;type:VARCHAR(20)"` TotalSupply string `gorm:"column:totalSupply;type:VARCHAR(80)"` Disable bool `gorm:"column:disable;type:TINYINT(1);DEFAULT:0"` Type int `gorm:"column:type;type:TINYINT;DEFAULT:0"` Status int `gorm:"column:status;type:TINYINT;DEFAULT:0"` ErrorLog string `gorm:"column:errorLog;type:VARCHAR(255);"` CreatedAt *time.Time `gorm:"column:createdAt;type:DATETIME;DEFAULT:NULL"` UpdatedAt *time.Time `gorm:"column:updatedAt;type:DATETIME;DEFAULT:NULL"` DeletedAt *time.Time `gorm:"column:deletedAt;type:DATETIME;DEFAULT:NULL"` }
type RevertedTx ¶
type RevertedTx struct { TransactionHash []byte `gorm:"column:transactionHash;type:VARBINARY(32);NOT NULL;PRIMARY_KEY"` BlockNumber int64 `gorm:"column:blockNumber;type:BIGINT"` RevertMessage string `gorm:"column:revertMessage;type:VARCHAR(1024)"` ContractAddress []byte `gorm:"column:contractAddress;type:VARBINARY(20);NOT NULL"` Timestamp int64 `gorm:"column:timestamp;type:INT(11)"` }
func (RevertedTx) TableName ¶
func (RevertedTx) TableName() string
type Tx ¶
type Tx struct { TransactionId int64 `gorm:"column:transactionId;type:BIGINT;INDEX:idIdx;NOT NULL;PRIMARY_KEY"` FromAddr []byte `gorm:"column:fromAddr;type:VARBINARY(20);INDEX:txFromAddrIdx"` ToAddr []byte `gorm:"column:toAddr;type:VARBINARY(20);INDEX:txToAddrIdx"` Value string `gorm:"column:value;type:VARCHAR(80)"` TransactionHash []byte `gorm:"column:transactionHash;type:VARBINARY(32);INDEX:tHashIdx;NOT NULL"` Status int `gorm:"column:status;type:SMALLINT"` Timestamp int64 `gorm:"column:timestamp;type:INT(11)"` TypeInt int `gorm:"column:typeInt;INDEX:tTypeIdx;NOT NULL"` GasPrice uint64 `gorm:"column:gasPrice;type:BIGINT"` GasUsed uint64 `gorm:"column:gasUsed;type:BIGINT"` FeePayer []byte `gorm:"column:feePayer;type:VARBINARY(20)"` FeeRatio uint `gorm:"column:feeRatio;type:INT"` Internal bool `gorm:"column:internal;type:TINYINT(1);DEFAULT:0"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.